Bubba-3D
0.9.0
Awesome game engine!
|
Public Member Functions | |
Octree () | |
Octree (chag::float3 origin, chag::float3 halfVector) | |
void | insertTriangle (Triangle *t) |
void | insertAll (std::vector< Triangle * > &triangles) |
bool | hasChildren () |
void | getChildren (std::vector< Octree * > *octs) |
void | clearChildren () |
int | getOctantContainingPoint (const chag::float3 &point) |
int | getTriangleCount () |
int | getTriangleCountRecursively () |
std::vector< Triangle * > * | getTriangles () |
int | getNumberOfSubTrees () |
void | getTrianglesInsersectedByRayCast (chag::float3 rayOrigin, chag::float3 rayVector, std::vector< Triangle * > *triangleList) |
AABB * | getAABB () |
Octree::Octree | ( | ) |
Initiates the Octree with default values for origin and halfVector. Should NOT be used unless you really want a small Octree. // TODO(Bubbad) Make Octree resize after insertions to make this constructor useful
Definition at line 24 of file Octree.cpp.
Octree::Octree | ( | chag::float3 | origin, |
chag::float3 | halfVector | ||
) |
Initiates a Octree that can contain triangles that are at within the cube of size 2*halfVector that is centered around the specified origin.
origin | The center position of the Octree |
halfVector | Half the length of the surrounding cube |
Definition at line 35 of file Octree.cpp.
void Octree::clearChildren | ( | ) |
Removes all the Octrees children and their triangles
Definition at line 50 of file Octree.cpp.
AABB * Octree::getAABB | ( | ) |
NOTE: The AABB is not transformed.
Definition at line 149 of file Octree.cpp.
void Octree::getChildren | ( | std::vector< Octree * > * | octs | ) |
Fills the specified list with all the Octrees child Octrees
octs | List to be filled |
Definition at line 128 of file Octree.cpp.
int Octree::getNumberOfSubTrees | ( | ) |
Definition at line 165 of file Octree.cpp.
int Octree::getTriangleCountRecursively | ( | ) |
Definition at line 153 of file Octree.cpp.
std::vector< Triangle * > * Octree::getTriangles | ( | ) |
Definition at line 83 of file Octree.cpp.
void Octree::getTrianglesInsersectedByRayCast | ( | chag::float3 | rayOrigin, |
chag::float3 | rayVector, | ||
std::vector< Triangle * > * | triangleList | ||
) |
Recursively searches the Octree for triangles hit by the ray cast
triangleList | A list to be filled with all intersected triangles |
Definition at line 222 of file Octree.cpp.
bool Octree::hasChildren | ( | ) |
return True if the Octree is recursed and have triangles in deeper levels, false otherwise
Definition at line 124 of file Octree.cpp.