CompoundCollidable collision detection.

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
Peter Prins
Posts: 54
Joined: Fri Mar 11, 2011 11:44 pm

CompoundCollidable collision detection.

Post by Peter Prins »

Hello Norbo,

I have a question about the CompoundCollidable and collisions. I would like to be able to figure out what child of the CompoundCollidable is involved in each of its Contacts. I was hoping the individual EntityCollidables of its children would have the information in their Pairs, however the lists of pairs of these Collidables are always empty:

Code: Select all

CompoundCollidable.Children[i].CollisionInformation.Pairs;
Sincerely,
Peter
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: CompoundCollidable collision detection.

Post by Norbo »

Each ContactInformation grabbed from a pair stores a Pair field which refers to the pair which owns that contact. For compound pair contacts, the Pair stored in the ContactInformation refers to the most immediate owner of the contact. Each pair also has a Parent property which, if not null, climbs the hierarchy of pairs one level.

Grabbing the contact's directly owning Pair would provide access to the involved child through the Collidable(A|B) property.
however the lists of pairs of these Collidables are always empty:
This is a bit of an odd limitation that I'd like to deal with. In the current model, it would require the addition a lock in a performance sensitive area. I may be able to eliminate this requirement with a better design, but that's a big job and has been on my to-do list for a while.
Peter Prins
Posts: 54
Joined: Fri Mar 11, 2011 11:44 pm

Re: CompoundCollidable collision detection.

Post by Peter Prins »

Thanks a lot! :D That's a lot easier than I feared when my first aproach didn't work.
Post Reply