示例#1
0
        // Set motion values to zero.
        // Do it to the properties so the values get set in the physics engine.
        // Push the setting of the values to the viewer.
        // Called at taint time!
        public override void ZeroMotion()
        {
            _velocity           = OMV.Vector3.Zero;
            _acceleration       = OMV.Vector3.Zero;
            _rotationalVelocity = OMV.Vector3.Zero;

            // Zero some other properties directly into the physics engine
            BulletSimAPI.SetLinearVelocity2(BSBody.ptr, OMV.Vector3.Zero);
            BulletSimAPI.SetAngularVelocity2(BSBody.ptr, OMV.Vector3.Zero);
            BulletSimAPI.SetInterpolationVelocity2(BSBody.ptr, OMV.Vector3.Zero, OMV.Vector3.Zero);
            BulletSimAPI.ClearForces2(BSBody.ptr);
        }