Did a quick look through the first few pages of the forum and couldn't find anything on handling contacts in 2.1a so I thought I'd start a thread on it. Specifically I'm interested in how people are handling contacts.
For instance, right now I have a player object that gets it's update() method called each tick of the game engine. This player object has a reference to a b2Body that represents the player in the game's world. Each time update() is called on this object I loop over the body's contact list to handle any contacts that may exist. This works well enough I suppose but I'm thinking it might be a rather slow method.
Is there a better way to handle this? I feel like I should be using b2ContactListener, but I'm not really sure the best way to go about doing this. How are you guys handling this situation?
For instance, right now I have a player object that gets it's update() method called each tick of the game engine. This player object has a reference to a b2Body that represents the player in the game's world. Each time update() is called on this object I loop over the body's contact list to handle any contacts that may exist. This works well enough I suppose but I'm thinking it might be a rather slow method.
Is there a better way to handle this? I feel like I should be using b2ContactListener, but I'm not really sure the best way to go about doing this. How are you guys handling this situation?