Original Post
For the AI in my (2-d) game, I'm using a navigation mesh built from a constrained Delaunay triangulation. For each triangle in the mesh, I'm computing a PVS indicating which triangles in the mesh are potentially visible from within that triangle. To determine triangle-to-triangle visibility, I'm traversing each portal sequence in the mesh while maintaining a pair of convex hulls built from all portal endpoints encountered on the left and right, respectively. Since a given portal sequence will only admit a sightline if the left and right sets of portal endpoints are linearly separable, the search can be terminated as soon as the hulls intersect (please correct me if I've got any of this wrong!). Now, I'm wanting to add an additional bit of information for each entry in the PVS: whether the triangle in question will always be fully visible from the source triangle, regardless of the position of the observer. I haven't found any references that discuss this, but here's what I've come up with so far. Given two triangles that do not share any vertices, build lines passing through the left and right endpoints, respectively, of the first and last portals in the portal sequence connecting the triangles. If the two triangles fall between the two lines and the left and right convex hulls are entirely behind the respective lines, the triangles will always be fully visible with respect to one another. Here's a diagram that illustrates this:
When the triangles share one or more vertices, the line(s) must instead be built from the shared vertex and the opposite vertex of the source triangle:
This seems to work, but I don't have any formal proof of its correctness. Can anyone offer any comments on this? Is this a correct way of determining 'full visibility' between two triangles in a constrained Delaunay triangulation?
When the triangles share one or more vertices, the line(s) must instead be built from the shared vertex and the opposite vertex of the source triangle:
This seems to work, but I don't have any formal proof of its correctness. Can anyone offer any comments on this? Is this a correct way of determining 'full visibility' between two triangles in a constrained Delaunay triangulation?
