Jump to content

  • Log In with Google      Sign In   
  • Create Account


Contact caching


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 rayp   Members   -  Reputation: 131

Like
0Likes
Like

Posted 21 December 2012 - 10:41 AM

a



Sponsor:

#2 EWClay   Members   -  Reputation: 659

Like
0Likes
Like

Posted 24 December 2012 - 04:31 AM

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/




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS