Skip to content

five-on-it / packages/world/src/pieces / PiecePlacement

Interface: PiecePlacement ​

Defined in: packages/world/src/pieces.ts:226

One placed piece: where a node of the editor scene stands in the game's frame. For a block the scaling is its size (a unit box scaled by [sx, sy, sz] is a sx × sy × sz box, a unit wedge becomes width = sx, height = sy, length = sz, a unit nail strip is length = sx long, a unit road slab is width = sx across and length = sz long, along its slope when pitched); spawns and dummies must keep their size.

Properties ​

name ​

name: string

Defined in: packages/world/src/pieces.ts:230

The node's name in the editor (for error messages and a stable order).


params ​

params: Record<string, BlockParam>

Defined in: packages/world/src/pieces.ts:240

The values of the block script's parameters (steps for stairs, lanes and speed for a road, a door's lock).


pitch ​

pitch: number

Defined in: packages/world/src/pieces.ts:236

Rotation around the node's local x axis, applied before the yaw (rad).


position ​

position: [number, number, number]

Defined in: packages/world/src/pieces.ts:232

World position of the node's origin (m).


scaling ​

scaling: [number, number, number]

Defined in: packages/world/src/pieces.ts:238

World scaling of the node.


source ​

source: string

Defined in: packages/world/src/pieces.ts:228

The name of the source mesh: block:<kind> for a block, the piece's name for a kit piece.


yaw ​

yaw: number

Defined in: packages/world/src/pieces.ts:234

Rotation around +y (rad, 0 faces +z, positive turns toward +x).