I was looking at the code for quaternion vector rotation (multiplication) (line 141, math/linear_algebra/quaternion.h), and it seems to me that the formula shown in the comment was incorrectly applied in the implementation. I didn't test the engine directly but I wrote my own version of quaternions and tested that.
The correct implementation would probably look something like this:
return (2*(quat.w*quat.w)- 1.0f)vec + 2.0f(dot(quat.r, vec)quat.r + quat.wcross(quat.r, vec));
This version worked for me
I was looking at the code for quaternion vector rotation (multiplication) (line 141, math/linear_algebra/quaternion.h), and it seems to me that the formula shown in the comment was incorrectly applied in the implementation. I didn't test the engine directly but I wrote my own version of quaternions and tested that.
The correct implementation would probably look something like this:
return (2*(quat.w*quat.w)- 1.0f)vec + 2.0f(dot(quat.r, vec)quat.r + quat.wcross(quat.r, vec));
This version worked for me