public Vector2f getCanvasToWindowRatio() {
        if (environment != null){

            if (environment.getApplication() != null){
                if( ratio == null ) {
                    ratio = new Vector2f();
                    Vector2f canvas = getCanvasSize();
                    int width = Integer.min(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode().getWidth(),
                            environment.getApplication().getContext().getSettings().getWidth());
                    int height = Integer.min(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode().getHeight(),
                            environment.getApplication().getContext().getSettings().getHeight());
                    ratio.x = Float.max(1f, canvas.x / width);
                    ratio.y = Float.max(1f, canvas.y / height);
                }
                return ratio;

            } else {
                throw new IllegalStateException("VR GUI manager underlying environment is not attached to any application.");
            }
        } else {
            throw new IllegalStateException("VR GUI manager is not attached to any environment.");
        }
    }
Get the ratio between the {@link #getCanvasSize() GUI canvas size} and the application main windows (if available) or the screen size.
@return the ratio between the {@link #getCanvasSize() GUI canvas size} and the application main windows (if available).
@see #getCanvasSize()
jme3-vr/src/main/java/com/jme3/util/VRGuiManager.java