小编tug*_*ugs的帖子

如何让我的物理对象安定下来?

我正在使用BulletSharp,它是子弹库的C#发行版.我已经在一个据称有0.0f的恢复原状的物体中得到了一些弹跳.

我有一个动态气缸(不久将是一个网状物)落在两个静态气缸上.像这样:

起始物体位置

顶部的气缸通常会疯狂地弹跳,通常会弹到一边.

这是我用来设置场景的代码:

        //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 …
Run Code Online (Sandbox Code Playgroud)

c# bullet rigid-bodies bulletphysics

9
推荐指数
1
解决办法
1329
查看次数

标签 统计

bullet ×1

bulletphysics ×1

c# ×1

rigid-bodies ×1