summaryrefslogtreecommitdiff
path: root/core/math/quaternion.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/math/quaternion.h')
-rw-r--r--core/math/quaternion.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/core/math/quaternion.h b/core/math/quaternion.h
index 7874e4f428..f8a2c6456e 100644
--- a/core/math/quaternion.h
+++ b/core/math/quaternion.h
@@ -145,19 +145,19 @@ struct _NO_DISCARD_ Quaternion {
Vector3 c = v0.cross(v1);
real_t d = v0.dot(v1);
- if (d < -1.0 + CMP_EPSILON) {
+ if (d < -1.0f + CMP_EPSILON) {
x = 0;
y = 1;
z = 0;
w = 0;
} else {
- real_t s = Math::sqrt((1.0 + d) * 2.0);
- real_t rs = 1.0 / s;
+ real_t s = Math::sqrt((1.0f + d) * 2.0f);
+ real_t rs = 1.0f / s;
x = c.x * rs;
y = c.y * rs;
z = c.z * rs;
- w = s * 0.5;
+ w = s * 0.5f;
}
}
};
@@ -192,7 +192,7 @@ void Quaternion::operator*=(const real_t &s) {
}
void Quaternion::operator/=(const real_t &s) {
- *this *= 1.0 / s;
+ *this *= 1.0f / s;
}
Quaternion Quaternion::operator+(const Quaternion &q2) const {
@@ -215,7 +215,7 @@ Quaternion Quaternion::operator*(const real_t &s) const {
}
Quaternion Quaternion::operator/(const real_t &s) const {
- return *this * (1.0 / s);
+ return *this * (1.0f / s);
}
bool Quaternion::operator==(const Quaternion &p_quaternion) const {