Skip to main content

OldVisibilityTest

A static class in Root.Township, the global namespace.

Older tool that finds mesh triangles that can't be seen from outside, using raycasts and test renders, so they can be removed.

Methods​

MemberWhat it is
static void CalculateOccludedTriangles(Mesh mesh, int renderResolution, List<RemovingTriangle> trianglesToRemove, Func<Vector3, bool> validateVertex = null, IEnumerable<Vector3> additionalCheckPoints = null, Func<Vector3, Vector3, Vector3, bool> triangleValidation = null)Fills a list with triangles that are hidden from every test direction and extra check point.
3 private and internal methods
MemberWhat it is
private static bool CheckVisibility(int renderResolution, float distance, RenderTexture renderTexture, Material downscaleMaterial, List<RenderTexture> downscalingRTs, Texture2D extraction, Vector3 center, Vector3 normalDirection, Camera camera)Renders one triangle from a point and returns whether any of it shows.
private static bool CheckVisibility(int renderResolution, Vector3 position, RenderTexture renderTexture, Material downscaleMaterial, List<RenderTexture> downscalingRTs, Texture2D extraction, Vector3 normalDirection, Camera camera)Renders one triangle from a point and returns whether any of it shows.
private static IEnumerable<Quaternion> Rotations() (iterator)The test view directions: six axes plus eight diagonals.