summaryrefslogtreecommitdiffstats
path: root/core/math/vector2.h
diff options
context:
space:
mode:
authorlawnjelly <lawnjelly@gmail.com>2022-02-06 11:14:58 +0000
committerlawnjelly <lawnjelly@gmail.com>2022-02-10 18:43:19 +0000
commit5298e16e80e032a7ff0c6a661b826859e5aeccd0 (patch)
tree71d1a20724bd477e59f2051d4f7c62dd4df5757b /core/math/vector2.h
parent38c851a3fa14983e60f74703fea2178d52358b92 (diff)
downloadredot-engine-5298e16e80e032a7ff0c6a661b826859e5aeccd0.tar.gz
Float literals - fix main primitives to use .f
Converts float literals from double format (e.g. 0.0) to float format (e.g. 0.0f) where appropriate for 32 bit calculations.
Diffstat (limited to 'core/math/vector2.h')
-rw-r--r--core/math/vector2.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/math/vector2.h b/core/math/vector2.h
index 92ac5257b0..a2680b84fc 100644
--- a/core/math/vector2.h
+++ b/core/math/vector2.h
@@ -248,7 +248,7 @@ Vector2 Vector2::lerp(const Vector2 &p_to, const real_t p_weight) const {
Vector2 Vector2::slerp(const Vector2 &p_to, const real_t p_weight) const {
real_t start_length_sq = length_squared();
real_t end_length_sq = p_to.length_squared();
- if (unlikely(start_length_sq == 0.0 || end_length_sq == 0.0)) {
+ if (unlikely(start_length_sq == 0.0f || end_length_sq == 0.0f)) {
// Zero length vectors have no angle, so the best we can do is either lerp or throw an error.
return lerp(p_to, p_weight);
}