diff options
Diffstat (limited to 'modules/csg/csg.h')
-rw-r--r-- | modules/csg/csg.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/modules/csg/csg.h b/modules/csg/csg.h index 1513a01f9e..2a0831e1ce 100644 --- a/modules/csg/csg.h +++ b/modules/csg/csg.h @@ -135,6 +135,17 @@ struct CSGBrushOperation { return h; } }; + struct Intersection { + bool found = false; + real_t conormal = FLT_MAX; + real_t distance_squared = FLT_MAX; + real_t origin_angle = FLT_MAX; + }; + + struct IntersectionDistance { + bool is_conormal; + real_t distance_squared; + }; Vector<Vector3> points; Vector<Face> faces; @@ -143,9 +154,9 @@ struct CSGBrushOperation { OAHashMap<VertexKey, int, VertexKeyHash> snap_cache; float vertex_snap = 0.0; - inline void _add_distance(List<real_t> &r_intersectionsA, List<real_t> &r_intersectionsB, bool p_from_B, real_t p_distance) const; - inline bool _bvh_inside(FaceBVH *facebvhptr, int p_max_depth, int p_bvh_first, int p_face_idx) const; - inline int _create_bvh(FaceBVH *facebvhptr, FaceBVH **facebvhptrptr, int p_from, int p_size, int p_depth, int &r_max_depth, int &r_max_alloc); + inline void _add_distance(List<IntersectionDistance> &r_intersectionsA, List<IntersectionDistance> &r_intersectionsB, bool p_from_B, real_t p_distance, bool p_is_conormal) const; + inline bool _bvh_inside(FaceBVH *r_facebvhptr, int p_max_depth, int p_bvh_first, int p_face_idx) const; + inline int _create_bvh(FaceBVH *r_facebvhptr, FaceBVH **r_facebvhptrptr, int p_from, int p_size, int p_depth, int &r_max_depth, int &r_max_alloc); void add_face(const Vector3 p_points[3], const Vector2 p_uvs[3], bool p_smooth, bool p_invert, const Ref<Material> &p_material, bool p_from_b); void mark_inside_faces(); |