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-01-27 02:38:08 +00:00

44 lines
925 B
C++

#pragma once
#ifndef _PICKUPOBJECT_HPP_
#define _PICKUPOBJECT_HPP_
#include <engine/GameObject.hpp>
#include <bullet/btBulletCollisionCommon.h>
#include <BulletCollision/CollisionDispatch/btGhostObject.h>
#include <glm/glm.hpp>
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;
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