@Override
    public void update(float tpf) {
        if (environment != null){
            // grab the observer
            Object obs = environment.getObserver();
            Quaternion objRot;
            Vector3f objPos;
            if( obs instanceof Camera ) {
                objRot = ((Camera)obs).getRotation();
                objPos = ((Camera)obs).getLocation();
            } else {
                objRot = ((Spatial)obs).getWorldRotation();
                objPos = ((Spatial)obs).getWorldTranslation();
            }
            // grab the hardware handle
            VRAPI dev = environment.getVRHardware();
            if( dev != null ) {
                // update the HMD's position & orientation
                dev.updatePose();
                dev.getPositionAndOrientation(hmdPos, hmdRot);
/*
                // TOREMOVE
                Vector3f v   = dev.getVRinput().getTrackedController(0).getPosition();
                Quaternion q = dev.getVRinput().getTrackedController(0).getOrientation();
                if ((v != null)&&(q != null)){
                    hmdPos.set(v);
                    hmdRot.set(q);
                }

                logger.severe("HMD controller ");
                logger.severe("  Position "+hmdPos);
                logger.severe("  Orientation "+hmdRot);

                VRTrackedController tc = null;
                for(int i = 0; i < dev.getVRinput().getTrackedControllerCount(); i++){
                    tc = dev.getVRinput().getTrackedController(i);
                    logger.severe("Tracked controller "+i+": "+tc.getControllerName());
                    logger.severe("  Position "+tc.getPosition());
                    logger.severe("  Orientation "+tc.getOrientation());
                    logger.severe("");
                }
*/
                // TOREMOVE

                if( obs != null ) {
                    // update hmdPos based on obs rotation
                    finalRotation.set(objRot);
                    finalRotation.mult(hmdPos, hmdPos);
                    finalRotation.multLocal(hmdRot);
                }

                finalizeCamera(dev.getHMDVectorPoseLeftEye(), objPos, getLeftCamera());
                finalizeCamera(dev.getHMDVectorPoseRightEye(), objPos, getRightCamera());
            } else {
                getLeftCamera().setFrame(objPos, objRot);
                getRightCamera().setFrame(objPos, objRot);
            }

            if( environment.hasTraditionalGUIOverlay() ) {
                // update the mouse?
                environment.getVRMouseManager().update(tpf);

                // update GUI position?
                if( environment.getVRGUIManager().isWantsReposition() || environment.getVRGUIManager().getPositioningMode() != VRGUIPositioningMode.MANUAL ) {
                    environment.getVRGUIManager().positionGuiNow(tpf);
                    environment.getVRGUIManager().updateGuiQuadGeometricState();
                }
            }
        } else {
            throw new IllegalStateException("This VR view manager is not attached to any VR environment.");
        }
    }
Replaces rootNode with the distortion mesh as the main camera's scene.
jme3-vr/src/main/java/com/jme3/input/vr/openvr/OpenVRViewManager.java