Jump to content
  • Advertisement
Sign in to follow this  
rayp

Contact caching

This topic is 2009 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
How are you searching the contact list? Box2D has a list of contacts per colliding body, so it usually only has to search through a few contacts to find a match. This could be a problem for a body with a large number of contacts, but if you are only using circles and they are all about the same size that won't be the case.

If you do use a hash table (and this is probably the easier method), watch out for memory allocations. In C++, std::unordered_map will allocate per entry, and this is slow.

There's more to making collisions go fast. I've written about it here:

http://dtosoftware.wordpress.com/

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!