Docs / Fabric simulation

Glossary: FabricSurfaceHit

The members of FabricSurfaceHit, in alphabetical order.

Color legend plain property

Where a ray meets the sheet: the point in the flat-sheet coordinates Fabric.Cut takes, where that point is in the world, and how far along the ray.

A read-only record struct, compared by value, with a constructor that takes the three properties in order. Filled by FabricSurface.Raycast, TryRaycast and FabricStroke.Add. The picking page shows it in context, with code.

Names are colored by what they are: a property; values and fields keep the plain color.

Properties

Cloth →

Vector2 · Read-only. The point on the flat, unfolded sheet, in meters: (0, 0) is the point at ParticleIndex(0, 0), X runs along Width and Y along Height. Blended from the hit triangle’s corners by where the ray crossed it, so it lies where the cloth was, however crumpled. What Cut(ReadOnlySpan<Vector2>) takes, and what to collect for a cut of your own.

Distance →

float · Read-only. How far along the ray, in meters from its origin, whatever the length of the ray’s direction: the surface measures along the direction made unit length, so a ray straight from Viewport.Unproject measures in meters too. 0 or more. Layers are told apart by it, nearest first.

World →

Vector3 · Read-only. The point in world space, on the ray, where the cloth stood in the captured pose: what a preview of the cut draws through.