AngularVelocity fix
This commit is contained in:
parent
89ef3b830a
commit
8f630125b4
|
@ -58,7 +58,7 @@ void RigidBody::Update_LeapFrog( Float updateFrameLength )
|
||||||
Float4x4 wMomentOfInertiaTensor = TransformMatrix( rotationMatrix, this->momentOfInertiaTensor ); // RI
|
Float4x4 wMomentOfInertiaTensor = TransformMatrix( rotationMatrix, this->momentOfInertiaTensor ); // RI
|
||||||
|
|
||||||
// dO = dt * Formula::AngularVelocity( (RI)^-1, avg_H ) = dt * (RI)^-1 * avg_H
|
// dO = dt * Formula::AngularVelocity( (RI)^-1, avg_H ) = dt * (RI)^-1 * avg_H
|
||||||
this->axis += Formula::AngularVelocity( wMomentOfInertiaTensor.GetInverse(), AverageWithDelta(this->momentum_Angular, this->impulse_Angular) );
|
this->axis += Radian( Formula::AngularVelocity(wMomentOfInertiaTensor.GetInverse(), AverageWithDelta(this->momentum_Angular, this->impulse_Angular)) );
|
||||||
this->rotation = Rotation( this->axis );
|
this->rotation = Rotation( this->axis );
|
||||||
|
|
||||||
// update momentums and clear impulse_Linear and impulse_Angular
|
// update momentums and clear impulse_Linear and impulse_Angular
|
||||||
|
|
Loading…
Reference in New Issue