2013-11-21 17:22:13 +01:00
|
|
|
#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>
|
2013-11-21 17:22:13 +01:00
|
|
|
|
|
|
|
namespace Oyster { namespace Physics
|
|
|
|
{
|
|
|
|
class SimpleRigidBody : public ICustomBody
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SimpleRigidBody();
|
2013-11-28 11:58:46 +01:00
|
|
|
SimpleRigidBody( const API::SimpleBodyDescription &desc );
|
2013-11-21 17:22:13 +01:00
|
|
|
virtual ~SimpleRigidBody();
|
|
|
|
|
2014-02-09 21:24:09 +01:00
|
|
|
void SetCollisionShape(btCollisionShape* shape);
|
|
|
|
void SetMotionState(btDefaultMotionState* motionState);
|
|
|
|
void SetRigidBody(btRigidBody* rigidBody);
|
2013-11-21 17:22:13 +01:00
|
|
|
|
2014-02-09 21:24:09 +01:00
|
|
|
void SetSubscription(EventAction_AfterCollisionResponse function);
|
|
|
|
void CallSubsciptMessage(ICustomBody* bodyA, ICustomBody* bodyB, Math::Float kineticEnergyLoss);
|
|
|
|
|
2013-12-06 09:46:30 +01:00
|
|
|
State GetState() const;
|
|
|
|
State & GetState( State &targetMem ) const;
|
|
|
|
void SetState( const State &state );
|
2014-01-17 16:07:25 +01:00
|
|
|
|
2014-02-09 21:24:09 +01:00
|
|
|
btDefaultMotionState* GetMotionState() const;
|
2014-01-17 16:07:25 +01:00
|
|
|
|
2014-01-20 13:44:12 +01:00
|
|
|
void SetCustomTag( void *ref );
|
2014-02-09 21:24:09 +01:00
|
|
|
void* GetCustomTag() const;
|
2013-11-21 17:22:13 +01:00
|
|
|
|
|
|
|
private:
|
2014-02-09 21:24:09 +01:00
|
|
|
btCollisionShape* collisionShape;
|
|
|
|
btDefaultMotionState* motionState;
|
|
|
|
btRigidBody* rigidBody;
|
2014-02-03 15:48:42 +01:00
|
|
|
|
2014-02-09 21:24:09 +01:00
|
|
|
Struct::CustomBodyState state;
|
2014-02-03 15:48:42 +01:00
|
|
|
|
2014-02-09 21:24:09 +01:00
|
|
|
EventAction_AfterCollisionResponse afterCollision;
|
2014-02-03 15:48:42 +01:00
|
|
|
|
2014-01-20 13:44:12 +01:00
|
|
|
void *customTag;
|
2013-11-21 17:22:13 +01:00
|
|
|
};
|
|
|
|
} }
|
|
|
|
|
|
|
|
#endif
|