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
|
|
|
|
|
2013-12-12 09:36:14 +01:00
|
|
|
#include "GameLogicStates.h"
|
2014-01-28 15:04:25 +01:00
|
|
|
#include "GameAPI.h"
|
2014-01-10 10:08:42 +01:00
|
|
|
#include <PhysicsAPI.h>
|
2013-12-12 12:16:13 +01:00
|
|
|
|
2013-11-19 18:35:35 +01:00
|
|
|
namespace GameLogic
|
|
|
|
{
|
2014-01-20 15:47:52 +01:00
|
|
|
class Game;
|
|
|
|
|
2014-01-28 15:04:25 +01:00
|
|
|
class Object :public IObjectData
|
2013-11-19 18:35:35 +01:00
|
|
|
{
|
2013-11-29 09:23:00 +01:00
|
|
|
public:
|
2013-12-12 09:36:14 +01:00
|
|
|
Object();
|
2014-01-29 14:33:21 +01:00
|
|
|
Object(OBJECT_TYPE type);
|
|
|
|
Object(Oyster::Physics::ICustomBody *rigidBody, OBJECT_TYPE type);
|
|
|
|
Object(void* collisionFuncBefore, void* collisionFuncAfter, OBJECT_TYPE type);
|
|
|
|
Object(Oyster::Physics::ICustomBody *rigidBody ,void* collisionFuncBefore, void* collisionFuncAfter, OBJECT_TYPE type);
|
|
|
|
Object(Oyster::Physics::ICustomBody *rigidBody ,Oyster::Physics::ICustomBody::SubscriptMessage (*collisionFuncBefore)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter), Oyster::Physics::ICustomBody::SubscriptMessage (*collisionFuncAfter)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), OBJECT_TYPE type);
|
2013-12-12 09:36:14 +01:00
|
|
|
~Object(void);
|
2013-11-19 18:35:35 +01:00
|
|
|
|
2014-01-28 15:04:25 +01:00
|
|
|
// API overrides
|
2014-01-30 09:40:58 +01:00
|
|
|
OBJECT_TYPE GetObjectType() const;
|
2014-01-15 11:03:25 +01:00
|
|
|
int GetID() const;
|
2014-01-28 15:04:25 +01:00
|
|
|
Oyster::Math::Float3 GetPosition();
|
|
|
|
Oyster::Math::Float4x4 GetOrientation();
|
|
|
|
|
|
|
|
|
2013-12-12 12:16:13 +01:00
|
|
|
Oyster::Physics::ICustomBody* GetRigidBody();
|
2014-01-28 15:44:32 +01:00
|
|
|
void ApplyLinearImpulse(Oyster::Math::Float3 force);
|
2013-12-12 12:16:13 +01:00
|
|
|
|
2014-01-20 15:47:52 +01:00
|
|
|
void BeginFrame();
|
|
|
|
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-29 14:33:21 +01:00
|
|
|
static Oyster::Physics::ICustomBody::SubscriptMessage DefaultCollisionBefore(Oyster::Physics::ICustomBody *rigidBodyLevel, Oyster::Physics::ICustomBody *obj);
|
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);
|
2013-11-19 18:35:35 +01:00
|
|
|
private:
|
2013-11-26 11:30:49 +01:00
|
|
|
OBJECT_TYPE 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:
|
2013-11-28 09:26:29 +01:00
|
|
|
Oyster::Physics::ICustomBody *rigidBody;
|
2014-01-15 11:03:25 +01:00
|
|
|
Oyster::Physics::ICustomBody::State setState;
|
|
|
|
Oyster::Physics::ICustomBody::State getState;
|
2014-01-09 13:06:18 +01:00
|
|
|
|
2014-01-20 15:47:52 +01:00
|
|
|
static const Game* gameInstance;
|
|
|
|
|
2013-11-19 18:35:35 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|