From 2c044a29c5e1d5ac96abc9efd2a00ea4594085c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rickard=20Ed=C3=A9n?= Date: Mon, 9 Oct 2017 07:44:03 +0200 Subject: [PATCH] Revert "added functionality to use front mounted vive camera" This reverts commit ae7a134f1e8763bf25ecaf894ef3f2136288feda. --- .../main/java/com/jme3/input/vr/OpenVR.java | 56 ++++++------------- 1 file changed, 18 insertions(+), 38 deletions(-) diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/OpenVR.java b/jme3-vr/src/main/java/com/jme3/input/vr/OpenVR.java index 71007b5ca..a9f3fdcfb 100644 --- a/jme3-vr/src/main/java/com/jme3/input/vr/OpenVR.java +++ b/jme3-vr/src/main/java/com/jme3/input/vr/OpenVR.java @@ -18,7 +18,6 @@ import com.jme3.system.jopenvr.OpenVRUtil; import com.jme3.system.jopenvr.TrackedDevicePose_t; import com.jme3.system.jopenvr.VR_IVRCompositor_FnTable; import com.jme3.system.jopenvr.VR_IVRSystem_FnTable; -import com.jme3.system.jopenvr.VR_IVRTrackedCamera_FnTable; import com.jme3.util.VRUtil; import com.sun.jna.Memory; import com.sun.jna.Pointer; @@ -42,20 +41,19 @@ public class OpenVR implements VRAPI { private static final Logger logger = Logger.getLogger(OpenVR.class.getName()); private static VR_IVRCompositor_FnTable compositorFunctions; - private static VR_IVRTrackedCamera_FnTable cameraFunctions; private static VR_IVRSystem_FnTable vrsystemFunctions; private static boolean initSuccess = false; private static boolean flipEyes = false; - private static IntBuffer hmdDisplayFrequency; - private static TrackedDevicePose_t.ByReference hmdTrackedDevicePoseReference; - protected static TrackedDevicePose_t[] hmdTrackedDevicePoses; + private IntBuffer hmdDisplayFrequency; + private TrackedDevicePose_t.ByReference hmdTrackedDevicePoseReference; + protected TrackedDevicePose_t[] hmdTrackedDevicePoses; - protected static IntByReference hmdErrorStore; + protected IntByReference hmdErrorStore; - private static final Quaternion rotStore = new Quaternion(); - private static final Vector3f posStore = new Vector3f(); + private final Quaternion rotStore = new Quaternion(); + private final Vector3f posStore = new Vector3f(); private static FloatByReference tlastVsync; @@ -67,20 +65,21 @@ public class OpenVR implements VRAPI { // for debugging latency private int frames = 0; - protected static Matrix4f[] poseMatrices; + protected Matrix4f[] poseMatrices; - private static final Matrix4f hmdPose = Matrix4f.IDENTITY.clone(); - private static Matrix4f hmdProjectionLeftEye; - private static Matrix4f hmdProjectionRightEye; - private static Matrix4f hmdPoseLeftEye; - private static Matrix4f hmdPoseRightEye; + private final Matrix4f hmdPose = Matrix4f.IDENTITY.clone(); + private Matrix4f hmdProjectionLeftEye; + private Matrix4f hmdProjectionRightEye; + private Matrix4f hmdPoseLeftEye; + private Matrix4f hmdPoseRightEye; - private static Vector3f hmdPoseLeftEyeVec, hmdPoseRightEyeVec, hmdSeatToStand; + private Vector3f hmdPoseLeftEyeVec, hmdPoseRightEyeVec, hmdSeatToStand; + + private float vsyncToPhotons; + private double timePerFrame, frameCountRun; + private long frameCount; + private OpenVRInput VRinput; - private static float vsyncToPhotons; - private static double timePerFrame, frameCountRun; - private static long frameCount; - private static OpenVRInput VRinput; private VREnvironment environment = null; @@ -108,10 +107,6 @@ public class OpenVR implements VRAPI { return compositorFunctions; } - public VR_IVRTrackedCamera_FnTable getTrackedCamera(){ - return cameraFunctions; - } - @Override public String getName() { return "OpenVR"; @@ -240,21 +235,6 @@ public class OpenVR implements VRAPI { } return compositorFunctions != null; } - - public void initCamera(boolean allowed) { - hmdErrorStore.setValue(0); // clear the error store - if( allowed && vrsystemFunctions != null ) { - IntByReference intptr = JOpenVRLibrary.VR_GetGenericInterface(JOpenVRLibrary.IVRTrackedCamera_Version, hmdErrorStore); - if (intptr != null){ - cameraFunctions = new VR_IVRTrackedCamera_FnTable(intptr.getPointer()); - if(cameraFunctions != null && hmdErrorStore.getValue() == 0 ){ - cameraFunctions.setAutoSynch(false); - cameraFunctions.read(); - logger.config("OpenVR Camera initialized"); - } - } - } - } @Override public void destroy() {