voxolith
API reference@voxolith/gen-creatureFunctions

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

ParameterTypeDescription
paramsCreatureParamsAny creature params; not mutated.
voxelsPerMetrenumberThe world's scale.

Returns

CreatureParams

A copy with only shape.size changed.

Example

const rat = atScale(PRESETS.rat, 100); // size 0.8
const { entity } = generateCreature(rat, seededRandom(1));

On this page