Re: [Algorithms] Formula for Damping f times
Brought to you by:
vexxed72
|
From: Fabian G. <f.g...@49...> - 2009-06-05 10:21:37
|
> Hi,
> This is a semi-trivial but I can't quite remember the answer, even
> though I've done it before.
>
> I have an update function sort of like this..
>
> void updateX( float deltaTime)
> {
> x = x*k;
> }
>
> k is a constant less than 1.0.
>
> Now to do the damping properly I need to perform "x=x*k" deltaTime
> times, where deltaTime is a fraction.
>
> Can anyone help with this please? I recall it just being a log or
> something.
x *= pow(k,deltaTime);
Kind regards,
-Fabian Giesen
|