summaryrefslogtreecommitdiffstats
path: root/core/math/face3.cpp
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/face3.cpp
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/face3.cpp')
-rw-r--r--core/math/face3.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/math/face3.cpp b/core/math/face3.cpp
index d588f34e5d..9c968df19b 100644
--- a/core/math/face3.cpp
+++ b/core/math/face3.cpp
@@ -157,7 +157,7 @@ Vector3 Face3::get_random_point_inside() const {
SWAP(a, b);
}
- return vertex[0] * a + vertex[1] * (b - a) + vertex[2] * (1.0 - b);
+ return vertex[0] * a + vertex[1] * (b - a) + vertex[2] * (1.0f - b);
}
Plane Face3::get_plane(ClockDirection p_dir) const {
@@ -165,11 +165,11 @@ Plane Face3::get_plane(ClockDirection p_dir) const {
}
Vector3 Face3::get_median_point() const {
- return (vertex[0] + vertex[1] + vertex[2]) / 3.0;
+ return (vertex[0] + vertex[1] + vertex[2]) / 3.0f;
}
real_t Face3::get_area() const {
- return vec3_cross(vertex[0] - vertex[1], vertex[0] - vertex[2]).length() * 0.5;
+ return vec3_cross(vertex[0] - vertex[1], vertex[0] - vertex[2]).length() * 0.5f;
}
ClockDirection Face3::get_clock_dir() const {
@@ -223,7 +223,7 @@ bool Face3::intersects_aabb(const AABB &p_aabb) const {
Vector3 axis = vec3_cross(e1, e2);
- if (axis.length_squared() < 0.0001) {
+ if (axis.length_squared() < 0.0001f) {
continue; // coplanar
}
axis.normalize();