diff --git a/Code/Debug/Tester.ilk b/Code/Debug/Tester.ilk index 49c33576..868317a8 100644 Binary files a/Code/Debug/Tester.ilk and b/Code/Debug/Tester.ilk differ diff --git a/Code/Debug/Tester.pdb b/Code/Debug/Tester.pdb index 6fcf8970..5df839b7 100644 Binary files a/Code/Debug/Tester.pdb and b/Code/Debug/Tester.pdb differ diff --git a/Code/GamePhysics/Implementation/PhysicsAPI_Impl.cpp b/Code/GamePhysics/Implementation/PhysicsAPI_Impl.cpp index c1816a0b..a69666d6 100644 --- a/Code/GamePhysics/Implementation/PhysicsAPI_Impl.cpp +++ b/Code/GamePhysics/Implementation/PhysicsAPI_Impl.cpp @@ -1,5 +1,6 @@ #include "PhysicsAPI_Impl.h" #include "SimpleRigidBody.h" +#include "OysterPhysics3D.h" using namespace ::Oyster::Physics; using namespace ::Oyster::Math; @@ -8,6 +9,31 @@ using namespace ::Utility::DynamicMemory; API_Impl instance; +::Oyster::Math::Float4x4 & MomentOfInertia::CreateSphereMatrix( const ::Oyster::Math::Float mass, const ::Oyster::Math::Float radius) +{ + return ::Oyster::Physics3D::Formula::MomentOfInertia::Sphere(mass, radius); +} + +::Oyster::Math::Float4x4 & MomentOfInertia::CreateHollowSphereMatrix( const ::Oyster::Math::Float mass, const ::Oyster::Math::Float radius) +{ + return ::Oyster::Physics3D::Formula::MomentOfInertia::HollowSphere(mass, radius); +} + +::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 ) +{ + return ::Oyster::Physics3D::Formula::MomentOfInertia::Cuboid(mass, height, width, depth); +} + +::Oyster::Math::Float4x4 & MomentOfInertia::CreateCylinderMatrix( const ::Oyster::Math::Float mass, const ::Oyster::Math::Float height, const ::Oyster::Math::Float radius ) +{ + return ::Oyster::Physics3D::Formula::MomentOfInertia::Cylinder(mass, height, radius); +} + +::Oyster::Math::Float4x4 & MomentOfInertia::CreateRodMatrix( const ::Oyster::Math::Float mass, const ::Oyster::Math::Float length ) +{ + return ::Oyster::Physics3D::Formula::MomentOfInertia::RodCenter(mass, length); +} + API & Instance() { return instance; diff --git a/Code/GamePhysics/PhysicsAPI.h b/Code/GamePhysics/PhysicsAPI.h index b78c19df..cbea8cb5 100644 --- a/Code/GamePhysics/PhysicsAPI.h +++ b/Code/GamePhysics/PhysicsAPI.h @@ -23,11 +23,21 @@ namespace Oyster const float gravity_constant = (const float)6.67284e-11; // The _big_G_! ( N(m/kg)^2 ) Used in real gravityforcefields. } - namespace MomentOfInertia - { - //! @todo TODO: add forward methods to Oyster::Physics3D::Formula::MomentOfInertia - } + class MomentOfInertia + { + public: + static ::Oyster::Math::Float4x4 & CreateSphereMatrix( const ::Oyster::Math::Float mass, const ::Oyster::Math::Float radius); + + static ::Oyster::Math::Float4x4 & CreateHollowSphereMatrix( const ::Oyster::Math::Float mass, const ::Oyster::Math::Float radius); + + static ::Oyster::Math::Float4x4 & CreateCuboidMatrix( const ::Oyster::Math::Float mass, const ::Oyster::Math::Float height, const ::Oyster::Math::Float width, const ::Oyster::Math::Float depth ); + + static ::Oyster::Math::Float4x4 & CreateCylinderMatrix( const ::Oyster::Math::Float mass, const ::Oyster::Math::Float height, const ::Oyster::Math::Float radius ); + + static ::Oyster::Math::Float4x4 & CreateRodMatrix( const ::Oyster::Math::Float mass, const ::Oyster::Math::Float length ); + }; + class API {