contact callback, contact test - performance

marios
Posts: 52
Joined: Mon Jul 19, 2010 3:11 am

contact callback, contact test - performance

Post by marios »

It is better to register contact callback, for body or call contact test every physics tick to improve performance.
How much worse is calling contact test every tick, or better, or performance is the same both methods?
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: contact callback, contact test - performance

Post by Erwin Coumans »

Performance should be similar, they both execute the same code.

The main difference is that the regular code (stepSimulation + contact callback) uses the broadphase culling.
If you only call contact test for few pairs, it shouldn't matter.

Thanks,
Erwin