class MAGES::MeshDeformations::Editor::AlbedoBaker::OriginalMeshAccelerator¶
Overview¶
Uniform grid over the original mesh’s (sim-space) triangles backing both the ±normal raycast and the closest-point fallback. Mirrors the traversal ideas in AutoUV’s internal grid. More…
class OriginalMeshAccelerator
{
public:
// properties
int TriangleCount;
// methods
OriginalMeshAccelerator(Mesh mesh, Matrix4x4 sourceToSim);
float2 InterpolateUv(in TriangleHit hit);
bool RaycastBidirectional(
float3 origin,
float3 normal,
float maxDist,
Scratch scratch,
out TriangleHit hit
);
bool ClosestPoint(float3 query, out TriangleHit hit);
};
Detailed Documentation¶
Uniform grid over the original mesh’s (sim-space) triangles backing both the ±normal raycast and the closest-point fallback. Mirrors the traversal ideas in AutoUV’s internal grid.
Methods¶
float2 InterpolateUv(in TriangleHit hit)
Interpolates the original mesh’s UV0 at a hit using its barycentric weights.
bool RaycastBidirectional(
float3 origin,
float3 normal,
float maxDist,
Scratch scratch,
out TriangleHit hit
)
Casts along +normal and -normal from origin up to maxDist and returns the nearest hit (by absolute distance) across both directions.
bool ClosestPoint(float3 query, out TriangleHit hit)
Finds the closest point on any original triangle to query via an expanding cell-shell search over the grid, returning its triangle + barycentric weights.