public readonly record struct ClosestTriangleEverything a closest-point query found, rather than only how far away it was.
Remarks
docs/plan/41-automatic-retopology.md § D12 interpolates normals, texture coordinates, vertex colours and skin weights from the source mesh at the point a retopologised vertex lands on. A scalar distance cannot do that: the interpolation needs to know which triangle and where on it, which is Triangle and Barycentric.
⚠ Barycentric's three components always sum to one, including when the nearest point is on an edge or a vertex or the triangle has no area. Those are the cases where the interior solution divides by zero, and a transfer that read a NaN weight there would write a NaN normal into the output mesh. Each degenerate region produces its weights directly instead of dividing.
Fields and properties (4)
public int TriangleWhich triangle it is, indexed as the caller's indices were, or -1 over an empty tree.
public Vector3 PointThe point on that triangle nearest the query, or the query itself when empty.
public float DistanceSquaredHow far the query was from it, squared, or PositiveInfinity when empty.
public Vector3 BarycentricThe weights of the triangle's first, second and third vertex at .
Methods (1)
Used by (7)
- AttributeTransferVixen.Geometry.Remeshing
- DensityFieldVixen.Geometry.Remeshing
- MapBakerVixen.Geometry.Remeshing
- TransferFixturesVixen.Geometry.Remeshing.Tests
- TriangleTreeVixen.Core.Mathematics
- TriangleTreeScaleTestsVixen.Core.Mathematics.Tests
- TriangleTreeTestsVixen.Core.Mathematics.Tests