Urho3D
|
Octree octant. More...
#include </home/runner/work/urho3d-doxygen.github.io/urho3d-doxygen.github.io/urho3d_repo/Source/Urho3D/Graphics/Octree.h>
Public Member Functions | |
Octant (const BoundingBox &box, i32 level, Octant *parent, Octree *root, i32 index=ROOT_INDEX) | |
Construct. | |
virtual | ~Octant () |
Destruct. Move drawables to root if available (detach if not) and free child octants. | |
Octant * | GetOrCreateChild (i32 index) |
Return or create a child octant. | |
void | DeleteChild (i32 index) |
Delete child octant. | |
void | InsertDrawable (Drawable *drawable) |
Insert a drawable object by checking for fit recursively. | |
bool | CheckDrawableFit (const BoundingBox &box) const |
Check if a drawable object fits. | |
void | AddDrawable (Drawable *drawable) |
Add a drawable object to this octant. | |
void | RemoveDrawable (Drawable *drawable, bool resetOctant=true) |
Remove a drawable object from this octant. | |
const BoundingBox & | GetWorldBoundingBox () const |
Return world-space bounding box. | |
const BoundingBox & | GetCullingBox () const |
Return bounding box used for fitting drawable objects. | |
i32 | GetLevel () const |
Return subdivision level. | |
Octant * | GetParent () const |
Return parent octant. | |
Octree * | GetRoot () const |
Return octree root. | |
i32 | GetNumDrawables () const |
Return number of drawables. | |
bool | IsEmpty () |
Return true if there are no drawable objects in this octant and child octants. | |
void | ResetRoot () |
Reset root pointer recursively. Called when the whole octree is being destroyed. | |
void | DrawDebugGeometry (DebugRenderer *debug, bool depthTest) |
Draw bounds to the debug graphics recursively. | |
Protected Member Functions | |
void | Initialize (const BoundingBox &box) |
Initialize bounding box. | |
void | GetDrawablesInternal (OctreeQuery &query, bool inside) const |
Return drawable objects by a query, called internally. | |
void | GetDrawablesInternal (RayOctreeQuery &query) const |
Return drawable objects by a ray query, called internally. | |
void | GetDrawablesOnlyInternal (RayOctreeQuery &query, Vector< Drawable * > &drawables) const |
Return drawable objects only for a threaded ray query, called internally. | |
void | IncDrawableCount () |
Increase drawable object count recursively. | |
void | DecDrawableCount () |
Decrease drawable object count recursively and remove octant if it becomes empty. | |
Protected Attributes | |
BoundingBox | worldBoundingBox_ |
World bounding box. | |
BoundingBox | cullingBox_ |
Bounding box used for drawable object fitting. | |
Vector< Drawable * > | drawables_ |
Drawable objects. | |
Octant * | children_ [NUM_OCTANTS] {} |
Child octants. | |
Vector3 | center_ |
World bounding box center. | |
Vector3 | halfSize_ |
World bounding box half size. | |
i32 | level_ |
Subdivision level. | |
i32 | numDrawables_ {} |
Number of drawable objects in this octant and child octants. | |
Octant * | parent_ |
Parent octant. | |
Octree * | root_ |
Octree root. | |
i32 | index_ |
Octant index relative to its siblings or ROOT_INDEX for root octant. | |
Octree octant.