Class Octree
- Namespace
- ValveResourceFormat.Renderer
- Assembly
- Renderer.dll
Spatial partitioning structure for efficient scene node culling and queries.
public class OctreeInheritance
Inherited Members
Constructors
Octree(float)
Initializes a new octree with the specified size.
public Octree(float size)Parameters
sizefloat-
Total size of the octree region (centered at origin).
Octree(AABB)
Initializes a new octree with the specified bounding box as the largest region.
public Octree(AABB size)Parameters
sizeAABB
Properties
DebugRenderer
public OctreeDebugRenderer? DebugRenderer { get; set; }Property Value
Dirty
Gets or sets whether this octree needs to be rebuilt.
public bool Dirty { get; set; }Property Value
Root
Gets the root node of the octree.
public Octree.Node Root { get; }Property Value
Methods
Clear()
Clears all nodes and elements from the octree.
public void Clear()Clear(AABB)
Clears all nodes and roughly sizes root to the specified bounds.
public void Clear(AABB rootBounds)Parameters
rootBoundsAABB
Insert(SceneNode)
Inserts a scene node into the octree.
public void Insert(SceneNode obj)Parameters
objSceneNode-
Scene node to insert.
Exceptions
- ArgumentNullException
-
Thrown if
objis null.
Remove(SceneNode)
Removes a scene node from the octree.
public void Remove(SceneNode obj)Parameters
objSceneNode-
Scene node to remove.
Exceptions
- ArgumentNullException
-
Thrown if
objis null.
Update(SceneNode, in AABB)
Updates a scene node's position in the octree after its bounds have changed.
public void Update(SceneNode obj, in AABB oldBounds)Parameters
Remarks
Relocates the node to the appropriate octree node based on its new bounds. May push the node down to child nodes or up to ancestor nodes as needed.
Exceptions
- ArgumentNullException
-
Thrown if
objis null.