2013-11-20 11:09:27 +01:00
|
|
|
#include "PhysicsAPI_Impl.h"
|
2013-11-21 17:22:13 +01:00
|
|
|
#include "SimpleRigidBody.h"
|
2013-11-22 11:52:45 +01:00
|
|
|
#include "OysterPhysics3D.h"
|
2013-11-20 11:09:27 +01:00
|
|
|
|
2013-11-21 17:22:13 +01:00
|
|
|
using namespace ::Oyster::Physics;
|
|
|
|
using namespace ::Oyster::Math;
|
|
|
|
using namespace ::Oyster::Collision3D;
|
|
|
|
using namespace ::Utility::DynamicMemory;
|
2013-11-20 11:09:27 +01:00
|
|
|
|
|
|
|
API_Impl instance;
|
|
|
|
|
2013-11-25 12:21:44 +01:00
|
|
|
::Oyster::Math::Float4x4 & MomentOfInertia::CreateSphereMatrix( const ::Oyster::Math::Float mass, const ::Oyster::Math::Float radius)
|
2013-11-22 11:52:45 +01:00
|
|
|
{
|
|
|
|
return ::Oyster::Physics3D::Formula::MomentOfInertia::Sphere(mass, radius);
|
|
|
|
}
|
|
|
|
|
2013-11-25 12:21:44 +01:00
|
|
|
::Oyster::Math::Float4x4 & MomentOfInertia::CreateHollowSphereMatrix( const ::Oyster::Math::Float mass, const ::Oyster::Math::Float radius)
|
2013-11-22 11:52:45 +01:00
|
|
|
{
|
|
|
|
return ::Oyster::Physics3D::Formula::MomentOfInertia::HollowSphere(mass, radius);
|
|
|
|
}
|
|
|
|
|
2013-11-25 12:21:44 +01:00
|
|
|
::Oyster::Math::Float4x4 & MomentOfInertia::CreateCuboidMatrix( const ::Oyster::Math::Float mass, const ::Oyster::Math::Float height, const ::Oyster::Math::Float width, const ::Oyster::Math::Float depth )
|
2013-11-22 11:52:45 +01:00
|
|
|
{
|
|
|
|
return ::Oyster::Physics3D::Formula::MomentOfInertia::Cuboid(mass, height, width, depth);
|
|
|
|
}
|
|
|
|
|
2013-11-25 12:21:44 +01:00
|
|
|
::Oyster::Math::Float4x4 & MomentOfInertia::CreateCylinderMatrix( const ::Oyster::Math::Float mass, const ::Oyster::Math::Float height, const ::Oyster::Math::Float radius )
|
2013-11-22 11:52:45 +01:00
|
|
|
{
|
|
|
|
return ::Oyster::Physics3D::Formula::MomentOfInertia::Cylinder(mass, height, radius);
|
|
|
|
}
|
|
|
|
|
2013-11-25 12:21:44 +01:00
|
|
|
::Oyster::Math::Float4x4 & MomentOfInertia::CreateRodMatrix( const ::Oyster::Math::Float mass, const ::Oyster::Math::Float length )
|
2013-11-22 11:52:45 +01:00
|
|
|
{
|
|
|
|
return ::Oyster::Physics3D::Formula::MomentOfInertia::RodCenter(mass, length);
|
|
|
|
}
|
|
|
|
|
2013-11-25 12:21:44 +01:00
|
|
|
API & API::Instance()
|
2013-11-20 11:09:27 +01:00
|
|
|
{
|
|
|
|
return instance;
|
|
|
|
}
|
|
|
|
|
|
|
|
API_Impl::API_Impl()
|
|
|
|
{
|
|
|
|
/** @todo TODO: Fix this constructor.*/
|
|
|
|
}
|
|
|
|
|
|
|
|
API_Impl::~API_Impl()
|
|
|
|
{
|
|
|
|
/** @todo TODO: Fix this destructor.*/
|
|
|
|
}
|
|
|
|
|
|
|
|
void API_Impl::SetDeltaTime( float deltaTime )
|
|
|
|
{
|
|
|
|
/** @todo TODO: Fix this function.*/
|
|
|
|
}
|
|
|
|
void API_Impl::SetGravityConstant( float g )
|
|
|
|
{
|
|
|
|
/** @todo TODO: Fix this function.*/
|
|
|
|
}
|
|
|
|
void API_Impl::SetAction( EventAction_Collision functionPointer )
|
|
|
|
{
|
|
|
|
/** @todo TODO: Fix this function.*/
|
|
|
|
}
|
|
|
|
void API_Impl::SetAction( EventAction_Destruction functionPointer )
|
|
|
|
{
|
|
|
|
/** @todo TODO: Fix this function.*/
|
|
|
|
}
|
|
|
|
|
|
|
|
void API_Impl::Update()
|
|
|
|
{
|
|
|
|
/** @todo TODO: Fix this function.*/
|
|
|
|
}
|
|
|
|
|
2013-11-25 10:54:27 +01:00
|
|
|
bool API_Impl::IsInLimbo( const ICustomBody* objRef )
|
2013-11-21 17:22:13 +01:00
|
|
|
{
|
|
|
|
//! @todo TODO: implement stub
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2013-11-25 10:54:27 +01:00
|
|
|
void API_Impl::MoveToLimbo( const ICustomBody* objRef )
|
2013-11-20 11:09:27 +01:00
|
|
|
{
|
|
|
|
/** @todo TODO: Fix this function.*/
|
|
|
|
}
|
2013-11-25 10:54:27 +01:00
|
|
|
void API_Impl::ReleaseFromLimbo( const ICustomBody* objRef )
|
2013-11-20 11:09:27 +01:00
|
|
|
{
|
|
|
|
/** @todo TODO: Fix this function.*/
|
|
|
|
}
|
|
|
|
|
2013-11-25 10:54:27 +01:00
|
|
|
void API_Impl::AddObject( ::Utility::DynamicMemory::UniquePointer<ICustomBody> handle )
|
2013-11-20 11:09:27 +01:00
|
|
|
{
|
|
|
|
/** @todo TODO: Fix this function.*/
|
|
|
|
}
|
2013-11-21 17:22:13 +01:00
|
|
|
|
2013-11-25 10:54:27 +01:00
|
|
|
::Utility::DynamicMemory::UniquePointer<ICustomBody> API_Impl::ExtractObject( const ICustomBody* objRef )
|
2013-11-21 17:22:13 +01:00
|
|
|
{
|
|
|
|
//! @todo TODO: implement stub
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2013-11-25 10:54:27 +01:00
|
|
|
void API_Impl::DestroyObject( const ICustomBody* objRef )
|
2013-11-20 11:09:27 +01:00
|
|
|
{
|
|
|
|
/** @todo TODO: Fix this function.*/
|
2013-11-21 17:22:13 +01:00
|
|
|
}
|
|
|
|
|
2013-11-25 10:54:27 +01:00
|
|
|
void API_Impl::ApplyForceAt( const ICustomBody* objRef, const Float3 &worldPos, const Float3 &worldF )
|
2013-11-21 17:22:13 +01:00
|
|
|
{
|
|
|
|
//! @todo TODO: implement stub
|
|
|
|
}
|
|
|
|
|
2013-11-25 10:54:27 +01:00
|
|
|
void API_Impl::ApplyCollisionResponse( const ICustomBody* objRefA, const ICustomBody* objRefB, Float &deltaWhen, Float3 &worldPointOfContact )
|
2013-11-21 17:22:13 +01:00
|
|
|
{
|
|
|
|
//! @todo TODO: implement stub
|
|
|
|
}
|
|
|
|
|
2013-11-25 10:54:27 +01:00
|
|
|
void API_Impl::SetMomentOfInertiaTensor_KeepVelocity( const ICustomBody* objRef, const Float4x4 &localI )
|
2013-11-21 17:22:13 +01:00
|
|
|
{
|
|
|
|
//! @todo TODO: implement stub
|
|
|
|
}
|
|
|
|
|
2013-11-25 10:54:27 +01:00
|
|
|
void API_Impl::SetMomentOfInertiaTensor_KeepMomentum( const ICustomBody* objRef, const Float4x4 &localI )
|
2013-11-21 17:22:13 +01:00
|
|
|
{
|
|
|
|
//! @todo TODO: implement stub
|
|
|
|
}
|
|
|
|
|
2013-11-25 10:54:27 +01:00
|
|
|
void API_Impl::SetMass_KeepVelocity( const ICustomBody* objRef, Float m )
|
2013-11-21 17:22:13 +01:00
|
|
|
{
|
|
|
|
//! @todo TODO: implement stub
|
|
|
|
}
|
|
|
|
|
2013-11-25 10:54:27 +01:00
|
|
|
void API_Impl::SetMass_KeepMomentum( const ICustomBody* objRef, Float m )
|
2013-11-21 17:22:13 +01:00
|
|
|
{
|
|
|
|
//! @todo TODO: implement stub
|
|
|
|
}
|
|
|
|
|
2013-11-25 10:54:27 +01:00
|
|
|
void API_Impl::SetCenter( const ICustomBody* objRef, const Float3 &worldPos )
|
2013-11-21 17:22:13 +01:00
|
|
|
{
|
|
|
|
//! @todo TODO: implement stub
|
|
|
|
}
|
|
|
|
|
2013-11-25 10:54:27 +01:00
|
|
|
void API_Impl::SetRotation( const ICustomBody* objRef, const Float4x4 &rotation )
|
2013-11-21 17:22:13 +01:00
|
|
|
{
|
|
|
|
//! @todo TODO: implement stub
|
|
|
|
}
|
|
|
|
|
2013-11-25 10:54:27 +01:00
|
|
|
void API_Impl::SetOrientation( const ICustomBody* objRef, const Float4x4 &orientation )
|
2013-11-21 17:22:13 +01:00
|
|
|
{
|
|
|
|
//! @todo TODO: implement stub
|
|
|
|
}
|
|
|
|
|
|
|
|
UniquePointer<ICustomBody> API_Impl::CreateSimpleRigidBody() const
|
|
|
|
{
|
|
|
|
return new SimpleRigidBody();
|
2013-11-20 11:09:27 +01:00
|
|
|
}
|