Class BspTree
A binary space partitioning tree.
Inheritance
System.Object
BspTree
Namespace: InsaneScatterbrain.MapGraph
Syntax
public class BspTree : object
Constructors
BspTree()
Declaration
public BspTree()
BspTree(RectInt)
Creates a new BSP tree for the space represented by the given bounds.
Declaration
public BspTree(RectInt rootBounds)
Parameters
Type | Name | Description |
---|---|---|
RectInt | rootBounds | The root node's bounds. |
Properties
Leafs
Gets all the tree's leafs.
Declaration
public IReadOnlyCollection<BspNode> Leafs { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<BspNode> |
Root
Gets the tree's root node.
Declaration
public BspNode Root { get; }
Property Value
Type | Description |
---|---|
BspNode |
Methods
AddLeaf(BspNode)
Adds a leaf to the tree.
Declaration
public void AddLeaf(BspNode leaf)
Parameters
Type | Name | Description |
---|---|---|
BspNode | leaf | The leaf node to add. |
RemoveLeaf(BspNode)
Removes a leaf from the tree.
Declaration
public void RemoveLeaf(BspNode leaf)
Parameters
Type | Name | Description |
---|---|---|
BspNode | leaf | The leaf node to remove. |
Reset()
Declaration
public void Reset()
Set(BspNode, RectInt)
Creates a new BSP tree for the space represented by the given bounds.
Declaration
public void Set(BspNode rootNode, RectInt rootBounds)
Parameters
Type | Name | Description |
---|---|---|
BspNode | rootNode | The node instance to use as root node. |
RectInt | rootBounds | The root node's bounds. |