I am new to game programming as well as Chipmunk. I have a simple question:
What do m_inv ( inverse of mass) and i_inv (inverse of moment of inertia) mean?
Inverse in Chipmunk
- slembcke
- Site Admin
- Posts: 4166
- Joined: Tue Aug 14, 2007 7:13 pm
- Contact:
Re: Inverse in Chipmunk
On most older CPUs, floating point division is very expensive compared to multiplication. So for a something like mass where you almost always use it as var/mass, it's better to precalculate m_inv = 1/mass so you can do var*m_inv instead.
It's quite possible that in the last 8 (!) years that it's no longer a relevant optimization though. Haven't bothered to check in a long time.
It's quite possible that in the last 8 (!) years that it's no longer a relevant optimization though. Haven't bothered to check in a long time.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Who is online
Users browsing this forum: No registered users and 24 guests