From ec0f0e0d147904ff025120ddc54f8ab78375d480 Mon Sep 17 00:00:00 2001 From: Dander7BD Date: Fri, 20 Dec 2013 11:30:11 +0100 Subject: [PATCH] SimpleRigidBody::Predict(..) added --- Code/GamePhysics/Implementation/SimpleRigidBody.cpp | 5 +++++ Code/GamePhysics/Implementation/SimpleRigidBody.h | 1 + Code/GamePhysics/PhysicsAPI.h | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/Code/GamePhysics/Implementation/SimpleRigidBody.cpp b/Code/GamePhysics/Implementation/SimpleRigidBody.cpp index 88899259..29f64144 100644 --- a/Code/GamePhysics/Implementation/SimpleRigidBody.cpp +++ b/Code/GamePhysics/Implementation/SimpleRigidBody.cpp @@ -266,6 +266,11 @@ UpdateState SimpleRigidBody::Update( Float timeStepLength ) return UpdateState_altered; } +void SimpleRigidBody::Predict( Float4 &outDeltaPos, Float4 &outDeltaAxis, const Float4 &actingLinearImpulse, const Float4 &actingAngularImpulse, Float deltaTime ) +{ + this->rigid.Predict_LeapFrog( outDeltaPos, outDeltaAxis, actingLinearImpulse, actingAngularImpulse, deltaTime ); +} + void SimpleRigidBody::SetScene( void *scene ) { this->scene = (Octree*)scene; diff --git a/Code/GamePhysics/Implementation/SimpleRigidBody.h b/Code/GamePhysics/Implementation/SimpleRigidBody.h index f407ad1d..c7d915ef 100644 --- a/Code/GamePhysics/Implementation/SimpleRigidBody.h +++ b/Code/GamePhysics/Implementation/SimpleRigidBody.h @@ -36,6 +36,7 @@ namespace Oyster { namespace Physics //::Oyster::Math::Float4x4 & GetView( ::Oyster::Math::Float4x4 &targetMem = ::Oyster::Math::Float4x4() ) const; UpdateState Update( ::Oyster::Math::Float timeStepLength ); + void Predict( ::Oyster::Math::Float4 &outDeltaPos, ::Oyster::Math::Float4 &outDeltaAxis, const ::Oyster::Math::Float4 &actingLinearImpulse, const ::Oyster::Math::Float4 &actingAngularImpulse, ::Oyster::Math::Float deltaTime ); void SetScene( void *scene ); void SetSubscription( EventAction_Collision functionPointer ); diff --git a/Code/GamePhysics/PhysicsAPI.h b/Code/GamePhysics/PhysicsAPI.h index 3e91a103..d1727a85 100644 --- a/Code/GamePhysics/PhysicsAPI.h +++ b/Code/GamePhysics/PhysicsAPI.h @@ -337,6 +337,11 @@ namespace Oyster * Is called during API::Update ********************************************************/ virtual UpdateState Update( ::Oyster::Math::Float timeStepLength ) = 0; + + /******************************************************** + * @todo TODO: add doc + ********************************************************/ + virtual void Predict( ::Oyster::Math::Float4 &outDeltaPos, ::Oyster::Math::Float4 &outDeltaAxis, const ::Oyster::Math::Float4 &actingLinearImpulse, const ::Oyster::Math::Float4 &actingAngularImpulse, ::Oyster::Math::Float deltaTime ) = 0; /******************************************************** * Sets which scene this ICustomBody is within.