Re: Formula for Damping f times

Alen Ladavac <[email protected]>
Newsgroups gmane.games.devel.algorithms
Organization Croteam
Message-ID <[email protected]>
Paul wrote at 6/5/2009:
> x *= 1.0f-(k*deltaTime);

Note this:

x1 = x0*(1-k*d)
x2 = x1*(1-k*d)
   = x0*(1-k*d)*(1-k*d)
   = x0*(1 - k*2*d + k^2*d^2)

If you skip and do two steps at a time:

x2 = x0*(1-k*2*d)

So, this formula does not behave well with step variance. OP didn't
state he requires this explicitly, but it is important to note as it
can cause weird results later if you don't pay attention to that.
I'd prefer using pow(), as Fabian described, unless performance is
extremely critical there.

JM2C,
Alen


------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
GDAlgorithms-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.