From 0107745c7e6040bb9c972fbeb76943730ffb45cf Mon Sep 17 00:00:00 2001 From: Dander7BD Date: Mon, 20 Jan 2014 15:31:19 +0100 Subject: [PATCH] Disable rotation disabled at: * RigidBody::Update_LeapFrog * SimpleRigidBody::SetState * SphericalRigidBody::SetState --- Code/GamePhysics/Implementation/SimpleRigidBody.cpp | 2 +- Code/GamePhysics/Implementation/SphericalRigidBody.cpp | 2 +- Code/OysterPhysics3D/RigidBody.cpp | 9 ++++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Code/GamePhysics/Implementation/SimpleRigidBody.cpp b/Code/GamePhysics/Implementation/SimpleRigidBody.cpp index ad84bdbd..df191059 100644 --- a/Code/GamePhysics/Implementation/SimpleRigidBody.cpp +++ b/Code/GamePhysics/Implementation/SimpleRigidBody.cpp @@ -116,7 +116,7 @@ SimpleRigidBody::State & SimpleRigidBody::GetState( SimpleRigidBody::State &targ void SimpleRigidBody::SetState( const SimpleRigidBody::State &state ) { this->rigid.centerPos = state.GetCenterPosition(); - this->rigid.SetRotation( state.GetRotation() ); + //this->rigid.SetRotation( state.GetRotation() ); //! HACK: @todo Rotation temporary disabled this->rigid.boundingReach = state.GetReach(); this->rigid.momentum_Linear = state.GetLinearMomentum(); this->rigid.momentum_Angular = state.GetAngularMomentum(); diff --git a/Code/GamePhysics/Implementation/SphericalRigidBody.cpp b/Code/GamePhysics/Implementation/SphericalRigidBody.cpp index 7a8f12a9..7b15510a 100644 --- a/Code/GamePhysics/Implementation/SphericalRigidBody.cpp +++ b/Code/GamePhysics/Implementation/SphericalRigidBody.cpp @@ -84,7 +84,7 @@ SphericalRigidBody::State & SphericalRigidBody::GetState( SphericalRigidBody::St void SphericalRigidBody::SetState( const SphericalRigidBody::State &state ) { this->rigid.centerPos = state.GetCenterPosition(); - this->rigid.SetRotation( state.GetRotation() ); + //this->rigid.SetRotation( state.GetRotation() ); //! HACK: @todo Rotation temporary disabled this->rigid.boundingReach = state.GetReach(); this->rigid.momentum_Linear = state.GetLinearMomentum(); this->rigid.momentum_Angular = state.GetAngularMomentum(); diff --git a/Code/OysterPhysics3D/RigidBody.cpp b/Code/OysterPhysics3D/RigidBody.cpp index 6fef6311..80c800a6 100644 --- a/Code/OysterPhysics3D/RigidBody.cpp +++ b/Code/OysterPhysics3D/RigidBody.cpp @@ -58,13 +58,16 @@ void RigidBody::Update_LeapFrog( Float updateFrameLength ) Float4x4 wMomentOfInertiaTensor = TransformMatrix( rotationMatrix, this->momentOfInertiaTensor ); // RI // dO = dt * Formula::AngularVelocity( (RI)^-1, avg_H ) = dt * (RI)^-1 * avg_H - this->axis += Radian( Formula::AngularVelocity(wMomentOfInertiaTensor.GetInverse(), AverageWithDelta(this->momentum_Angular, this->impulse_Angular)) ); - this->rotation = Rotation( this->axis ); + + //! HACK: @todo Rotation temporary disabled + //this->axis += Radian( Formula::AngularVelocity(wMomentOfInertiaTensor.GetInverse(), AverageWithDelta(this->momentum_Angular, this->impulse_Angular)) ); + //this->rotation = Rotation( this->axis ); // update momentums and clear impulse_Linear and impulse_Angular this->momentum_Linear += this->impulse_Linear; this->impulse_Linear = Float4::null; - this->momentum_Angular += this->impulse_Angular; + + //this->momentum_Angular += this->impulse_Angular; //! HACK: @todo Rotation temporary disabled this->impulse_Angular = Float4::null; }