Page 1 of 1
How to detect a collision and its position
Posted: Tue Nov 30, 2010 11:33 pm
by micro4004
Hi
I am new in Bepu and I would like to use it. maybe these are silly questions but I didn“t find a simple way to detect a collision, more specific, to detect if an entity is colliding with anything and trigger an event and also know its position.
Sorry for the mistakes, I am from Mexico
Re: How to detect a collision and its position
Posted: Tue Nov 30, 2010 11:49 pm
by Norbo
The Entity class has an event manager property which contains a variety of collision events. They can tell you when a collision starts, stops, updates, etc. in addition to individual contact point data.
The Entity's CollisionPairs list also contains the things that the Entity is colliding with. Within each collision pair, you can find a contact list too.
Re: How to detect a collision and its position
Posted: Wed Dec 01, 2010 3:02 am
by micro4004
Hi
Thanks for the quick answer an very helpful, I was using the 0.13 version. In the 0.14.3 version appears all the method to detect collision.
Could you please give some code to use a collision event
Re: How to detect a collision and its position
Posted: Wed Dec 01, 2010 3:49 am
by Norbo
Here's some documentation from the website docs section:
http://www.bepu-games.com/BEPUphysics/d ... tation.pdf
This one does all the usual beginning stuff, including events:
http://www.bepu-games.com/BEPUphysics/d ... tation.pdf
And has a demo to go with it:
http://www.bepu-games.com/BEPUphysics/d ... edDemo.zip
v0.13.0 had events too, though they were slightly differently organized.
Re: How to detect a collision and its position
Posted: Wed Dec 01, 2010 4:15 am
by micro4004
Hi
thank you, I will check the information