NoBroadphase collision event

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
ruggy
Posts: 22
Joined: Sun Jun 03, 2012 3:17 pm

NoBroadphase collision event

Post by ruggy »

Hi,
I have some 'kinematic' hit zones that I raycast bullets against and the hit zones have no broadphase so they don't interfere with anything else. Works fine for raycasts but now I want an entity-based projectile to collide with them but obviously since they have no broadphase it goes right through them. Is there a way to get a collision event but still leave the hit zones as 'dummy physics' objects? (I update their position to match the characters bones manually elsewhere). I tried ContactCreated. I could do a simple sphere check myself to see if they collide but just thought I'd check first since I already use the event for when the projectiles hit static meshes.

EDIT: Actually "InitialCollisionDetectedEventHandler" seems to be working, but I don't get Contact data with that and thus no normal, which I was using but could workaround.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: NoBroadphase collision event

Post by Norbo »

NoBroadPhase means that no pair is created. No event will ever fire while objects have a NoBroadPhase rule between them, because the thing that would fire the event doesn't exist.

The solution is to change the collision rule between projectiles and the dummy objects to something besides NoBroadPhase. For example, NoSolver would let contacts be generated and thus contact events would fire. Since you presumably want to maintain the NoBroadPhase behavior for other interactions, a good approach would be CollisionGroups. Check out the CollisionFilteringDemo in the BEPUphysicsDemos and the collision rules documentation for more information.
Post Reply