update raymath.h function QuaternionMultiply
the multiplication algorithm was slightly off previously when combining quaternion rotations objects would shrink now they rotate as expected trying to get around the issue by using QuaternionToMatrix then QuaternionTransform doesn't work, and I'm not sure why
This commit is contained in:
parent
c5fc771622
commit
24c8104189
|
|
@ -2225,9 +2225,9 @@ RMAPI Quaternion QuaternionMultiply(Quaternion q1, Quaternion q2)
|
||||||
float qax = q1.x, qay = q1.y, qaz = q1.z, qaw = q1.w;
|
float qax = q1.x, qay = q1.y, qaz = q1.z, qaw = q1.w;
|
||||||
float qbx = q2.x, qby = q2.y, qbz = q2.z, qbw = q2.w;
|
float qbx = q2.x, qby = q2.y, qbz = q2.z, qbw = q2.w;
|
||||||
|
|
||||||
result.x = qax*qbw + qaw*qbx + qay*qbz - qaz*qby;
|
result.x = qax*qbw + qaw*qbx + qaz*qby - qay*qbz;
|
||||||
result.y = qay*qbw + qaw*qby + qaz*qbx - qax*qbz;
|
result.y = qay*qbw + qaw*qby + qax*qbz - qaz*qbx;
|
||||||
result.z = qaz*qbw + qaw*qbz + qax*qby - qay*qbx;
|
result.z = qaz*qbw + qaw*qbz + qay*qbx - qax*qby;
|
||||||
result.w = qaw*qbw - qax*qbx - qay*qby - qaz*qbz;
|
result.w = qaw*qbw - qax*qbx - qay*qby - qaz*qbz;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user