mirror of
https://github.com/raysan5/raylib.git
synced 2026-01-23 15:49:18 -05:00
[raymath] QuaternionFromVector3ToVector3(), math is wrong (#5508)
* the math in QuaternionFromVector3ToVector3 is wrong * fix styling
This commit is contained in:
@ -2369,7 +2369,7 @@ RMAPI Quaternion QuaternionFromVector3ToVector3(Vector3 from, Vector3 to)
|
||||
result.x = cross.x;
|
||||
result.y = cross.y;
|
||||
result.z = cross.z;
|
||||
result.w = 1.0f + cos2Theta;
|
||||
result.w = sqrtf(cross.x*cross.x + cross.y*cross.y + cross.z*cross.z + cos2Theta*cos2Theta) + cos2Theta; // sqrtf(Vector3DotProduct(cross, cross) + cos2Theta * cos2Theta) + cos2Theta
|
||||
|
||||
// QuaternionNormalize(q);
|
||||
// NOTE: Normalize to essentially nlerp the original and identity to 0.5
|
||||
|
||||
Reference in New Issue
Block a user