Color legend plain property method
A knife’s drag, recorded against one captured pose: each ray’s nearest layer, or its miss, in the order the rays came.
A sealed class. Capture a surface at the press, Add the cursor’s ray every frame the button is held, drawing the preview from the hit it returns, and hand the stroke to Fabric.Cut on release. The cut is made from the samples themselves, never picked again, so it lands exactly where the preview showed it however far the cloth has blown since the press. Misses are kept in their place, so the cut can tell where the knife left the cloth and where it came back. Not thread-safe: one gesture, one thread, though the surface under it may be shared. The picking page shows it in context, with code.
Names are colored by what they are: a property or a method; values and fields keep the plain color.
Properties
Count →
int · Read-only. The samples recorded so far, misses included.
Surface →
FabricSurface · Read-only. The pose every ray of the stroke is picked against, given to the constructor. Cut throws when it comes from another sheet, or from this one before its last Rebuild.
Methods
FabricStroke() →
FabricStroke(FabricSurface surface) · An empty stroke over a pose. Throws ArgumentNullException for a null surface.
| Parameter | Type | Description |
|---|---|---|
surface |
FabricSurface |
From Fabric.CaptureSurface, captured at the press. |
Add() →
Add(Ray ray, out FabricSurfaceHit hit) · Returns bool: whether the ray hit the cloth. Picks the ray’s nearest layer, a blade’s, with TryRaycast, and records it, or the miss, as the stroke’s next sample. Each ray is picked once, here, for both the preview and the cut.
| Parameter | Type | Description |
|---|---|---|
ray |
Ray |
The cursor’s ray in world space, unprojected through your own camera; any direction length. |
hit |
out FabricSurfaceHit |
The hit to draw the preview from; default on a miss. |
Clear() →
Clear() · Forgets every sample and keeps the surface: a cancelled drag, started again over the same capture.