Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I make my physics object settle down?
    primarykey
    data
    text
    <p>I'm using BulletSharp, a C# distribution of the bullet library. I have been getting some bouncing in an object that supposedly has Restitution of 0.0f.</p> <p>I have one dynamic cylinder (what will be a mesh soon) falling to rest on two static cylinders. Like so: </p> <p><img src="https://i.stack.imgur.com/0YCH3.png" alt="starting object positions"></p> <p>The cylinder on top often bounces around wildly, usually bouncing off to the side.</p> <p>Here's the code I'm using to set up the scene:</p> <pre><code> //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); logBody.SetDamping(0.04f, 0.1f); world.AddRigidBody(logBody); //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); world.AddRigidBody(r1); 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); world.AddRigidBody(r2); </code></pre> <p>And every frame I use <code>world.StepSimulation(0.05f, 100, 0.0005f);</code> to update the physics simulation.</p> <p>Am I missing any obvious settings? Why is my simulation doing this?</p> <p>Small update: I have successfully made a similar simulation in Blender's Bullet stuff. There was no bouncing there... I don't know what difference there might be between that and this.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload