Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Contact caching

4: Adsense

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   

131
Like
0Likes
Like

Posted 21 December 2012 - 10:41 AM

a



#2 EWClay   Members   

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.