Danbias/Code/Game/GameLogic/Object.h

66 lines
2.2 KiB
C
Raw Normal View History

2013-11-28 08:33:29 +01:00
//////////////////////////////////////////////////
//Created by Erik and Linda of the GameLogic team
//////////////////////////////////////////////////
2013-11-19 18:35:35 +01:00
#ifndef OBJECT_H
#define OBJECT_H
#include "GameLogicStates.h"
#include "GameAPI.h"
#include <PhysicsAPI.h>
2013-11-19 18:35:35 +01:00
namespace GameLogic
{
2014-01-20 15:47:52 +01:00
class Game;
class Object :public IObjectData
2013-11-19 18:35:35 +01:00
{
2013-11-29 09:23:00 +01:00
public:
Object();
2014-02-12 14:48:58 +01:00
Object(ObjectSpecialType type);
Object(Oyster::Physics::ICustomBody *rigidBody, ObjectSpecialType type);
Object(void* collisionFuncAfter, ObjectSpecialType type);
Object(Oyster::Physics::ICustomBody *rigidBody, void* collisionFuncAfter, ObjectSpecialType type);
Object(Oyster::Physics::ICustomBody *rigidBody, Oyster::Physics::ICustomBody::SubscriptMessage (*collisionFuncAfter)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), ObjectSpecialType type);
~Object(void);
2013-11-19 18:35:35 +01:00
2014-02-12 14:48:58 +01:00
ObjectSpecialType GetObjectType() const override;
int GetID() const override;
void setID(int id);
Oyster::Math::Float3 GetPosition() override;
Oyster::Math::Quaternion GetRotation() override;
Oyster::Math::Float3 GetScale() override;
Oyster::Math::Float4x4 GetOrientation() override;
2014-02-12 14:48:58 +01:00
// API overrides
Oyster::Physics::ICustomBody* GetRigidBody();
void ApplyLinearImpulse(Oyster::Math::Float3 force);
virtual void BeginFrame();
virtual void EndFrame();
2014-01-29 16:01:56 +01:00
void setBeforeCollisonFunc(Oyster::Physics::ICustomBody::SubscriptMessage (*collisionFuncBefore)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter));
void setAfterCollisonFunc(Oyster::Physics::ICustomBody::SubscriptMessage (*collisionFuncAfter)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss));
2014-01-31 10:58:03 +01:00
static Oyster::Physics::ICustomBody::SubscriptMessage DefaultCollisionAfter(Oyster::Physics::ICustomBody *rigidBodyLevel, Oyster::Physics::ICustomBody *obj, Oyster::Math::Float kineticEnergyLoss);
2014-02-12 14:48:58 +01:00
public: //TODO: Hax This should be private when level is dynamic
ObjectSpecialType type;
2013-12-18 13:01:13 +01:00
int objectID;
2014-01-20 15:47:52 +01:00
2013-11-19 18:35:35 +01:00
protected:
Oyster::Physics::ICustomBody *rigidBody;
2014-01-20 15:47:52 +01:00
static const Game* gameInstance;
Oyster::Math::Float3 currLook;
Oyster::Math::Float3 newLook;
2013-11-19 18:35:35 +01:00
};
}
#endif