which function can i do to check for overlapping bounding volumes?
CollisionRules.AddRule(toAdd, toAdd2, CollisionRule.NoBroadPhase);
toAdd.CollisionInformation.OverlappedCollidables.Contains(toAdd2.CollisionInformation) -> can i use this ?
i do not want them to have physics collision response but i want to do some other stuffs (if statement) when they overlap.
etc.. door portal..
Collision Information
Re: Collision Information
You can indeed use the entity.CollisionInformation.OverlappedCollidables.Contains method to test if the collidables overlap.
Note that an 'overlapped' collidable means that the bounding boxes overlap. The pair does not necessarily have contacts.
In order to look at only collidables with which your object has contacts, go through the entity.CollisionInformation.Pairs list and look at the pair.Contacts.Count. If there's more than 1 contact, then they are colliding (with some subtleties that can usually be ignored).
If you were wondering, OverlappedCollidables is built on top of the that Pairs collection. The OverlappedCollidables enumerable goes through the list and returns the collidable in the pair that isn't the entity.CollisionInformation. In other words, it finds the 'opposing' collidable.
If you want contacts to be created but no collision response, then CollisionRule.NoSolver would be the best option.
Note that an 'overlapped' collidable means that the bounding boxes overlap. The pair does not necessarily have contacts.
In order to look at only collidables with which your object has contacts, go through the entity.CollisionInformation.Pairs list and look at the pair.Contacts.Count. If there's more than 1 contact, then they are colliding (with some subtleties that can usually be ignored).
If you were wondering, OverlappedCollidables is built on top of the that Pairs collection. The OverlappedCollidables enumerable goes through the list and returns the collidable in the pair that isn't the entity.CollisionInformation. In other words, it finds the 'opposing' collidable.
This will prevent the broad phase from creating a pair between the objects. In other words, toAdd2 will never be in the OverlappedCollidables of toAdd or vice versa.CollisionRules.AddRule(toAdd, toAdd2, CollisionRule.NoBroadPhase);
If you want contacts to be created but no collision response, then CollisionRule.NoSolver would be the best option.
Collision events might make this easier. They can be accessed in the entity.CollisionInformation.Events. More information can be found here: http://bepuphysics.codeplex.com/wikipag ... umentationi want to do some other stuffs (if statement) when they overlap.
etc.. door portal..