feat(tabletop): let candidates inherit and override route stacking
Candidates now carry their own stacking strategy, inheriting the route's when absent, so the default tilt applies consistently. Drop the now redundant explicit tilt from the poker deck.
This commit is contained in:
@@ -17,7 +17,9 @@ export function PartPlacement({ pkg, placement }: { pkg: Package; placement: Pla
|
||||
const part = pkg.parts.get(piece.split(':').slice(1).join(':'));
|
||||
if (!part) return null;
|
||||
|
||||
const { x, y, rotation, z, tilt } = useStacking(route.stacking, index, stackSize);
|
||||
// A candidate inherits the route's stacking unless it overrides it.
|
||||
const stacking = candidate?.stacking ?? route.stacking;
|
||||
const { x, y, rotation, z, tilt } = useStacking(stacking, index, stackSize);
|
||||
|
||||
// Route anchors and stacking offsets are in mm; convert to world units so
|
||||
// parts land on the (world-scaled) surface. `z` raises the part along the
|
||||
|
||||
Reference in New Issue
Block a user