@Override
    public void update(float tpf) {
        // if we are showing the cursor, add our picture as it
        if( vrMouseEnabled && environment.getApplication().getInputManager().isCursorVisible() ) {
            if(!mouseAttached) {
                mouseAttached = true;
                environment.getApplication().getGuiViewPort().attachScene(mouseImage);
                centerMouse();
                // the "real" mouse pointer should stay hidden
                if (environment.getApplication().getContext() instanceof LwjglWindow){
                    GLFW.glfwSetInputMode(((LwjglWindow)environment.getApplication().getContext()).getWindowHandle(), GLFW.GLFW_CURSOR, GLFW.GLFW_CURSOR_DISABLED);
                }
            }
            // handle mouse movements, which may be in addition to (or exclusive from) tracked movement
            MouseInput mi = environment.getApplication().getContext().getMouseInput();
            if( mi instanceof GlfwMouseInputVR ) {
                if( recentCenterCount <= 0 ) {
                    //Vector2f winratio = VRGuiManager.getCanvasToWindowRatio();
                    cursorPos.x += ((GlfwMouseInputVR)mi).getLastDeltaX();// * winratio.x;
                    cursorPos.y += ((GlfwMouseInputVR)mi).getLastDeltaY();// * winratio.y;
                    if( cursorPos.x < 0f ) cursorPos.x = 0f;
                    if( cursorPos.y < 0f ) cursorPos.y = 0f;
                    if( cursorPos.x > environment.getVRGUIManager().getCanvasSize().x ) cursorPos.x = environment.getVRGUIManager().getCanvasSize().x;
                    if( cursorPos.y > environment.getVRGUIManager().getCanvasSize().y ) cursorPos.y = environment.getVRGUIManager().getCanvasSize().y;
                } else recentCenterCount--;
                ((GlfwMouseInputVR)mi).clearDeltas();
            }
            // ok, update the cursor graphic position
            Vector2f currentPos = getCursorPosition();
            mouseImage.setLocalTranslation(currentPos.x, currentPos.y - ySize, environment.getVRGUIManager().getGuiDistance() + 1f);

            mouseImage.updateGeometricState();

        } else if(mouseAttached) {
            mouseAttached = false;
            environment.getApplication().getGuiViewPort().detachScene(mouseImage);

            // Use the setCursorVisible implementation to show the cursor again, depending on the state of cursorVisible
            boolean cursorVisible = environment.getApplication().getInputManager().isCursorVisible();
            environment.getApplication().getContext().getMouseInput().setCursorVisible(cursorVisible);
        }
    }
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