Disabling collision between objects of a certain type

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
snoozbuster
Posts: 172
Joined: Sat Sep 24, 2011 7:31 am

Disabling collision between objects of a certain type

Post by snoozbuster »

I took a look at the Collision Filtering demo, and I saw how to make two entities not collide, and I saw how to make two groups not collide, but is there a way to just add a bunch of Entities to a group and say "nothing in this group collides with anything else in this group?" Collision rule stuff is all over the place and I really have no idea what I'm looking for.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Disabling collision between objects of a certain type

Post by Norbo »

is there a way to just add a bunch of Entities to a group and say "nothing in this group collides with anything else in this group?"
Yup. The collision rules documentation has supplementary information too.

Basically, you could assign a NoBroadPhase collision rule between a group and itself. The CollisionGroup class has a bunch of static helper methods:

Code: Select all

           CollisionGroup.DefineCollisionRule(group, group, CollisionRule.NoBroadPhase);
snoozbuster
Posts: 172
Joined: Sat Sep 24, 2011 7:31 am

Re: Disabling collision between objects of a certain type

Post by snoozbuster »

Gotcha. I remembered that the objects I'd need to put in the group are kinetic anyway, so... Does the Solver even check for collision at all between kinetics?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Disabling collision between objects of a certain type

Post by Norbo »

Does the Solver even check for collision at all between kinetics?
By default, all kinematic entities (and static collidables like the StaticMesh, InstancedMesh, and Terrain) belong to their own collision group which has a NoBroadPhase relationship with itself. So nope; no collision detection, no contacts, no solver.
snoozbuster
Posts: 172
Joined: Sat Sep 24, 2011 7:31 am

Re: Disabling collision between objects of a certain type

Post by snoozbuster »

Fantastic. But, it's nice to know anyway. =p
Post Reply