fix(tabletop): tilt cards uniformly about the y axis
Apply the same tilt to every stacked part and rotate it about its local Y axis instead of Z. Default tilt to 1 degree when a stacking strategy is present, and arc the poker deck along the surface's bottom edge.
This commit is contained in:
@@ -43,9 +43,10 @@ export function stackingOffset(
|
||||
const shownIndex = shown.indexOf(index);
|
||||
if (shownIndex < 0) return NO_OFFSET;
|
||||
|
||||
// `tilt` fans each shown part about its local Y (long) axis, so the stack's
|
||||
// edges stay visible. It applies even without a curve.
|
||||
const tilt = (stacking?.tilt ?? 0) * shownIndex;
|
||||
// `tilt` rotates each shown part about its local Y (long) axis by the same
|
||||
// amount. It applies even without a curve. Defaults to 1° when a stacking
|
||||
// strategy is present but doesn't specify a tilt.
|
||||
const tilt = stacking?.tilt ?? (stacking ? 1 : 0);
|
||||
|
||||
// The horizontal position along the curve (or a straight pile when there's
|
||||
// no curve), plus the normalized progress used to ramp the z height.
|
||||
|
||||
Reference in New Issue
Block a user