I'm trying to compare two rotations. I'm checking to see if they are equal like this
Here's an example of the Debug.Log of two that were not equal according to the if statement. But look at the output...
Why doesn't the Debug.Log output match the if statement?
internally quaternion stored as 4 floats, so two quaternions can be different but both logs as (0,0,0,1) due to precision of float.
use this to compare two rotations by angle between them - for example if angle is lower then some threshold then these quaternions are same
answered Jul 22, 2012 at 06:32 AM