Danbias/Code/GamePhysics/Implementation/SimpleRigidBody.h

45 lines
1.1 KiB
C
Raw Normal View History

#ifndef OYSTER_PHYSICS_SIMPLE_RIGIDBODY_H
#define OYSTER_PHYSICS_SIMPLE_RIGIDBODY_H
#include "..\PhysicsAPI.h"
2014-02-09 21:24:09 +01:00
#include <btBulletDynamicsCommon.h>
namespace Oyster { namespace Physics
{
class SimpleRigidBody : public ICustomBody
{
public:
SimpleRigidBody();
SimpleRigidBody( const API::SimpleBodyDescription &desc );
virtual ~SimpleRigidBody();
2014-02-09 21:24:09 +01:00
void SetCollisionShape(btCollisionShape* shape);
void SetMotionState(btDefaultMotionState* motionState);
void SetRigidBody(btRigidBody* rigidBody);
2014-02-09 21:24:09 +01:00
void SetSubscription(EventAction_AfterCollisionResponse function);
void CallSubsciptMessage(ICustomBody* bodyA, ICustomBody* bodyB, Math::Float kineticEnergyLoss);
State GetState() const;
State & GetState( State &targetMem ) const;
void SetState( const State &state );
2014-02-09 21:24:09 +01:00
btDefaultMotionState* GetMotionState() const;
2014-01-20 13:44:12 +01:00
void SetCustomTag( void *ref );
2014-02-09 21:24:09 +01:00
void* GetCustomTag() const;
private:
2014-02-09 21:24:09 +01:00
btCollisionShape* collisionShape;
btDefaultMotionState* motionState;
btRigidBody* rigidBody;
2014-02-09 21:24:09 +01:00
Struct::CustomBodyState state;
2014-02-09 21:24:09 +01:00
EventAction_AfterCollisionResponse afterCollision;
2014-01-20 13:44:12 +01:00
void *customTag;
};
} }
#endif