diff options
Diffstat (limited to 'core/math/face3.h')
-rw-r--r-- | core/math/face3.h | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/core/math/face3.h b/core/math/face3.h index 3dbbca09e0..c61d6ad66e 100644 --- a/core/math/face3.h +++ b/core/math/face3.h @@ -36,8 +36,7 @@ #include "core/math/transform_3d.h" #include "core/math/vector3.h" -class _NO_DISCARD_ Face3 { -public: +struct _NO_DISCARD_ Face3 { enum Side { SIDE_OVER, SIDE_UNDER, @@ -48,14 +47,11 @@ public: Vector3 vertex[3]; /** - * * @param p_plane plane used to split the face * @param p_res array of at least 3 faces, amount used in function return * @param p_is_point_over array of at least 3 booleans, determining which face is over the plane, amount used in function return - * @param _epsilon constant used for numerical error rounding, to add "thickness" to the plane (so coplanar points can happen) * @return amount of faces generated by the split, either 0 (means no split possible), 2 or 3 */ - int split_by_plane(const Plane &p_plane, Face3 *p_res, bool *p_is_point_over) const; Plane get_plane(ClockDirection p_dir = CLOCKWISE) const; @@ -99,7 +95,7 @@ public: bool Face3::intersects_aabb2(const AABB &p_aabb) const { Vector3 perp = (vertex[0] - vertex[2]).cross(vertex[0] - vertex[1]); - Vector3 half_extents = p_aabb.size * 0.5; + Vector3 half_extents = p_aabb.size * 0.5f; Vector3 ofs = p_aabb.position + half_extents; Vector3 sup = Vector3( @@ -210,7 +206,7 @@ bool Face3::intersects_aabb2(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(); |