While working on app for mobile devices I encountered what seems to be a bug. A collision problem occurs when continuous collision detection is set and compound child is set to NoSolver.
I was trying to use each children of a compound object to act as triggers by setting them to NoSolver when coins are picked up on the map. But when every time a player moves through the coins to pick them up, the player would get stuck for few frames then continue to move.
At first I thought it was a bug introduced when I converted BEPU to use FixedMath to be cross-platform deterministic, but after spending few painful hours of wondering why it's doing that, it turns out that it's because continuous collision detection.
Here is the code to reproduce it:
Code: Select all
MotionSettings.DefaultPositionUpdateMode = BEPUphysics.PositionUpdating.PositionUpdateMode.Continuous;
List<CompoundChildData> tmpList = new List<CompoundChildData>();
CompoundChildData boxChild = new CompoundChildData();
boxChild.Entry = new CompoundShapeEntry(new BoxShape(10, 1, 10), new Vector3(0, 0, 0));
boxChild.CollisionRules = new CollisionRules { Personal = CollisionRule.Normal };
tmpList.Add(boxChild);
for(int i = 0; i < 4; i ++)
{
CompoundChildData cylinderChild = new CompoundChildData();
cylinderChild.Entry = new CompoundShapeEntry(new CylinderShape(0.5f, 1), new Vector3(0, 2 + (2 * i), 0), 0);
cylinderChild.CollisionRules = new CollisionRules { Personal = CollisionRule.NoSolver };
tmpList.Add(cylinderChild);
}
compChildern = new CompoundBody(tmpList);
Space.Add(compChildern);
fallingBall = new Sphere(new Vector3(0, 14, 0), 1, 1);
Space.Add(fallingBall);
fallingBall2 = new Sphere(new Vector3(-3, 14, 0), 1, 1);
Space.Add(fallingBall2);
Hope this helps you, took me a while to find the bug.
Once again, thanks for the great engine.