Extracting an object's forward vector from their rotation quaternion

Started by
9 comments, last by apatriarca 11 years, 10 months ago
The fact that people are doing it does not mean it is the right thing to do. This is not correct matematically since the formula for rotation using quaternions is different and you are now using two very different multiplications on quaternions: one with quaternions and the other with vector. The main consequence of this is that it reduces the readability of your code and more mathematically inclined people will often repeat your code is wrong because it does not follows the usual equations. It also makes it harder to implement new code involving quaternions because the maths is different from your code. If you really want to overload something then it is better to overload the function application. After all, this is an action:

public void GetForwardVector( Quaternion quatRot )
{
return quatRot( vector3.Forward );
}

This topic is closed to new replies.

Advertisement