Class BspTree
A binary space partitioning tree.
Inheritance
object
BspTree
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: InsaneScatterbrain.MapGraph
Syntax
public class BspTree
Constructors
BspTree()
Declaration
public BspTree()
BspTree(RectInt)
Creates a new BSP tree for the space represented by the given bounds.
Declaration
[Obsolete("Please use the pool manager to get a TextureData instance. This constructor will probably be removed in version 2.0. Alternatively, use the parameterless constructor and call the Set method.")]
public BspTree(RectInt rootBounds)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.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 |
---|---|
System.Collections.Generic.IReadOnlyCollection<T><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. |
UnityEngine.RectInt | rootBounds | The root node's bounds. |