Skip to main content

Class: Damper

Extra-Helpers.Damper

The Damper class is a generic second-order critically damped system that does one linear step of the desired length of time. The only parameter is DECAY_MILLISECONDS. This common parameter makes all states converge at the same rate regardless of scale. xNormalization is a number to provide the rough scale of x, such that NIL_SPEED clamping also happens at roughly the same convergence for all states.

Constructors

constructor

new Damper(decayMilliseconds?)

Parameters

NameTypeDefault value
decayMillisecondsnumberDECAY_MILLISECONDS

Defined in

webgi/src/helpers/damper.ts:37

Methods

setDecayTime

setDecayTime(decayMilliseconds): void

Parameters

NameType
decayMillisecondsnumber

Returns

void

Defined in

webgi/src/helpers/damper.ts:41


update

update(v, vGoal, timeStepMilliseconds, xNormalization): number

Parameters

NameType
vnumber
vGoalnumber
timeStepMillisecondsnumber
xNormalizationnumber

Returns

number

Defined in

webgi/src/helpers/damper.ts:46