google / mathfu

C++ math library developed primarily for games focused on simplicity and efficiency.
http://google.github.io/mathfu
Apache License 2.0
1.4k stars 188 forks source link

Bug on Quaternion::LookAt() #50

Open OttoX opened 2 years ago

OttoX commented 2 years ago

use default handedness: LH testcase:


Vector<float, 3> dir(0.615524292f,0,-1.49077988f);
dir.Normalize();

Vector<float, 3> up(0,1,0);
Quaternion<float> q = Quaternion<float>::LookAt(dir, up);

output q, the result is wrong: q = (-0.194535, 0.000000, 0.980896, 0.000000);

right answer should be: q = (0.194535, 0.000000, 0.980896, 0.000000);