Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SetAngularVelocity in rotationalframe.h
03-02-2010, 10:16 AM,
#1
SetAngularVelocity in rotationalframe.h
Sorry for again having to post such a little bug, but the effects can be dramatic.

Please replace
Code:
void SetAngularVelocity(const MATHVECTOR <T, 3> & newangvel)
    {
        angular_momentum = inverse_inertia_tensor.Inverse().Multiply(newangvel);
        RecalculateSecondary();
    }
with

Code:
void SetAngularVelocity(const MATHVECTOR <T, 3> & newangvel)
    {
        angular_momentum = world_inverse_inertia_tensor.Inverse().Multiply(newangvel);
        angular_velocity = newangvel;
    }

To not RecalculateSecondary is just a minor optimation, but what really matters is the world in world_inverse_inertia_tensor

This can lead to a very strange problems, should the function be used somewhere.
Reply
03-02-2010, 11:14 AM,
#2
 
Done, R2624.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)