Skip to content
party.js logoparty.js logo

ReferenceSamplersFunction

randomSpin()

Picks a random spin axis and speed.

function randomSpin(
min: number,
max: number,
axis?: Readonly<Vec3>,
): SamplerFn<Vec3>;

Creates a sampler for spinning in a random direction: a speed between min and max on a rotation axis. If no axis is provided, a random one is sampled.

minnumber

The slowest spin, in degrees per second.

maxnumber

The fastest spin, in degrees per second.

axisoptionalReadonly<Vec3>

Optionally, the axis to create the rotation on.