voxolith
API reference@voxolith/gen-creatureFunctions

minVoxelsPerMetre()

The smallest world scale, in voxels per metre, at which atScale builds this creature at its real size (see realSizeAt): about 84 for the default rat (size 1.2), 88 for the fat rat (1.15). Scales from here up to about 250 vox/m are real size. The size snaps to a 0.05 grid, so this is where the...

function minVoxelsPerMetre(params: CreatureParams): number;

Defined in: presets.ts:137

The smallest world scale, in voxels per metre, at which atScale builds this creature at its real size (see realSizeAt): about 84 for the default rat (size 1.2), 88 for the fat rat (1.15). Scales from here up to about 250 vox/m are real size. The size snaps to a 0.05 grid, so this is where the snapped size first reaches 0.7, a little under the unsnapped 87.5 for the default rat.

Parameters

ParameterTypeDescription
paramsCreatureParamsAny creature params; not mutated.

Returns

number

A scale v with realSizeAt(params, v) true and false for anything below it.

Example

const vpm = 100;
const rats = vpm >= minVoxelsPerMetre(PRESETS.rat); // true: 100 >= 84.375

On this page