Skip to content
Open
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
4 changes: 1 addition & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[versions]

checkstyle = "9.3"
lwjgl3 = "3.3.6"
lwjgl3 = "3.4.0"
nifty = "1.4.3"

[libraries]
Expand Down Expand Up @@ -32,8 +32,6 @@ lwjgl3-jemalloc = { module = "org.lwjgl:lwjgl-jemalloc", version.ref = "lwjgl3"
lwjgl3-openal = { module = "org.lwjgl:lwjgl-openal", version.ref = "lwjgl3" }
lwjgl3-opencl = { module = "org.lwjgl:lwjgl-opencl", version.ref = "lwjgl3" }
lwjgl3-opengl = { module = "org.lwjgl:lwjgl-opengl", version.ref = "lwjgl3" }
lwjgl3-openvr = { module = "org.lwjgl:lwjgl-openvr", version.ref = "lwjgl3" }
lwjgl3-ovr = { module = "org.lwjgl:lwjgl-ovr", version.ref = "lwjgl3" }

mokito-core = "org.mockito:mockito-core:3.12.4"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
package com.jme3.bullet.debug;

import com.jme3.app.Application;
import com.jme3.app.VRAppState;
import com.jme3.app.state.AbstractAppState;
import com.jme3.app.state.AppStateManager;
import com.jme3.asset.AssetManager;
Expand Down Expand Up @@ -173,17 +172,11 @@ public void initialize(AppStateManager stateManager, Application app) {
setupMaterials(app);
physicsDebugRootNode.setCullHint(Spatial.CullHint.Never);

if (isVr()) {
/* This is a less good solution than the non-vr version (as the debug shapes can be obscured by the regular
Copy link
Member

@richardTingle richardTingle Jan 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I wrote this and I'm so glad to see it go. Nasty hack that didn't really achieve what the debug state is supposed to do (because jme3-vr never supported view overlays)

* geometry), however it is the best possible as VR does not currently support multiple viewports per eye */
VRAppState vrAppState = stateManager.getState(VRAppState.ID, VRAppState.class);
vrAppState.getLeftViewPort().attachScene(physicsDebugRootNode);
vrAppState.getRightViewPort().attachScene(physicsDebugRootNode);
} else {
viewPort = rm.createMainView("Physics Debug Overlay", app.getCamera());
viewPort.setClearFlags(false, true, false);
viewPort.attachScene(physicsDebugRootNode);
}

viewPort = rm.createMainView("Physics Debug Overlay", app.getCamera());
viewPort.setClearFlags(false, true, false);
viewPort.attachScene(physicsDebugRootNode);

}

/**
Expand All @@ -193,15 +186,8 @@ public void initialize(AppStateManager stateManager, Application app) {
* is invoked.
*/
@Override
public void cleanup() {
if (isVr()) {
VRAppState vrAppState = app.getStateManager().getState(VRAppState.ID, VRAppState.class);
vrAppState.getLeftViewPort().detachScene(physicsDebugRootNode);
vrAppState.getRightViewPort().detachScene(physicsDebugRootNode);
} else {
rm.removeMainView(viewPort);
}

public void cleanup() {
rm.removeMainView(viewPort);
super.cleanup();
}

Expand Down Expand Up @@ -436,17 +422,4 @@ public static interface DebugAppStateFilter {
*/
public boolean displayObject(Object obj);
}

private boolean isVr() {
if (isVr == null) {
try {
VRAppState vrAppState = app.getStateManager().getState(VRAppState.ID, VRAppState.class);
isVr = vrAppState != null && !vrAppState.DISABLE_VR;
} catch (NoClassDefFoundError e) {
//Vr isn't even on the classpath
isVr = false;
}
}
return isVr;
}
}
}
18 changes: 11 additions & 7 deletions jme3-lwjgl3/src/main/java/com/jme3/opencl/lwjgl/LwjglDevice.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,19 @@ public long getDevice() {
public LwjglPlatform getPlatform() {
return platform;
}

@Override
public DeviceType getDeviceType() {
int type = Info.clGetDeviceInfoInt(device, CL10.CL_DEVICE_TYPE);
switch (type) {
case CL10.CL_DEVICE_TYPE_ACCELERATOR: return DeviceType.ACCELEARTOR;
case CL10.CL_DEVICE_TYPE_CPU: return DeviceType.CPU;
case CL10.CL_DEVICE_TYPE_GPU: return DeviceType.GPU;
default: return DeviceType.DEFAULT;
long type = Info.clGetDeviceInfoInt(device, CL10.CL_DEVICE_TYPE);

if ((type & CL10.CL_DEVICE_TYPE_GPU) != 0) {
return DeviceType.GPU;
} else if ((type & CL10.CL_DEVICE_TYPE_CPU) != 0) {
return DeviceType.CPU;
} else if ((type & CL10.CL_DEVICE_TYPE_ACCELERATOR) != 0) {
return DeviceType.ACCELEARTOR;
} else {
return DeviceType.DEFAULT;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public List<LwjglDevice> getDevices() {
* @param deviceType the device type
* @return the available devices
*/
private long[] getDevices(int deviceType) {
private long[] getDevices(long deviceType) {
int[] count = new int[1];
int errcode = CL10.clGetDeviceIDs(platform, deviceType, null, count);
if (errcode == CL10.CL_DEVICE_NOT_FOUND) {
Expand Down
30 changes: 0 additions & 30 deletions jme3-vr/build.gradle

This file was deleted.

Loading