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); } } }
/// <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); }
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); }