ChristianLa91 / slimdx

Automatically exported from code.google.com/p/slimdx
MIT License
0 stars 0 forks source link

Issue in SlimDX.Quaternion.Angle on x64 #840

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm using the March 2011 release and I get undesired behaviour when compiling 
for the x64 plattform. In some situations Quaternion.Angle returns NaN instead 
of 0.

Code to reproduce:

Quaternion q1 = new Quaternion(0.001275f, 0.0002249998f, -2.868749E-07f, 
0.9999992f);

Quaternion q2 = new Quaternion(0.005153927f, 0.0009097299f, -4.835008E-06f, 
-0.9999973f);

Quaternion q3 = q1 * q2;

on x86 plattform: q3.Angle == 0.0
on x64 plattform: q3.Angle == NaN

Original issue reported on code.google.com by Nemole...@googlemail.com on 16 Oct 2011 at 5:27

GoogleCodeExporter commented 9 years ago
You have to normalize the quaternion before you can reliably get its angle. 
I'll add a note to the documentation to make it clear.

Original comment by Mike.Popoloski on 15 Nov 2011 at 7:30