diff options
author | lawnjelly <lawnjelly@gmail.com> | 2022-02-06 11:14:58 +0000 |
---|---|---|
committer | lawnjelly <lawnjelly@gmail.com> | 2022-02-10 18:43:19 +0000 |
commit | 5298e16e80e032a7ff0c6a661b826859e5aeccd0 (patch) | |
tree | 71d1a20724bd477e59f2051d4f7c62dd4df5757b /core/math/plane.cpp | |
parent | 38c851a3fa14983e60f74703fea2178d52358b92 (diff) | |
download | redot-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/plane.cpp')
-rw-r--r-- | core/math/plane.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/math/plane.cpp b/core/math/plane.cpp index 8bd4b5ef4f..0ce8aed51c 100644 --- a/core/math/plane.cpp +++ b/core/math/plane.cpp @@ -58,7 +58,7 @@ Vector3 Plane::get_any_perpendicular_normal() const { static const Vector3 p2 = Vector3(0, 1, 0); Vector3 p; - if (ABS(normal.dot(p1)) > 0.99) { // if too similar to p1 + if (ABS(normal.dot(p1)) > 0.99f) { // if too similar to p1 p = p2; // use p2 } else { p = p1; // use p1 @@ -129,7 +129,7 @@ bool Plane::intersects_segment(const Vector3 &p_begin, const Vector3 &p_end, Vec real_t dist = (normal.dot(p_begin) - d) / den; //printf("dist is %i\n",dist); - if (dist < -CMP_EPSILON || dist > (1.0 + CMP_EPSILON)) { + if (dist < -CMP_EPSILON || dist > (1.0f + CMP_EPSILON)) { return false; } |