public Spatial center() {
        Vector3f worldTrans = getWorldTranslation();
        Vector3f worldCenter = getWorldBound().getCenter();

        Vector3f absTrans = worldTrans.subtract(worldCenter);
        setLocalTranslation(absTrans);

        return this;
    }
Centers the spatial in the origin of the world bound.

@return The spatial on which this method is called, e.g <code>this</code>.
jme3-core/src/main/java/com/jme3/scene/Spatial.java