I'm having a problem when using the bulletsharp port/wrapper.
I have three cylinders, I want the top one(dynamic) to rest on the other two(static). My setup looks like this:
For some reason, after jittering a bit, the top cylinder bounces off of the other two and falls out of view.
Here's my code to set up the scene.
//now figure out bulletsharp stuff...
CollisionConfiguration collConfig = new DefaultCollisionConfiguration();
Dispatcher collDispatch = new CollisionDispatcher(collConfig);
BroadphaseInterface broadphase = new DbvtBroadphase();
ConstraintSolver sol = new SequentialImpulseConstraintSolver();
world = new DiscreteDynamicsWorld(collDispatch, broadphase, sol, collConfig);
world.Gravity = new Vector3(0.0f, -10.0f, 0.0f);
//log (moving object)
MotionState still = new DefaultMotionState();
CylinderShape shape = new CylinderShapeZ(0.5f, 1.0f, 1.0f);
still.WorldTransform = Matrix.Translation(0.0f, 0.4f, 0.0f);
RigidBodyConstructionInfo constructInfo = new RigidBodyConstructionInfo(1.0f, still, shape);
logBody = new RigidBody(constructInfo);
//rollers (static objects)
CylinderShape r1s = new CylinderShapeZ(0.1f, 1.0f, 1.0f);
MotionState r1m = new DefaultMotionState();
r1m.WorldTransform = Matrix.Translation(-0.2f, -0.4f, 0.0f);
RigidBodyConstructionInfo r1ci = new RigidBodyConstructionInfo(0.0f, r1m, r1s);
r1 = new RigidBody(r1ci);
CylinderShape r2s = new CylinderShapeZ(0.1f, 1.0f, 1.0f);
MotionState r2m = new DefaultMotionState();
r2m.WorldTransform = Matrix.Translation(0.2f, -0.4f, 0.0f);
RigidBodyConstructionInfo r2ci = new RigidBodyConstructionInfo(0.0f, r2m, r2s);
r2 = new RigidBody(r2ci);
And every frame is updated using:
world.StepSimulation(0.05f, 100, 0.0005f);
While debugging, the Restitution for all three objects is listed as 0.0f.
Is there anything I might be missing?
I can also mention that I have put together a similar setup in Blender using the Bullet physics there, and there is no jitter.