@Override
    public void centerMouse() {
        if (environment != null){
            if (environment.getApplication() != null){
                // set mouse in center of the screen if newly added
                Vector2f size = environment.getVRGUIManager().getCanvasSize();
                MouseInput mi = environment.getApplication().getContext().getMouseInput();
                AppSettings as = environment.getApplication().getContext().getSettings();
                if( mi instanceof GlfwMouseInputVR ) ((GlfwMouseInputVR)mi).setCursorPosition((int)(as.getWidth() / 2f), (int)(as.getHeight() / 2f));
                if( environment.isInVR() ) {
                    cursorPos.x = size.x / 2f;
                    cursorPos.y = size.y / 2f;
                    recentCenterCount = 2;
                }
            } else {
                throw new IllegalStateException("This VR environment is not attached to any application.");
            }
        } else {
            throw new IllegalStateException("This VR view manager is not attached to any VR environment.");
        }
    }
Create a new AbstractVRMouseManager attached to the given {@link VREnvironment VR environment}.
@param environment the {@link VREnvironment VR environment} that this manager is attached to.
jme3-vr/src/main/java/com/jme3/input/vr/AbstractVRMouseManager.java