@Override
    public Vector3f getFinalObserverPosition(int index) {

        if (environment != null) {
            VRViewManager vrvm = environment.getVRViewManager();

            if (vrvm != null) {
                if (isInputDeviceTracking(index) == false) {
                    return null;
                }
                Object obs = environment.getObserver();
                Vector3f pos = getPosition(index);
                if (obs instanceof Camera) {
                    ((Camera) obs).getRotation().mult(pos, pos);
                    return pos.addLocal(((Camera) obs).getLocation());
                } else {
                    ((Spatial) obs).getWorldRotation().mult(pos, pos);
                    return pos.addLocal(((Spatial) obs).getWorldTranslation());
                }
            } else {
                throw new IllegalStateException("VR environment has no valid view manager.");
            }

        } else {
            throw new IllegalStateException("VR input is not attached to a VR environment.");
        }
    }
Create a new
<a href="https://github.com/ValveSoftware/openvr/wiki/API-Documentation">OpenVR</a>
input attached to the given VR environment.

@param environment the VR environment to which the input is attached.
jme3-vr/src/main/java/com/jme3/input/vr/lwjgl_openvr/LWJGLOpenVRInput.java