Disable rotation

disabled at:
* RigidBody::Update_LeapFrog
* SimpleRigidBody::SetState
* SphericalRigidBody::SetState
This commit is contained in:
Dander7BD 2014-01-20 15:31:19 +01:00
parent 82d1a03450
commit 0107745c7e
3 changed files with 8 additions and 5 deletions

View File

@ -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();

View File

@ -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();

View File

@ -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;
}