20 #include <linmath/float3.h> 29 const int MAX_DEPTH = 8;
30 const int MAX_CHILDREN = 16;
49 Octree(chag::float3 origin, chag::float3 halfVector);
54 void insertAll(std::vector<Triangle*> &triangles);
71 int getOctantContainingPoint(
const chag::float3& point);
72 int getTriangleCount();
94 std::vector<Triangle*> *triangleList);
102 Octree(chag::float3 origin, chag::float3 halfVector,
int depth);
104 void setupAABB(chag::float3 origin, chag::float3 halfVector);
109 void createChildren();
116 chag::float3 combineTwoPointsByComparator(chag::float3 p1, chag::float3 p2,
117 std::function<
bool(
float,
float)> comparator);
119 bool rayCastIntersectsAABB(chag::float3 rayOrigin, chag::float3 rayVector);
120 void putTrianglesToList(std::vector<Triangle *> *triangleList);
123 chag::float3 halfVector;
126 std::vector<Triangle*> ts;
int getTriangleCountRecursively()
std::vector< Triangle * > * getTriangles()
void getTrianglesInsersectedByRayCast(chag::float3 rayOrigin, chag::float3 rayVector, std::vector< Triangle * > *triangleList)
void getChildren(std::vector< Octree * > *octs)
int getNumberOfSubTrees()