Setup infrastructure for using LibOVR

empirephoenix-patch-1
Campbell Suter 7 years ago
parent cf28e81480
commit 7313abf58d
No known key found for this signature in database
GPG Key ID: 754A66CCF3F73C0F
  1. 7
      jme3-vr/src/main/java/com/jme3/app/VRConstants.java
  2. 8
      jme3-vr/src/main/java/com/jme3/app/VREnvironment.java

@ -141,6 +141,13 @@ public class VRConstants {
* @see #SETTING_VRAPI * @see #SETTING_VRAPI
*/ */
public static final int SETTING_VRAPI_OPENVR_LWJGL_VALUE = 3; public static final int SETTING_VRAPI_OPENVR_LWJGL_VALUE = 3;
/**
* The identifier of the LibOVR (Oculus) system.
*
* @see #SETTING_VRAPI
*/
public static final int SETTING_VRAPI_OCULUSVR_VALUE = 4;

@ -7,6 +7,7 @@ import java.util.logging.Logger;
import com.jme3.app.state.AppState; import com.jme3.app.state.AppState;
import com.jme3.input.vr.OSVR; import com.jme3.input.vr.OSVR;
import com.jme3.input.vr.OpenVR; import com.jme3.input.vr.OpenVR;
import com.jme3.input.vr.OculusVR;
import com.jme3.input.vr.VRAPI; import com.jme3.input.vr.VRAPI;
import com.jme3.input.vr.VRBounds; import com.jme3.input.vr.VRBounds;
import com.jme3.input.vr.VRInputAPI; import com.jme3.input.vr.VRInputAPI;
@ -18,6 +19,7 @@ import com.jme3.util.VRGuiManager;
import com.jme3.util.VRMouseManager; import com.jme3.util.VRMouseManager;
import com.jme3.util.VRViewManager; import com.jme3.util.VRViewManager;
import com.jme3.util.VRViewManagerOSVR; import com.jme3.util.VRViewManagerOSVR;
import com.jme3.util.VRViewManagerOculus;
import com.jme3.util.VRViewManagerOpenVR; import com.jme3.util.VRViewManagerOpenVR;
public class VREnvironment { public class VREnvironment {
@ -388,6 +390,8 @@ public class VREnvironment {
viewmanager = new VRViewManagerOpenVR(this); viewmanager = new VRViewManagerOpenVR(this);
} else if (vrBinding == VRConstants.SETTING_VRAPI_OSVR_VALUE){ } else if (vrBinding == VRConstants.SETTING_VRAPI_OSVR_VALUE){
viewmanager = new VRViewManagerOSVR(this); viewmanager = new VRViewManagerOSVR(this);
} else if (vrBinding == VRConstants.SETTING_VRAPI_OCULUSVR_VALUE) {
viewmanager = new VRViewManagerOculus(this);
} else { } else {
logger.severe("Cannot instanciate view manager, unknown VRAPI type: "+vrBinding); logger.severe("Cannot instanciate view manager, unknown VRAPI type: "+vrBinding);
} }
@ -419,6 +423,10 @@ public class VREnvironment {
hardware = new OpenVR(this); hardware = new OpenVR(this);
initialized = true; initialized = true;
logger.config("Creating OpenVR wrapper [SUCCESS]"); logger.config("Creating OpenVR wrapper [SUCCESS]");
} else if (vrBinding == VRConstants.SETTING_VRAPI_OCULUSVR_VALUE) {
hardware = new OculusVR(this);
initialized = true;
logger.config("Creating LibOVR wrapper [SUCCESS]");
} else { } else {
logger.config("Cannot create VR binding: "+vrBinding+" [FAILED]"); logger.config("Cannot create VR binding: "+vrBinding+" [FAILED]");
logger.log(Level.SEVERE, "Cannot initialize VR environment [FAILED]"); logger.log(Level.SEVERE, "Cannot initialize VR environment [FAILED]");

Loading…
Cancel
Save