public void GetEdgeVertices(int index, out Vector3 pred, out Vector3 succ) { MyWingedEdgeMesh mesh = this.m_navMesh.Mesh; MyWingedEdgeMesh.Edge edge = mesh.GetEdge(this.GetEdgeIndex(index)); pred = mesh.GetVertexPosition(edge.GetFacePredVertex(this.m_triIndex)); succ = mesh.GetVertexPosition(edge.GetFaceSuccVertex(this.m_triIndex)); }
public void GetEdgeVertices(int index, out Vector3 pred, out Vector3 succ) { MyWingedEdgeMesh mesh = m_navMesh.Mesh; int i = GetEdgeIndex(index); MyWingedEdgeMesh.Edge edge = mesh.GetEdge(i); pred = mesh.GetVertex(edge.GetFacePredVertex(m_triIndex)); succ = mesh.GetVertex(edge.GetFaceSuccVertex(m_triIndex)); }
private void CheckOuterEdgeConsistency() { if (DO_CONSISTENCY_CHECKS) { foreach (MyTuple <MyVoxelConnectionHelper.OuterEdgePoint, Vector3> local1 in new List <MyTuple <MyVoxelConnectionHelper.OuterEdgePoint, Vector3> >()) { int edgeIndex = local1.Item1.EdgeIndex; MyWingedEdgeMesh.Edge edge = base.Mesh.GetEdge(edgeIndex); if (local1.Item1.FirstPoint) { edge.GetFaceSuccVertex(-1); continue; } edge.GetFacePredVertex(-1); } } }
private int GetTriangleOneNewEdge(ref int newEdge, ref int succ, ref int pred, MyNavigationTriangle newTri) { MyWingedEdgeMesh.Edge edge = this.m_mesh.GetEdge(pred); MyWingedEdgeMesh.Edge other = this.m_mesh.GetEdge(succ); int vertex = edge.TryGetSharedVertex(ref other); if (vertex != -1) { int num3 = edge.OtherVertex(vertex); return(this.m_mesh.MakeEdgeFace(num3, other.OtherVertex(vertex), pred, succ, newTri, out newEdge)); } int num2 = succ; Vector3 vertexPosition = this.m_mesh.GetVertexPosition(other.GetFacePredVertex(-1)); this.m_mesh.MergeEdges(num2, succ); return(this.m_mesh.ExtrudeTriangleFromEdge(ref vertexPosition, pred, newTri, out newEdge, out succ)); }
public bool IsEdgeVertexDangerous(int index, bool predVertex) { MyWingedEdgeMesh mesh = this.m_navMesh.Mesh; int edgeIndex = this.GetEdgeIndex(index); MyWingedEdgeMesh.Edge edge = mesh.GetEdge(edgeIndex); int vertexIndex = predVertex ? edge.GetFacePredVertex(this.m_triIndex) : edge.GetFaceSuccVertex(this.m_triIndex); while (!IsTriangleDangerous(edge.VertexLeftFace(vertexIndex))) { int nextVertexEdge = edge.GetNextVertexEdge(vertexIndex); edge = mesh.GetEdge(nextVertexEdge); if (nextVertexEdge == edgeIndex) { return(false); } } return(true); }
/// <summary> /// Whether it's dangerous for the bot to navigate close to this edge /// </summary> public bool IsEdgeVertexDangerous(int index, bool predVertex) { MyWingedEdgeMesh mesh = m_navMesh.Mesh; int i = GetEdgeIndex(index); int e = i; MyWingedEdgeMesh.Edge edge = mesh.GetEdge(e); int v = predVertex ? edge.GetFacePredVertex(m_triIndex) : edge.GetFaceSuccVertex(m_triIndex); do { if (IsTriangleDangerous(edge.VertexLeftFace(v))) { return(true); } e = edge.GetNextVertexEdge(v); edge = mesh.GetEdge(e); } while (e != i); return(false); }