Class Argos::AABBTree
Axis-Aligned Bounding Box tree for accelerating spatial queries on a triangle mesh. More...
#include <AABBTree.h>
Classes
| Type | Name |
|---|---|
| struct | Triangle A single triangle with its vertex positions, original vertex indices, and the source face it came from. |
Public Types
| Type | Name |
|---|---|
| typedef Vector3D< double > | Vec3 Convenience alias for 3D positions used by the tree. |
Public Functions
| Type | Name |
|---|---|
| AABBTree (const Mesh & mesh) Build an AABB tree from a mesh. |
|
| bool | empty () const Whether the tree contains no triangles. |
| int | getNbIntersections (const Vec3 & v1, const Vec3 & v2) Count how many triangles intersect the segment [v1, v2]. |
| const std::vector< Triangle > & | getTriangles () const Const access to the flattened triangle list. |
| double | nearestDistance (const Vec3 & point) const Euclidean distance from a point to the nearest triangle. |
| double | nearestDistanceSquared (const Vec3 & point) const Squared distance from a point to the nearest triangle. |
| std::vector< Triangle > | nearestTriangles (const Vec3 & point) const Find all triangles within the current best distance. |
| std::size_t | triangleCount () const Number of triangles stored in the tree. |
Detailed Description
Builds a balanced binary tree of AABBs over the triangles of a Mesh. Supports nearest-point queries and ray-intersection counting.
Public Types Documentation
typedef Vec3
Convenience alias for 3D positions used by the tree.
Public Functions Documentation
function AABBTree
Build an AABB tree from a mesh.
Parameters:
meshThe input mesh (triangulated internally if needed).
function empty
Whether the tree contains no triangles.
function getNbIntersections [1/2]
Count how many triangles intersect the segment [v1, v2].
Parameters:
v1Segment start.v2Segment end.
Returns:
Number of intersections.
function getTriangles
Const access to the flattened triangle list.
function nearestDistance
Euclidean distance from a point to the nearest triangle.
Parameters:
pointQuery point.
Returns:
Minimum distance.
function nearestDistanceSquared
Squared distance from a point to the nearest triangle.
Parameters:
pointQuery point.
Returns:
Squared minimum distance.
function nearestTriangles [1/2]
Find all triangles within the current best distance.
Parameters:
pointQuery point.
Returns:
Vector of nearest triangles (may contain ties).
function triangleCount
Number of triangles stored in the tree.
The documentation for this class was generated from the following file include/structure/AABBTree.h