private void addRigidBody(PhysicsRigidBody node) {
        if(physicsBodies.containsKey(node.getObjectId())){
            logger.log(Level.WARNING, "RigidBody {0} already exists in PhysicsSpace, cannot add.", node);
            return;
        }
        physicsBodies.put(node.getObjectId(), node);

        //Workaround
        //It seems that adding a Kinematic RigidBody to the dynamicWorld prevent it from being non-kinematic again afterward.
        //so we add it non-kinematic, then set it kinematic again.
        boolean kinematic = false;
        if (node.isKinematic()) {
            kinematic = true;
            node.setKinematic(false);
        }
        dynamicsWorld.addRigidBody(node.getObjectId());
        if (kinematic) {
            node.setKinematic(true);
        }

        logger.log(Level.FINE, "Adding RigidBody {0} to physics space.", node.getObjectId());
        if (node instanceof PhysicsVehicle) {
            logger.log(Level.FINE, "Adding vehicle constraint {0} to physics space.", ((PhysicsVehicle) node).getVehicleId());
            ((PhysicsVehicle) node).createVehicle(this);
            physicsVehicles.put(((PhysicsVehicle) node).getVehicleId(), (PhysicsVehicle)node);
            dynamicsWorld.addVehicle(((PhysicsVehicle) node).getVehicleId());
        }
    }
Removes all physics controls and joints in the given spatial from the physics space
(e.g. before saving to disk) - recursive if node
@param spatial the rootnode containing the physics objects
jme3-jbullet/src/main/java/com/jme3/bullet/PhysicsSpace.java