How to detect a body collision with all the others?

anileci

21-03-2007 05:48:35

I have searched all the topics about collision detect in the forum.
I found the customContactReporter class can report the collision with two bodies.
Because the scene have the method mScene->createContactPair(myCube1,myCube2);
But in my case, I want to detect myCube1 with all the other shape(many of them are static).
Do I have to call n times createContactPair(myCube1,myCuben) ?
Is there have some earier code to implement this?

thanks.

betajaen

21-03-2007 11:30:56

Sadly "n-times" is the only way.

Unless you want to go through the state system, which it'll do much of the work for you, there was some code added to the 0.6 SVN a week or two back which will do the "n-times" method to all bodies sharing states.

anileci

22-03-2007 05:15:43

betajaen:
Thanks for your reply.

I'm a newbie to nxOgre. I just want to make sure I have done the right things. createContactPair is enough for me.

Thanks for your contribuation of the nxOgre lib. It's really a useful lib for helping me to use PhysiX easily!