atScale()
The same creature, sized for a world of voxelsPerMetre (a rat at 100 vox/m comes out at size 0.8, about 50 voxels long). Presets keep their ratios to each other; sizes snap to the 0.05 grid of shape.size and never go below 0.7, where legs would thin to one voxel.
function atScale(params: CreatureParams, voxelsPerMetre: number): CreatureParams;Defined in: presets.ts:91
Parameters
| Parameter | Type | Description |
|---|---|---|
params | CreatureParams | Any creature params; not mutated. |
voxelsPerMetre | number | The world's scale. |
Returns
A copy with only shape.size changed.
Example
const rat = atScale(PRESETS.rat, 100); // size 0.8
const { entity } = generateCreature(rat, seededRandom(1));