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:
+5
-6
@@ -371,10 +371,9 @@ layout:
|
||||
- `align` — `start`, `end`, or `center` of the curve.
|
||||
- `steps` — the maximum number of parts per curve length unit. Defaults to
|
||||
`1`. See the positioning process below.
|
||||
- `tilt` — rotation in degrees per shown part about the card's local Y (long)
|
||||
axis. Each part tilts `tilt` more than the previous, fanning the stack so
|
||||
its edges stay visible. It applies even without a `curve`, so a bare `tilt`
|
||||
fans a straight pile.
|
||||
- `tilt` — rotation in degrees applied to every shown part about the card's
|
||||
local Y (long) axis. It applies even without a `curve`, so a bare `tilt`
|
||||
rotates a straight pile.
|
||||
- `zStart` / `zEnd` — the height (surface-normal) in mm at the start and end
|
||||
of the `curve`. The stack ramps linearly between them across its span,
|
||||
lifting it in 3D. Requires a `curve`.
|
||||
@@ -389,8 +388,8 @@ layout:
|
||||
each `step length` apart.
|
||||
4. **Lift each part.** The part's height is `zStart + (zEnd − zStart) × u`,
|
||||
where `u` is its normalized position along the `curve`.
|
||||
5. **Tilt each part.** Each part is rotated `tilt × # of parts before it`
|
||||
about its local Y (long) axis.
|
||||
5. **Tilt each part.** Every part is rotated `tilt` about its local Y (long)
|
||||
axis.
|
||||
|
||||
### Edge cases
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ interface GameState {
|
||||
length from curve length / `max(steps, count-1)`, alignment (`start`/`end`/
|
||||
`center`), and `limit` (`0` all, `n` first n, `-n` last n).
|
||||
- `z` ramps linearly from `zStart` to `zEnd` across the curve's span; `tilt`
|
||||
fans each shown part about its local Y (long) axis.
|
||||
rotates each shown part about its local Y (long) axis.
|
||||
- Curve length from an SVG path string (small helper; no new dep).
|
||||
|
||||
### 8. Public API (`index.ts`) ✅
|
||||
|
||||
@@ -40,7 +40,7 @@ the render map is per enabled surface: a piece may appear on more than one enabl
|
||||
|
||||
## 4. stacking
|
||||
|
||||
the format's stacking strategy (`curve` / `limit` / `align` / `steps` / `tilt` / `zStart` / `zEnd`, see `bgm-format.md` §4) is implemented as a hook, e.g. `useStacking(route.stacking, index, stackSize)`, returning the offset/rotation to apply to a piece: `{ x, y, rotation, z, tilt }`. `x`/`y`/`rotation` come from the `curve`; `z` is the surface-normal height ramped from `zStart` to `zEnd`; `tilt` is the per-part fan about the card's local Y (long) axis. `PartPlacement` consumes it.
|
||||
the format's stacking strategy (`curve` / `limit` / `align` / `steps` / `tilt` / `zStart` / `zEnd`, see `bgm-format.md` §4) is implemented as a hook, e.g. `useStacking(route.stacking, index, stackSize)`, returning the offset/rotation to apply to a piece: `{ x, y, rotation, z, tilt }`. `x`/`y`/`rotation` come from the `curve`; `z` is the surface-normal height ramped from `zStart` to `zEnd`; `tilt` is the rotation about the card's local Y (long) axis, applied to every part. `PartPlacement` consumes it.
|
||||
|
||||
## 5. usage
|
||||
|
||||
|
||||
Reference in New Issue
Block a user