How to detect a collision and its position

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
micro4004
Posts: 3
Joined: Thu Nov 04, 2010 8:23 pm

How to detect a collision and its position

Post 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
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: How to detect a collision and its position

Post 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.
micro4004
Posts: 3
Joined: Thu Nov 04, 2010 8:23 pm

Re: How to detect a collision and its position

Post 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
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: How to detect a collision and its position

Post 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.
micro4004
Posts: 3
Joined: Thu Nov 04, 2010 8:23 pm

Re: How to detect a collision and its position

Post by micro4004 »

Hi
thank you, I will check the information
Post Reply