in the game, has a hero and other some sprites,how to detect the hero collision with other different sprites;
using the api of onContactBegin.?
Plz see PhysicsTest->ContactTest for example.
@boyu0 onContactBegin(PhysicsContact& contact)注册后不被触发。
@yue19870813 You need to set contact mask for your bodies, It won't trigger the callback function by default.Please use english, for someone who encounter the same problem can search it, thank you.
@boyu0 thanks,I know.
@boyu0 How can I set contact mask for bodies?
@yinhuaYou can use PhysicsBody::setContactTestBitmask() to set body contact mask value. If you want receive all the contact events, you can simply set this to 0xFFFFFFFF.You can see the function description for more details.