Pathfinding.NavMeshGraph.RebuildBBTree C# (CSharp) Method

RebuildBBTree() public static method

public static RebuildBBTree ( NavMeshGraph graph ) : void
graph NavMeshGraph
return void
		public static void RebuildBBTree (NavMeshGraph graph) {
			//Build Axis Aligned Bounding Box Tree
			
			NavMeshGraph meshGraph = graph as NavMeshGraph;
			
			BBTree bbTree = new BBTree (graph as INavmeshHolder);
			
			TriangleMeshNode[] nodes = meshGraph.TriNodes;
			
			for (int i=nodes.Length-1;i>=0;i--) {
				bbTree.Insert (nodes[i]);
			}
			
			meshGraph.bbTree = bbTree;
		}
		

Usage Example

Ejemplo n.º 1
0
 public override void RelocateNodes(Matrix4x4 oldMatrix, Matrix4x4 newMatrix)
 {
     if (this.vertices == null || this.vertices.Length == 0 || this.originalVertices == null || this.originalVertices.Length != this.vertices.Length)
     {
         return;
     }
     for (int i = 0; i < this._vertices.Length; i++)
     {
         this._vertices[i] = (Int3)newMatrix.MultiplyPoint3x4(this.originalVertices[i]);
     }
     for (int j = 0; j < this.nodes.Length; j++)
     {
         TriangleMeshNode triangleMeshNode = this.nodes[j];
         triangleMeshNode.UpdatePositionFromVertices();
         if (triangleMeshNode.connections != null)
         {
             for (int k = 0; k < triangleMeshNode.connections.Length; k++)
             {
                 triangleMeshNode.connectionCosts[k] = (uint)(triangleMeshNode.position - triangleMeshNode.connections[k].position).costMagnitude;
             }
         }
     }
     base.SetMatrix(newMatrix);
     NavMeshGraph.RebuildBBTree(this);
 }
All Usage Examples Of Pathfinding.NavMeshGraph::RebuildBBTree