Skip to content

@modoki/engine / index / applyDeadzone

Function: applyDeadzone() ​

applyDeadzone(v, dz?): number

Radial-ish deadzone for a single analog axis: values under dz collapse to 0, the remainder is rescaled to keep full 0…1 range past the threshold. Keyboard produces exact ∓1 so this is a no-op there; it matters for sticks (Phase 2).

Parameters ​

v ​

number

dz? ​

number = 0.2

Returns ​

number

Built with Modoki.