REVIEWED: QuaternionFromAxisAngle() #1892
This commit is contained in:
parent
4e363b5479
commit
70ed52dd5d
1 changed files with 11 additions and 10 deletions
|
@ -1422,7 +1422,7 @@ RMDEF Quaternion QuaternionFromAxisAngle(Vector3 axis, float angle)
|
||||||
Quaternion result = { 0.0f, 0.0f, 0.0f, 1.0f };
|
Quaternion result = { 0.0f, 0.0f, 0.0f, 1.0f };
|
||||||
|
|
||||||
if (Vector3Length(axis) != 0.0f)
|
if (Vector3Length(axis) != 0.0f)
|
||||||
|
{
|
||||||
angle *= 0.5f;
|
angle *= 0.5f;
|
||||||
|
|
||||||
axis = Vector3Normalize(axis);
|
axis = Vector3Normalize(axis);
|
||||||
|
@ -1436,6 +1436,7 @@ RMDEF Quaternion QuaternionFromAxisAngle(Vector3 axis, float angle)
|
||||||
result.w = cosres;
|
result.w = cosres;
|
||||||
|
|
||||||
result = QuaternionNormalize(result);
|
result = QuaternionNormalize(result);
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue