Table of Contents

Class Octree

Namespace
ValveResourceFormat.Renderer
Assembly
Renderer.dll

Spatial partitioning structure for efficient scene node culling and queries.

public class Octree

Inheritance

Inherited Members

Constructors

Octree(float)

Initializes a new octree with the specified size.

public Octree(float size)

Parameters

size float

Total size of the octree region (centered at origin).

Exceptions

ArgumentOutOfRangeException

Thrown if size is negative or zero.

Properties

Root

Gets the root node of the octree.

public Octree.Node Root { get; }

Property Value

Octree.Node

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

obj SceneNode

Scene node to insert.

Exceptions

ArgumentNullException

Thrown if obj is null.

Remove(SceneNode)

Removes a scene node from the octree.

public void Remove(SceneNode obj)

Parameters

obj SceneNode

Scene node to remove.

Exceptions

ArgumentNullException

Thrown if obj is 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

obj SceneNode

Scene node to update.

oldBounds AABB

Previous bounding box of the scene node.

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 obj is null.