Skip to content

smoothBody

smoothBody(prev, next, amount?): Body

Smooths a body against the previous frame, so the avatar does not jitter or blink: positions ease towards the new points (amount 0–1: how much of the new frame to take), and a point seen in the last frame stays visible until its visibility drops well below the threshold. Keep the result per player and pass it back as prev.

The easing follows the speed: a point that barely moves (a still arm, where the camera’s points only tremble) takes a small share of amount, down to STILL_SHARE, so a resting arm stays still instead of wobbling; a point that moves STILL_FULL or more in a frame takes all of amount, so real movements are not delayed.

The face (nose, eyes, ears, mouth: what places and tilts the head) is smoothed much more, and relative to the shoulders: the head follows the body at once when the child moves, but face-point noise and small nods barely move it.

Body | null | undefined

Body

number

Body