class MAGES::MeshDeformations::AutoUV::TriangleGrid

Overview

Uniform grid over the mesh’s non-degenerate triangles, backing the outward ray-cast hull test with Amanatides-Woo voxel traversal so no O(faces²) brute force is required. More…

class TriangleGrid
{
public:
    // methods

    TriangleGrid(
        float3[] vertices,
        int[] indices,
        int faceCount,
        bool[] faceDegenerate,
        float3 meshMin,
        float3 meshMax,
        float diagonal
    );

    bool RayBlocked(
        float3 origin,
        float3 direction,
        int selfFace,
        int[] stamp,
        int rayId,
        float hitEpsilon
    );
};

Detailed Documentation

Uniform grid over the mesh’s non-degenerate triangles, backing the outward ray-cast hull test with Amanatides-Woo voxel traversal so no O(faces²) brute force is required.

Methods

bool RayBlocked(
    float3 origin,
    float3 direction,
    int selfFace,
    int[] stamp,
    int rayId,
    float hitEpsilon
)

Cast a ray and report whether any triangle other than selfFace is hit before the ray leaves the grid bounds. A ray that leaves unobstructed (false) proves the origin face is on the hull.