Optimizing code, because Quat_FromAxisAngle() will normalize the axis vector. No need to normalize again.
This commit is contained in:
parent
0ce2c1398c
commit
c2e1416a2a
@ -10,6 +10,6 @@ C3D_FQuat Quat_LookAt(C3D_FVec source, C3D_FVec target, C3D_FVec forwardVector,
|
|||||||
if (dot - 1.0f < -FLT_EPSILON)
|
if (dot - 1.0f < -FLT_EPSILON)
|
||||||
return Quat_Identity();
|
return Quat_Identity();
|
||||||
float rotationAngle = acosf(dot);
|
float rotationAngle = acosf(dot);
|
||||||
C3D_FVec rotationAxis = FVec3_Normalize(FVec3_Cross(forwardVector, forward));
|
C3D_FVec rotationAxis = FVec3_Cross(forwardVector, forward);
|
||||||
return Quat_FromAxisAngle(rotationAxis, rotationAngle);
|
return Quat_FromAxisAngle(rotationAxis, rotationAngle);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user