libmove3d
3.13.0
|
#include <gpKdTree.h>
Public Member Functions | |
gpAABBTris (gpKdTreeTris *tree, std::list< unsigned int > &inner_triangles) | |
constructor for root AABB | |
gpAABBTris (gpAABBTris *previous, double xmin, double xmax, double ymin, double ymax, double zmin, double zmax) | |
constructor for non root AABB | |
bool | isTriangleOutside (p3d_vector3 p1, p3d_vector3 p2, p3d_vector3 p3) |
bool | isInsidePolyhedre () |
int | divide () |
int | draw (unsigned int level) |
int | sample (double step, std::list< gpVector3D > &points) |
A class for Axis-Aligned Bounding Box of a p3d_polyhedre (a set of triangles). It is used in an associated Kd tree class.
gpAABBTris::gpAABBTris | ( | gpKdTreeTris * | tree, |
std::list< unsigned int > & | inner_triangles | ||
) |
constructor for root AABB
Constructor for root gpAABBTris.
tree | pointer to the Kd tree, the AABB will belong to |
inner_points | list of the points the AABB must bound |
gpAABBTris::gpAABBTris | ( | gpAABBTris * | previous, |
double | xmin, | ||
double | xmax, | ||
double | ymin, | ||
double | ymax, | ||
double | zmin, | ||
double | zmax | ||
) |
constructor for non root AABB
Constructor for non root gpAABBTris.
previous | pointer to the previous AABB in the tree |
xmin | minimal coordinate of the AABB along x axis |
xmax | maximal coordinate of the AABB along x axis |
ymin | minimal coordinate of the AABB along y axis |
ymax | maximal coordinate of the AABB along y axis |
zmin | minimal coordinate of the AABB along z axis |
zmax | maximal coordinate of the AABB along z axis |
inner_points | list of the points the AABB must bound |
int gpAABBTris::divide | ( | ) |
Divides an AABB along its larger dimension.
int gpAABBTris::draw | ( | unsigned int | level | ) |
Draws a gpAABBTris if its level is equal to the input value or if it is a leaf and if it is not ouside the polyhedron interior.
level | the value to compare to the gpAABB level |
bool gpAABBTris::isInsidePolyhedre | ( | ) |
Tests if the AABB is entirely inside the p3d_polyhedre.
bool gpAABBTris::isTriangleOutside | ( | p3d_vector3 | p1, |
p3d_vector3 | p2, | ||
p3d_vector3 | p3 | ||
) |
Tests if a triangle is completely outside the AABB.
p1 | first vertex of the triangle |
p2 | second vertex of the triangle |
p3 | third vertex of the triangle |