U3D
Open-source, cross-platform 2D and 3D game engine built in C++
Loading...
Searching...
No Matches
Urho3D::Octant Class Reference

#include </var/dev/u3d/stable/Source/Urho3D/Graphics/Octree.h>

Inheritance diagram for Urho3D::Octant:
[legend]
Collaboration diagram for Urho3D::Octant:
[legend]

Public Member Functions

 Octant (const BoundingBox &box, unsigned level, Octant *parent, Octree *root, unsigned index=ROOT_INDEX)
 Construct.
 
virtual ~Octant ()
 Destruct. Move drawables to root if available (detach if not) and free child octants.
 
OctantGetOrCreateChild (unsigned index)
 Return or create a child octant.
 
void DeleteChild (unsigned 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 BoundingBoxGetWorldBoundingBox () const
 
const BoundingBoxGetCullingBox () const
 Return bounding box used for fitting drawable objects.
 
unsigned GetLevel () const
 Return subdivision level.
 
OctantGetParent () const
 Return parent octant.
 
OctreeGetRoot () const
 Return octree root.
 
unsigned 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)
 

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, PODVector< 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.
 
PODVector< Drawable * > drawables_
 Drawable objects.
 
Octantchildren_ [NUM_OCTANTS] {}
 Child octants.
 
Vector3 center_
 World bounding box center.
 
Vector3 halfSize_
 World bounding box half size.
 
unsigned level_
 Subdivision level.
 
unsigned numDrawables_ {}
 Number of drawable objects in this octant and child octants.
 
Octantparent_
 Parent octant.
 
Octreeroot_
 Octree root.
 
unsigned index_
 Octant index relative to its siblings or ROOT_INDEX for root octant.
 

Detailed Description

Octree octant.

Member Function Documentation

◆ DrawDebugGeometry()

void Urho3D::Octant::DrawDebugGeometry ( DebugRenderer debug,
bool  depthTest 
)

Draw bounds to the debug graphics recursively.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetWorldBoundingBox()

const BoundingBox & Urho3D::Octant::GetWorldBoundingBox ( ) const
inline

Return world-space bounding box.


The documentation for this class was generated from the following files: