summaryrefslogtreecommitdiffstats
path: root/core/math/face3.cpp
diff options
context:
space:
mode:
authorlawnjelly <lawnjelly@gmail.com>2022-02-24 07:17:00 +0000
committerlawnjelly <lawnjelly@gmail.com>2022-02-24 08:15:10 +0000
commit1485924a2b90d15949fe544097ce8d00d527e9e7 (patch)
tree0f1dff59ef994a9b0ea640d3745858b114128fdd /core/math/face3.cpp
parentcfc7c78732198a7ebc43b92ed24e7025fdf4bc11 (diff)
downloadredot-engine-1485924a2b90d15949fe544097ce8d00d527e9e7.tar.gz
Float literals - fix main primitives to use real_t casting
Uses (real_t) casting to ensure appropriate calculations are done in 32 bit where real_t is compiled as 32 bit.
Diffstat (limited to 'core/math/face3.cpp')
-rw-r--r--core/math/face3.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/math/face3.cpp b/core/math/face3.cpp
index 9c968df19b..5bc1bc25e6 100644
--- a/core/math/face3.cpp
+++ b/core/math/face3.cpp
@@ -42,7 +42,7 @@ int Face3::split_by_plane(const Plane &p_plane, Face3 p_res[3], bool p_is_point_
int below_count = 0;
for (int i = 0; i < 3; i++) {
- if (p_plane.has_point(vertex[i], CMP_EPSILON)) { // point is in plane
+ if (p_plane.has_point(vertex[i], (real_t)CMP_EPSILON)) { // point is in plane
ERR_FAIL_COND_V(above_count >= 4, 0);
above[above_count++] = vertex[i];
@@ -117,7 +117,7 @@ bool Face3::intersects_segment(const Vector3 &p_from, const Vector3 &p_dir, Vect
bool Face3::is_degenerate() const {
Vector3 normal = vec3_cross(vertex[0] - vertex[1], vertex[0] - vertex[2]);
- return (normal.length_squared() < CMP_EPSILON2);
+ return (normal.length_squared() < (real_t)CMP_EPSILON2);
}
Face3::Side Face3::get_side_of(const Face3 &p_face, ClockDirection p_clock_dir) const {