2013-11-20 11:09:27 +01:00
|
|
|
#ifndef PHYSICS_API_IMPL_H
|
|
|
|
#define PHYSICS_API_IMPL_H
|
|
|
|
|
|
|
|
#include "../PhysicsAPI.h"
|
|
|
|
|
|
|
|
namespace Oyster
|
|
|
|
{
|
|
|
|
namespace Physics
|
|
|
|
{
|
|
|
|
class API_Impl : public API
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
API_Impl();
|
|
|
|
virtual ~API_Impl();
|
|
|
|
|
2013-11-26 13:27:34 +01:00
|
|
|
void Init( unsigned int numObjects, unsigned int numGravityWells , const ::Oyster::Math::Float3 &worldSize );
|
|
|
|
|
2013-11-20 11:09:27 +01:00
|
|
|
void SetDeltaTime( float deltaTime );
|
|
|
|
void SetGravityConstant( float g );
|
|
|
|
void SetAction( EventAction_Collision functionPointer );
|
|
|
|
void SetAction( EventAction_Destruction functionPointer );
|
|
|
|
|
|
|
|
void Update();
|
|
|
|
|
2013-11-25 10:54:27 +01:00
|
|
|
bool IsInLimbo( const ICustomBody* objRef );
|
|
|
|
void MoveToLimbo( const ICustomBody* objRef );
|
|
|
|
void ReleaseFromLimbo( const ICustomBody* objRef );
|
|
|
|
|
|
|
|
void AddObject( ::Utility::DynamicMemory::UniquePointer<ICustomBody> handle );
|
|
|
|
::Utility::DynamicMemory::UniquePointer<ICustomBody> ExtractObject( const ICustomBody* objRef );
|
|
|
|
void DestroyObject( const ICustomBody* objRef );
|
|
|
|
|
|
|
|
void ApplyForceAt( const ICustomBody* objRef, const ::Oyster::Math::Float3 &worldPos, const ::Oyster::Math::Float3 &worldF );
|
|
|
|
void ApplyCollisionResponse( const ICustomBody* objRefA, const ICustomBody* objRefB, ::Oyster::Math::Float &deltaWhen, ::Oyster::Math::Float3 &worldPointOfContact );
|
|
|
|
|
|
|
|
void SetMomentOfInertiaTensor_KeepVelocity( const ICustomBody* objRef, const ::Oyster::Math::Float4x4 &localI );
|
|
|
|
void SetMomentOfInertiaTensor_KeepMomentum( const ICustomBody* objRef, const ::Oyster::Math::Float4x4 &localI );
|
|
|
|
void SetMass_KeepVelocity( const ICustomBody* objRef, ::Oyster::Math::Float m );
|
|
|
|
void SetMass_KeepMomentum( const ICustomBody* objRef, ::Oyster::Math::Float m );
|
|
|
|
void SetCenter( const ICustomBody* objRef, const ::Oyster::Math::Float3 &worldPos );
|
|
|
|
void SetRotation( const ICustomBody* objRef, const ::Oyster::Math::Float4x4 &rotation );
|
|
|
|
void SetOrientation( const ICustomBody* objRef, const ::Oyster::Math::Float4x4 &orientation );
|
2013-11-26 13:27:34 +01:00
|
|
|
void SetSize( const ICustomBody* objRef, const ::Oyster::Math::Float3 &size );
|
2013-11-21 17:22:13 +01:00
|
|
|
|
|
|
|
::Utility::DynamicMemory::UniquePointer<ICustomBody> CreateSimpleRigidBody() const;
|
2013-11-25 16:57:38 +01:00
|
|
|
private:
|
|
|
|
::Oyster::Math::Float gravityConstant, updateFrameLength;
|
|
|
|
EventAction_Collision collisionAction;
|
|
|
|
EventAction_Destruction destructionAction;
|
2013-11-20 11:09:27 +01:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|