Re: [Algorithms] Formula for Damping f times
Brought to you by:
vexxed72
From: Robin G. <rob...@gm...> - 2009-06-05 19:22:31
|
exp() is one of the simplest and most direct math function to implement. It should be approximately the cost of, say, five or sequential six multiply-adds (and that includes range reduction and reconstruction). Do not fear exp(). pow(), however, is a different story. - Robin Green. On Fri, Jun 5, 2009 at 8:06 AM, Jeff Russell<je...@8m...> wrote: > x *= e ^ k * dt (where k < 0) is my good old standby. Works well with > variable time steps. The call to exp() can be expensive, but if you have a > lot of things decaying at the same rate you can compute exp( k * dt ) once > for the frame and keep reusing it. > cheers, > jeff |