1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-07 19:32:49 +01:00
openrw/rwengine/include/objects/PickupObject.hpp
2015-04-27 02:09:56 +01:00

46 lines
961 B
C++

#pragma once
#ifndef _PICKUPOBJECT_HPP_
#define _PICKUPOBJECT_HPP_
#include <objects/GameObject.hpp>
#include <bullet/btBulletCollisionCommon.h>
#include <BulletCollision/CollisionDispatch/btGhostObject.h>
#include <glm/glm.hpp>
class VisualFX;
class CharacterObject;
/**
* @brief The PickupObject class
* Implements interface and base behaviour for pickups
*/
class PickupObject : public GameObject
{
btPairCachingGhostObject* _ghost;
btSphereShape* _shape;
bool _enabled;
float _enableTimer;
bool collected;
int _modelID;
VisualFX* corona;
public:
PickupObject(GameWorld* world, const glm::vec3& position, int modelID);
~PickupObject();
int getModelID() const { return _modelID; }
Type type() { return Pickup; }
void tick(float dt);
virtual bool onCharacterTouch(CharacterObject* character) = 0;
bool isEnabled() const { return _enabled; }
void setEnabled(bool enabled);
bool isCollected() const { return collected; }
};
#endif