Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion jme3-vr/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ if (!hasProperty('mainClass')) {
ext.mainClass = ''
}

def lwjglVersion = '3.1.3'
def lwjglVersion = '3.2.0'

sourceCompatibility = '1.8'

Expand All @@ -18,4 +18,12 @@ dependencies {
// Native LibOVR/Oculus support
compile "org.lwjgl:lwjgl-ovr:${lwjglVersion}"
runtime "org.lwjgl:lwjgl-ovr:${lwjglVersion}:natives-windows"

// Native OpenVR/LWJGL support
compile "org.lwjgl:lwjgl-openvr:${lwjglVersion}"
compile "org.lwjgl:lwjgl-openvr:${lwjglVersion}:natives-linux"
compile "org.lwjgl:lwjgl-openvr:${lwjglVersion}:natives-macos"
runtime "org.lwjgl:lwjgl-openvr:${lwjglVersion}:natives-windows"
runtime "org.lwjgl:lwjgl-openvr:${lwjglVersion}:natives-linux"
runtime "org.lwjgl:lwjgl-openvr:${lwjglVersion}:natives-macos"
}
17 changes: 17 additions & 0 deletions jme3-vr/src/main/java/com/jme3/app/VREnvironment.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
import com.jme3.input.vr.VRInputAPI;
import com.jme3.input.vr.VRMouseManager;
import com.jme3.input.vr.VRViewManager;
import com.jme3.input.vr.lwjgl_openvr.LWJGLOpenVR;
import com.jme3.input.vr.lwjgl_openvr.LWJGLOpenVRMouseManager;
import com.jme3.input.vr.lwjgl_openvr.LWJGLOpenVRViewManager;
import com.jme3.input.vr.oculus.OculusMouseManager;
import com.jme3.input.vr.oculus.OculusVR;
import com.jme3.input.vr.oculus.OculusViewManager;
Expand Down Expand Up @@ -166,6 +169,10 @@ public void setSeatedExperience(boolean isSeated) {
} else {
((OpenVR)hardware).getCompositor().SetTrackingSpace.apply(JOpenVRLibrary.ETrackingUniverseOrigin.ETrackingUniverseOrigin_TrackingUniverseStanding);
}
} else if (hardware instanceof LWJGLOpenVR) {
if( ((LWJGLOpenVR)hardware).isInitialized() ) {
((LWJGLOpenVR)hardware).setTrackingSpace(seated);
}
}
}

Expand Down Expand Up @@ -406,6 +413,8 @@ public void atttach(AppState appState, Application application){
viewmanager = new OSVRViewManager(this);
} else if (vrBinding == VRConstants.SETTING_VRAPI_OCULUSVR_VALUE) {
viewmanager = new OculusViewManager(this);
} else if (vrBinding == VRConstants.SETTING_VRAPI_OPENVR_LWJGL_VALUE) {
viewmanager = new LWJGLOpenVRViewManager(this);
} else {
logger.severe("Cannot instanciate view manager, unknown VRAPI type: "+vrBinding);
}
Expand Down Expand Up @@ -453,6 +462,14 @@ public boolean initialize(){
hardware = new OculusVR(this);
initialized = true;
logger.config("Creating Occulus Rift wrapper [SUCCESS]");
} else if (vrBinding == VRConstants.SETTING_VRAPI_OPENVR_LWJGL_VALUE) {

guiManager = new VRGuiManager(this);
mouseManager = new LWJGLOpenVRMouseManager(this);

hardware = new LWJGLOpenVR(this);
initialized = true;
logger.config("Creating OpenVR/LWJGL wrapper [SUCCESS]");
} else {
logger.config("Cannot create VR binding: "+vrBinding+" [FAILED]");
logger.log(Level.SEVERE, "Cannot initialize VR environment [FAILED]");
Expand Down
Loading