81 Node() : child1(NULL), child2(NULL) {}
96 void BuildHierarchyRecursive(Node *node, std::vector<AABB> boxes);
97 void IntersectRecursive(
const Ray &r, Node *node, std::vector<int> *data_list)
const;
98 void FreeNodeRecursive(Node* node);
A 3D axis-aligned bounding box defined by two corners (min and max).
A Bounding Volume Hierarchy (BVH) data structure that can be used to accelerate ray-object intersecti...
void CreateFromMesh(const Mesh &mesh)
Creates a bounding volume hierarchy where each leaf node contains a single triangle from the mesh.
void CreateFromListOfBoxes(const std::vector< AABB > &boxes)
Creates a BVH where each leaf node contains one of the boxes passed in to the function.
BVH()
Initializes the class with an empty hierarchy.
std::vector< int > IntersectAndReturnUserData(const Ray &r) const
Traverse the BVH to find leaf nodes whose AABBs are intersected by the ray.
A triangle mesh data structure that can be rendered with a ShaderProgram like DefaultShader.
Stores the mathematical object of a ray that begins at an origin (a 3D point) and points in a directi...
Namespace for the MinGfx Toolkit.