private void spatialToLight(Light light) {
        TempVars vars = TempVars.get();

        final Vector3f worldTranslation = vars.vect1;
        worldTranslation.set(spatial.getWorldTranslation());
        final Vector3f worldDirection = vars.vect2;
        spatial.getWorldRotation().mult(Vector3f.UNIT_Z, worldDirection).negateLocal();

        if (light instanceof PointLight) {
            ((PointLight) light).setPosition(worldTranslation);
        } else if (light instanceof DirectionalLight) {
            ((DirectionalLight) light).setDirection(worldDirection);
        } else if (light instanceof SpotLight) {
            final SpotLight spotLight = (SpotLight) light;
            spotLight.setPosition(worldTranslation);
            spotLight.setDirection(worldDirection);
        }
        vars.release();
    }
Sets the light to adopt the spatial's world transformations.

@author Markil 3
@author pspeed42
jme3-core/src/main/java/com/jme3/scene/control/LightControl.java