public void GetCubeTriangles(CubeId cubeId, List <MyNavigationTriangle> trianglesOut) { MyGridNavigationMesh mesh = null; if (mesh != null) { mesh.GetCubeTriangles(cubeId.Coords, trianglesOut); } }
public void GetCubeTriangles(CubeId cubeId, List <MyNavigationTriangle> trianglesOut) { MyGridNavigationMesh gridMesh = null; Debug.Assert(m_navigationMeshes.TryGetValue(cubeId.Grid, out gridMesh), "Navigation mesh missing for a grid"); if (gridMesh == null) { return; } gridMesh.GetCubeTriangles(cubeId.Coords, trianglesOut); }
public void RemoveGridNavmeshLinks(MyCubeGrid grid) { MyGridNavigationMesh navmesh = this.m_gridPathfinding.GetNavmesh(grid); if (navmesh != null) { m_tmpNavPrims.Clear(); MyVector3ISet.Enumerator cubes = navmesh.GetCubes(); while (cubes.MoveNext()) { int num; MyGridPathfinding.CubeId key = new MyGridPathfinding.CubeId { Grid = grid, Coords = cubes.Current }; if (this.m_gridLinkCounter.TryGetValue(key, out num)) { m_tmpNavTris.Clear(); navmesh.GetCubeTriangles(cubes.Current, m_tmpNavTris); foreach (MyNavigationTriangle triangle in m_tmpNavTris) { this.m_links.RemoveAllLinks(triangle); MyHighLevelPrimitive highLevelPrimitive = triangle.GetHighLevelPrimitive(); if (!m_tmpNavPrims.Contains(highLevelPrimitive)) { m_tmpNavPrims.Add(highLevelPrimitive); } } m_tmpNavTris.Clear(); this.m_gridLinkCounter.Remove(key); } } cubes.Dispose(); foreach (MyNavigationPrimitive primitive2 in m_tmpNavPrims) { this.m_highLevelLinks.RemoveAllLinks(primitive2); } m_tmpNavPrims.Clear(); } }