Kigs Framework
Doc version 0.8
Open source multi purpose Rapid Application Development framework
|
#include <AABBTree.h>
Public Member Functions | |
AABBTreeNode () | |
constructor | |
virtual | ~AABBTreeNode () |
destructor More... | |
Public Attributes | |
AABBTreeNode * | mSon1 = nullptr |
sons. AABBTree is a binary tree | |
BBox | mBBox |
BBox for this node. | |
Protected Member Functions | |
template<typename t > | |
void | Build2 (AABBTree *root, BuildTriangle< t > *TrArray, BuildTriangle< t > *TmpTrArray, unsigned int TrCount, Point3D *VertexArray, const int leafSize, int lastSortMode, BBox currentbbox) |
Protected Attributes | |
int | mTriangleCount = 0 |
triangle count in this BBox | |
Friends | |
class | AABBTreeNode |
class | Collision |
Node structure in a Axis Aligned Bounding box tree, used to optimise intersection calculation.
|
virtual |
destructor
delete son nodes
|
protected |
first compute triangle array BoundingBox
Compute bounding box diagonal
if Triangle count is small then this is a leaf
else find the longest bbox length on X, Y or Z
and sort array according to the longest axis
now that we have a sorted array of triangles, we take the bboxes of first and last triangle in the array, and try to set each triangle in the bbox where it fits better. Triangle are taken in this order :
at the end, if one of the list is empty, just separate the triangle list in two
else use the list to construct the two sons recursively
|
friend |
call base class constructor (CollisionBaseObject) and init members