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