@relu-interactives/spatial-ecs
@relu-interactives/spatial-ecs / index / dampFactor
Function: dampFactor() ​
ts
function dampFactor(smoothTime, deltaTime): number;Defined in: camera/damping.ts:10
How much of a gap to close this frame so it shrinks at the same rate at any frame rate. smoothTime is the seconds it takes to close about 63% of a gap; 0 closes all of it.
Math.min(1, speed * deltaTime) looks equivalent and isn't: it moves further on a slow frame than two fast ones cover, so a camera built on it trails by a different amount every frame whenever the frame time varies.
Parameters ​
| Parameter | Type |
|---|---|
smoothTime | number |
deltaTime | number |
Returns ​
number

