protected void ragDollUpdate(float tpf) {
        TempVars vars = TempVars.get();
        Quaternion tmpRot1 = vars.quat1;
        Quaternion tmpRot2 = vars.quat2;

        for (PhysicsBoneLink link : boneLinks.values()) {

            Vector3f position = vars.vect1;

            //retrieving bone position in physics world space
            Vector3f p = link.rigidBody.getMotionState().getWorldLocation();
            //transforming this position with inverse transforms of the model
            targetModel.getWorldTransform().transformInverseVector(p, position);

            //retrieving bone rotation in physics world space
            Quaternion q = link.rigidBody.getMotionState().getWorldRotationQuat();

            //multiplying this rotation by the initialWorld rotation of the bone,
            //then transforming it with the inverse world rotation of the model
            tmpRot1.set(q).multLocal(link.initalWorldRotation);
            tmpRot2.set(targetModel.getWorldRotation()).inverseLocal().mult(tmpRot1, tmpRot1);
            tmpRot1.normalizeLocal();

            //if the bone is the root bone, we apply the physic's transform to the model, so its position and rotation are correctly updated
            if (link.bone.getParent() == null) {

                //offsetting the physics position/rotation by the root bone inverse model space position/rotation
                modelPosition.set(p).subtractLocal(link.bone.getBindPosition());
                targetModel.getParent().getWorldTransform().transformInverseVector(modelPosition, modelPosition);
                modelRotation.set(q).multLocal(tmpRot2.set(link.bone.getBindRotation()).inverseLocal());


                //applying transforms to the model
                targetModel.setLocalTranslation(modelPosition);

                targetModel.setLocalRotation(modelRotation);

                //Applying computed transforms to the bone
                link.bone.setUserTransformsInModelSpace(position, tmpRot1);

            } else {
                // Some bones in the skeleton might not be associated with a collision shape,
                // so we update them recursively.
                RagdollUtils.setTransform(link.bone, position, tmpRot1, false, boneList);
            }
        }
        vars.release();
    }
Update this control in Ragdoll mode, based on Bullet physics.

@param tpf the time interval between frames (in seconds, &ge;0)
jme3-jbullet/src/main/java/com/jme3/bullet/control/KinematicRagdollControl.java