Class TriangleQuadTree
A Quadtree implementation optimized for triangles.
Inheritance
System.Object
TriangleQuadTree
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: UnityEngine.Experimental.U2D.TriangleNet.Tools
Syntax
public class TriangleQuadTree
Constructors
TriangleQuadTree(Mesh, Int32, Int32)
Initializes a new instance of the TriangleQuadTree class.
Declaration
public TriangleQuadTree(Mesh mesh, int maxDepth = 10, int sizeBound = 10)
Parameters
Type | Name | Description |
---|---|---|
Mesh | mesh | Mesh containing triangles. |
System.Int32 | maxDepth | The maximum depth of the tree. |
System.Int32 | sizeBound | The maximum number of triangles contained in a leaf. |
Remarks
The quadtree does not track changes of the mesh. If a mesh is refined or changed in any other way, a new quadtree has to be built to make the point location work.
A node of the tree will be split, if its level if less than the max depth parameter AND the number of triangles in the node is greater than the size bound.
Methods
Query(Double, Double)
Declaration
public ITriangle Query(double x, double y)
Parameters
Type | Name | Description |
---|---|---|
System.Double | x | |
System.Double | y |
Returns
Type | Description |
---|---|
ITriangle |