Fixed missing float number types
This commit is contained in:
parent
bebd097db3
commit
3c67a2e16a
@ -78,9 +78,9 @@ float Quaternion::Dot(Quaternion a, Quaternion b) {
|
|||||||
|
|
||||||
Vector3 Quaternion::ToAngles(const Quaternion& q1) {
|
Vector3 Quaternion::ToAngles(const Quaternion& q1) {
|
||||||
float test = q1.x * q1.y + q1.z * q1.w;
|
float test = q1.x * q1.y + q1.z * q1.w;
|
||||||
if (test > 0.499) { // singularity at north pole
|
if (test > 0.499f) { // singularity at north pole
|
||||||
return Vector3(0, 2 * (float)atan2(q1.x, q1.w) * Rad2Deg, 90);
|
return Vector3(0, 2 * (float)atan2(q1.x, q1.w) * Rad2Deg, 90);
|
||||||
} else if (test < -0.499) { // singularity at south pole
|
} else if (test < -0.499f) { // singularity at south pole
|
||||||
return Vector3(0, -2 * (float)atan2(q1.x, q1.w) * Rad2Deg, -90);
|
return Vector3(0, -2 * (float)atan2(q1.x, q1.w) * Rad2Deg, -90);
|
||||||
} else {
|
} else {
|
||||||
float sqx = q1.x * q1.x;
|
float sqx = q1.x * q1.x;
|
||||||
@ -218,7 +218,7 @@ Quaternion Quaternion::AngleAxis(float angle, const Vector3& axis) {
|
|||||||
|
|
||||||
Quaternion result = Quaternion();
|
Quaternion result = Quaternion();
|
||||||
float radians = angle * Deg2Rad;
|
float radians = angle * Deg2Rad;
|
||||||
radians *= 0.5;
|
radians *= 0.5f;
|
||||||
|
|
||||||
Vector3 axis2 = axis * (float)sin(radians);
|
Vector3 axis2 = axis * (float)sin(radians);
|
||||||
result.x = axis2.x;
|
result.x = axis2.x;
|
||||||
@ -257,8 +257,8 @@ Quaternion Quaternion::SlerpUnclamped(const Quaternion& a,
|
|||||||
const Quaternion& b,
|
const Quaternion& b,
|
||||||
float t) {
|
float t) {
|
||||||
// if either input is zero, return the other.
|
// if either input is zero, return the other.
|
||||||
if (Quaternion::GetLengthSquared(a) == 0.0) {
|
if (Quaternion::GetLengthSquared(a) == 0.0f) {
|
||||||
if (Quaternion::GetLengthSquared(b) == 0.0) {
|
if (Quaternion::GetLengthSquared(b) == 0.0f) {
|
||||||
return Quaternion();
|
return Quaternion();
|
||||||
}
|
}
|
||||||
return b;
|
return b;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user