Switching to dynamic falls through terrain 0.10.0

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
imtrobin
Posts: 101
Joined: Thu Jun 11, 2009 3:03 am

Switching to dynamic falls through terrain 0.10.0

Post by imtrobin »

I have not fully understood how to set the new collision reponse rules but here what seems like a bug.


sphere_ = new Sphere (new Vector3 (400, 800, 400), 3.5f, 2);
sphere_.becomeKinematic ();
space_.add (sphere_);

// Then later I switch to dynamic, it falls through the terrain
sphere_.becomeDynamic (1);
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Switching to dynamic falls through terrain 0.10.0

Post by Norbo »

By default, becomeDynamic/becomeKinematic do not change the collisionGroup of the entity. They have a secondary overload that lets you pass a collision group, or you can set it afterward. The reason the object falls through the terrain is because it still has the defaultKinematicCollisionGroup from when you added it to the space. The defaultKinematicCollisionGroup does not collide with itself.

The default groups can be found in space.simulationSettings.collisionDetection.
Post Reply