Pathfinding.NavMeshGraph.RelocateNodes C# (CSharp) Method

RelocateNodes() public method

public RelocateNodes ( Matrix4x4 oldMatrix, Matrix4x4 newMatrix ) : void
oldMatrix UnityEngine.Matrix4x4
newMatrix UnityEngine.Matrix4x4
return void
		public override void RelocateNodes (Matrix4x4 oldMatrix, Matrix4x4 newMatrix) {
			//base.RelocateNodes (oldMatrix,newMatrix);
			
			if (vertices == null || vertices.Length == 0 || originalVertices == null || originalVertices.Length != vertices.Length) {
				return;
			}
			
			for (int i=0;i<_vertices.Length;i++) {
				//Vector3 tmp = inv.MultiplyPoint3x4 (vertices[i]);
				//vertices[i] = (Int3)newMatrix.MultiplyPoint3x4 (tmp);
				_vertices[i] = (Int3)newMatrix.MultiplyPoint3x4 ((Vector3)originalVertices[i]);
			}
			
			for (int i=0;i<nodes.Length;i++) {
				TriangleMeshNode node = (TriangleMeshNode)nodes[i];
				node.UpdatePositionFromVertices();
				
				if (node.connections != null) {
					for (int q=0;q<node.connections.Length;q++) {
						node.connectionCosts[q] = (uint)(node.position-node.connections[q].position).costMagnitude;
					}
				}
			}
			
			SetMatrix (newMatrix);
			
			// Make a new BBTree
			bbTree = new BBTree(this);
			for (int i=0;i<nodes.Length;i++) {
				bbTree.Insert (nodes[i]);
			}
		}