public List <Vector4D> FindPathGlobal(MyCubeGrid startGrid, MyCubeGrid endGrid, ref Vector3D start, ref Vector3D end) { Debug.Assert(startGrid == endGrid, "Pathfinding between different grids not implemented yet!"); if (startGrid != endGrid) { return(null); } Vector3D tformedStart = Vector3D.Transform(start, startGrid.PositionComp.WorldMatrixInvScaled); Vector3D tformedEnd = Vector3D.Transform(end, endGrid.PositionComp.WorldMatrixInvScaled); MyGridNavigationMesh mesh = null; if (m_navigationMeshes.TryGetValue(startGrid, out mesh)) { return(mesh.FindPath(tformedStart, tformedEnd)); } return(null); }
public List <Vector4D> FindPathGlobal(MyCubeGrid startGrid, MyCubeGrid endGrid, ref Vector3D start, ref Vector3D end) { if (!ReferenceEquals(startGrid, endGrid)) { return(null); } Vector3D vectord = Vector3D.Transform(start, startGrid.PositionComp.WorldMatrixInvScaled); Vector3D vectord2 = Vector3D.Transform(end, endGrid.PositionComp.WorldMatrixInvScaled); MyGridNavigationMesh mesh = null; return(!this.m_navigationMeshes.TryGetValue(startGrid, out mesh) ? null : mesh.FindPath((Vector3)vectord, (Vector3)vectord2)); }