Jump to content

Performance Question: onBeginContact VS impactEvents


valueerror
 Share

Recommended Posts

My game is already quite complex and it's getting even worse ;-)

 

because i have several objects that for example should collide with some other objects but not collide with a specific group of objects 

or because i'm using a postBroadphase callback and other things i think i need to work with collisionGroups, and   therfore  i need to set 

game.physics.p2.setImpactEvents(true);

but rich said that those impactEvents are set to false because they are very expensive - so my question is the following:

 

i have at least 8 kinds of  GroupCallbacks with different collsionGroups that could be replaced with onBeginContact signals.  

 

while using object.body.collides([thisgoup,thatgroup]) for the overall collision handling would it make sense to use onBeginContact instead of groupCallback  to  get a better performance ?

Link to comment
Share on other sites

 I think that @ Rich says that is because if there are a thousand impacts of any kind, everything is sent to the time and of course that's very expensive in the equation, so it is best to control what you want it to collide with collision mask or onBeginContact.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...