diff options
Diffstat (limited to 'core/math/triangle_mesh.h')
-rw-r--r-- | core/math/triangle_mesh.h | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/core/math/triangle_mesh.h b/core/math/triangle_mesh.h index 65250c023d..7f81e54613 100644 --- a/core/math/triangle_mesh.h +++ b/core/math/triangle_mesh.h @@ -29,11 +29,11 @@ #ifndef TRIANGLE_MESH_H #define TRIANGLE_MESH_H -#include "reference.h" #include "face3.h" +#include "reference.h" class TriangleMesh : public Reference { - GDCLASS( TriangleMesh, Reference); + GDCLASS(TriangleMesh, Reference); struct Triangle { @@ -56,7 +56,7 @@ class TriangleMesh : public Reference { struct BVHCmpX { - bool operator()(const BVH* p_left, const BVH* p_right) const { + bool operator()(const BVH *p_left, const BVH *p_right) const { return p_left->center.x < p_right->center.x; } @@ -64,35 +64,33 @@ class TriangleMesh : public Reference { struct BVHCmpY { - bool operator()(const BVH* p_left, const BVH* p_right) const { + bool operator()(const BVH *p_left, const BVH *p_right) const { return p_left->center.y < p_right->center.y; } }; struct BVHCmpZ { - bool operator()(const BVH* p_left, const BVH* p_right) const { + bool operator()(const BVH *p_left, const BVH *p_right) const { return p_left->center.z < p_right->center.z; } }; - int _create_bvh(BVH*p_bvh,BVH** p_bb,int p_from,int p_size,int p_depth,int&max_depth,int&max_alloc); + int _create_bvh(BVH *p_bvh, BVH **p_bb, int p_from, int p_size, int p_depth, int &max_depth, int &max_alloc); PoolVector<BVH> bvh; int max_depth; bool valid; public: - bool is_valid() const; - bool intersect_segment(const Vector3& p_begin,const Vector3& p_end,Vector3 &r_point, Vector3 &r_normal) const; - bool intersect_ray(const Vector3& p_begin,const Vector3& p_dir,Vector3 &r_point, Vector3 &r_normal) const; - Vector3 get_area_normal(const Rect3& p_aabb) const; + bool intersect_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 &r_point, Vector3 &r_normal) const; + bool intersect_ray(const Vector3 &p_begin, const Vector3 &p_dir, Vector3 &r_point, Vector3 &r_normal) const; + Vector3 get_area_normal(const Rect3 &p_aabb) const; PoolVector<Face3> get_faces() const; - - void create(const PoolVector<Vector3>& p_faces); + void create(const PoolVector<Vector3> &p_faces); TriangleMesh(); }; |