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).
Exceptions
- ArgumentOutOfRangeException
-
Thrown if
sizeis negative or zero.
Properties
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()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.