diff --git a/jme3-examples/build.gradle b/jme3-examples/build.gradle index dde857609a..5c6c71f871 100644 --- a/jme3-examples/build.gradle +++ b/jme3-examples/build.gradle @@ -38,6 +38,7 @@ dependencies { compile project(':jme3-plugins') compile project(':jme3-terrain') compile project(':jme3-testdata') + compile project(':jme3-vr') } jar.doFirst{ diff --git a/jme3-examples/src/main/java/jme3test/app/HelloVr.java b/jme3-examples/src/main/java/jme3test/app/HelloVr.java new file mode 100644 index 0000000000..70070b4e47 --- /dev/null +++ b/jme3-examples/src/main/java/jme3test/app/HelloVr.java @@ -0,0 +1,496 @@ +package jme3test.app; + +import com.jme3.app.*; +import com.jme3.app.state.AppState; +import com.jme3.asset.plugins.FileLocator; +import com.jme3.input.InputManager; +import com.jme3.input.KeyInput; +import com.jme3.input.controls.ActionListener; +import com.jme3.input.controls.KeyTrigger; +import com.jme3.input.vr.VRInputType; +import com.jme3.material.Material; +import com.jme3.math.FastMath; +import com.jme3.math.Quaternion; +import com.jme3.math.Vector2f; +import com.jme3.math.Vector3f; +import com.jme3.post.CartoonSSAO; +import com.jme3.post.FilterPostProcessor; +import com.jme3.scene.Geometry; +import com.jme3.scene.Node; +import com.jme3.scene.Spatial; +import com.jme3.scene.Spatial.CullHint; +import com.jme3.scene.shape.Box; +import com.jme3.system.AppSettings; +import com.jme3.texture.Texture; +import com.jme3.texture.Texture.MagFilter; +import com.jme3.texture.Texture.MinFilter; +import com.jme3.ui.Picture; +import com.jme3.util.SkyFactory; +import com.jme3.util.VRGUIPositioningMode; +import org.lwjgl.system.Configuration; + +import java.io.File; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.logging.*; + +/** + * A Jmonkey sample that show the use of VR rendering with a JMonkey Application. + * + * @author Julien Seinturier + */ +public class HelloVr extends SimpleApplication { + + private static final Logger logger = Logger.getLogger(HelloVr.class.getName()); + + // general objects for scene management + Node boxes = new Node(""); + Spatial observer; + boolean moveForward, moveBackwards, rotateLeft, rotateRight; + Material mat; + Node mainScene; + Geometry leftHand, rightHand; + + private float distance = 100f; + private float prod = 0f; + private float placeRate = 0f; + + VRAppState vrAppState = null; + + public HelloVr(AppState... initialStates) { + super(initialStates); + + vrAppState = getStateManager().getState(VRAppState.class); + } + + + @Override + public void simpleInitApp() { + + logger.info("Updating asset manager with " + System.getProperty("user.dir")); + getAssetManager().registerLocator(System.getProperty("user.dir") + File.separator + "assets", FileLocator.class); + + mainScene = new Node("scene"); + observer = new Node("observer"); + +// Spatial sky = SkyFactory.createSky(getAssetManager(), "Textures/Sky/Bright/spheremap.png", SkyFactory.EnvMapType.EquirectMap); + Spatial sky = SkyFactory.createSky(getAssetManager(), "Textures/BrightSky.dds", SkyFactory.EnvMapType.CubeMap); + rootNode.attachChild(sky); + + Geometry box = new Geometry("", new Box(5, 5, 5)); + mat = new Material(getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md"); + Texture noise = getAssetManager().loadTexture("Textures/noise.png"); + noise.setMagFilter(MagFilter.Nearest); + noise.setMinFilter(MinFilter.Trilinear); + noise.setAnisotropicFilter(16); + mat.setTexture("ColorMap", noise); + + // make the floor according to the size of our play area + Geometry floor = new Geometry("floor", new Box(1f, 1f, 1f)); + + Vector2f playArea = vrAppState.getVREnvironment().getVRBounds().getPlaySize(); + if (playArea == null) { + // no play area, use default size & height + floor.setLocalScale(2f, 0.5f, 2f); + floor.move(0f, -1.5f, 0f); + } else { + // cube model is actually 2x as big, cut it down to proper playArea size with * 0.5 + floor.setLocalScale(playArea.x * 0.5f, 0.5f, playArea.y * 0.5f); + floor.move(0f, -0.5f, 0f); + } + floor.setMaterial(mat); + rootNode.attachChild(floor); + + // hand wands +// leftHand = (Geometry) getAssetManager().loadModel("Models/vive_controller.j3o"); + leftHand = (Geometry) getAssetManager().loadModel("Models/body.obj"); + rightHand = leftHand.clone(); + Material handMat = new Material(getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md"); + handMat.setTexture("ColorMap", getAssetManager().loadTexture("Textures/vive_controller.png")); + + leftHand.setMaterial(handMat); + rightHand.setMaterial(handMat); + rootNode.attachChild(rightHand); + rootNode.attachChild(leftHand); + + // gui element + Vector2f guiCanvasSize = vrAppState.getVRGUIManager().getCanvasSize(); + Picture test = new Picture("testpic"); + test.setImage(getAssetManager(), "Textures/crosshair.png", true); + test.setWidth(192f); + test.setHeight(128f); + test.setPosition(guiCanvasSize.x * 0.5f - 192f * 0.5f, guiCanvasSize.y * 0.5f - 128f * 0.5f); + guiNode.attachChild(test); + + + // test any positioning mode here (defaults to AUTO_CAM_ALL) + vrAppState.getVRGUIManager().setPositioningMode(VRGUIPositioningMode.AUTO_OBSERVER_ALL); + vrAppState.getVRGUIManager().setGuiScale(0.4f); + + box.setMaterial(mat); + + Geometry box2 = box.clone(); + box2.move(15, 0, 0); + box2.setMaterial(mat); + Geometry box3 = box.clone(); + box3.move(-15, 0, 0); + box3.setMaterial(mat); + + boxes.attachChild(box); + boxes.attachChild(box2); + boxes.attachChild(box3); + rootNode.attachChild(boxes); + + observer.setLocalTranslation(new Vector3f(0.0f, 0.0f, 0.0f)); + + vrAppState.setObserver(observer); + mainScene.attachChild(observer); + rootNode.attachChild(mainScene); + + addAllBoxes(); + + initInputs(); + + // use magic VR mouse cusor (same usage as non-VR mouse cursor) + getInputManager().setCursorVisible(true); + + // filter test (can be added here like this) + // but we are going to save them for the F key during runtime + /* + CartoonSSAO cartfilt = new CartoonSSAO(); + FilterPostProcessor fpp = new FilterPostProcessor(assetManager); + fpp.addFilter(cartfilt); + viewPort.addProcessor(fpp); + */ + } + + + private void initInputs() { + InputManager inputManager = getInputManager(); + inputManager.addMapping("toggle", new KeyTrigger(KeyInput.KEY_SPACE)); + inputManager.addMapping("incShift", new KeyTrigger(KeyInput.KEY_Q)); + inputManager.addMapping("decShift", new KeyTrigger(KeyInput.KEY_E)); + inputManager.addMapping("forward", new KeyTrigger(KeyInput.KEY_W)); + inputManager.addMapping("back", new KeyTrigger(KeyInput.KEY_S)); + inputManager.addMapping("left", new KeyTrigger(KeyInput.KEY_A)); + inputManager.addMapping("right", new KeyTrigger(KeyInput.KEY_D)); + inputManager.addMapping("filter", new KeyTrigger(KeyInput.KEY_F)); + inputManager.addMapping("dumpImages", new KeyTrigger(KeyInput.KEY_I)); + inputManager.addMapping("exit", new KeyTrigger(KeyInput.KEY_ESCAPE)); + + ActionListener acl = new ActionListener() { + + public void onAction(String name, boolean keyPressed, float tpf) { + if (name.equals("incShift") && keyPressed) { + vrAppState.getVRGUIManager().adjustGuiDistance(-0.1f); + } else if (name.equals("decShift") && keyPressed) { + vrAppState.getVRGUIManager().adjustGuiDistance(0.1f); + } else if (name.equals("filter") && keyPressed) { + // adding filters in realtime + CartoonSSAO cartfilt = new CartoonSSAO(vrAppState.isInstanceRendering()); + FilterPostProcessor fpp = new FilterPostProcessor(getAssetManager()); + fpp.addFilter(cartfilt); + getViewPort().addProcessor(fpp); + // filters added to main viewport during runtime, + // move them into VR processing + // (won't do anything if not in VR mode) + vrAppState.moveScreenProcessingToVR(); + } + if (name.equals("toggle")) { + vrAppState.getVRGUIManager().positionGui(); + } + if (name.equals("forward")) { + if (keyPressed) { + moveForward = true; + } else { + moveForward = false; + } + } else if (name.equals("back")) { + if (keyPressed) { + moveBackwards = true; + } else { + moveBackwards = false; + } + } else if (name.equals("dumpImages")) { +// ((OpenVR) vrAppState.getVRHardware()).getCompositor().CompositorDumpImages.apply(); + } else if (name.equals("left")) { + if (keyPressed) { + rotateLeft = true; + } else { + rotateLeft = false; + } + } else if (name.equals("right")) { + if (keyPressed) { + rotateRight = true; + } else { + rotateRight = false; + } + } else if (name.equals("exit")) { + stop(true); + System.exit(0); + } + + + } + }; + inputManager.addListener(acl, "forward"); + inputManager.addListener(acl, "back"); + inputManager.addListener(acl, "left"); + inputManager.addListener(acl, "right"); + inputManager.addListener(acl, "toggle"); + inputManager.addListener(acl, "incShift"); + inputManager.addListener(acl, "decShift"); + inputManager.addListener(acl, "filter"); + inputManager.addListener(acl, "dumpImages"); + inputManager.addListener(acl, "exit"); + } + + @Override + public void simpleUpdate(float tpf) { + + //FPS test + /*tpfAdder += tpf; + tpfCount++; + if( tpfCount == 60 ) { + System.out.println("FPS: " + Float.toString(1f / (tpfAdder / tpfCount))); + tpfCount = 0; + tpfAdder = 0f; + }*/ + + prod += tpf; + distance = 100f * FastMath.sin(prod); + boxes.setLocalTranslation(0, 0, 200f + distance); + + if (moveForward) { + observer.move(vrAppState.getFinalObserverRotation().getRotationColumn(2).mult(tpf * 8f)); + } + if (moveBackwards) { + observer.move(vrAppState.getFinalObserverRotation().getRotationColumn(2).mult(-tpf * 8f)); + } + if (rotateLeft) { + observer.rotate(0, 0.75f * tpf, 0); + } + if (rotateRight) { + observer.rotate(0, -0.75f * tpf, 0); + } + + handleWandInput(0, leftHand); + handleWandInput(1, rightHand); + if (placeRate > 0f) placeRate -= tpf; + } + + private void handleWandInput(int index, Geometry geo) { + + Quaternion q = vrAppState.getVRinput().getFinalObserverRotation(index); + Vector3f v = vrAppState.getVRinput().getFinalObserverPosition(index); + if (q != null && v != null) { + geo.setCullHint(CullHint.Dynamic); // make sure we see it + geo.setLocalTranslation(v); + geo.setLocalRotation(q); + // place boxes when holding down trigger + if (vrAppState.getVRinput().getAxis(index, VRInputType.ViveTriggerAxis).x >= 1f && + placeRate <= 0f) { + placeRate = 0.5f; + addBox(v, q, 0.1f); + vrAppState.getVRinput().triggerHapticPulse(index, 0.1f); + } + // print out all of the known information about the controllers here + /*for(int i=0;i -1) && (index < (simpleClassName.length() - 1))) { + simpleClassName = simpleClassName.substring(index + 1); + } + } else { + simpleClassName = "Unknow,"; + } + + String level = ""; + if (record.getLevel().equals(Level.FINEST)) { + level = "FINEST "; + } else if (record.getLevel().equals(Level.FINER)) { + level = "FINER "; + } else if (record.getLevel().equals(Level.FINE)) { + level = "FINE "; + } else if (record.getLevel().equals(Level.CONFIG)) { + level = "CONFIG "; + } else if (record.getLevel().equals(Level.INFO)) { + level = "INFO "; + } else if (record.getLevel().equals(Level.WARNING)) { + level = "WARNING"; + } else if (record.getLevel().equals(Level.SEVERE)) { + level = "SEVERE "; + } else { + level = "???????"; + } + + // Use record parameters + String message = record.getMessage(); + if (record.getParameters() != null) { + for (int i = 0; i < record.getParameters().length; i++) { + message = message.replace("{" + i + "}", "" + record.getParameters()[i]); + } + } + + if (record.getThrown() == null) { + return "(" + sdf.format(new Date(record.getMillis())) + ") " + level + " [" + simpleClassName + "] [" + record.getSourceMethodName() + "] " + message + lineSeparator; + } else { + String str = "(" + sdf.format(new Date(record.getMillis())) + ") " + level + " [" + simpleClassName + "] [" + record.getSourceMethodName() + "] caused by " + message + lineSeparator; + + StackTraceElement[] elements = record.getThrown().getStackTrace(); + for (int i = 0; i < elements.length; i++) { + str += "(" + sdf.format(new Date(record.getMillis())) + ") " + level + " [" + simpleClassName + "] [" + record.getSourceMethodName() + "] at " + elements[i] + lineSeparator; + } + return "(" + sdf.format(new Date(record.getMillis())) + ") " + level + " [" + record.getSourceClassName() + "] [" + record.getSourceMethodName() + "] " + message + lineSeparator + str; + } + } else { + return null; + } + } + }; + + // If the init is forced from a previous configuration, we remove the older handlers. + if (log != null) { + if (log.getHandlers() != null) { + for (int i = log.getHandlers().length - 1; i >= 0; i--) { + log.getHandlers()[i].setFilter(filter); + log.getHandlers()[i].setFormatter(formatter); + log.getHandlers()[i].setLevel(Level.CONFIG); + } + } + } + } + + /** + * Create a {@link VRAppState VR app state} and use a Simple application that use it.
+ * The recommended procedure is:
+ * + * + * @param args not used + */ + public static void main(String[] args) { + + Configuration.DEBUG.set(true); + Configuration.DEBUG_LOADER.set(true); + + // Init the log to display all the configuration informations. + // This is not needed within final application. + initLog(); + + // Prepare settings for VR rendering. + // It is recommended to share same settings between the VR app state and the application. + AppSettings settings = new AppSettings(true); + + settings.put(VRConstants.SETTING_VRAPI, VRConstants.SETTING_VRAPI_OPENVR_VALUE); // The VR api to use (need to be present on the system) + settings.put(VRConstants.SETTING_DISABLE_VR, false); // Enable VR + settings.put(VRConstants.SETTING_ENABLE_MIRROR_WINDOW, true); // Enable Mirror rendering oh the screen (disable to be faster) + settings.put(VRConstants.SETTING_VR_FORCE, false); // Not forcing VR rendering if no VR system is found. +// settings.put(VRConstants.SETTING_GUI_CURVED_SURFACE, true); // Curve the mesh that is displaying the GUI + settings.put(VRConstants.SETTING_FLIP_EYES, false); // Is the HMD eyes have to be inverted. + settings.put(VRConstants.SETTING_NO_GUI, false); // enable gui. +// settings.put(VRConstants.SETTING_GUI_OVERDRAW, true); // show gui even if it is behind things. + + settings.put(VRConstants.SETTING_DEFAULT_FOV, 108f); // The default ield Of View (FOV) + settings.put(VRConstants.SETTING_DEFAULT_ASPECT_RATIO, 1f); // The default aspect ratio. + + settings.setRenderer(AppSettings.LWJGL_OPENGL3); // Setting the renderer. OpenGL 3 is needed if you're using Instance Rendering. + + // The VR Environment. + // This object is the interface between the JMonkey world (Application, AppState, ...) and the VR specific stuff. + VREnvironment environment = new VREnvironment(settings); + environment.initialize(); + + // Checking if the VR environment is well initialized + // (access to the underlying VR system is effective, VR devices are detected). + if (environment.isInitialized()) { + + // Initialise VR AppState with the VR environment. + VRAppState vrAppState = new VRAppState(settings, environment); + + // Create the sample application with the VRAppState attached. + // There is no constraint on the Application type. + SimpleApplication test = new HelloVr(vrAppState); + test.setShowSettings(false); + + // Sharing settings between app state and application is recommended. + test.setSettings(settings); + + // Starting the application. + test.start(); + } else { + logger.severe("Cannot start VR sample application as VR system is not initialized (see log for details)"); + } + } +} \ No newline at end of file diff --git a/jme3-lwjgl/build.gradle b/jme3-lwjgl/build.gradle deleted file mode 100644 index c7154d8090..0000000000 --- a/jme3-lwjgl/build.gradle +++ /dev/null @@ -1,9 +0,0 @@ -if (!hasProperty('mainClass')) { - ext.mainClass = '' -} - -dependencies { - compile project(':jme3-core') - compile project(':jme3-desktop') - compile 'org.lwjgl.lwjgl:lwjgl:2.9.3' -} diff --git a/jme3-lwjgl/src/main/java/com/jme3/audio/lwjgl/LwjglAL.java b/jme3-lwjgl/src/main/java/com/jme3/audio/lwjgl/LwjglAL.java deleted file mode 100644 index 9cb52c688c..0000000000 --- a/jme3-lwjgl/src/main/java/com/jme3/audio/lwjgl/LwjglAL.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.jme3.audio.lwjgl; - -import com.jme3.audio.openal.AL; -import java.nio.ByteBuffer; -import java.nio.FloatBuffer; -import java.nio.IntBuffer; -import org.lwjgl.openal.AL10; -import org.lwjgl.openal.AL11; - -public final class LwjglAL implements AL { - - public LwjglAL() { - } - - public String alGetString(int parameter) { - return AL10.alGetString(parameter); - } - - public int alGenSources() { - return AL10.alGenSources(); - } - - public int alGetError() { - return AL10.alGetError(); - } - - public void alDeleteSources(int numSources, IntBuffer sources) { - if (sources.position() != 0) throw new AssertionError(); - if (sources.limit() != numSources) throw new AssertionError(); - AL10.alDeleteSources(sources); - } - - public void alGenBuffers(int numBuffers, IntBuffer buffers) { - if (buffers.position() != 0) throw new AssertionError(); - if (buffers.limit() != numBuffers) throw new AssertionError(); - AL10.alGenBuffers(buffers); - } - - public void alDeleteBuffers(int numBuffers, IntBuffer buffers) { - if (buffers.position() != 0) throw new AssertionError(); - if (buffers.limit() != numBuffers) throw new AssertionError(); - AL10.alDeleteBuffers(buffers); - } - - public void alSourceStop(int source) { - AL10.alSourceStop(source); - } - - public void alSourcei(int source, int param, int value) { - AL10.alSourcei(source, param, value); - } - - public void alBufferData(int buffer, int format, ByteBuffer data, int size, int frequency) { - if (data.position() != 0) throw new AssertionError(); - if (data.limit() != size) throw new AssertionError(); - AL10.alBufferData(buffer, format, data, frequency); - } - - public void alSourcePlay(int source) { - AL10.alSourcePlay(source); - } - - public void alSourcePause(int source) { - AL10.alSourcePause(source); - } - - public void alSourcef(int source, int param, float value) { - AL10.alSourcef(source, param, value); - } - - public void alSource3f(int source, int param, float value1, float value2, float value3) { - AL10.alSource3f(source, param, value1, value2, value3); - } - - public int alGetSourcei(int source, int param) { - return AL10.alGetSourcei(source, param); - } - - public void alSourceUnqueueBuffers(int source, int numBuffers, IntBuffer buffers) { - if (buffers.position() != 0) throw new AssertionError(); - if (buffers.limit() != numBuffers) throw new AssertionError(); - AL10.alSourceUnqueueBuffers(source, buffers); - } - - public void alSourceQueueBuffers(int source, int numBuffers, IntBuffer buffers) { - if (buffers.position() != 0) throw new AssertionError(); - if (buffers.limit() != numBuffers) throw new AssertionError(); - AL10.alSourceQueueBuffers(source, buffers); - } - - public void alListener(int param, FloatBuffer data) { - AL10.alListener(param, data); - } - - public void alListenerf(int param, float value) { - AL10.alListenerf(param, value); - } - - public void alListener3f(int param, float value1, float value2, float value3) { - AL10.alListener3f(param, value1, value2, value3); - } - - public void alSource3i(int source, int param, int value1, int value2, int value3) { - AL11.alSource3i(source, param, value1, value2, value3); - } - -} diff --git a/jme3-lwjgl/src/main/java/com/jme3/audio/lwjgl/LwjglALC.java b/jme3-lwjgl/src/main/java/com/jme3/audio/lwjgl/LwjglALC.java deleted file mode 100644 index ffce940b09..0000000000 --- a/jme3-lwjgl/src/main/java/com/jme3/audio/lwjgl/LwjglALC.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.jme3.audio.lwjgl; - -import com.jme3.audio.openal.ALC; -import java.nio.IntBuffer; -import org.lwjgl.LWJGLException; -import org.lwjgl.openal.AL; -import org.lwjgl.openal.ALC10; -import org.lwjgl.openal.ALCcontext; -import org.lwjgl.openal.ALCdevice; - -public class LwjglALC implements ALC { - - public void createALC() { - try { - AL.create(); - } catch (LWJGLException ex) { - throw new RuntimeException(ex); - } - } - - public void destroyALC() { - AL.destroy(); - } - - public boolean isCreated() { - return AL.isCreated(); - } - - public String alcGetString(int parameter) { - ALCcontext context = ALC10.alcGetCurrentContext(); - ALCdevice device = ALC10.alcGetContextsDevice(context); - return ALC10.alcGetString(device, parameter); - } - - public boolean alcIsExtensionPresent(String extension) { - ALCcontext context = ALC10.alcGetCurrentContext(); - ALCdevice device = ALC10.alcGetContextsDevice(context); - return ALC10.alcIsExtensionPresent(device, extension); - } - - public void alcGetInteger(int param, IntBuffer buffer, int size) { - if (buffer.position() != 0) throw new AssertionError(); - if (buffer.limit() != size) throw new AssertionError(); - - ALCcontext context = ALC10.alcGetCurrentContext(); - ALCdevice device = ALC10.alcGetContextsDevice(context); - ALC10.alcGetInteger(device, param, buffer); - } - - public void alcDevicePauseSOFT() { - } - - public void alcDeviceResumeSOFT() { - } - -} diff --git a/jme3-lwjgl/src/main/java/com/jme3/audio/lwjgl/LwjglEFX.java b/jme3-lwjgl/src/main/java/com/jme3/audio/lwjgl/LwjglEFX.java deleted file mode 100644 index 639758c4ef..0000000000 --- a/jme3-lwjgl/src/main/java/com/jme3/audio/lwjgl/LwjglEFX.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.jme3.audio.lwjgl; - -import com.jme3.audio.openal.EFX; -import java.nio.IntBuffer; -import org.lwjgl.openal.EFX10; - -public class LwjglEFX implements EFX { - - public void alGenAuxiliaryEffectSlots(int numSlots, IntBuffer buffers) { - if (buffers.position() != 0) throw new AssertionError(); - if (buffers.limit() != numSlots) throw new AssertionError(); - EFX10.alGenAuxiliaryEffectSlots(buffers); - } - - public void alGenEffects(int numEffects, IntBuffer buffers) { - if (buffers.position() != 0) throw new AssertionError(); - if (buffers.limit() != numEffects) throw new AssertionError(); - EFX10.alGenEffects(buffers); - } - - public void alEffecti(int effect, int param, int value) { - EFX10.alEffecti(effect, param, value); - } - - public void alAuxiliaryEffectSloti(int effectSlot, int param, int value) { - EFX10.alAuxiliaryEffectSloti(effectSlot, param, value); - } - - public void alDeleteEffects(int numEffects, IntBuffer buffers) { - if (buffers.position() != 0) throw new AssertionError(); - if (buffers.limit() != numEffects) throw new AssertionError(); - EFX10.alDeleteEffects(buffers); - } - - public void alDeleteAuxiliaryEffectSlots(int numEffectSlots, IntBuffer buffers) { - if (buffers.position() != 0) throw new AssertionError(); - if (buffers.limit() != numEffectSlots) throw new AssertionError(); - EFX10.alDeleteAuxiliaryEffectSlots(buffers); - } - - public void alGenFilters(int numFilters, IntBuffer buffers) { - if (buffers.position() != 0) throw new AssertionError(); - if (buffers.limit() != numFilters) throw new AssertionError(); - EFX10.alGenFilters(buffers); - } - - public void alFilteri(int filter, int param, int value) { - EFX10.alFilteri(filter, param, value); - } - - public void alFilterf(int filter, int param, float value) { - EFX10.alFilterf(filter, param, value); - } - - public void alDeleteFilters(int numFilters, IntBuffer buffers) { - if (buffers.position() != 0) throw new AssertionError(); - if (buffers.limit() != numFilters) throw new AssertionError(); - EFX10.alDeleteFilters(buffers); - } - - public void alEffectf(int effect, int param, float value) { - EFX10.alEffectf(effect, param, value); - } - -} diff --git a/jme3-lwjgl/src/main/java/com/jme3/input/lwjgl/JInputJoyInput.java b/jme3-lwjgl/src/main/java/com/jme3/input/lwjgl/JInputJoyInput.java deleted file mode 100644 index d89a07af51..0000000000 --- a/jme3-lwjgl/src/main/java/com/jme3/input/lwjgl/JInputJoyInput.java +++ /dev/null @@ -1,346 +0,0 @@ -/* - * Copyright (c) 2009-2016 jMonkeyEngine - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of 'jMonkeyEngine' nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package com.jme3.input.lwjgl; - -import com.jme3.input.AbstractJoystick; -import com.jme3.input.DefaultJoystickAxis; -import com.jme3.input.DefaultJoystickButton; -import com.jme3.input.InputManager; -import com.jme3.input.JoyInput; -import com.jme3.input.Joystick; -import com.jme3.input.JoystickAxis; -import com.jme3.input.JoystickButton; -import com.jme3.input.JoystickCompatibilityMappings; -import com.jme3.input.RawInputListener; -import com.jme3.input.event.JoyAxisEvent; -import com.jme3.input.event.JoyButtonEvent; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; -import net.java.games.input.*; -import net.java.games.input.Component.Identifier; -import net.java.games.input.Component.Identifier.Axis; -import net.java.games.input.Component.Identifier.Button; -import net.java.games.input.Component.POV; - -public class JInputJoyInput implements JoyInput { - - private static final Logger logger = Logger.getLogger(InputManager.class.getName()); - - private boolean inited = false; - private JInputJoystick[] joysticks; - private RawInputListener listener; - - private Map joystickIndex = new HashMap(); - - public void setJoyRumble(int joyId, float amount){ - - if( joyId >= joysticks.length ) - throw new IllegalArgumentException(); - - Controller c = joysticks[joyId].controller; - for (Rumbler r : c.getRumblers()){ - r.rumble(amount); - } - } - - public Joystick[] loadJoysticks(InputManager inputManager){ - ControllerEnvironment ce = - ControllerEnvironment.getDefaultEnvironment(); - - Controller[] cs = ce.getControllers(); - - List list = new ArrayList(); - for( Controller c : ce.getControllers() ) { - if (c.getType() == Controller.Type.KEYBOARD - || c.getType() == Controller.Type.MOUSE) - continue; - - logger.log(Level.FINE, "Attempting to create joystick for: \"{0}\"", c); - - // Try to create it like a joystick - JInputJoystick stick = new JInputJoystick(inputManager, this, c, list.size(), c.getName()); - for( Component comp : c.getComponents() ) { - stick.addComponent(comp); - } - - // If it has no axes then we'll assume it's not - // a joystick - if( stick.getAxisCount() == 0 ) { - logger.log(Level.FINE, "Not a joystick: {0}", c); - continue; - } - - joystickIndex.put(c, stick); - list.add(stick); - } - - joysticks = list.toArray( new JInputJoystick[list.size()] ); - - return joysticks; - } - - public void initialize() { - inited = true; - } - - public void update() { - ControllerEnvironment ce = - ControllerEnvironment.getDefaultEnvironment(); - - Controller[] cs = ce.getControllers(); - Event e = new Event(); - for (int i = 0; i < cs.length; i++){ - Controller c = cs[i]; - - JInputJoystick stick = joystickIndex.get(c); - if( stick == null ) - continue; - - if( !c.poll() ) - continue; - - int joyId = stick.getJoyId(); - - EventQueue q = c.getEventQueue(); - while (q.getNextEvent(e)){ - Identifier id = e.getComponent().getIdentifier(); - if (id == Identifier.Axis.POV){ - float x = 0, y = 0; - float v = e.getValue(); - - if (v == POV.CENTER){ - x = 0; y = 0; - }else if (v == POV.DOWN){ - x = 0; y = -1f; - }else if (v == POV.DOWN_LEFT){ - x = -1f; y = -1f; - }else if (v == POV.DOWN_RIGHT){ - x = 1f; y = -1f; - }else if (v == POV.LEFT){ - x = -1f; y = 0; - }else if (v == POV.RIGHT){ - x = 1f; y = 0; - }else if (v == POV.UP){ - x = 0; y = 1f; - }else if (v == POV.UP_LEFT){ - x = -1f; y = 1f; - }else if (v == POV.UP_RIGHT){ - x = 1f; y = 1f; - } - - JoyAxisEvent evt1 = new JoyAxisEvent(stick.povX, x); - JoyAxisEvent evt2 = new JoyAxisEvent(stick.povY, y); - listener.onJoyAxisEvent(evt1); - listener.onJoyAxisEvent(evt2); - }else if (id instanceof Axis){ - float value = e.getValue(); - - JoystickAxis axis = stick.axisIndex.get(e.getComponent()); - JoyAxisEvent evt = new JoyAxisEvent(axis, value); - listener.onJoyAxisEvent(evt); - }else if (id instanceof Button){ - - JoystickButton button = stick.buttonIndex.get(e.getComponent()); - JoyButtonEvent evt = new JoyButtonEvent(button, e.getValue() == 1f); - listener.onJoyButtonEvent(evt); - } - } - } - } - - public void destroy() { - inited = false; - } - - public boolean isInitialized() { - return inited; - } - - public void setInputListener(RawInputListener listener) { - this.listener = listener; - } - - public long getInputTimeNanos() { - return 0; - } - - protected class JInputJoystick extends AbstractJoystick { - - private JoystickAxis nullAxis; - private Controller controller; - private JoystickAxis xAxis; - private JoystickAxis yAxis; - private JoystickAxis povX; - private JoystickAxis povY; - private Map axisIndex = new HashMap(); - private Map buttonIndex = new HashMap(); - - public JInputJoystick( InputManager inputManager, JoyInput joyInput, Controller controller, - int joyId, String name ) { - super( inputManager, joyInput, joyId, name ); - - this.controller = controller; - - this.nullAxis = new DefaultJoystickAxis( getInputManager(), this, -1, - "Null", "null", false, false, 0 ); - this.xAxis = nullAxis; - this.yAxis = nullAxis; - this.povX = nullAxis; - this.povY = nullAxis; - } - - protected void addComponent( Component comp ) { - - Identifier id = comp.getIdentifier(); - if( id instanceof Button ) { - addButton(comp); - } else if( id instanceof Axis ) { - addAxis(comp); - } else { - logger.log(Level.FINE, "Ignoring: \"{0}\"", comp); - } - } - - protected void addButton( Component comp ) { - - logger.log(Level.FINE, "Adding button: \"{0}\" id:" + comp.getIdentifier(), comp); - - Identifier id = comp.getIdentifier(); - if( !(id instanceof Button) ) { - throw new IllegalArgumentException( "Component is not an button:" + comp ); - } - - String name = comp.getName(); - String original = id.getName(); - try { - Integer.parseInt(original); - } catch (NumberFormatException e){ - original = String.valueOf(buttonIndex.size()); - } - String logicalId = JoystickCompatibilityMappings.remapComponent( controller.getName(), original ); - if( logicalId != original ) { - logger.log(Level.FINE, "Remapped:" + original + " to:" + logicalId); - } - - JoystickButton button = new DefaultJoystickButton( getInputManager(), this, getButtonCount(), - name, logicalId ); - addButton(button); - buttonIndex.put( comp, button ); - } - - protected void addAxis( Component comp ) { - - logger.log(Level.FINE, "Adding axis: \"{0}\" id:" + comp.getIdentifier(), comp ); - - Identifier id = comp.getIdentifier(); - if( !(id instanceof Axis) ) { - throw new IllegalArgumentException( "Component is not an axis:" + comp ); - } - - String name = comp.getName(); - String original = id.getName(); - String logicalId = JoystickCompatibilityMappings.remapComponent( controller.getName(), original ); - if( logicalId != original ) { - logger.log(Level.FINE, "Remapped:" + original + " to:" + logicalId); - } - - JoystickAxis axis = new DefaultJoystickAxis( getInputManager(), - this, getAxisCount(), name, logicalId, - comp.isAnalog(), comp.isRelative(), - comp.getDeadZone() ); - addAxis(axis); - axisIndex.put( comp, axis ); - - // Support the X/Y axis indexes - if( id == Axis.X ) { - xAxis = axis; - } else if( id == Axis.Y ) { - yAxis = axis; - } else if( id == Axis.POV ) { - - // Add two fake axes for the JME provided convenience - // axes: AXIS_POV_X, AXIS_POV_Y - povX = new DefaultJoystickAxis( getInputManager(), - this, getAxisCount(), JoystickAxis.POV_X, - id.getName() + "_x", - comp.isAnalog(), comp.isRelative(), comp.getDeadZone() ); - logger.log(Level.FINE, "Adding axis: \"{0}\" id:" + id.getName() + "_x", povX.getName() ); - addAxis(povX); - povY = new DefaultJoystickAxis( getInputManager(), - this, getAxisCount(), JoystickAxis.POV_Y, - id.getName() + "_y", - comp.isAnalog(), comp.isRelative(), comp.getDeadZone() ); - logger.log(Level.FINE, "Adding axis: \"{0}\" id:" + id.getName() + "_y", povY.getName() ); - addAxis(povY); - } - - } - - @Override - public JoystickAxis getXAxis() { - return xAxis; - } - - @Override - public JoystickAxis getYAxis() { - return yAxis; - } - - @Override - public JoystickAxis getPovXAxis() { - return povX; - } - - @Override - public JoystickAxis getPovYAxis() { - return povY; - } - - @Override - public int getXAxisIndex(){ - return xAxis.getAxisId(); - } - - @Override - public int getYAxisIndex(){ - return yAxis.getAxisId(); - } - } -} - - - diff --git a/jme3-lwjgl/src/main/java/com/jme3/input/lwjgl/LwjglKeyInput.java b/jme3-lwjgl/src/main/java/com/jme3/input/lwjgl/LwjglKeyInput.java deleted file mode 100644 index e7b9f9268a..0000000000 --- a/jme3-lwjgl/src/main/java/com/jme3/input/lwjgl/LwjglKeyInput.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (c) 2009-2012 jMonkeyEngine - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of 'jMonkeyEngine' nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package com.jme3.input.lwjgl; - -import com.jme3.input.KeyInput; -import com.jme3.input.RawInputListener; -import com.jme3.input.event.KeyInputEvent; -import com.jme3.system.lwjgl.LwjglAbstractDisplay; -import com.jme3.system.lwjgl.LwjglTimer; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.lwjgl.LWJGLException; -import org.lwjgl.Sys; -import org.lwjgl.input.Keyboard; - -public class LwjglKeyInput implements KeyInput { - - private static final Logger logger = Logger.getLogger(LwjglKeyInput.class.getName()); - - private LwjglAbstractDisplay context; - - private RawInputListener listener; - - public LwjglKeyInput(LwjglAbstractDisplay context){ - this.context = context; - } - - public void initialize() { - if (!context.isRenderable()) - return; - - try { - Keyboard.create(); - Keyboard.enableRepeatEvents(true); - logger.fine("Keyboard created."); - } catch (LWJGLException ex) { - logger.log(Level.SEVERE, "Error while creating keyboard.", ex); - } - } - - public int getKeyCount(){ - return Keyboard.KEYBOARD_SIZE; - } - - public void update() { - if (!context.isRenderable()) - return; - - Keyboard.poll(); - while (Keyboard.next()){ - int keyCode = Keyboard.getEventKey(); - char keyChar = Keyboard.getEventCharacter(); - boolean pressed = Keyboard.getEventKeyState(); - boolean down = Keyboard.isRepeatEvent(); - long time = Keyboard.getEventNanoseconds(); - KeyInputEvent evt = new KeyInputEvent(keyCode, keyChar, pressed, down); - evt.setTime(time); - listener.onKeyEvent(evt); - } - } - - public void destroy() { - if (!context.isRenderable()) - return; - - Keyboard.destroy(); - logger.fine("Keyboard destroyed."); - } - - public boolean isInitialized() { - return Keyboard.isCreated(); - } - - public void setInputListener(RawInputListener listener) { - this.listener = listener; - } - - public long getInputTimeNanos() { - return Sys.getTime() * LwjglTimer.LWJGL_TIME_TO_NANOS; - } - -} diff --git a/jme3-lwjgl/src/main/java/com/jme3/input/lwjgl/LwjglMouseInput.java b/jme3-lwjgl/src/main/java/com/jme3/input/lwjgl/LwjglMouseInput.java deleted file mode 100644 index b53d93660b..0000000000 --- a/jme3-lwjgl/src/main/java/com/jme3/input/lwjgl/LwjglMouseInput.java +++ /dev/null @@ -1,222 +0,0 @@ -/* - * Copyright (c) 2009-2018 jMonkeyEngine - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of 'jMonkeyEngine' nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package com.jme3.input.lwjgl; - -import com.jme3.cursors.plugins.JmeCursor; -import com.jme3.input.MouseInput; -import com.jme3.input.RawInputListener; -import com.jme3.input.event.MouseButtonEvent; -import com.jme3.input.event.MouseMotionEvent; -import com.jme3.system.lwjgl.LwjglAbstractDisplay; -import com.jme3.system.lwjgl.LwjglTimer; -import java.util.HashMap; -import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.lwjgl.LWJGLException; -import org.lwjgl.Sys; -import org.lwjgl.input.Cursor; -import org.lwjgl.input.Mouse; - -public class LwjglMouseInput implements MouseInput { - - private static final Logger logger = Logger.getLogger(LwjglMouseInput.class.getName()); - - private LwjglAbstractDisplay context; - - private RawInputListener listener; - - private boolean supportHardwareCursor = false; - private boolean cursorVisible = true; - - /** - * We need to cache the cursors - * (https://github.com/jMonkeyEngine/jmonkeyengine/issues/537) - */ - private Map cursorMap = new HashMap(); - - private int curX, curY, curWheel; - - public LwjglMouseInput(LwjglAbstractDisplay context){ - this.context = context; - } - - public void initialize() { - if (!context.isRenderable()) - return; - - try { - Mouse.create(); - logger.fine("Mouse created."); - supportHardwareCursor = (Cursor.getCapabilities() & Cursor.CURSOR_ONE_BIT_TRANSPARENCY) != 0; - - // Recall state that was set before initialization - Mouse.setGrabbed(!cursorVisible); - } catch (LWJGLException ex) { - logger.log(Level.SEVERE, "Error while creating mouse", ex); - } - - if (listener != null) { - sendFirstMouseEvent(); - } - } - - public boolean isInitialized(){ - return Mouse.isCreated(); - } - - public int getButtonCount(){ - return Mouse.getButtonCount(); - } - - public void update() { - if (!context.isRenderable()) - return; - - while (Mouse.next()){ - int btn = Mouse.getEventButton(); - - int wheelDelta = Mouse.getEventDWheel(); - int xDelta = Mouse.getEventDX(); - int yDelta = Mouse.getEventDY(); - int x = Mouse.getX(); - int y = Mouse.getY(); - - curWheel += wheelDelta; - if (cursorVisible){ - xDelta = x - curX; - yDelta = y - curY; - curX = x; - curY = y; - }else{ - x = curX + xDelta; - y = curY + yDelta; - curX = x; - curY = y; - } - - if (xDelta != 0 || yDelta != 0 || wheelDelta != 0){ - MouseMotionEvent evt = new MouseMotionEvent(x, y, xDelta, yDelta, curWheel, wheelDelta); - evt.setTime(Mouse.getEventNanoseconds()); - listener.onMouseMotionEvent(evt); - } - if (btn != -1){ - MouseButtonEvent evt = new MouseButtonEvent(btn, - Mouse.getEventButtonState(), x, y); - evt.setTime(Mouse.getEventNanoseconds()); - listener.onMouseButtonEvent(evt); - } - } - } - - public void destroy() { - if (!context.isRenderable()) - return; - - Mouse.destroy(); - - // Destroy the cursor cache - for (Cursor cursor : cursorMap.values()) { - cursor.destroy(); - } - cursorMap.clear(); - - logger.fine("Mouse destroyed."); - } - - public void setCursorVisible(boolean visible){ - cursorVisible = visible; - if (!context.isRenderable()) - return; - - Mouse.setGrabbed(!visible); - } - - @Override - public void setInputListener(RawInputListener listener) { - this.listener = listener; - if (listener != null && Mouse.isCreated()) { - sendFirstMouseEvent(); - } - } - - /** - * Send the input listener a special mouse-motion event with zero deltas in - * order to initialize the listener's cursor position. - */ - private void sendFirstMouseEvent() { - assert listener != null; - assert Mouse.isCreated(); - - int x = Mouse.getX(); - int y = Mouse.getY(); - int xDelta = 0; - int yDelta = 0; - int wheelDelta = 0; - MouseMotionEvent evt = new MouseMotionEvent(x, y, xDelta, yDelta, - curWheel, wheelDelta); - evt.setTime(Mouse.getEventNanoseconds()); - - listener.onMouseMotionEvent(evt); - } - - public long getInputTimeNanos() { - return Sys.getTime() * LwjglTimer.LWJGL_TIME_TO_NANOS; - } - - public void setNativeCursor(JmeCursor jmeCursor) { - try { - Cursor newCursor = null; - if (jmeCursor != null) { - newCursor = cursorMap.get(jmeCursor); - if (newCursor == null) { - newCursor = new Cursor( - jmeCursor.getWidth(), - jmeCursor.getHeight(), - jmeCursor.getXHotSpot(), - jmeCursor.getYHotSpot(), - jmeCursor.getNumImages(), - jmeCursor.getImagesData(), - jmeCursor.getImagesDelay()); - - // Add to cache - cursorMap.put(jmeCursor, newCursor); - } - } - Mouse.setNativeCursor(newCursor); - } catch (LWJGLException ex) { - Logger.getLogger(LwjglMouseInput.class.getName()).log(Level.SEVERE, null, ex); - } - } - -} diff --git a/jme3-lwjgl/src/main/java/com/jme3/opencl/lwjgl/LwjglBuffer.java b/jme3-lwjgl/src/main/java/com/jme3/opencl/lwjgl/LwjglBuffer.java deleted file mode 100644 index cd6cdeb271..0000000000 --- a/jme3-lwjgl/src/main/java/com/jme3/opencl/lwjgl/LwjglBuffer.java +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Copyright (c) 2009-2016 jMonkeyEngine - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of 'jMonkeyEngine' nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package com.jme3.opencl.lwjgl; - -import com.jme3.opencl.*; -import java.nio.ByteBuffer; -import org.lwjgl.opencl.*; - -/** - * - * @author shaman - */ -public class LwjglBuffer extends Buffer { - - private final CLMem buffer; - - public LwjglBuffer(CLMem buffer) { - super(new ReleaserImpl(buffer)); - this.buffer = buffer; - } - public CLMem getBuffer() { - return buffer; - } - - @Override - public long getSize() { - return buffer.getInfoSize(CL10.CL_MEM_SIZE); - } - - @Override - public MemoryAccess getMemoryAccessFlags() { - return Utils.getMemoryAccessFromFlag(buffer.getInfoLong(CL10.CL_MEM_FLAGS)); - } - - @Override - public void read(CommandQueue queue, ByteBuffer dest, long size, long offset) { - //Note: LWJGL does not support the size parameter, I have to set the buffer limit - dest.limit((int) (dest.position() + size)); - int ret = CL10.clEnqueueReadBuffer(((LwjglCommandQueue)queue).getQueue(), - buffer, CL10.CL_TRUE, offset, dest, null, null); - Utils.checkError(ret, "clEnqueueReadBuffer"); - } - - @Override - public Event readAsync(CommandQueue queue, ByteBuffer dest, long size, long offset) { - //Note: LWJGL does not support the size parameter, I have to set the buffer limit - dest.limit((int) (dest.position() + size)); - Utils.pointerBuffers[0].rewind(); - CLCommandQueue q = ((LwjglCommandQueue)queue).getQueue(); - int ret = CL10.clEnqueueReadBuffer(q, buffer, CL10.CL_FALSE, offset, dest, null, Utils.pointerBuffers[0]); - Utils.checkError(ret, "clEnqueueReadBuffer"); - long event = Utils.pointerBuffers[0].get(0); - return new LwjglEvent(q.getCLEvent(event)); - } - - @Override - public void write(CommandQueue queue, ByteBuffer src, long size, long offset) { - //Note: LWJGL does not support the size parameter, I have to set the buffer limit - src.limit((int) (src.position() + size)); - CLCommandQueue q = ((LwjglCommandQueue)queue).getQueue(); - int ret = CL10.clEnqueueWriteBuffer(q, buffer, CL10.CL_TRUE, offset, src, null, null); - Utils.checkError(ret, "clEnqueueWriteBuffer"); - } - - @Override - public Event writeAsync(CommandQueue queue, ByteBuffer src, long size, long offset) { - //Note: LWJGL does not support the size parameter, I have to set the buffer limit - src.limit((int) (src.position() + size)); - Utils.pointerBuffers[0].rewind(); - CLCommandQueue q = ((LwjglCommandQueue)queue).getQueue(); - int ret = CL10.clEnqueueWriteBuffer(q, buffer, CL10.CL_FALSE, offset, src, null, Utils.pointerBuffers[0]); - Utils.checkError(ret, "clEnqueueWriteBuffer"); - long event = Utils.pointerBuffers[0].get(0); - return new LwjglEvent(q.getCLEvent(event)); - } - - @Override - public void copyTo(CommandQueue queue, Buffer dest, long size, long srcOffset, long destOffset) { - CLCommandQueue q = ((LwjglCommandQueue)queue).getQueue(); - Utils.pointerBuffers[0].rewind(); - int ret = CL10.clEnqueueCopyBuffer(q, buffer, ((LwjglBuffer) dest).buffer, srcOffset, destOffset, size, null, Utils.pointerBuffers[0]); - Utils.checkError(ret, "clEnqueueCopyBuffer"); - long event = Utils.pointerBuffers[0].get(0); - ret = CL10.clWaitForEvents(q.getCLEvent(event)); - Utils.checkError(ret, "clWaitForEvents"); - } - - @Override - public Event copyToAsync(CommandQueue queue, Buffer dest, long size, long srcOffset, long destOffset) { - CLCommandQueue q = ((LwjglCommandQueue)queue).getQueue(); - Utils.pointerBuffers[0].rewind(); - int ret = CL10.clEnqueueCopyBuffer(q, buffer, ((LwjglBuffer) dest).buffer, srcOffset, destOffset, size, null, Utils.pointerBuffers[0]); - Utils.checkError(ret, "clEnqueueCopyBuffer"); - long event = Utils.pointerBuffers[0].get(0); - return new LwjglEvent(q.getCLEvent(event)); - } - - @Override - public ByteBuffer map(CommandQueue queue, long size, long offset, MappingAccess access) { - CLCommandQueue q = ((LwjglCommandQueue) queue).getQueue(); - long flags = Utils.getMappingAccessFlags(access); - Utils.errorBuffer.rewind(); - ByteBuffer b = CL10.clEnqueueMapBuffer(q, buffer, CL10.CL_TRUE, flags, offset, size, null, null, Utils.errorBuffer); - Utils.checkError(Utils.errorBuffer, "clEnqueueMapBuffer"); - return b; - } - - @Override - public void unmap(CommandQueue queue, ByteBuffer ptr) { - ptr.position(0); - CLCommandQueue q = ((LwjglCommandQueue) queue).getQueue(); - Utils.pointerBuffers[0].rewind(); - int ret = CL10.clEnqueueUnmapMemObject(q, buffer, ptr, null, Utils.pointerBuffers[0]); - Utils.checkError(ret, "clEnqueueUnmapMemObject"); - long event = Utils.pointerBuffers[0].get(0); - ret = CL10.clWaitForEvents(q.getCLEvent(event)); - Utils.checkError(ret, "clWaitForEvents"); - } - - @Override - public com.jme3.opencl.Buffer.AsyncMapping mapAsync(CommandQueue queue, long size, long offset, MappingAccess access) { - Utils.pointerBuffers[0].rewind(); - Utils.errorBuffer.rewind(); - CLCommandQueue q = ((LwjglCommandQueue) queue).getQueue(); - long flags = Utils.getMappingAccessFlags(access); - ByteBuffer buf = CL10.clEnqueueMapBuffer(q, buffer, CL10.CL_FALSE, flags, offset, size, null, Utils.pointerBuffers[0], Utils.errorBuffer); - Utils.checkError(Utils.errorBuffer, "clEnqueueMapBuffer"); - long event = Utils.pointerBuffers[0].get(0); - return new com.jme3.opencl.Buffer.AsyncMapping(new LwjglEvent(q.getCLEvent(event)), buf); - } - - @Override - public Event fillAsync(CommandQueue queue, ByteBuffer pattern, long size, long offset) { - Utils.pointerBuffers[0].rewind(); - CLCommandQueue q = ((LwjglCommandQueue) queue).getQueue(); - int ret = CL12.clEnqueueFillBuffer(q, buffer, pattern, offset, size, null, Utils.pointerBuffers[0]); - Utils.checkError(ret, "clEnqueueFillBuffer"); - long event = Utils.pointerBuffers[0].get(0); - return new LwjglEvent(q.getCLEvent(event)); - } - - @Override - public Event copyToImageAsync(CommandQueue queue, Image dest, long srcOffset, long[] destOrigin, long[] destRegion) { - if (destOrigin.length!=3 || destRegion.length!=3) { - throw new IllegalArgumentException("origin and region must both be arrays of length 3"); - } - Utils.pointerBuffers[0].rewind(); - Utils.pointerBuffers[1].rewind(); - Utils.pointerBuffers[2].rewind(); - Utils.pointerBuffers[1].put(destOrigin).position(0); - Utils.pointerBuffers[2].put(destRegion).position(0); - CLCommandQueue q = ((LwjglCommandQueue) queue).getQueue(); - int ret = CL10.clEnqueueCopyBufferToImage(q, buffer, ((LwjglImage) dest).getImage(), - srcOffset, Utils.pointerBuffers[1], Utils.pointerBuffers[2], null, Utils.pointerBuffers[0]); - Utils.checkError(ret, "clEnqueueCopyBufferToImage"); - long event = Utils.pointerBuffers[0].get(0); - return new LwjglEvent(q.getCLEvent(event)); - } - - @Override - public Event acquireBufferForSharingAsync(CommandQueue queue) { - Utils.pointerBuffers[0].rewind(); - CLCommandQueue q = ((LwjglCommandQueue) queue).getQueue(); - int ret = CL10GL.clEnqueueAcquireGLObjects(q, buffer, null, Utils.pointerBuffers[0]); - Utils.checkError(ret, "clEnqueueAcquireGLObjects"); - long event = Utils.pointerBuffers[0].get(0); - return new LwjglEvent(q.getCLEvent(event)); - } - @Override - public void acquireBufferForSharingNoEvent(CommandQueue queue) { - CLCommandQueue q = ((LwjglCommandQueue) queue).getQueue(); - int ret = CL10GL.clEnqueueAcquireGLObjects(q, buffer, null, null); - Utils.checkError(ret, "clEnqueueAcquireGLObjects"); - } - - @Override - public Event releaseBufferForSharingAsync(CommandQueue queue) { - Utils.pointerBuffers[0].rewind(); - CLCommandQueue q = ((LwjglCommandQueue) queue).getQueue(); - int ret = CL10GL.clEnqueueReleaseGLObjects(q, buffer, null, Utils.pointerBuffers[0]); - Utils.checkError(ret, "clEnqueueReleaseGLObjects"); - long event = Utils.pointerBuffers[0].get(0); - return new LwjglEvent(q.getCLEvent(event)); - } - @Override - public void releaseBufferForSharingNoEvent(CommandQueue queue) { - CLCommandQueue q = ((LwjglCommandQueue) queue).getQueue(); - int ret = CL10GL.clEnqueueReleaseGLObjects(q, buffer, null, null); - Utils.checkError(ret, "clEnqueueReleaseGLObjects"); - } - - private static class ReleaserImpl implements ObjectReleaser { - private CLMem mem; - private ReleaserImpl(CLMem mem) { - this.mem = mem; - } - @Override - public void release() { - if (mem != null) { - int ret = CL10.clReleaseMemObject(mem); - mem = null; - Utils.reportError(ret, "clReleaseMemObject"); - } - } - - } -} diff --git a/jme3-lwjgl/src/main/java/com/jme3/opencl/lwjgl/LwjglCommandQueue.java b/jme3-lwjgl/src/main/java/com/jme3/opencl/lwjgl/LwjglCommandQueue.java deleted file mode 100644 index 28c8676202..0000000000 --- a/jme3-lwjgl/src/main/java/com/jme3/opencl/lwjgl/LwjglCommandQueue.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2009-2016 jMonkeyEngine - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of 'jMonkeyEngine' nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package com.jme3.opencl.lwjgl; - -import com.jme3.opencl.CommandQueue; -import com.jme3.opencl.Device; -import com.jme3.opencl.OpenCLObjectManager; -import org.lwjgl.opencl.CL10; -import org.lwjgl.opencl.CLCommandQueue; - -/** - * - * @author shaman - */ -public class LwjglCommandQueue extends CommandQueue { - - private final CLCommandQueue queue; - - public LwjglCommandQueue(CLCommandQueue queue, Device device) { - super(new ReleaserImpl(queue), device); - this.queue = queue; - } - - public CLCommandQueue getQueue() { - return queue; - } - - @Override - public void flush() { - int ret = CL10.clFlush(queue); - Utils.checkError(ret, "clFlush"); - } - - @Override - public void finish() { - int ret = CL10.clFinish(queue); - Utils.checkError(ret, "clFinish"); - } - - private static class ReleaserImpl implements ObjectReleaser { - private CLCommandQueue queue; - private ReleaserImpl(CLCommandQueue queue) { - this.queue = queue; - } - @Override - public void release() { - if (queue != null) { - int ret = CL10.clReleaseCommandQueue(queue); - queue = null; - Utils.reportError(ret, "clReleaseCommandQueue"); - } - } - } -} diff --git a/jme3-lwjgl/src/main/java/com/jme3/opencl/lwjgl/LwjglContext.java b/jme3-lwjgl/src/main/java/com/jme3/opencl/lwjgl/LwjglContext.java deleted file mode 100644 index 96b34eb101..0000000000 --- a/jme3-lwjgl/src/main/java/com/jme3/opencl/lwjgl/LwjglContext.java +++ /dev/null @@ -1,240 +0,0 @@ -/* - * Copyright (c) 2009-2016 jMonkeyEngine - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of 'jMonkeyEngine' nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package com.jme3.opencl.lwjgl; - -import com.jme3.opencl.*; -import com.jme3.opencl.Context; -import com.jme3.opencl.Image.ImageDescriptor; -import com.jme3.opencl.Image.ImageFormat; -import com.jme3.scene.VertexBuffer; -import com.jme3.texture.FrameBuffer; -import com.jme3.texture.Texture; -import java.nio.ByteBuffer; -import java.nio.IntBuffer; -import java.util.List; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.lwjgl.BufferUtils; -import org.lwjgl.opencl.*; -import org.lwjgl.opengl.*; - -/** - * - * @author shaman - */ -public class LwjglContext extends Context { - private static final Logger LOG = Logger.getLogger(LwjglContext.class.getName()); - private final CLContext context; - private final List devices; - - public LwjglContext(CLContext context, List devices) { - super(new ReleaserImpl(context, devices)); - this.context = context; - this.devices = devices; - } - - public CLContext getContext() { - return context; - } - - @Override - public List getDevices() { - return devices; - } - - @Override - @SuppressWarnings("element-type-mismatch") - public CommandQueue createQueue(Device device) { - assert (devices.contains(device)); //this also ensures that device is a LwjglDevice - CLDevice d = ((LwjglDevice) device).getDevice(); - long properties = 0; - CLCommandQueue q = CL10.clCreateCommandQueue(context, d, properties, Utils.errorBuffer); - Utils.checkError(Utils.errorBuffer, "clCreateCommandQueue"); - return new LwjglCommandQueue(q, device); - } - - @Override - public Buffer createBuffer(long size, MemoryAccess access) { - long flags = Utils.getMemoryAccessFlags(access); - CLMem mem = CL10.clCreateBuffer(context, flags, size, Utils.errorBuffer); - Utils.checkError(Utils.errorBuffer, "clCreateBuffer"); - return new LwjglBuffer(mem); - } - - @Override - public Buffer createBufferFromHost(ByteBuffer data, MemoryAccess access) { - long flags = Utils.getMemoryAccessFlags(access); - flags |= CL10.CL_MEM_USE_HOST_PTR; - CLMem mem = CL10.clCreateBuffer(context, flags, data, Utils.errorBuffer); - Utils.checkError(Utils.errorBuffer, "clCreateBuffer"); - return new LwjglBuffer(mem); - } - - @Override - public Image createImage(MemoryAccess access, ImageFormat format, ImageDescriptor descr) { - long memFlags = Utils.getMemoryAccessFlags(access); - Utils.errorBuffer.rewind(); - //fill image format - Utils.tempBuffers[0].b16i.rewind(); - Utils.tempBuffers[0].b16i.put(LwjglImage.decodeImageChannelOrder(format.channelOrder)) - .put(LwjglImage.decodeImageChannelType(format.channelType)); - Utils.tempBuffers[0].b16.rewind(); - //fill image desc - Utils.b80l.rewind(); - Utils.b80l.put(LwjglImage.decodeImageType(descr.type)) - .put(descr.width).put(descr.height).put(descr.depth) - .put(descr.arraySize).put(descr.rowPitch).put(descr.slicePitch) - .put(0).put(0).put(0); - Utils.b80.rewind(); - //create image - CLMem mem = CL12.clCreateImage(context, memFlags, Utils.tempBuffers[0].b16, Utils.b80, descr.hostPtr, Utils.errorBuffer); - Utils.checkError(Utils.errorBuffer, "clCreateImage"); - return new LwjglImage(mem); - } - - @Override - public ImageFormat[] querySupportedFormats(MemoryAccess access, Image.ImageType type) { - long memFlags = Utils.getMemoryAccessFlags(access); - int typeFlag = LwjglImage.decodeImageType(type); - Utils.tempBuffers[0].b16i.rewind(); - //query count - int ret = CL10.clGetSupportedImageFormats(context, memFlags, typeFlag, null, Utils.tempBuffers[0].b16i); - Utils.checkError(ret, "clGetSupportedImageFormats"); - int count = Utils.tempBuffers[0].b16i.get(0); - if (count == 0) { - return new ImageFormat[0]; - } - //get formats - ByteBuffer formatsB = BufferUtils.createByteBuffer(count * 8); - ret = CL10.clGetSupportedImageFormats(context, memFlags, typeFlag, formatsB, null); - Utils.checkError(ret, "clGetSupportedImageFormats"); - //convert formats - ImageFormat[] formats = new ImageFormat[count]; - IntBuffer formatsBi = formatsB.asIntBuffer(); - formatsBi.rewind(); - for (int i=0; i devices; - private ReleaserImpl(CLContext mem, List devices) { - this.context = mem; - this.devices = devices; - } - @Override - public void release() { - if (context != null) { - int ret = CL10.clReleaseContext(context); - context = null; - devices.clear(); - Utils.reportError(ret, "clReleaseMemObject"); - } - } - - } -} diff --git a/jme3-lwjgl/src/main/java/com/jme3/opencl/lwjgl/LwjglDevice.java b/jme3-lwjgl/src/main/java/com/jme3/opencl/lwjgl/LwjglDevice.java deleted file mode 100644 index 7811e3a004..0000000000 --- a/jme3-lwjgl/src/main/java/com/jme3/opencl/lwjgl/LwjglDevice.java +++ /dev/null @@ -1,293 +0,0 @@ -/* - * Copyright (c) 2009-2016 jMonkeyEngine - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of 'jMonkeyEngine' nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package com.jme3.opencl.lwjgl; - -import com.jme3.opencl.Device; -import com.jme3.opencl.Platform; -import java.util.Arrays; -import java.util.Collection; -import org.lwjgl.opencl.CL10; -import org.lwjgl.opencl.CL11; -import org.lwjgl.opencl.CLDevice; - -/** - * - * @author shaman - */ -public final class LwjglDevice implements Device { - - final CLDevice device; - final LwjglPlatform platform; - - public LwjglDevice(CLDevice device, LwjglPlatform platform) { - this.device = device; - this.platform = platform; - } - - public CLDevice getDevice() { - return device; - } - - @Override - public LwjglPlatform getPlatform() { - return platform; - } - - @Override - public DeviceType getDeviceType() { - int type = device.getInfoInt(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; - } - } - - @Override - public int getVendorId() { - return device.getInfoInt(CL10.CL_DEVICE_VENDOR_ID); - } - - @Override - public boolean isAvailable() { - return device.getInfoBoolean(CL10.CL_DEVICE_AVAILABLE); - } - - @Override - public boolean hasCompiler() { - return device.getInfoBoolean(CL10.CL_DEVICE_COMPILER_AVAILABLE); - } - - @Override - public boolean hasDouble() { - return hasExtension("cl_khr_fp64"); - } - - @Override - public boolean hasHalfFloat() { - return hasExtension("cl_khr_fp16"); - } - - @Override - public boolean hasErrorCorrectingMemory() { - return device.getInfoBoolean(CL10.CL_DEVICE_ERROR_CORRECTION_SUPPORT); - } - - @Override - public boolean hasUnifiedMemory() { - return device.getInfoBoolean(CL11.CL_DEVICE_HOST_UNIFIED_MEMORY); - } - - @Override - public boolean hasImageSupport() { - return device.getInfoBoolean(CL10.CL_DEVICE_IMAGE_SUPPORT); - } - - @Override - public boolean hasWritableImage3D() { - return hasExtension("cl_khr_3d_image_writes"); - } - - @Override - public boolean hasOpenGLInterop() { - return hasExtension("cl_khr_gl_sharing"); - } - - @Override - public boolean hasExtension(String extension) { - return getExtensions().contains(extension); - } - - @Override - public Collection getExtensions() { - return Arrays.asList(device.getInfoString(CL10.CL_DEVICE_EXTENSIONS).split(" ")); - } - - @Override - public int getComputeUnits() { - return device.getInfoInt(CL10.CL_DEVICE_MAX_COMPUTE_UNITS); - } - - @Override - public int getClockFrequency() { - return device.getInfoInt(CL10.CL_DEVICE_MAX_CLOCK_FREQUENCY); - } - - @Override - public int getAddressBits() { - return device.getInfoInt(CL10.CL_DEVICE_ADDRESS_BITS); - } - - @Override - public boolean isLittleEndian() { - return device.getInfoBoolean(CL10.CL_DEVICE_ENDIAN_LITTLE); - } - - @Override - public long getMaximumWorkItemDimensions() { - return device.getInfoSize(CL10.CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS); - } - - @Override - public long[] getMaximumWorkItemSizes() { - return device.getInfoSizeArray(CL10.CL_DEVICE_MAX_WORK_ITEM_SIZES); - } - - @Override - public long getMaxiumWorkItemsPerGroup() { - return device.getInfoSize(CL10.CL_DEVICE_MAX_WORK_GROUP_SIZE); - } - - @Override - public int getMaximumSamplers() { - return device.getInfoInt(CL10.CL_DEVICE_MAX_SAMPLERS); - } - - @Override - public int getMaximumReadImages() { - return device.getInfoInt(CL10.CL_DEVICE_MAX_READ_IMAGE_ARGS); - } - - @Override - public int getMaximumWriteImages() { - return device.getInfoInt(CL10.CL_DEVICE_MAX_WRITE_IMAGE_ARGS); - } - - @Override - public long[] getMaximumImage2DSize() { - return new long[] { - device.getInfoSize(CL10.CL_DEVICE_IMAGE2D_MAX_WIDTH), - device.getInfoSize(CL10.CL_DEVICE_IMAGE2D_MAX_HEIGHT) - }; - } - - @Override - public long[] getMaximumImage3DSize() { - return new long[] { - device.getInfoSize(CL10.CL_DEVICE_IMAGE3D_MAX_WIDTH), - device.getInfoSize(CL10.CL_DEVICE_IMAGE3D_MAX_HEIGHT), - device.getInfoSize(CL10.CL_DEVICE_IMAGE3D_MAX_DEPTH) - }; - } - - @Override - public long getMaximumAllocationSize() { - return device.getInfoLong(CL10.CL_DEVICE_MAX_MEM_ALLOC_SIZE); - } - - @Override - public long getGlobalMemorySize() { - return device.getInfoLong(CL10.CL_DEVICE_GLOBAL_MEM_SIZE); - } - - @Override - public long getLocalMemorySize() { - return device.getInfoLong(CL10.CL_DEVICE_LOCAL_MEM_SIZE); - } - - @Override - public long getMaximumConstantBufferSize() { - return device.getInfoLong(CL10.CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE); - } - - @Override - public int getMaximumConstantArguments() { - return device.getInfoInt(CL10.CL_DEVICE_MAX_CONSTANT_ARGS); - } - - @Override - public String getProfile() { - return device.getInfoString(CL10.CL_DEVICE_PROFILE); - } - - @Override - public String getVersion() { - return device.getInfoString(CL10.CL_DEVICE_VERSION); - } - - @Override - public int getVersionMajor() { - return Utils.getMajorVersion(getVersion(), "OpenCL "); - } - - @Override - public int getVersionMinor() { - return Utils.getMinorVersion(getVersion(), "OpenCL "); - } - - @Override - public String getCompilerVersion() { - return device.getInfoString(CL11.CL_DEVICE_OPENCL_C_VERSION); - } - - @Override - public int getCompilerVersionMajor() { - return Utils.getMajorVersion(getCompilerVersion(), "OpenCL C "); - } - - @Override - public int getCompilerVersionMinor() { - return Utils.getMinorVersion(getCompilerVersion(), "OpenCL C "); - } - - @Override - public String getDriverVersion() { - return device.getInfoString(CL10.CL_DRIVER_VERSION); - } - - @Override - public int getDriverVersionMajor() { - return Utils.getMajorVersion(getDriverVersion(), ""); - } - - @Override - public int getDriverVersionMinor() { - return Utils.getMinorVersion(getDriverVersion(), ""); - } - - @Override - public String getName() { - return device.getInfoString(CL10.CL_DEVICE_NAME); - } - - @Override - public String getVendor() { - return device.getInfoString(CL10.CL_DEVICE_VENDOR); - } - - @Override - public String toString() { - return getName(); - } - -} diff --git a/jme3-lwjgl/src/main/java/com/jme3/opencl/lwjgl/LwjglEvent.java b/jme3-lwjgl/src/main/java/com/jme3/opencl/lwjgl/LwjglEvent.java deleted file mode 100644 index b7f992c95d..0000000000 --- a/jme3-lwjgl/src/main/java/com/jme3/opencl/lwjgl/LwjglEvent.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) 2009-2016 jMonkeyEngine - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of 'jMonkeyEngine' nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package com.jme3.opencl.lwjgl; - -import com.jme3.opencl.Event; -import java.util.logging.Logger; -import org.lwjgl.opencl.CL10; -import org.lwjgl.opencl.CLEvent; - -/** - * - * @author shaman - */ -public class LwjglEvent extends Event { - private static final Logger LOG = Logger.getLogger(LwjglEvent.class.getName()); - private CLEvent event; - - public LwjglEvent(CLEvent event) { - super(new ReleaserImpl(event)); - this.event = event; - } - - public CLEvent getEvent() { - return event; - } - - @Override - public void waitForFinished() { - if (event==null) { - return; - } - CL10.clWaitForEvents(event); - release(); //short cut to save resources - } - - @Override - public boolean isCompleted() { - if (event==null) { - return true; - } - int status = event.getInfoInt(CL10.CL_EVENT_COMMAND_EXECUTION_STATUS); - if (status == CL10.CL_SUCCESS) { - release(); //short cut to save resources - return true; - } else if (status < 0) { - Utils.checkError(status, "EventStatus"); - return false; - } else { - return false; - } - } - - private static class ReleaserImpl implements ObjectReleaser { - private CLEvent event; - - private ReleaserImpl(CLEvent event) { - this.event = event; - } - - @Override - public void release() { - if (event != null && event.isValid()) { - int ret = CL10.clReleaseEvent(event); - event = null; - Utils.reportError(ret, "clReleaseEvent"); - LOG.finer("Event deleted"); - } - } - - } -} diff --git a/jme3-lwjgl/src/main/java/com/jme3/opencl/lwjgl/LwjglImage.java b/jme3-lwjgl/src/main/java/com/jme3/opencl/lwjgl/LwjglImage.java deleted file mode 100644 index e41f69fe74..0000000000 --- a/jme3-lwjgl/src/main/java/com/jme3/opencl/lwjgl/LwjglImage.java +++ /dev/null @@ -1,575 +0,0 @@ -/* - * Copyright (c) 2009-2016 jMonkeyEngine - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of 'jMonkeyEngine' nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package com.jme3.opencl.lwjgl; - -import com.jme3.math.ColorRGBA; -import com.jme3.opencl.*; -import java.nio.ByteBuffer; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.lwjgl.opencl.*; -import org.lwjgl.opencl.api.CLImageFormat; - -/** - * - * @author shaman - */ -public class LwjglImage extends Image { - private static final Logger LOG = Logger.getLogger(LwjglImage.class.getName()); - - private final CLMem image; - - public LwjglImage(CLMem image) { - super(new ReleaserImpl(image)); - this.image = image; - } - - public CLMem getImage() { - return image; - } - - public static int decodeImageChannelOrder(ImageChannelOrder order) { - switch (order) { - case A: - return CL10.CL_A; - case ARGB: - return CL10.CL_ARGB; - case BGRA: - return CL10.CL_BGRA; - case INTENSITY: - return CL10.CL_INTENSITY; - case LUMINANCE: - return CL10.CL_LUMINANCE; - case R: - return CL10.CL_R; - case RA: - return CL10.CL_RA; - case RG: - return CL10.CL_RG; - case RGB: - return CL10.CL_RGB; - case RGBA: - return CL10.CL_RGBA; - case RGBx: - return CL11.CL_RGBx; - case RGx: - return CL11.CL_RGx; - case Rx: - return CL11.CL_Rx; - default: - throw new IllegalArgumentException("unknown image channel order: " + order); - } - } - - public static ImageChannelOrder encodeImageChannelOrder(int order) { - switch (order) { - case CL10.CL_A: - return ImageChannelOrder.A; - case CL10.CL_ARGB: - return ImageChannelOrder.ARGB; - case CL10.CL_BGRA: - return ImageChannelOrder.BGRA; - case CL10.CL_INTENSITY: - return ImageChannelOrder.INTENSITY; - case CL10.CL_LUMINANCE: - return ImageChannelOrder.LUMINANCE; - case CL10.CL_R: - return ImageChannelOrder.R; - case CL10.CL_RA: - return ImageChannelOrder.RA; - case CL10.CL_RG: - return ImageChannelOrder.RG; - case CL10.CL_RGB: - return ImageChannelOrder.RGB; - case CL10.CL_RGBA: - return ImageChannelOrder.RGBA; - case CL11.CL_RGBx: - return ImageChannelOrder.RGBx; - case CL11.CL_RGx: - return ImageChannelOrder.RGx; - case CL11.CL_Rx: - return ImageChannelOrder.Rx; - default: - //throw new com.jme3.opencl.OpenCLException("unknown image channel order id: " + order); - LOG.log(Level.WARNING, "Unknown image channel order id: {0}", order); - return null; - } - } - - public static int decodeImageChannelType(ImageChannelType type) { - switch (type) { - case FLOAT: - return CL10.CL_FLOAT; - case HALF_FLOAT: - return CL10.CL_HALF_FLOAT; - case SIGNED_INT16: - return CL10.CL_SIGNED_INT16; - case SIGNED_INT32: - return CL10.CL_SIGNED_INT32; - case SIGNED_INT8: - return CL10.CL_SIGNED_INT8; - case SNORM_INT16: - return CL10.CL_SNORM_INT16; - case SNORM_INT8: - return CL10.CL_SNORM_INT8; - case UNORM_INT8: - return CL10.CL_UNORM_INT8; - case UNORM_INT_101010: - return CL10.CL_UNORM_INT_101010; - case UNORM_INT16: - return CL10.CL_UNORM_INT16; - case UNORM_SHORT_565: - return CL10.CL_UNORM_SHORT_565; - case UNORM_SHORT_555: - return CL10.CL_UNORM_SHORT_555; - case UNSIGNED_INT16: - return CL10.CL_UNSIGNED_INT16; - case UNSIGNED_INT32: - return CL10.CL_UNSIGNED_INT32; - case UNSIGNED_INT8: - return CL10.CL_UNSIGNED_INT8; - default: - throw new IllegalArgumentException("Unknown image channel type: " + type); - } - } - - public static ImageChannelType encodeImageChannelType(int type) { - switch (type) { - case CL10.CL_FLOAT: - return ImageChannelType.FLOAT; - case CL10.CL_HALF_FLOAT: - return ImageChannelType.HALF_FLOAT; - case CL10.CL_SIGNED_INT16: - return ImageChannelType.SIGNED_INT16; - case CL10.CL_SIGNED_INT32: - return ImageChannelType.SIGNED_INT32; - case CL10.CL_SIGNED_INT8: - return ImageChannelType.SIGNED_INT8; - case CL10.CL_SNORM_INT16: - return ImageChannelType.SNORM_INT16; - case CL10.CL_SNORM_INT8: - return ImageChannelType.SNORM_INT8; - case CL10.CL_UNORM_INT8: - return ImageChannelType.UNORM_INT8; - case CL10.CL_UNORM_INT16: - return ImageChannelType.UNORM_INT16; - case CL10.CL_UNORM_INT_101010: - return ImageChannelType.UNORM_INT_101010; - case CL10.CL_UNORM_SHORT_555: - return ImageChannelType.UNORM_SHORT_555; - case CL10.CL_UNORM_SHORT_565: - return ImageChannelType.UNORM_SHORT_565; - case CL10.CL_UNSIGNED_INT16: - return ImageChannelType.UNSIGNED_INT16; - case CL10.CL_UNSIGNED_INT32: - return ImageChannelType.UNSIGNED_INT32; - case CL10.CL_UNSIGNED_INT8: - return ImageChannelType.UNSIGNED_INT8; - default: - //throw new com.jme3.opencl.OpenCLException("unknown image channel type id: " + type); - LOG.log(Level.WARNING, "Unknown image channel type id: {0}", type); - return null; - } - } - - public static int decodeImageType(ImageType type) { - switch (type) { - case IMAGE_1D: - return CL12.CL_MEM_OBJECT_IMAGE1D; - case IMAGE_1D_ARRAY: - return CL12.CL_MEM_OBJECT_IMAGE1D_ARRAY; - case IMAGE_1D_BUFFER: - return CL12.CL_MEM_OBJECT_IMAGE1D_BUFFER; - case IMAGE_2D: - return CL10.CL_MEM_OBJECT_IMAGE2D; - case IMAGE_2D_ARRAY: - return CL12.CL_MEM_OBJECT_IMAGE2D_ARRAY; - case IMAGE_3D: - return CL10.CL_MEM_OBJECT_IMAGE3D; - default: - throw new IllegalArgumentException("Unknown image type: " + type); - } - } - - public static ImageType encodeImageType(int type) { - switch (type) { - case CL12.CL_MEM_OBJECT_IMAGE1D: - return ImageType.IMAGE_1D; - case CL12.CL_MEM_OBJECT_IMAGE1D_ARRAY: - return ImageType.IMAGE_1D_ARRAY; - case CL12.CL_MEM_OBJECT_IMAGE1D_BUFFER: - return ImageType.IMAGE_1D_BUFFER; - case CL10.CL_MEM_OBJECT_IMAGE2D: - return ImageType.IMAGE_2D; - case CL12.CL_MEM_OBJECT_IMAGE2D_ARRAY: - return ImageType.IMAGE_2D_ARRAY; - case CL10.CL_MEM_OBJECT_IMAGE3D: - return ImageType.IMAGE_3D; - default: - throw new com.jme3.opencl.OpenCLException("Unknown image type id: " + type); - } - } - - @Override - public long getWidth() { - return image.getImageInfoSize(CL10.CL_IMAGE_WIDTH); - } - - @Override - public long getHeight() { - return image.getImageInfoSize(CL10.CL_IMAGE_HEIGHT); - } - - @Override - public long getDepth() { - return image.getImageInfoSize(CL10.CL_IMAGE_DEPTH); - } - - @Override - public long getRowPitch() { - return image.getImageInfoSize(CL10.CL_IMAGE_ROW_PITCH); - } - - @Override - public long getSlicePitch() { - return image.getImageInfoSize(CL10.CL_IMAGE_SLICE_PITCH); - } - - @Override - public long getArraySize() { - return image.getImageInfoSize(CL12.CL_IMAGE_ARRAY_SIZE); - } - - @Override - public ImageFormat getImageFormat() { - CLImageFormat format = image.getImageFormat(); - return new ImageFormat( - encodeImageChannelOrder(format.getChannelOrder()), - encodeImageChannelType(format.getChannelType())); - } - - @Override - public ImageType getImageType() { - int type = image.getInfoInt(CL10.CL_MEM_TYPE); - return encodeImageType(type); - } - - @Override - public int getElementSize() { - return (int) image.getImageInfoSize(CL10.CL_IMAGE_ELEMENT_SIZE); - } - - @Override - public void readImage(CommandQueue queue, ByteBuffer dest, long[] origin, long[] region, long rowPitch, long slicePitch) { - if (origin.length!=3 || region.length!=3) { - throw new IllegalArgumentException("origin and region must both be arrays of length 3"); - } - Utils.pointerBuffers[1].rewind(); - Utils.pointerBuffers[2].rewind(); - Utils.pointerBuffers[1].put(origin).position(0); - Utils.pointerBuffers[2].put(region).position(0); - CLCommandQueue q = ((LwjglCommandQueue) queue).getQueue(); - int ret = CL10.clEnqueueReadImage(q, image, CL10.CL_TRUE, - Utils.pointerBuffers[1], Utils.pointerBuffers[2], - rowPitch, slicePitch, dest, null, null); - Utils.checkError(ret, "clEnqueueReadImage"); - } - - @Override - public Event readImageAsync(CommandQueue queue, ByteBuffer dest, long[] origin, long[] region, long rowPitch, long slicePitch) { - if (origin.length!=3 || region.length!=3) { - throw new IllegalArgumentException("origin and region must both be arrays of length 3"); - } - Utils.pointerBuffers[0].rewind(); - Utils.pointerBuffers[1].rewind(); - Utils.pointerBuffers[2].rewind(); - Utils.pointerBuffers[1].put(origin).position(0); - Utils.pointerBuffers[2].put(region).position(0); - CLCommandQueue q = ((LwjglCommandQueue) queue).getQueue(); - int ret = CL10.clEnqueueReadImage(q, image, CL10.CL_FALSE, - Utils.pointerBuffers[1], Utils.pointerBuffers[2], - rowPitch, slicePitch, dest, null, Utils.pointerBuffers[0]); - Utils.checkError(ret, "clEnqueueReadImage"); - long event = Utils.pointerBuffers[0].get(0); - return new LwjglEvent(q.getCLEvent(event)); - } - - @Override - public void writeImage(CommandQueue queue, ByteBuffer dest, long[] origin, long[] region, long rowPitch, long slicePitch) { - if (origin.length!=3 || region.length!=3) { - throw new IllegalArgumentException("origin and region must both be arrays of length 3"); - } - Utils.pointerBuffers[1].rewind(); - Utils.pointerBuffers[2].rewind(); - Utils.pointerBuffers[1].put(origin).position(0); - Utils.pointerBuffers[2].put(region).position(0); - CLCommandQueue q = ((LwjglCommandQueue) queue).getQueue(); - int ret = CL10.clEnqueueWriteImage(q, image, CL10.CL_TRUE, - Utils.pointerBuffers[1], Utils.pointerBuffers[2], - rowPitch, slicePitch, dest, null, null); - Utils.checkError(ret, "clEnqueueWriteImage"); - } - - @Override - public Event writeImageAsync(CommandQueue queue, ByteBuffer dest, long[] origin, long[] region, long rowPitch, long slicePitch) { - if (origin.length!=3 || region.length!=3) { - throw new IllegalArgumentException("origin and region must both be arrays of length 3"); - } - Utils.pointerBuffers[0].rewind(); - Utils.pointerBuffers[1].rewind(); - Utils.pointerBuffers[2].rewind(); - Utils.pointerBuffers[1].put(origin).position(0); - Utils.pointerBuffers[2].put(region).position(0); - CLCommandQueue q = ((LwjglCommandQueue) queue).getQueue(); - int ret = CL10.clEnqueueWriteImage(q, image, CL10.CL_FALSE, - Utils.pointerBuffers[1], Utils.pointerBuffers[2], - rowPitch, slicePitch, dest, null, Utils.pointerBuffers[0]); - Utils.checkError(ret, "clEnqueueWriteImage"); - long event = Utils.pointerBuffers[0].get(0); - return new LwjglEvent(q.getCLEvent(event)); - } - - @Override - public void copyTo(CommandQueue queue, Image dest, long[] srcOrigin, long[] destOrigin, long[] region) { - if (srcOrigin.length!=3 || destOrigin.length!=3 || region.length!=3) { - throw new IllegalArgumentException("origin and region must both be arrays of length 3"); - } - Utils.pointerBuffers[0].rewind(); - Utils.pointerBuffers[1].rewind(); - Utils.pointerBuffers[2].rewind(); - Utils.pointerBuffers[3].rewind(); - Utils.pointerBuffers[1].put(srcOrigin).position(0); - Utils.pointerBuffers[2].put(destOrigin).position(0); - Utils.pointerBuffers[3].put(region).position(0); - CLCommandQueue q = ((LwjglCommandQueue) queue).getQueue(); - int ret = CL10.clEnqueueCopyImage(q, image, ((LwjglImage) dest).getImage(), - Utils.pointerBuffers[1], Utils.pointerBuffers[2], Utils.pointerBuffers[3], - null, Utils.pointerBuffers[0]); - Utils.checkError(ret, "clEnqueueCopyImage"); - long event = Utils.pointerBuffers[0].get(0); - ret = CL10.clWaitForEvents(q.getCLEvent(event)); - Utils.checkError(ret, "clWaitForEvents"); - } - - @Override - public Event copyToAsync(CommandQueue queue, Image dest, long[] srcOrigin, long[] destOrigin, long[] region) { - if (srcOrigin.length!=3 || destOrigin.length!=3 || region.length!=3) { - throw new IllegalArgumentException("origin and region must both be arrays of length 3"); - } - Utils.pointerBuffers[0].rewind(); - Utils.pointerBuffers[1].rewind(); - Utils.pointerBuffers[2].rewind(); - Utils.pointerBuffers[3].rewind(); - Utils.pointerBuffers[1].put(srcOrigin).position(0); - Utils.pointerBuffers[2].put(destOrigin).position(0); - Utils.pointerBuffers[3].put(region).position(0); - CLCommandQueue q = ((LwjglCommandQueue) queue).getQueue(); - int ret = CL10.clEnqueueCopyImage(q, image, ((LwjglImage) dest).getImage(), - Utils.pointerBuffers[1], Utils.pointerBuffers[2], Utils.pointerBuffers[3], - null, Utils.pointerBuffers[0]); - Utils.checkError(ret, "clEnqueueCopyImage"); - long event = Utils.pointerBuffers[0].get(0); - return new LwjglEvent(q.getCLEvent(event)); - } - - @Override - public ImageMapping map(CommandQueue queue, long[] origin, long[] region, MappingAccess access) { - if (origin.length!=3 || region.length!=3) { - throw new IllegalArgumentException("origin and region must both be arrays of length 3"); - } - Utils.pointerBuffers[1].rewind(); - Utils.pointerBuffers[2].rewind(); - Utils.pointerBuffers[3].rewind(); - Utils.pointerBuffers[4].rewind(); - Utils.pointerBuffers[1].put(origin).position(0); - Utils.pointerBuffers[2].put(region).position(0); - CLCommandQueue q = ((LwjglCommandQueue) queue).getQueue(); - long flags = Utils.getMappingAccessFlags(access); - Utils.errorBuffer.rewind(); - ByteBuffer buf = CL10.clEnqueueMapImage(q, image, CL10.CL_TRUE, flags, - Utils.pointerBuffers[1], Utils.pointerBuffers[2], - Utils.pointerBuffers[3], Utils.pointerBuffers[4], null, null, Utils.errorBuffer); - Utils.checkError(Utils.errorBuffer, "clEnqueueMapBuffer"); - return new ImageMapping(buf, Utils.pointerBuffers[3].get(0), Utils.pointerBuffers[4].get(0)); - } - - @Override - public ImageMapping mapAsync(CommandQueue queue, long[] origin, long[] region, MappingAccess access) { - if (origin.length!=3 || region.length!=3) { - throw new IllegalArgumentException("origin and region must both be arrays of length 3"); - } - Utils.pointerBuffers[0].rewind(); - Utils.pointerBuffers[1].rewind(); - Utils.pointerBuffers[2].rewind(); - Utils.pointerBuffers[3].rewind(); - Utils.pointerBuffers[4].rewind(); - Utils.pointerBuffers[1].put(origin).position(0); - Utils.pointerBuffers[2].put(region).position(0); - CLCommandQueue q = ((LwjglCommandQueue) queue).getQueue(); - long flags = Utils.getMappingAccessFlags(access); - Utils.errorBuffer.rewind(); - ByteBuffer buf = CL10.clEnqueueMapImage(q, image, CL10.CL_FALSE, flags, - Utils.pointerBuffers[1], Utils.pointerBuffers[2], - Utils.pointerBuffers[3], Utils.pointerBuffers[4], null, Utils.pointerBuffers[0], Utils.errorBuffer); - Utils.checkError(Utils.errorBuffer, "clEnqueueMapBuffer"); - long event = Utils.pointerBuffers[0].get(0); - return new ImageMapping(buf, Utils.pointerBuffers[3].get(0), Utils.pointerBuffers[4].get(0), new LwjglEvent(q.getCLEvent(event))); - } - - @Override - public void unmap(CommandQueue queue, ImageMapping mapping) { - mapping.buffer.position(0); - CLCommandQueue q = ((LwjglCommandQueue) queue).getQueue(); - Utils.pointerBuffers[0].rewind(); - int ret = CL10.clEnqueueUnmapMemObject(q, image, mapping.buffer, null, Utils.pointerBuffers[0]); - Utils.checkError(ret, "clEnqueueUnmapMemObject"); - long event = Utils.pointerBuffers[0].get(0); - ret = CL10.clWaitForEvents(q.getCLEvent(event)); - Utils.checkError(ret, "clWaitForEvents"); - } - - @Override - public Event fillAsync(CommandQueue queue, long[] origin, long[] region, ColorRGBA color) { - if (origin.length!=3 || region.length!=3) { - throw new IllegalArgumentException("origin and region must both be arrays of length 3"); - } - Utils.pointerBuffers[0].rewind(); - Utils.pointerBuffers[1].rewind(); - Utils.pointerBuffers[2].rewind(); - Utils.pointerBuffers[1].put(origin).position(0); - Utils.pointerBuffers[2].put(region).position(0); - Utils.tempBuffers[0].b16f.rewind(); - Utils.tempBuffers[0].b16f.limit(4); - Utils.tempBuffers[0].b16f.put(color.r).put(color.g).put(color.b).put(color.a); - Utils.tempBuffers[0].b16.rewind(); - CLCommandQueue q = ((LwjglCommandQueue) queue).getQueue(); - int ret = CL12.clEnqueueFillImage(q, image, Utils.tempBuffers[0].b16, - Utils.pointerBuffers[1], Utils.pointerBuffers[2], null, Utils.pointerBuffers[0]); - Utils.checkError(ret, "clEnqueueFillImage"); - long event = Utils.pointerBuffers[0].get(0); - return new LwjglEvent(q.getCLEvent(event)); - //TODO: why does q.getCLEvent(event) return null? - //This is a bug in LWJGL: they forgot to include the line - // if ( __result == CL_SUCCESS ) command_queue.registerCLEvent(event); - // after the native call - } - - @Override - public Event fillAsync(CommandQueue queue, long[] origin, long[] region, int[] color) { - if (color.length != 4) { - throw new IllegalArgumentException("the passed color array must have length 4"); - } - if (origin.length!=3 || region.length!=3) { - throw new IllegalArgumentException("origin and region must both be arrays of length 3"); - } - Utils.pointerBuffers[0].rewind(); - Utils.pointerBuffers[1].rewind(); - Utils.pointerBuffers[2].rewind(); - Utils.pointerBuffers[1].put(origin).position(0); - Utils.pointerBuffers[2].put(region).position(0); - Utils.tempBuffers[0].b16i.rewind(); - Utils.tempBuffers[0].b16i.limit(4); - Utils.tempBuffers[0].b16i.put(color); - Utils.tempBuffers[0].b16.rewind(); - CLCommandQueue q = ((LwjglCommandQueue) queue).getQueue(); - int ret = CL12.clEnqueueFillImage(q, image, Utils.tempBuffers[0].b16, - Utils.pointerBuffers[1], Utils.pointerBuffers[2], null, Utils.pointerBuffers[0]); - Utils.checkError(ret, "clEnqueueFillImage"); - long event = Utils.pointerBuffers[0].get(0); - return new LwjglEvent(q.getCLEvent(event)); - } - - @Override - public Event copyToBufferAsync(CommandQueue queue, Buffer dest, long[] srcOrigin, long[] srcRegion, long destOffset) { - if (srcOrigin.length!=3 || srcRegion.length!=3) { - throw new IllegalArgumentException("origin and region must both be arrays of length 3"); - } - Utils.pointerBuffers[0].rewind(); - Utils.pointerBuffers[1].rewind(); - Utils.pointerBuffers[2].rewind(); - Utils.pointerBuffers[1].put(srcOrigin).position(0); - Utils.pointerBuffers[2].put(srcRegion).position(0); - CLCommandQueue q = ((LwjglCommandQueue) queue).getQueue(); - int ret = CL10.clEnqueueCopyImageToBuffer(q, image, ((LwjglBuffer) dest).getBuffer(), - Utils.pointerBuffers[1], Utils.pointerBuffers[2], destOffset, null, Utils.pointerBuffers[0]); - Utils.checkError(ret, "clEnqueueCopyImageToBuffer"); - long event = Utils.pointerBuffers[0].get(0); - return new LwjglEvent(q.getCLEvent(event)); - } - - @Override - public Event acquireImageForSharingAsync(CommandQueue queue) { - Utils.pointerBuffers[0].rewind(); - CLCommandQueue q = ((LwjglCommandQueue) queue).getQueue(); - int ret = CL10GL.clEnqueueAcquireGLObjects(q, image, null, Utils.pointerBuffers[0]); - Utils.checkError(ret, "clEnqueueAcquireGLObjects"); - long event = Utils.pointerBuffers[0].get(0); - return new LwjglEvent(q.getCLEvent(event)); - } - @Override - public void acquireImageForSharingNoEvent(CommandQueue queue) { - CLCommandQueue q = ((LwjglCommandQueue) queue).getQueue(); - int ret = CL10GL.clEnqueueAcquireGLObjects(q, image, null, null); - Utils.checkError(ret, "clEnqueueAcquireGLObjects"); - } - @Override - public Event releaseImageForSharingAsync(CommandQueue queue) { - Utils.pointerBuffers[0].rewind(); - CLCommandQueue q = ((LwjglCommandQueue) queue).getQueue(); - int ret = CL10GL.clEnqueueReleaseGLObjects(q, image, null, Utils.pointerBuffers[0]); - Utils.checkError(ret, "clEnqueueReleaseGLObjects"); - long event = Utils.pointerBuffers[0].get(0); - return new LwjglEvent(q.getCLEvent(event)); - } - @Override - public void releaseImageForSharingNoEvent(CommandQueue queue) { - CLCommandQueue q = ((LwjglCommandQueue) queue).getQueue(); - int ret = CL10GL.clEnqueueReleaseGLObjects(q, image, null, null); - Utils.checkError(ret, "clEnqueueReleaseGLObjects"); - } - - private static class ReleaserImpl implements ObjectReleaser { - private CLMem mem; - private ReleaserImpl(CLMem mem) { - this.mem = mem; - } - @Override - public void release() { - if (mem != null) { - int ret = CL10.clReleaseMemObject(mem); - mem = null; - Utils.reportError(ret, "clReleaseMemObject"); - } - } - - } -} diff --git a/jme3-lwjgl/src/main/java/com/jme3/opencl/lwjgl/LwjglKernel.java b/jme3-lwjgl/src/main/java/com/jme3/opencl/lwjgl/LwjglKernel.java deleted file mode 100644 index 92ea60beb7..0000000000 --- a/jme3-lwjgl/src/main/java/com/jme3/opencl/lwjgl/LwjglKernel.java +++ /dev/null @@ -1,277 +0,0 @@ -/* - * Copyright (c) 2009-2016 jMonkeyEngine - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of 'jMonkeyEngine' nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package com.jme3.opencl.lwjgl; - -import com.jme3.math.Matrix4f; -import com.jme3.math.Quaternion; -import com.jme3.math.Vector2f; -import com.jme3.math.Vector4f; -import com.jme3.opencl.*; -import com.jme3.opencl.Buffer; -import java.nio.*; -import org.lwjgl.PointerBuffer; -import org.lwjgl.opencl.CL10; -import org.lwjgl.opencl.CLCommandQueue; -import org.lwjgl.opencl.CLDevice; -import org.lwjgl.opencl.CLKernel; - -/** - * - * @author shaman - */ -public class LwjglKernel extends Kernel { - - private final CLKernel kernel; - - public LwjglKernel(CLKernel kernel) { - super(new ReleaserImpl(kernel)); - this.kernel = kernel; - } - - public CLKernel getKernel() { - return kernel; - } - - @Override - public String getName() { - return kernel.getInfoString(CL10.CL_KERNEL_FUNCTION_NAME); - } - - @Override - public int getArgCount() { - return kernel.getInfoInt(CL10.CL_KERNEL_NUM_ARGS); - } - - @Override - public long getMaxWorkGroupSize(Device device) { - CLDevice d = ((LwjglDevice) device).getDevice(); - return kernel.getWorkGroupInfoSize(d, CL10.CL_KERNEL_WORK_GROUP_SIZE); - } - - @Override - public void setArg(int index, LocalMemPerElement t) { - int ret = CL10.clSetKernelArg (kernel, index, t.getSize() * workGroupSize.getSizes()[0] * workGroupSize.getSizes()[1] * workGroupSize.getSizes()[2]); - Utils.checkError(ret, "clSetKernelArg"); - } - - @Override - public void setArg(int index, LocalMem t) { - int ret = CL10.clSetKernelArg (kernel, index, t.getSize()); - Utils.checkError(ret, "clSetKernelArg"); - } - - @Override - public void setArg(int index, Buffer t) { - int ret = CL10.clSetKernelArg(kernel, index, ((LwjglBuffer) t).getBuffer()); - Utils.checkError(ret, "clSetKernelArg"); - } - - @Override - public void setArg(int index, Image i) { - int ret = CL10.clSetKernelArg(kernel, index, ((LwjglImage) i).getImage()); - Utils.checkError(ret, "clSetKernelArg"); - } - - @Override - public void setArg(int index, byte b) { - ByteBuffer buf = Utils.tempBuffers[0].b16; - buf.position(0); - buf.limit(1); - buf.put(0, b); - int ret = CL10.clSetKernelArg(kernel, index, buf); - Utils.checkError(ret, "clSetKernelArg"); - } - - @Override - public void setArg(int index, short s) { - ShortBuffer buf = Utils.tempBuffers[0].b16s; - buf.position(0); - buf.limit(1); - buf.put(0, s); - int ret = CL10.clSetKernelArg(kernel, index, buf); - Utils.checkError(ret, "clSetKernelArg"); - } - - @Override - public void setArg(int index, int i) { - IntBuffer buf = Utils.tempBuffers[0].b16i; - buf.position(0); - buf.limit(1); - buf.put(0, i); - int ret = CL10.clSetKernelArg(kernel, index, buf); - Utils.checkError(ret, "clSetKernelArg"); - } - - @Override - public void setArg(int index, long l) { - LongBuffer buf = Utils.tempBuffers[0].b16l; - buf.position(0); - buf.limit(1); - buf.put(0, l); - int ret = CL10.clSetKernelArg(kernel, index, buf); - Utils.checkError(ret, "clSetKernelArg"); - } - - @Override - public void setArg(int index, float f) { - FloatBuffer buf = Utils.tempBuffers[0].b16f; - buf.position(0); - buf.limit(1); - buf.put(0, f); - int ret = CL10.clSetKernelArg(kernel, index, buf); - Utils.checkError(ret, "clSetKernelArg"); - } - - @Override - public void setArg(int index, double d) { - DoubleBuffer buf = Utils.tempBuffers[0].b16d; - buf.position(0); - buf.limit(1); - buf.put(0, d); - int ret = CL10.clSetKernelArg(kernel, index, buf); - Utils.checkError(ret, "clSetKernelArg"); - } - - @Override - public void setArg(int index, Vector2f v) { - FloatBuffer buf = Utils.tempBuffers[0].b16f; - buf.position(0); - buf.limit(2); - buf.put(0, v.x); - buf.put(1, v.y); - int ret = CL10.clSetKernelArg(kernel, index, buf); - Utils.checkError(ret, "clSetKernelArg"); - } - - @Override - public void setArg(int index, Vector4f v) { - FloatBuffer buf = Utils.tempBuffers[0].b16f; - buf.position(0); - buf.limit(4); - buf.put(0, v.x); - buf.put(1, v.y); - buf.put(2, v.z); - buf.put(3, v.w); - int ret = CL10.clSetKernelArg(kernel, index, buf); - Utils.checkError(ret, "clSetKernelArg"); - } - - @Override - public void setArg(int index, Quaternion q) { - FloatBuffer buf = Utils.tempBuffers[0].b16f; - buf.position(0); - buf.limit(4); - buf.put(0, q.getX()); - buf.put(1, q.getY()); - buf.put(2, q.getZ()); - buf.put(3, q.getW()); - int ret = CL10.clSetKernelArg(kernel, index, buf); - Utils.checkError(ret, "clSetKernelArg"); - } - - @Override - public void setArg(int index, Matrix4f m) { - FloatBuffer buf = Utils.b80f; - buf.position(0); - buf.limit(16); - buf.put(m.m00).put(m.m01).put(m.m02).put(m.m03); - buf.put(m.m10).put(m.m11).put(m.m12).put(m.m13); - buf.put(m.m20).put(m.m21).put(m.m22).put(m.m23); - buf.put(m.m30).put(m.m31).put(m.m32).put(m.m33); - buf.position(0); - int ret = CL10.clSetKernelArg(kernel, index, buf); - Utils.checkError(ret, "clSetKernelArg"); - } - - @Override - public void setArg(int index, ByteBuffer buffer, long size) { - buffer.limit((int) (buffer.position() + size)); - int ret = CL10.clSetKernelArg(kernel, index, buffer); - Utils.checkError(ret, "clSetKernelArg"); - } - - @Override - public Event Run(CommandQueue queue) { - Utils.pointerBuffers[0].rewind(); - Utils.pointerBuffers[1].rewind(); - Utils.pointerBuffers[1].put(globalWorkSize.getSizes()); - Utils.pointerBuffers[1].position(0); - PointerBuffer p2 = null; - if (workGroupSize.getSizes()[0] > 0) { - p2 = Utils.pointerBuffers[2].rewind(); - p2.put(workGroupSize.getSizes()); - p2.position(0); - } - CLCommandQueue q = ((LwjglCommandQueue) queue).getQueue(); - int ret = CL10.clEnqueueNDRangeKernel(q, kernel, - globalWorkSize.getDimension(), null, Utils.pointerBuffers[1], - p2, null, Utils.pointerBuffers[0]); - Utils.checkError(ret, "clEnqueueNDRangeKernel"); - return new LwjglEvent(q.getCLEvent(Utils.pointerBuffers[0].get(0))); - } - @Override - public void RunNoEvent(CommandQueue queue) { - Utils.pointerBuffers[1].rewind(); - Utils.pointerBuffers[1].put(globalWorkSize.getSizes()); - Utils.pointerBuffers[1].position(0); - PointerBuffer p2 = null; - if (workGroupSize.getSizes()[0] > 0) { - p2 = Utils.pointerBuffers[2].rewind(); - p2.put(workGroupSize.getSizes()); - p2.position(0); - } - CLCommandQueue q = ((LwjglCommandQueue) queue).getQueue(); - int ret = CL10.clEnqueueNDRangeKernel(q, kernel, - globalWorkSize.getDimension(), null, Utils.pointerBuffers[1], - p2, null, null); - Utils.checkError(ret, "clEnqueueNDRangeKernel"); - } - - @Override - public ObjectReleaser getReleaser() { - return new ReleaserImpl(kernel); - } - private static class ReleaserImpl implements ObjectReleaser { - private CLKernel kernel; - private ReleaserImpl(CLKernel kernel) { - this.kernel = kernel; - } - @Override - public void release() { - if (kernel != null) { - int ret = CL10.clReleaseKernel(kernel); - kernel = null; - Utils.reportError(ret, "clReleaseKernel"); - } - } - } -} diff --git a/jme3-lwjgl/src/main/java/com/jme3/opencl/lwjgl/LwjglPlatform.java b/jme3-lwjgl/src/main/java/com/jme3/opencl/lwjgl/LwjglPlatform.java deleted file mode 100644 index 610b07e478..0000000000 --- a/jme3-lwjgl/src/main/java/com/jme3/opencl/lwjgl/LwjglPlatform.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright (c) 2009-2016 jMonkeyEngine - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of 'jMonkeyEngine' nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package com.jme3.opencl.lwjgl; - -import com.jme3.opencl.Device; -import com.jme3.opencl.Platform; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; -import org.lwjgl.opencl.CL10; -import org.lwjgl.opencl.CLDevice; -import org.lwjgl.opencl.CLPlatform; - -/** - * - * @author shaman - */ -public final class LwjglPlatform implements Platform { - - final CLPlatform platform; - List devices; - - public LwjglPlatform(CLPlatform platform) { - this.platform = platform; - } - - public CLPlatform getPlatform() { - return platform; - } - - @Override - public List getDevices() { - if (devices == null) { - devices = new ArrayList<>(); - for (CLDevice d : platform.getDevices(CL10.CL_DEVICE_TYPE_ALL)) { - devices.add(new LwjglDevice(d, this)); - } - } - return devices; - } - - @Override - public String getProfile() { - return platform.getInfoString(CL10.CL_PLATFORM_PROFILE); - } - - @Override - public boolean isFullProfile() { - return getProfile().contains("FULL_PROFILE"); - } - - @Override - public boolean isEmbeddedProfile() { - return getProfile().contains("EMBEDDED_PROFILE"); - } - - @Override - public String getVersion() { - return platform.getInfoString(CL10.CL_PLATFORM_VERSION); - } - - @Override - public int getVersionMajor() { - return Utils.getMajorVersion(getVersion(), "OpenCL "); - } - - @Override - public int getVersionMinor() { - return Utils.getMinorVersion(getVersion(), "OpenCL "); - } - - @Override - public String getName() { - return platform.getInfoString(CL10.CL_PLATFORM_NAME); - } - - @Override - public String getVendor() { - return platform.getInfoString(CL10.CL_PLATFORM_VENDOR); - } - - @Override - public boolean hasExtension(String extension) { - return getExtensions().contains(extension); - } - - @Override - public boolean hasOpenGLInterop() { - return hasExtension("cl_khr_gl_sharing"); - } - - @Override - public Collection getExtensions() { - return Arrays.asList(platform.getInfoString(CL10.CL_PLATFORM_EXTENSIONS).split(" ")); - } - - @Override - public String toString() { - return getName(); - } - -} diff --git a/jme3-lwjgl/src/main/java/com/jme3/opencl/lwjgl/LwjglProgram.java b/jme3-lwjgl/src/main/java/com/jme3/opencl/lwjgl/LwjglProgram.java deleted file mode 100644 index f0a1b2df60..0000000000 --- a/jme3-lwjgl/src/main/java/com/jme3/opencl/lwjgl/LwjglProgram.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright (c) 2009-2016 jMonkeyEngine - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of 'jMonkeyEngine' nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package com.jme3.opencl.lwjgl; - -import com.jme3.opencl.*; -import java.nio.ByteBuffer; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.lwjgl.PointerBuffer; -import org.lwjgl.opencl.*; - -/** - * - * @author shaman - */ -public class LwjglProgram extends Program { - private static final Logger LOG = Logger.getLogger(LwjglProgram.class.getName()); - - private final CLProgram program; - private final LwjglContext context; - - public LwjglProgram(CLProgram program, LwjglContext context) { - super(new ReleaserImpl(program)); - this.program = program; - this.context = context; - } - - public CLProgram getProgram() { - return program; - } - - @Override - public void build(String args, Device... devices) throws KernelCompilationException { - PointerBuffer deviceList = null; - if (devices != null) { - deviceList = PointerBuffer.allocateDirect(devices.length); - deviceList.rewind(); - for (Device d : devices) { - deviceList.put(((LwjglDevice) d).device.getPointer()); - } - deviceList.flip(); - } - int ret = CL10.clBuildProgram(program, deviceList, args, null); - if (ret != CL10.CL_SUCCESS) { - String log = Log(); - LOG.log(Level.WARNING, "Unable to compile program:\n{0}", log); - if (ret == CL10.CL_BUILD_PROGRAM_FAILURE) { - throw new KernelCompilationException("Failed to build program", ret, log); - } else { - Utils.checkError(ret, "clBuildProgram"); - } - } else { - LOG.log(Level.INFO, "Program compiled:\n{0}", Log()); - } - } - - private String Log() { - StringBuilder str = new StringBuilder(); - for (LwjglDevice device : context.getDevices()) { - CLDevice d = device.getDevice(); - str.append(device.getName()).append(":\n"); - str.append(program.getBuildInfoString(d, CL10.CL_PROGRAM_BUILD_LOG)); - str.append('\n'); - } - return str.toString(); - } - - @Override - public Kernel createKernel(String name) { - CLKernel kernel = CL10.clCreateKernel(program, name, Utils.errorBuffer); - Utils.checkError(Utils.errorBuffer, "clCreateKernel"); - return new LwjglKernel(kernel); - } - - @Override - public Kernel[] createAllKernels() { - CLKernel[] kernels = program.createKernelsInProgram(); - Kernel[] kx = new Kernel[kernels.length]; - for (int i=0; i CL_ERROR_TOKENS = LWJGLUtil.getClassTokens(new LWJGLUtil.TokenFilter() { - public boolean accept(final Field field, final int value) { - return value < 0; // Currently, all OpenCL errors have negative values. - } - }, null, CL10.class, CL11.class, CL12.class, KHRGLSharing.class, KHRICD.class, APPLEGLSharing.class, EXTDeviceFission.class); - - public static int getMajorVersion(String version, String prefix) { - String s = version.substring(prefix.length()); - return Integer.parseInt(s); - } - - public static int getMinorVersion(String version, String prefix) { - String s = version.substring(prefix.length()); - int major = Integer.parseInt(s); - s = s.substring((int) (Math.log10(major) + 2)); - return Integer.parseInt(s); - } - - public static final class TempBuffer { - public final ByteBuffer b16; - public final ShortBuffer b16s; - public final IntBuffer b16i; - public final LongBuffer b16l; - public final FloatBuffer b16f; - public final DoubleBuffer b16d; - public TempBuffer() { - b16 = BufferUtils.createByteBuffer(16); - b16s = b16.asShortBuffer(); - b16i = b16.asIntBuffer(); - b16l = b16.asLongBuffer(); - b16f = b16.asFloatBuffer(); - b16d = b16.asDoubleBuffer(); - } - } - public static final ByteBuffer b80; //needed for ImageDescriptor and Matrix4f - public static final LongBuffer b80l; - public static final FloatBuffer b80f; - public static final TempBuffer[] tempBuffers = new TempBuffer[8]; - public static final PointerBuffer[] pointerBuffers = new PointerBuffer[8]; - static { - for (int i=0; i<8; ++i) { - tempBuffers[i] = new TempBuffer(); - pointerBuffers[i] = PointerBuffer.allocateDirect(4); - } - errorBuffer = BufferUtils.createIntBuffer(1); - b80 = BufferUtils.createByteBuffer(80); - b80l = b80.asLongBuffer(); - b80f = b80.asFloatBuffer(); - } - - public static IntBuffer errorBuffer; - public static void checkError(IntBuffer errorBuffer, String callName) { - checkError(errorBuffer.get(0), callName); - } - public static void checkError(int error, String callName) { - if (error != CL10.CL_SUCCESS) { - String errname = getErrorName(error); - if (errname == null) { - errname = "UNKNOWN"; - } - throw new OpenCLException("OpenCL error in " + callName + ": " + errname + " (0x" + Integer.toHexString(error) + ")", error); - } - } - - public static void reportError(int error, String callName) { - if (error != CL10.CL_SUCCESS) { - String errname = getErrorName(error); - if (errname == null) { - errname = "UNKNOWN"; - } - LOG.log(Level.WARNING, "OpenCL error in {0}: {1} (0x{2})", new Object[]{callName, errname, Integer.toHexString(error)}); - } - } - - public static String getErrorName(int code) { - return CL_ERROR_TOKENS.get(code); - } - - public static long getMemoryAccessFlags(MemoryAccess ma) { - switch (ma) { - case READ_ONLY: return CL10.CL_MEM_READ_ONLY; - case WRITE_ONLY: return CL10.CL_MEM_WRITE_ONLY; - case READ_WRITE: return CL10.CL_MEM_READ_WRITE; - default: throw new IllegalArgumentException("Unknown memory access: "+ma); - } - } - public static MemoryAccess getMemoryAccessFromFlag(long flag) { - if ((flag & CL10.CL_MEM_READ_WRITE) > 0) { - return MemoryAccess.READ_WRITE; - } - if ((flag & CL10.CL_MEM_READ_ONLY) > 0) { - return MemoryAccess.READ_ONLY; - } - if ((flag & CL10.CL_MEM_WRITE_ONLY) > 0) { - return MemoryAccess.WRITE_ONLY; - } - throw new OpenCLException("Unknown memory access flag: "+flag); - } - - public static long getMappingAccessFlags(MappingAccess ma) { - switch (ma) { - case MAP_READ_ONLY: return CL10.CL_MAP_READ; - case MAP_READ_WRITE: return CL10.CL_MAP_READ | CL10.CL_MAP_WRITE; - case MAP_WRITE_ONLY: return CL10.CL_MAP_WRITE; - case MAP_WRITE_INVALIDATE: return CL12.CL_MAP_WRITE_INVALIDATE_REGION; - default: throw new IllegalArgumentException("Unknown mapping access: "+ma); - } - } - -} diff --git a/jme3-lwjgl/src/main/java/com/jme3/renderer/lwjgl/LwjglGL.java b/jme3-lwjgl/src/main/java/com/jme3/renderer/lwjgl/LwjglGL.java deleted file mode 100644 index 5a74e06f01..0000000000 --- a/jme3-lwjgl/src/main/java/com/jme3/renderer/lwjgl/LwjglGL.java +++ /dev/null @@ -1,496 +0,0 @@ -package com.jme3.renderer.lwjgl; - -import com.jme3.renderer.RendererException; -import com.jme3.renderer.opengl.GL; -import com.jme3.renderer.opengl.GL2; -import com.jme3.renderer.opengl.GL3; -import java.nio.Buffer; -import java.nio.ByteBuffer; -import java.nio.FloatBuffer; -import java.nio.IntBuffer; -import java.nio.ShortBuffer; - -import com.jme3.renderer.opengl.GL4; -import com.jme3.util.BufferUtils; -import org.lwjgl.opengl.*; - -public final class LwjglGL implements GL, GL2, GL3, GL4 { - - IntBuffer tmpBuff = BufferUtils.createIntBuffer(1); - - private static void checkLimit(Buffer buffer) { - if (buffer == null) { - return; - } - if (buffer.limit() == 0) { - throw new RendererException("Attempting to upload empty buffer (limit = 0), that's an error"); - } - if (buffer.remaining() == 0) { - throw new RendererException("Attempting to upload empty buffer (remaining = 0), that's an error"); - } - } - - public void resetStats() { - } - - public void glActiveTexture(int param1) { - GL13.glActiveTexture(param1); - } - - public void glAlphaFunc(int param1, float param2) { - GL11.glAlphaFunc(param1, param2); - } - - public void glAttachShader(int param1, int param2) { - GL20.glAttachShader(param1, param2); - } - - @Override - public void glBeginQuery(int target, int query) { - GL15.glBeginQuery(target, query); - } - - public void glBindBuffer(int param1, int param2) { - GL15.glBindBuffer(param1, param2); - } - - public void glBindTexture(int param1, int param2) { - GL11.glBindTexture(param1, param2); - } - - public void glBlendEquationSeparate(int colorMode, int alphaMode){ - GL20.glBlendEquationSeparate(colorMode,alphaMode); - } - - public void glBlendFunc(int param1, int param2) { - GL11.glBlendFunc(param1, param2); - } - - public void glBlendFuncSeparate(int param1, int param2, int param3, int param4) { - GL14.glBlendFuncSeparate(param1, param2, param3, param4); - } - - public void glBufferData(int param1, long param2, int param3) { - GL15.glBufferData(param1, param2, param3); - } - - public void glBufferData(int param1, FloatBuffer param2, int param3) { - checkLimit(param2); - GL15.glBufferData(param1, param2, param3); - } - - public void glBufferData(int param1, ShortBuffer param2, int param3) { - checkLimit(param2); - GL15.glBufferData(param1, param2, param3); - } - - public void glBufferData(int param1, ByteBuffer param2, int param3) { - checkLimit(param2); - GL15.glBufferData(param1, param2, param3); - } - - public void glBufferSubData(int param1, long param2, FloatBuffer param3) { - checkLimit(param3); - GL15.glBufferSubData(param1, param2, param3); - } - - public void glBufferSubData(int param1, long param2, ShortBuffer param3) { - checkLimit(param3); - GL15.glBufferSubData(param1, param2, param3); - } - - public void glBufferSubData(int param1, long param2, ByteBuffer param3) { - checkLimit(param3); - GL15.glBufferSubData(param1, param2, param3); - } - - public void glClear(int param1) { - GL11.glClear(param1); - } - - public void glClearColor(float param1, float param2, float param3, float param4) { - GL11.glClearColor(param1, param2, param3, param4); - } - - public void glColorMask(boolean param1, boolean param2, boolean param3, boolean param4) { - GL11.glColorMask(param1, param2, param3, param4); - } - - public void glCompileShader(int param1) { - GL20.glCompileShader(param1); - } - - public void glCompressedTexImage2D(int param1, int param2, int param3, int param4, int param5, int param6, ByteBuffer param7) { - checkLimit(param7); - GL13.glCompressedTexImage2D(param1, param2, param3, param4, param5, param6, param7); - } - - public void glCompressedTexImage3D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, ByteBuffer param8) { - checkLimit(param8); - GL13.glCompressedTexImage3D(param1, param2, param3, param4, param5, param6, param7, param8); - } - - public void glCompressedTexSubImage2D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, ByteBuffer param8) { - checkLimit(param8); - GL13.glCompressedTexSubImage2D(param1, param2, param3, param4, param5, param6, param7, param8); - } - - public void glCompressedTexSubImage3D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, ByteBuffer param10) { - checkLimit(param10); - GL13.glCompressedTexSubImage3D(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10); - } - - public int glCreateProgram() { - return GL20.glCreateProgram(); - } - - public int glCreateShader(int param1) { - return GL20.glCreateShader(param1); - } - - public void glCullFace(int param1) { - GL11.glCullFace(param1); - } - - public void glDeleteBuffers(IntBuffer param1) { - checkLimit(param1); - GL15.glDeleteBuffers(param1); - } - - public void glDeleteProgram(int param1) { - GL20.glDeleteProgram(param1); - } - - public void glDeleteShader(int param1) { - GL20.glDeleteShader(param1); - } - - public void glDeleteTextures(IntBuffer param1) { - checkLimit(param1); - GL11.glDeleteTextures(param1); - } - - public void glDepthFunc(int param1) { - GL11.glDepthFunc(param1); - } - - public void glDepthMask(boolean param1) { - GL11.glDepthMask(param1); - } - - public void glDepthRange(double param1, double param2) { - GL11.glDepthRange(param1, param2); - } - - public void glDetachShader(int param1, int param2) { - GL20.glDetachShader(param1, param2); - } - - public void glDisable(int param1) { - GL11.glDisable(param1); - } - - public void glDisableVertexAttribArray(int param1) { - GL20.glDisableVertexAttribArray(param1); - } - - public void glDrawArrays(int param1, int param2, int param3) { - GL11.glDrawArrays(param1, param2, param3); - } - - public void glDrawBuffer(int param1) { - GL11.glDrawBuffer(param1); - } - - public void glDrawRangeElements(int param1, int param2, int param3, int param4, int param5, long param6) { - GL12.glDrawRangeElements(param1, param2, param3, param4, param5, param6); - } - - public void glEnable(int param1) { - GL11.glEnable(param1); - } - - public void glEnableVertexAttribArray(int param1) { - GL20.glEnableVertexAttribArray(param1); - } - - @Override - public void glEndQuery(int target) { - GL15.glEndQuery(target); - } - - public void glGenBuffers(IntBuffer param1) { - checkLimit(param1); - GL15.glGenBuffers(param1); - } - - @Override - public void glGenQueries(int num, IntBuffer ids) { - GL15.glGenQueries(ids); - } - - public void glGenTextures(IntBuffer param1) { - checkLimit(param1); - GL11.glGenTextures(param1); - } - - public void glGetBoolean(int param1, ByteBuffer param2) { - checkLimit(param2); - GL11.glGetBoolean(param1, param2); - } - - public void glGetBufferSubData(int target, long offset, ByteBuffer data) { - checkLimit(data); - GL15.glGetBufferSubData(target, offset, data); - } - - public int glGetError() { - return GL11.glGetError(); - } - - public void glGetInteger(int param1, IntBuffer param2) { - checkLimit(param2); - GL11.glGetInteger(param1, param2); - } - - public void glGetProgram(int param1, int param2, IntBuffer param3) { - checkLimit(param3); - GL20.glGetProgram(param1, param2, param3); - } - - public void glGetShader(int param1, int param2, IntBuffer param3) { - checkLimit(param3); - GL20.glGetShader(param1, param2, param3); - } - - public String glGetString(int param1) { - return GL11.glGetString(param1); - } - - public String glGetString(int param1, int param2) { - return GL30.glGetStringi(param1, param2); - } - - public boolean glIsEnabled(int param1) { - return GL11.glIsEnabled(param1); - } - - public void glLineWidth(float param1) { - GL11.glLineWidth(param1); - } - - public void glLinkProgram(int param1) { - GL20.glLinkProgram(param1); - } - - public void glPixelStorei(int param1, int param2) { - GL11.glPixelStorei(param1, param2); - } - - public void glPointSize(float param1) { - GL11.glPointSize(param1); - } - - public void glPolygonMode(int param1, int param2) { - GL11.glPolygonMode(param1, param2); - } - - public void glPolygonOffset(float param1, float param2) { - GL11.glPolygonOffset(param1, param2); - } - - public void glReadBuffer(int param1) { - GL11.glReadBuffer(param1); - } - - public void glReadPixels(int param1, int param2, int param3, int param4, int param5, int param6, ByteBuffer param7) { - checkLimit(param7); - GL11.glReadPixels(param1, param2, param3, param4, param5, param6, param7); - } - - public void glReadPixels(int param1, int param2, int param3, int param4, int param5, int param6, long param7) { - GL11.glReadPixels(param1, param2, param3, param4, param5, param6, param7); - } - - public void glScissor(int param1, int param2, int param3, int param4) { - GL11.glScissor(param1, param2, param3, param4); - } - - public void glStencilFuncSeparate(int param1, int param2, int param3, int param4) { - GL20.glStencilFuncSeparate(param1, param2, param3, param4); - } - - public void glStencilOpSeparate(int param1, int param2, int param3, int param4) { - GL20.glStencilOpSeparate(param1, param2, param3, param4); - } - - public void glTexImage2D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, ByteBuffer param9) { - checkLimit(param9); - GL11.glTexImage2D(param1, param2, param3, param4, param5, param6, param7, param8, param9); - } - - public void glTexImage3D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, ByteBuffer param10) { - checkLimit(param10); - GL12.glTexImage3D(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10); - } - - public void glTexParameterf(int param1, int param2, float param3) { - GL11.glTexParameterf(param1, param2, param3); - } - - public void glTexParameteri(int param1, int param2, int param3) { - GL11.glTexParameteri(param1, param2, param3); - } - - public void glTexSubImage2D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, ByteBuffer param9) { - checkLimit(param9); - GL11.glTexSubImage2D(param1, param2, param3, param4, param5, param6, param7, param8, param9); - } - - public void glTexSubImage3D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, int param10, ByteBuffer param11) { - checkLimit(param11); - GL12.glTexSubImage3D(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11); - } - - public void glUniform1(int param1, FloatBuffer param2) { - checkLimit(param2); - GL20.glUniform1(param1, param2); - } - - public void glUniform1(int param1, IntBuffer param2) { - checkLimit(param2); - GL20.glUniform1(param1, param2); - } - - public void glUniform1f(int param1, float param2) { - GL20.glUniform1f(param1, param2); - } - - public void glUniform1i(int param1, int param2) { - GL20.glUniform1i(param1, param2); - } - - public void glUniform2(int param1, IntBuffer param2) { - checkLimit(param2); - GL20.glUniform2(param1, param2); - } - - public void glUniform2(int param1, FloatBuffer param2) { - checkLimit(param2); - GL20.glUniform2(param1, param2); - } - - public void glUniform2f(int param1, float param2, float param3) { - GL20.glUniform2f(param1, param2, param3); - } - - public void glUniform3(int param1, IntBuffer param2) { - checkLimit(param2); - GL20.glUniform3(param1, param2); - } - - public void glUniform3(int param1, FloatBuffer param2) { - checkLimit(param2); - GL20.glUniform3(param1, param2); - } - - public void glUniform3f(int param1, float param2, float param3, float param4) { - GL20.glUniform3f(param1, param2, param3, param4); - } - - public void glUniform4(int param1, FloatBuffer param2) { - checkLimit(param2); - GL20.glUniform4(param1, param2); - } - - public void glUniform4(int param1, IntBuffer param2) { - checkLimit(param2); - GL20.glUniform4(param1, param2); - } - - public void glUniform4f(int param1, float param2, float param3, float param4, float param5) { - GL20.glUniform4f(param1, param2, param3, param4, param5); - } - - public void glUniformMatrix3(int param1, boolean param2, FloatBuffer param3) { - checkLimit(param3); - GL20.glUniformMatrix3(param1, param2, param3); - } - - public void glUniformMatrix4(int param1, boolean param2, FloatBuffer param3) { - checkLimit(param3); - GL20.glUniformMatrix4(param1, param2, param3); - } - - public void glUseProgram(int param1) { - GL20.glUseProgram(param1); - } - - public void glVertexAttribPointer(int param1, int param2, int param3, boolean param4, int param5, long param6) { - GL20.glVertexAttribPointer(param1, param2, param3, param4, param5, param6); - } - - public void glViewport(int param1, int param2, int param3, int param4) { - GL11.glViewport(param1, param2, param3, param4); - } - - public int glGetAttribLocation(int param1, String param2) { - // NOTE: LWJGL requires null-terminated strings - return GL20.glGetAttribLocation(param1, param2 + "\0"); - } - - public int glGetUniformLocation(int param1, String param2) { - // NOTE: LWJGL requires null-terminated strings - return GL20.glGetUniformLocation(param1, param2 + "\0"); - } - - public void glShaderSource(int param1, String[] param2, IntBuffer param3) { - checkLimit(param3); - GL20.glShaderSource(param1, param2); - } - - public String glGetProgramInfoLog(int program, int maxSize) { - return GL20.glGetProgramInfoLog(program, maxSize); - } - - @Override - public long glGetQueryObjectui64(int query, int target) { - return ARBTimerQuery.glGetQueryObjectui64(query, target); - } - - @Override - public int glGetQueryObjectiv(int query, int pname) { - return GL15.glGetQueryObjecti(query, pname); - } - - public String glGetShaderInfoLog(int shader, int maxSize) { - return GL20.glGetShaderInfoLog(shader, maxSize); - } - - @Override - public void glBindFragDataLocation(int param1, int param2, String param3) { - GL30.glBindFragDataLocation(param1, param2, param3); - } - - @Override - public void glBindVertexArray(int param1) { - GL30.glBindVertexArray(param1); - } - - @Override - public void glGenVertexArrays(IntBuffer param1) { - checkLimit(param1); - GL30.glGenVertexArrays(param1); - } - - @Override - public void glPatchParameter(int count) { - GL40.glPatchParameteri(GL40.GL_PATCH_VERTICES,count); - } - - @Override - public void glDeleteVertexArrays(IntBuffer arrays) { - checkLimit(arrays); - ARBVertexArrayObject.glDeleteVertexArrays(arrays); - } -} diff --git a/jme3-lwjgl/src/main/java/com/jme3/renderer/lwjgl/LwjglGLExt.java b/jme3-lwjgl/src/main/java/com/jme3/renderer/lwjgl/LwjglGLExt.java deleted file mode 100644 index e3b9e6c77a..0000000000 --- a/jme3-lwjgl/src/main/java/com/jme3/renderer/lwjgl/LwjglGLExt.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.jme3.renderer.lwjgl; - -import com.jme3.renderer.RendererException; -import com.jme3.renderer.opengl.GLExt; -import java.nio.Buffer; -import java.nio.FloatBuffer; -import java.nio.IntBuffer; -import org.lwjgl.opengl.ARBDrawInstanced; -import org.lwjgl.opengl.ARBInstancedArrays; -import org.lwjgl.opengl.ARBSync; -import org.lwjgl.opengl.ARBTextureMultisample; -import org.lwjgl.opengl.GL15; -import org.lwjgl.opengl.GL20; -import org.lwjgl.opengl.GLSync; - -public final class LwjglGLExt implements GLExt { - - private static void checkLimit(Buffer buffer) { - if (buffer == null) { - return; - } - if (buffer.limit() == 0) { - throw new RendererException("Attempting to upload empty buffer (limit = 0), that's an error"); - } - if (buffer.remaining() == 0) { - throw new RendererException("Attempting to upload empty buffer (remaining = 0), that's an error"); - } - } - - @Override - public void glBufferData(int target, IntBuffer data, int usage) { - checkLimit(data); - GL15.glBufferData(target, data, usage); - } - - @Override - public void glBufferSubData(int target, long offset, IntBuffer data) { - checkLimit(data); - GL15.glBufferSubData(target, offset, data); - } - - @Override - public void glDrawArraysInstancedARB(int mode, int first, int count, int primcount) { - ARBDrawInstanced.glDrawArraysInstancedARB(mode, first, count, primcount); - } - - @Override - public void glDrawBuffers(IntBuffer bufs) { - checkLimit(bufs); - GL20.glDrawBuffers(bufs); - } - - @Override - public void glDrawElementsInstancedARB(int mode, int indices_count, int type, long indices_buffer_offset, int primcount) { - ARBDrawInstanced.glDrawElementsInstancedARB(mode, indices_count, type, indices_buffer_offset, primcount); - } - - @Override - public void glGetMultisample(int pname, int index, FloatBuffer val) { - checkLimit(val); - ARBTextureMultisample.glGetMultisample(pname, index, val); - } - - @Override - public void glTexImage2DMultisample(int target, int samples, int internalformat, int width, int height, boolean fixedsamplelocations) { - ARBTextureMultisample.glTexImage2DMultisample(target, samples, internalformat, width, height, fixedsamplelocations); - } - - @Override - public void glVertexAttribDivisorARB(int index, int divisor) { - ARBInstancedArrays.glVertexAttribDivisorARB(index, divisor); - } - - @Override - public Object glFenceSync(int condition, int flags) { - return ARBSync.glFenceSync(condition, flags); - } - - @Override - public int glClientWaitSync(Object sync, int flags, long timeout) { - return ARBSync.glClientWaitSync((GLSync) sync, flags, timeout); - } - - @Override - public void glDeleteSync(Object sync) { - ARBSync.glDeleteSync((GLSync) sync); - } -} diff --git a/jme3-lwjgl/src/main/java/com/jme3/renderer/lwjgl/LwjglGLFboEXT.java b/jme3-lwjgl/src/main/java/com/jme3/renderer/lwjgl/LwjglGLFboEXT.java deleted file mode 100644 index 8f746b4d4e..0000000000 --- a/jme3-lwjgl/src/main/java/com/jme3/renderer/lwjgl/LwjglGLFboEXT.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.jme3.renderer.lwjgl; - -import com.jme3.renderer.RendererException; -import com.jme3.renderer.opengl.GLFbo; -import java.nio.Buffer; -import java.nio.IntBuffer; -import org.lwjgl.opengl.EXTFramebufferBlit; -import org.lwjgl.opengl.EXTFramebufferMultisample; -import org.lwjgl.opengl.EXTFramebufferObject; -import org.lwjgl.opengl.EXTTextureArray; - -/** - * Implements GLFbo via GL_EXT_framebuffer_object. - * - * @author Kirill Vainer - */ -public final class LwjglGLFboEXT implements GLFbo { - - private static void checkLimit(Buffer buffer) { - if (buffer == null) { - return; - } - if (buffer.limit() == 0) { - throw new RendererException("Attempting to upload empty buffer (limit = 0), that's an error"); - } - if (buffer.remaining() == 0) { - throw new RendererException("Attempting to upload empty buffer (remaining = 0), that's an error"); - } - } - - @Override - public void glBlitFramebufferEXT(int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, int mask, int filter) { - EXTFramebufferBlit.glBlitFramebufferEXT(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); - } - - @Override - public void glRenderbufferStorageMultisampleEXT(int target, int samples, int internalformat, int width, int height) { - EXTFramebufferMultisample.glRenderbufferStorageMultisampleEXT(target, samples, internalformat, width, height); - } - - @Override - public void glBindFramebufferEXT(int param1, int param2) { - EXTFramebufferObject.glBindFramebufferEXT(param1, param2); - } - - @Override - public void glBindRenderbufferEXT(int param1, int param2) { - EXTFramebufferObject.glBindRenderbufferEXT(param1, param2); - } - - @Override - public int glCheckFramebufferStatusEXT(int param1) { - return EXTFramebufferObject.glCheckFramebufferStatusEXT(param1); - } - - @Override - public void glDeleteFramebuffersEXT(IntBuffer param1) { - checkLimit(param1); - EXTFramebufferObject.glDeleteFramebuffersEXT(param1); - } - - @Override - public void glDeleteRenderbuffersEXT(IntBuffer param1) { - checkLimit(param1); - EXTFramebufferObject.glDeleteRenderbuffersEXT(param1); - } - - @Override - public void glFramebufferRenderbufferEXT(int param1, int param2, int param3, int param4) { - EXTFramebufferObject.glFramebufferRenderbufferEXT(param1, param2, param3, param4); - } - - @Override - public void glFramebufferTexture2DEXT(int param1, int param2, int param3, int param4, int param5) { - EXTFramebufferObject.glFramebufferTexture2DEXT(param1, param2, param3, param4, param5); - } - - @Override - public void glGenFramebuffersEXT(IntBuffer param1) { - checkLimit(param1); - EXTFramebufferObject.glGenFramebuffersEXT(param1); - } - - @Override - public void glGenRenderbuffersEXT(IntBuffer param1) { - checkLimit(param1); - EXTFramebufferObject.glGenRenderbuffersEXT(param1); - } - - @Override - public void glGenerateMipmapEXT(int param1) { - EXTFramebufferObject.glGenerateMipmapEXT(param1); - } - - @Override - public void glRenderbufferStorageEXT(int param1, int param2, int param3, int param4) { - EXTFramebufferObject.glRenderbufferStorageEXT(param1, param2, param3, param4); - } - - @Override - public void glFramebufferTextureLayerEXT(int target, int attachment, int texture, int level, int layer) { - EXTTextureArray.glFramebufferTextureLayerEXT(target, attachment, texture, level, layer); - } -} diff --git a/jme3-lwjgl/src/main/java/com/jme3/renderer/lwjgl/LwjglGLFboGL3.java b/jme3-lwjgl/src/main/java/com/jme3/renderer/lwjgl/LwjglGLFboGL3.java deleted file mode 100644 index bec41d17f4..0000000000 --- a/jme3-lwjgl/src/main/java/com/jme3/renderer/lwjgl/LwjglGLFboGL3.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.jme3.renderer.lwjgl; - -import com.jme3.renderer.RendererException; -import com.jme3.renderer.opengl.GLFbo; -import java.nio.Buffer; -import java.nio.IntBuffer; -import org.lwjgl.opengl.GL30; - -/** - * Implements GLFbo via OpenGL3+. - * - * @author Kirill Vainer - */ -public final class LwjglGLFboGL3 implements GLFbo { - - private static void checkLimit(Buffer buffer) { - if (buffer == null) { - return; - } - if (buffer.limit() == 0) { - throw new RendererException("Attempting to upload empty buffer (limit = 0), that's an error"); - } - if (buffer.remaining() == 0) { - throw new RendererException("Attempting to upload empty buffer (remaining = 0), that's an error"); - } - } - - @Override - public void glBlitFramebufferEXT(int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, int mask, int filter) { - GL30.glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); - } - - @Override - public void glRenderbufferStorageMultisampleEXT(int target, int samples, int internalformat, int width, int height) { - GL30.glRenderbufferStorageMultisample(target, samples, internalformat, width, height); - } - - @Override - public void glBindFramebufferEXT(int param1, int param2) { - GL30.glBindFramebuffer(param1, param2); - } - - @Override - public void glBindRenderbufferEXT(int param1, int param2) { - GL30.glBindRenderbuffer(param1, param2); - } - - @Override - public int glCheckFramebufferStatusEXT(int param1) { - return GL30.glCheckFramebufferStatus(param1); - } - - @Override - public void glDeleteFramebuffersEXT(IntBuffer param1) { - checkLimit(param1); - GL30.glDeleteFramebuffers(param1); - } - - @Override - public void glDeleteRenderbuffersEXT(IntBuffer param1) { - checkLimit(param1); - GL30.glDeleteRenderbuffers(param1); - } - - @Override - public void glFramebufferRenderbufferEXT(int param1, int param2, int param3, int param4) { - GL30.glFramebufferRenderbuffer(param1, param2, param3, param4); - } - - @Override - public void glFramebufferTexture2DEXT(int param1, int param2, int param3, int param4, int param5) { - GL30.glFramebufferTexture2D(param1, param2, param3, param4, param5); - } - - @Override - public void glGenFramebuffersEXT(IntBuffer param1) { - checkLimit(param1); - GL30.glGenFramebuffers(param1); - } - - @Override - public void glGenRenderbuffersEXT(IntBuffer param1) { - checkLimit(param1); - GL30.glGenRenderbuffers(param1); - } - - @Override - public void glGenerateMipmapEXT(int param1) { - GL30.glGenerateMipmap(param1); - } - - @Override - public void glRenderbufferStorageEXT(int param1, int param2, int param3, int param4) { - GL30.glRenderbufferStorage(param1, param2, param3, param4); - } - - @Override - public void glFramebufferTextureLayerEXT(int param1, int param2, int param3, int param4, int param5) { - GL30.glFramebufferTextureLayer(param1, param2, param3, param4, param5); - } -} diff --git a/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglAbstractDisplay.java b/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglAbstractDisplay.java deleted file mode 100644 index 802b12a0fa..0000000000 --- a/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglAbstractDisplay.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Copyright (c) 2009-2012 jMonkeyEngine - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of 'jMonkeyEngine' nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package com.jme3.system.lwjgl; - -import com.jme3.input.JoyInput; -import com.jme3.input.KeyInput; -import com.jme3.input.MouseInput; -import com.jme3.input.TouchInput; -import com.jme3.input.lwjgl.JInputJoyInput; -import com.jme3.input.lwjgl.LwjglKeyInput; -import com.jme3.input.lwjgl.LwjglMouseInput; -import com.jme3.system.AppSettings; -import com.jme3.system.JmeSystem; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.lwjgl.LWJGLException; -import org.lwjgl.Sys; -import org.lwjgl.opengl.Display; -import org.lwjgl.opengl.OpenGLException; -import org.lwjgl.opengl.Util; - -public abstract class LwjglAbstractDisplay extends LwjglContext implements Runnable { - - private static final Logger logger = Logger.getLogger(LwjglAbstractDisplay.class.getName()); - - protected AtomicBoolean needClose = new AtomicBoolean(false); - protected boolean wasActive = false; - protected int frameRate = 0; - protected boolean autoFlush = true; - protected boolean allowSwapBuffers = false; - - /** - * @return Type.Display or Type.Canvas - */ - public abstract Type getType(); - - /** - * Set the title if its a windowed display - * @param title - */ - public abstract void setTitle(String title); - - /** - * Restart if its a windowed or full-screen display. - */ - public abstract void restart(); - - /** - * Apply the settings, changing resolution, etc. - * @param settings - */ - protected abstract void createContext(AppSettings settings) throws LWJGLException; - - /** - * Destroy the context. - */ - protected abstract void destroyContext(); - - /** - * Does LWJGL display initialization in the OpenGL thread - */ - protected boolean initInThread(){ - try { - if (!JmeSystem.isLowPermissions()){ - // Enable uncaught exception handler only for current thread - Thread.currentThread().setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() { - public void uncaughtException(Thread thread, Throwable thrown) { - listener.handleError("Uncaught exception thrown in "+thread.toString(), thrown); - if (needClose.get()){ - // listener.handleError() has requested the - // context to close. Satisfy request. - deinitInThread(); - } - } - }); - } - - // For canvas, this will create a pbuffer, - // allowing us to query information. - // When the canvas context becomes available, it will - // be replaced seamlessly. - createContext(settings); - printContextInitInfo(); - - created.set(true); - super.internalCreate(); - } catch (Exception ex){ - try { - if (Display.isCreated()) - Display.destroy(); - } catch (Exception ex2){ - logger.log(Level.WARNING, null, ex2); - } - - listener.handleError("Failed to create display", ex); - return false; // if we failed to create display, do not continue - } - - listener.initialize(); - return true; - } - - protected boolean checkGLError(){ - try { - Util.checkGLError(); - } catch (OpenGLException ex){ - listener.handleError("An OpenGL error has occured!", ex); - } - // NOTE: Always return true since this is used in an "assert" statement - return true; - } - - /** - * execute one iteration of the render loop in the OpenGL thread - */ - protected void runLoop(){ - if (!created.get()) - throw new IllegalStateException(); - - listener.update(); - - // All this does is call swap buffers - // If the canvas is not active, there's no need to waste time - // doing that .. - if (renderable.get()){ - assert checkGLError(); - - // calls swap buffers, etc. - try { - if (allowSwapBuffers && autoFlush) { - Display.update(false); - } - } catch (Throwable ex){ - listener.handleError("Error while swapping buffers", ex); - } - } - - int frameRateCap; - if (autoFlush) { - frameRateCap = frameRate; - } else { - frameRateCap = 20; - } - - if (frameRateCap > 0) { - // Cap framerate - Display.sync(frameRateCap); - } - - // check input after we synchronize with framerate. - // this reduces input lag. - if (renderable.get()){ - Display.processMessages(); - } - - // Subclasses just call GLObjectManager clean up objects here - // it is safe .. for now. - renderer.postFrame(); - } - - /** - * De-initialize in the OpenGL thread. - */ - protected void deinitInThread(){ - destroyContext(); - - listener.destroy(); - logger.fine("Display destroyed."); - super.internalDestroy(); - } - - public void run(){ - if (listener == null) { - throw new IllegalStateException("SystemListener is not set on context!" - + "Must set with JmeContext.setSystemListner()."); - } - - loadNatives(); - logger.log(Level.FINE, "Using LWJGL {0}", Sys.getVersion()); - if (!initInThread()) { - logger.log(Level.SEVERE, "Display initialization failed. Cannot continue."); - return; - } - while (true){ - if (renderable.get()){ - if (Display.isCloseRequested()) - listener.requestClose(false); - - if (wasActive != Display.isActive()) { - if (!wasActive) { - listener.gainFocus(); - timer.reset(); - wasActive = true; - } else { - listener.loseFocus(); - wasActive = false; - } - } - } - - runLoop(); - - if (needClose.get()) - break; - } - deinitInThread(); - } - - public JoyInput getJoyInput() { - if (joyInput == null){ - joyInput = new JInputJoyInput(); - } - return joyInput; - } - - public MouseInput getMouseInput() { - if (mouseInput == null){ - mouseInput = new LwjglMouseInput(this); - } - return mouseInput; - } - - public KeyInput getKeyInput() { - if (keyInput == null){ - keyInput = new LwjglKeyInput(this); - } - return keyInput; - } - - public TouchInput getTouchInput() { - return null; - } - - public void setAutoFlushFrames(boolean enabled){ - this.autoFlush = enabled; - } - - public void destroy(boolean waitFor){ - needClose.set(true); - if (waitFor) - waitFor(false); - } - -} diff --git a/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglCanvas.java b/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglCanvas.java deleted file mode 100644 index 0c5392b192..0000000000 --- a/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglCanvas.java +++ /dev/null @@ -1,490 +0,0 @@ -/* - * Copyright (c) 2009-2012 jMonkeyEngine - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of 'jMonkeyEngine' nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package com.jme3.system.lwjgl; - -import com.jme3.system.AppSettings; -import com.jme3.system.JmeCanvasContext; -import com.jme3.system.JmeContext.Type; -import com.jme3.system.JmeSystem; -import com.jme3.system.Platform; -import java.awt.Canvas; -import java.util.logging.Level; -import java.util.logging.Logger; -import javax.swing.SwingUtilities; -import org.lwjgl.LWJGLException; -import org.lwjgl.input.Keyboard; -import org.lwjgl.input.Mouse; -import org.lwjgl.opengl.Display; -import org.lwjgl.opengl.Pbuffer; -import org.lwjgl.opengl.PixelFormat; - -public class LwjglCanvas extends LwjglAbstractDisplay implements JmeCanvasContext { - - protected static final int TASK_NOTHING = 0, - TASK_DESTROY_DISPLAY = 1, - TASK_CREATE_DISPLAY = 2, - TASK_COMPLETE = 3; - -// protected static final boolean USE_SHARED_CONTEXT = -// Boolean.parseBoolean(System.getProperty("jme3.canvas.sharedctx", "true")); - - protected static final boolean USE_SHARED_CONTEXT = false; - - private static final Logger logger = Logger.getLogger(LwjglDisplay.class.getName()); - private Canvas canvas; - private int width; - private int height; - - private final Object taskLock = new Object(); - private int desiredTask = TASK_NOTHING; - - private Thread renderThread; - private boolean runningFirstTime = true; - private boolean mouseWasGrabbed = false; - - private boolean mouseWasCreated = false; - private boolean keyboardWasCreated = false; - - private Pbuffer pbuffer; - private PixelFormat pbufferFormat; - private PixelFormat canvasFormat; - - private class GLCanvas extends Canvas { - @Override - public void addNotify(){ - super.addNotify(); - - if (renderThread != null && renderThread.getState() == Thread.State.TERMINATED) { - return; // already destroyed. - } - - if (renderThread == null){ - logger.log(Level.FINE, "EDT: Creating OGL thread."); - - // Also set some settings on the canvas here. - // So we don't do it outside the AWT thread. - canvas.setFocusable(true); - canvas.setIgnoreRepaint(true); - - renderThread = new Thread(LwjglCanvas.this, THREAD_NAME); - renderThread.start(); - }else if (needClose.get()){ - return; - } - - logger.log(Level.FINE, "EDT: Telling OGL to create display .."); - synchronized (taskLock){ - desiredTask = TASK_CREATE_DISPLAY; -// while (desiredTask != TASK_COMPLETE){ -// try { -// taskLock.wait(); -// } catch (InterruptedException ex) { -// return; -// } -// } -// desiredTask = TASK_NOTHING; - } -// logger.log(Level.FINE, "EDT: OGL has created the display"); - } - - @Override - public void removeNotify(){ - if (needClose.get()){ - logger.log(Level.FINE, "EDT: Application is stopped. Not restoring canvas."); - super.removeNotify(); - return; - } - - // We must tell GL context to shutdown and wait for it to - // shutdown, otherwise, issues will occur. - logger.log(Level.FINE, "EDT: Telling OGL to destroy display .."); - synchronized (taskLock){ - desiredTask = TASK_DESTROY_DISPLAY; - while (desiredTask != TASK_COMPLETE){ - try { - taskLock.wait(); - } catch (InterruptedException ex){ - super.removeNotify(); - return; - } - } - desiredTask = TASK_NOTHING; - } - - logger.log(Level.FINE, "EDT: Acknowledged receipt of canvas death"); - // GL context is dead at this point - - super.removeNotify(); - } - } - - public LwjglCanvas(){ - super(); - canvas = new GLCanvas(); - } - - @Override - public Type getType() { - return Type.Canvas; - } - - public void create(boolean waitFor){ - if (renderThread == null){ - logger.log(Level.FINE, "MAIN: Creating OGL thread."); - - renderThread = new Thread(LwjglCanvas.this, THREAD_NAME); - renderThread.start(); - } - // do not do anything. - // superclass's create() will be called at initInThread() - if (waitFor) { - waitFor(true); - } - } - - @Override - public void setTitle(String title) { - } - - @Override - public void restart() { - frameRate = settings.getFrameRate(); - // TODO: Handle other cases, like change of pixel format, etc. - } - - public Canvas getCanvas(){ - return canvas; - } - - @Override - protected void runLoop(){ - if (desiredTask != TASK_NOTHING){ - synchronized (taskLock){ - switch (desiredTask){ - case TASK_CREATE_DISPLAY: - logger.log(Level.FINE, "OGL: Creating display .."); - restoreCanvas(); - listener.gainFocus(); - desiredTask = TASK_NOTHING; - break; - case TASK_DESTROY_DISPLAY: - logger.log(Level.FINE, "OGL: Destroying display .."); - listener.loseFocus(); - pauseCanvas(); - break; - } - desiredTask = TASK_COMPLETE; - taskLock.notifyAll(); - } - } - - if (renderable.get()){ - int newWidth = Math.max(canvas.getWidth(), 1); - int newHeight = Math.max(canvas.getHeight(), 1); - if (width != newWidth || height != newHeight){ - width = newWidth; - height = newHeight; - if (listener != null){ - listener.reshape(width, height); - } - } - }else{ - if (frameRate <= 0){ - // NOTE: MUST be done otherwise - // Windows OS will freeze - Display.sync(30); - } - } - - super.runLoop(); - } - - private void pauseCanvas(){ - if (Mouse.isCreated()){ - if (Mouse.isGrabbed()){ - Mouse.setGrabbed(false); - mouseWasGrabbed = true; - } - mouseWasCreated = true; - Mouse.destroy(); - } - if (Keyboard.isCreated()){ - keyboardWasCreated = true; - Keyboard.destroy(); - } - - renderable.set(false); - destroyContext(); - } - - /** - * Called to restore the canvas. - */ - private void restoreCanvas(){ - logger.log(Level.FINE, "OGL: Waiting for canvas to become displayable.."); - while (!canvas.isDisplayable()){ - try { - Thread.sleep(10); - } catch (InterruptedException ex) { - logger.log(Level.SEVERE, "OGL: Interrupted! ", ex); - } - } - - logger.log(Level.FINE, "OGL: Creating display context .."); - - // Set renderable to true, since canvas is now displayable. - renderable.set(true); - createContext(settings); - - logger.log(Level.FINE, "OGL: Display is active!"); - - try { - if (mouseWasCreated){ - Mouse.create(); - if (mouseWasGrabbed){ - Mouse.setGrabbed(true); - mouseWasGrabbed = false; - } - } - if (keyboardWasCreated){ - Keyboard.create(); - keyboardWasCreated = false; - } - } catch (LWJGLException ex){ - logger.log(Level.SEVERE, "Encountered exception when restoring input", ex); - } - - SwingUtilities.invokeLater(new Runnable(){ - public void run(){ - canvas.requestFocus(); - } - }); - } - - /** - * It seems it is best to use one pixel format for all shared contexts. - * @see http://developer.apple.com/library/mac/#qa/qa1248/_index.html - */ - protected PixelFormat acquirePixelFormat(boolean forPbuffer){ - if (forPbuffer){ - // Use 0 samples for pbuffer format, prevents - // crashes on bad drivers - if (pbufferFormat == null){ - pbufferFormat = new PixelFormat(settings.getBitsPerPixel(), - settings.getAlphaBits(), - settings.getDepthBits(), - settings.getStencilBits(), - 0, // samples - 0, - 0, - 0, - settings.useStereo3D()); - } - return pbufferFormat; - }else{ - if (canvasFormat == null){ - int samples = getNumSamplesToUse(); - canvasFormat = new PixelFormat(settings.getBitsPerPixel(), - settings.getAlphaBits(), - settings.getDepthBits(), - settings.getStencilBits(), - samples, - 0, - 0, - 0, - settings.useStereo3D()); - } - return canvasFormat; - } - } - - /** - * Makes sure the pbuffer is available and ready for use - */ - protected void makePbufferAvailable() throws LWJGLException{ - if (pbuffer != null && pbuffer.isBufferLost()){ - logger.log(Level.WARNING, "PBuffer was lost!"); - pbuffer.destroy(); - pbuffer = null; - } - - if (pbuffer == null) { - pbuffer = new Pbuffer(1, 1, acquirePixelFormat(true), null); - pbuffer.makeCurrent(); - logger.log(Level.FINE, "OGL: Pbuffer has been created"); - - // Any created objects are no longer valid - if (!runningFirstTime){ - renderer.resetGLObjects(); - } - } - - pbuffer.makeCurrent(); - if (!pbuffer.isCurrent()){ - throw new LWJGLException("Pbuffer cannot be made current"); - } - } - - protected void destroyPbuffer(){ - if (pbuffer != null){ - if (!pbuffer.isBufferLost()){ - pbuffer.destroy(); - } - pbuffer = null; - } - } - - /** - * This is called: - * 1) When the context thread ends - * 2) Any time the canvas becomes non-displayable - */ - protected void destroyContext(){ - try { - // invalidate the state so renderer can resume operation - if (!USE_SHARED_CONTEXT){ - renderer.cleanup(); - } - - if (Display.isCreated()){ - /* FIXES: - * org.lwjgl.LWJGLException: X Error - * BadWindow (invalid Window parameter) request_code: 2 minor_code: 0 - * - * Destroying keyboard early prevents the error above, triggered - * by destroying keyboard in by Display.destroy() or Display.setParent(null). - * Therefore Keyboard.destroy() should precede any of these calls. - */ - if (Keyboard.isCreated()){ - // Should only happen if called in - // LwjglAbstractDisplay.deinitInThread(). - Keyboard.destroy(); - } - - //try { - // NOTE: On Windows XP, not calling setParent(null) - // freezes the application. - // On Mac it freezes the application. - // On Linux it fixes a crash with X Window System. - if (JmeSystem.getPlatform() == Platform.Windows32 - || JmeSystem.getPlatform() == Platform.Windows64){ - //Display.setParent(null); - } - //} catch (LWJGLException ex) { - // logger.log(Level.SEVERE, "Encountered exception when setting parent to null", ex); - //} - - Display.destroy(); - } - - // The canvas is no longer visible, - // but the context thread is still running. - if (!needClose.get()){ - // MUST make sure there's still a context current here .. - // Display is dead, make pbuffer available to the system - makePbufferAvailable(); - - renderer.invalidateState(); - }else{ - // The context thread is no longer running. - // Destroy pbuffer. - destroyPbuffer(); - } - } catch (LWJGLException ex) { - listener.handleError("Failed make pbuffer available", ex); - } - } - - /** - * This is called: - * 1) When the context thread starts - * 2) Any time the canvas becomes displayable again. - */ - @Override - protected void createContext(AppSettings settings) { - // In case canvas is not visible, we still take framerate - // from settings to prevent "100% CPU usage" - frameRate = settings.getFrameRate(); - allowSwapBuffers = settings.isSwapBuffers(); - - try { - if (renderable.get()){ - if (!runningFirstTime){ - // because the display is a different opengl context - // must reset the context state. - if (!USE_SHARED_CONTEXT){ - renderer.cleanup(); - } - } - - // if the pbuffer is currently active, - // make sure to deactivate it - destroyPbuffer(); - - if (Keyboard.isCreated()){ - Keyboard.destroy(); - } - - try { - Thread.sleep(1000); - } catch (InterruptedException ex) { - } - - Display.setVSyncEnabled(settings.isVSync()); - Display.setParent(canvas); - - if (USE_SHARED_CONTEXT){ - Display.create(acquirePixelFormat(false), pbuffer); - }else{ - Display.create(acquirePixelFormat(false)); - } - - renderer.invalidateState(); - }else{ - // First create the pbuffer, if it is needed. - makePbufferAvailable(); - } - - // At this point, the OpenGL context is active. - if (runningFirstTime){ - // THIS is the part that creates the renderer. - // It must always be called, now that we have the pbuffer workaround. - initContextFirstTime(); - runningFirstTime = false; - } - } catch (LWJGLException ex) { - listener.handleError("Failed to initialize OpenGL context", ex); - // TODO: Fix deadlock that happens after the error (throw runtime exception?) - } - } -} diff --git a/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglContext.java b/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglContext.java deleted file mode 100644 index 68d46b1c7f..0000000000 --- a/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglContext.java +++ /dev/null @@ -1,429 +0,0 @@ -/* - * Copyright (c) 2009-2012 jMonkeyEngine - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of 'jMonkeyEngine' nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package com.jme3.system.lwjgl; - -import com.jme3.input.lwjgl.JInputJoyInput; -import com.jme3.input.lwjgl.LwjglKeyInput; -import com.jme3.input.lwjgl.LwjglMouseInput; -import com.jme3.opencl.Device; -import com.jme3.opencl.PlatformChooser; -import com.jme3.opencl.lwjgl.LwjglDevice; -import com.jme3.opencl.lwjgl.LwjglPlatform; -import com.jme3.opencl.DefaultPlatformChooser; -import com.jme3.renderer.Renderer; -import com.jme3.renderer.RendererException; -import com.jme3.renderer.lwjgl.LwjglGL; -import com.jme3.renderer.lwjgl.LwjglGLExt; -import com.jme3.renderer.lwjgl.LwjglGLFboEXT; -import com.jme3.renderer.lwjgl.LwjglGLFboGL3; -import com.jme3.renderer.opengl.GL; -import com.jme3.renderer.opengl.GL2; -import com.jme3.renderer.opengl.GL3; -import com.jme3.renderer.opengl.GL4; -import com.jme3.renderer.opengl.GLDebugDesktop; -import com.jme3.renderer.opengl.GLExt; -import com.jme3.renderer.opengl.GLFbo; -import com.jme3.renderer.opengl.GLRenderer; -import com.jme3.renderer.opengl.GLTiming; -import com.jme3.renderer.opengl.GLTimingState; -import com.jme3.renderer.opengl.GLTracer; -import com.jme3.system.*; -import java.io.File; -import java.util.ArrayList; -import java.util.List; - -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.lwjgl.LWJGLException; -import org.lwjgl.Sys; -import org.lwjgl.opencl.*; -import org.lwjgl.opengl.*; - -/** - * A LWJGL implementation of a graphics context. - */ -public abstract class LwjglContext implements JmeContext { - - private static final Logger logger = Logger.getLogger(LwjglContext.class.getName()); - - protected static final String THREAD_NAME = "jME3 Main"; - protected AtomicBoolean created = new AtomicBoolean(false); - protected AtomicBoolean renderable = new AtomicBoolean(false); - protected final Object createdLock = new Object(); - - protected AppSettings settings = new AppSettings(true); - protected Renderer renderer; - protected LwjglKeyInput keyInput; - protected LwjglMouseInput mouseInput; - protected JInputJoyInput joyInput; - protected Timer timer; - protected SystemListener listener; - - protected LwjglPlatform clPlatform; - protected com.jme3.opencl.lwjgl.LwjglContext clContext; - - public void setSystemListener(SystemListener listener) { - this.listener = listener; - } - - protected void printContextInitInfo() { - logger.log(Level.INFO, "LWJGL {0} context running on thread {1}\n" - + " * Graphics Adapter: {2}\n" - + " * Driver Version: {3}\n" - + " * Scaling Factor: {4}", - new Object[]{Sys.getVersion(), Thread.currentThread().getName(), - Display.getAdapter(), Display.getVersion(), - Display.getPixelScaleFactor()}); - } - - protected ContextAttribs createContextAttribs() { - if (settings.getBoolean("GraphicsDebug") || settings.getRenderer().equals(AppSettings.LWJGL_OPENGL3)) { - ContextAttribs attr; - if (settings.getRenderer().equals(AppSettings.LWJGL_OPENGL3)) { - attr = new ContextAttribs(3, 2); - attr = attr.withProfileCore(true).withForwardCompatible(true).withProfileCompatibility(false); - } else { - attr = new ContextAttribs(); - } - if (settings.getBoolean("GraphicsDebug")) { - attr = attr.withDebug(true); - } - return attr; - } else { - return null; - } - } - protected int determineMaxSamples(int requestedSamples) { - try { - // If we already have a valid context, determine samples using current - // context. - if (Display.isCreated() && Display.isCurrent()) { - if (GLContext.getCapabilities().GL_ARB_framebuffer_object) { - return GL11.glGetInteger(ARBFramebufferObject.GL_MAX_SAMPLES); - } else if (GLContext.getCapabilities().GL_EXT_framebuffer_multisample) { - return GL11.glGetInteger(EXTFramebufferMultisample.GL_MAX_SAMPLES_EXT); - } else { - // Unknown. - return Integer.MAX_VALUE; - } - } - } catch (LWJGLException ex) { - listener.handleError("Failed to check if display is current", ex); - } - if ((Pbuffer.getCapabilities() & Pbuffer.PBUFFER_SUPPORTED) == 0) { - // No pbuffer, assume everything is supported. - return Integer.MAX_VALUE; - } else { - Pbuffer pb = null; - // OpenGL2 method: Create pbuffer and query samples - // from GL_ARB_framebuffer_object or GL_EXT_framebuffer_multisample. - try { - pb = new Pbuffer(1, 1, new PixelFormat(0, 0, 0), null); - pb.makeCurrent(); - - if (GLContext.getCapabilities().GL_ARB_framebuffer_object) { - return GL11.glGetInteger(ARBFramebufferObject.GL_MAX_SAMPLES); - } else if (GLContext.getCapabilities().GL_EXT_framebuffer_multisample) { - return GL11.glGetInteger(EXTFramebufferMultisample.GL_MAX_SAMPLES_EXT); - } - - // OpenGL2 method failed. - return Integer.MAX_VALUE; - } catch (LWJGLException ex) { - // Something else failed. - return Integer.MAX_VALUE; - } finally { - if (pb != null) { - pb.destroy(); - } - } - } - } - protected void loadNatives() { - if (JmeSystem.isLowPermissions()) { - return; - } - if ("LWJGL".equals(settings.getAudioRenderer())) { - NativeLibraryLoader.loadNativeLibrary("openal", true); - } - if (settings.useJoysticks()) { - NativeLibraryLoader.loadNativeLibrary("jinput", true); - NativeLibraryLoader.loadNativeLibrary("jinput-dx8", true); - } - NativeLibraryLoader.loadNativeLibrary("lwjgl", true); - } - protected int getNumSamplesToUse() { - int samples = 0; - if (settings.getSamples() > 1) { - samples = settings.getSamples(); - int supportedSamples = determineMaxSamples(samples); - if (supportedSamples < samples) { - logger.log(Level.WARNING, - "Couldn''t satisfy antialiasing samples requirement: x{0}. " - + "Video hardware only supports: x{1}", - new Object[]{samples, supportedSamples}); - samples = supportedSamples; - } - } - return samples; - } - - protected void initContextFirstTime() { - if (!GLContext.getCapabilities().OpenGL20) { - throw new RendererException("OpenGL 2.0 or higher is " - + "required for jMonkeyEngine"); - } - - if (settings.getRenderer().equals(AppSettings.LWJGL_OPENGL2) - || settings.getRenderer().equals(AppSettings.LWJGL_OPENGL3)) { - GL gl = new LwjglGL(); - GLExt glext = new LwjglGLExt(); - GLFbo glfbo; - - if (GLContext.getCapabilities().OpenGL30) { - glfbo = new LwjglGLFboGL3(); - } else { - glfbo = new LwjglGLFboEXT(); - } - - if (settings.getBoolean("GraphicsDebug")) { - gl = new GLDebugDesktop(gl, glext, glfbo); - glext = (GLExt) gl; - glfbo = (GLFbo) gl; - } - if (settings.getBoolean("GraphicsTiming")) { - GLTimingState timingState = new GLTimingState(); - gl = (GL) GLTiming.createGLTiming(gl, timingState, GL.class, GL2.class, GL3.class, GL4.class); - glext = (GLExt) GLTiming.createGLTiming(glext, timingState, GLExt.class); - glfbo = (GLFbo) GLTiming.createGLTiming(glfbo, timingState, GLFbo.class); - } - if (settings.getBoolean("GraphicsTrace")) { - gl = (GL) GLTracer.createDesktopGlTracer(gl, GL.class, GL2.class, GL3.class, GL4.class); - glext = (GLExt) GLTracer.createDesktopGlTracer(glext, GLExt.class); - glfbo = (GLFbo) GLTracer.createDesktopGlTracer(glfbo, GLFbo.class); - } - renderer = new GLRenderer(gl, glext, glfbo); - renderer.initialize(); - } else { - throw new UnsupportedOperationException("Unsupported renderer: " + settings.getRenderer()); - } - if (GLContext.getCapabilities().GL_ARB_debug_output && settings.getBoolean("GraphicsDebug")) { - ARBDebugOutput.glDebugMessageCallbackARB(new ARBDebugOutputCallback(new LwjglGLDebugOutputHandler())); - } - renderer.setMainFrameBufferSrgb(settings.isGammaCorrection()); - renderer.setLinearizeSrgbImages(settings.isGammaCorrection()); - - // Init input - if (keyInput != null) { - keyInput.initialize(); - } - - if (mouseInput != null) { - mouseInput.initialize(); - } - - if (joyInput != null) { - joyInput.initialize(); - } - - } - - @SuppressWarnings("unchecked") - protected void initOpenCL() { - logger.info("Initialize OpenCL wiht LWJGL2"); - - try { - CL.create(); - } catch (LWJGLException ex) { - logger.log(Level.SEVERE, "Unable to initialize OpenCL", ex); - return; - } - - //load platforms and devices - StringBuilder platformInfos = new StringBuilder(); - ArrayList platforms = new ArrayList<>(); - for (CLPlatform p : CLPlatform.getPlatforms()) { - platforms.add(new LwjglPlatform(p)); - } - platformInfos.append("Available OpenCL platforms:"); - for (int i=0; i devices = platform.getDevices(); - platformInfos.append("\n * Available devices:"); - for (int j=0; j choosenDevices = chooser.chooseDevices(platforms); - List devices = new ArrayList<>(choosenDevices.size()); - LwjglPlatform platform = null; - for (Device d : choosenDevices) { - if (!(d instanceof LwjglDevice)) { - logger.log(Level.SEVERE, "attempt to return a custom Device implementation from PlatformChooser: {0}", d); - return; - } - LwjglDevice ld = (LwjglDevice) d; - if (platform == null) { - platform = ld.getPlatform(); - } else if (platform != ld.getPlatform()) { - logger.severe("attempt to use devices from different platforms"); - return; - } - devices.add(ld.getDevice()); - } - if (devices.isEmpty()) { - logger.warning("no devices specified, no OpenCL context created"); - return; - } - clPlatform = platform; - logger.log(Level.INFO, "chosen platform: {0}", platform.getName()); - logger.log(Level.INFO, "chosen devices: {0}", choosenDevices); - - //create context - try { - CLContext c = CLContext.create(platform.getPlatform(), devices, null, Display.getDrawable(), null); - clContext = new com.jme3.opencl.lwjgl.LwjglContext(c, (List) choosenDevices); - } catch (LWJGLException ex) { - logger.log(Level.SEVERE, "Unable to create OpenCL context", ex); - return; - } - - logger.info("OpenCL context created"); - } - - public void internalDestroy() { - renderer = null; - timer = null; - renderable.set(false); - synchronized (createdLock) { - created.set(false); - createdLock.notifyAll(); - } - } - public void internalCreate() { - timer = new LwjglTimer(); - synchronized (createdLock) { - created.set(true); - createdLock.notifyAll(); - } - if (renderable.get()) { - initContextFirstTime(); - } else { - assert getType() == Type.Canvas; - } - } - - public void create() { - create(false); - } - - public void destroy() { - destroy(false); - } - - protected void waitFor(boolean createdVal) { - synchronized (createdLock) { - while (created.get() != createdVal) { - try { - createdLock.wait(); - } catch (InterruptedException ex) { - } - } - } - } - - public boolean isCreated() { - return created.get(); - } - public boolean isRenderable() { - return renderable.get(); - } - - public void setSettings(AppSettings settings) { - this.settings.copyFrom(settings); - } - - public AppSettings getSettings() { - return settings; - } - - public Renderer getRenderer() { - return renderer; - } - - public Timer getTimer() { - return timer; - } - - @Override - public com.jme3.opencl.Context getOpenCLContext() { - return clContext; - } -} diff --git a/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglDisplay.java b/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglDisplay.java deleted file mode 100644 index 0fb787efef..0000000000 --- a/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglDisplay.java +++ /dev/null @@ -1,255 +0,0 @@ -/* - * Copyright (c) 2009-2012 jMonkeyEngine - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of 'jMonkeyEngine' nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package com.jme3.system.lwjgl; - -import com.jme3.system.AppSettings; -import com.jme3.system.JmeContext.Type; -import java.awt.Graphics2D; -import java.awt.image.BufferedImage; -import java.nio.ByteBuffer; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.lwjgl.LWJGLException; -import org.lwjgl.opengl.*; - -public class LwjglDisplay extends LwjglAbstractDisplay { - - private static final Logger logger = Logger.getLogger(LwjglDisplay.class.getName()); - - private final AtomicBoolean needRestart = new AtomicBoolean(false); - private PixelFormat pixelFormat; - - protected DisplayMode getFullscreenDisplayMode(int width, int height, int bpp, int freq){ - try { - DisplayMode[] modes = Display.getAvailableDisplayModes(); - for (DisplayMode mode : modes) { - if (mode.getWidth() == width - && mode.getHeight() == height - && (mode.getBitsPerPixel() == bpp || (bpp == 24 && mode.getBitsPerPixel() == 32)) - && (mode.getFrequency() == freq || (freq == 60 && mode.getFrequency() == 59))) { - return mode; - } - } - } catch (LWJGLException ex) { - listener.handleError("Failed to acquire fullscreen display mode!", ex); - } - return null; - } - - protected void createContext(AppSettings settings) throws LWJGLException{ - DisplayMode displayMode; - if (settings.getWidth() <= 0 || settings.getHeight() <= 0){ - displayMode = Display.getDesktopDisplayMode(); - settings.setResolution(displayMode.getWidth(), displayMode.getHeight()); - }else if (settings.isFullscreen()){ - displayMode = getFullscreenDisplayMode(settings.getWidth(), settings.getHeight(), - settings.getBitsPerPixel(), settings.getFrequency()); - if (displayMode == null) { - throw new RuntimeException("Unable to find fullscreen display mode matching settings"); - } - }else{ - displayMode = new DisplayMode(settings.getWidth(), settings.getHeight()); - } - - int samples = getNumSamplesToUse(); - PixelFormat pf = new PixelFormat(settings.getBitsPerPixel(), - settings.getAlphaBits(), - settings.getDepthBits(), - settings.getStencilBits(), - samples, - 0, - 0, - 0, - settings.useStereo3D()); - - frameRate = settings.getFrameRate(); - allowSwapBuffers = settings.isSwapBuffers(); - logger.log(Level.FINE, "Selected display mode: {0}", displayMode); - - boolean pixelFormatChanged = false; - if (created.get() && (pixelFormat.getBitsPerPixel() != pf.getBitsPerPixel() - ||pixelFormat.getAlphaBits() != pf.getAlphaBits() - ||pixelFormat.getDepthBits() != pf.getDepthBits() - ||pixelFormat.getStencilBits() != pf.getStencilBits() - ||pixelFormat.getSamples() != pf.getSamples())){ - renderer.resetGLObjects(); - Display.destroy(); - pixelFormatChanged = true; - } - pixelFormat = pf; - - Display.setTitle(settings.getTitle()); - Display.setResizable(settings.isResizable()); - - if (displayMode != null) { - if (settings.isFullscreen()) { - Display.setDisplayModeAndFullscreen(displayMode); - } else { - Display.setFullscreen(false); - Display.setDisplayMode(displayMode); - } - } else { - Display.setFullscreen(settings.isFullscreen()); - } - - if (settings.getIcons() != null) { - Display.setIcon(imagesToByteBuffers(settings.getIcons())); - } - - Display.setVSyncEnabled(settings.isVSync()); - - if (created.get() && !pixelFormatChanged) { - Display.releaseContext(); - Display.makeCurrent(); - Display.update(); - } - - if (!created.get() || pixelFormatChanged){ - ContextAttribs attr = createContextAttribs(); - if (attr != null) { - Display.create(pixelFormat, attr); - } else { - Display.create(pixelFormat); - } - renderable.set(true); - - if (pixelFormatChanged && pixelFormat.getSamples() > 1 - && GLContext.getCapabilities().GL_ARB_multisample){ - GL11.glEnable(ARBMultisample.GL_MULTISAMPLE_ARB); - } - } - - if (settings.isOpenCLSupport()) { - initOpenCL(); - } - } - - protected void destroyContext(){ - try { - renderer.cleanup(); - Display.releaseContext(); - Display.destroy(); - } catch (LWJGLException ex) { - listener.handleError("Failed to destroy context", ex); - } - } - - public void create(boolean waitFor){ - if (created.get()){ - logger.warning("create() called when display is already created!"); - return; - } - - new Thread(this, THREAD_NAME).start(); - if (waitFor) - waitFor(true); - } - - @Override - public void runLoop(){ - // This method is overriden to do restart - if (needRestart.getAndSet(false)) { - try { - createContext(settings); - } catch (LWJGLException ex) { - logger.log(Level.SEVERE, "Failed to set display settings!", ex); - } - listener.reshape(settings.getWidth(), settings.getHeight()); - logger.fine("Display restarted."); - } else if (Display.wasResized()) { - int newWidth = Display.getWidth(); - int newHeight = Display.getHeight(); - settings.setResolution(newWidth, newHeight); - listener.reshape(newWidth, newHeight); - } - - super.runLoop(); - } - - @Override - public void restart() { - if (created.get()){ - needRestart.set(true); - }else{ - logger.warning("Display is not created, cannot restart window."); - } - } - - public Type getType() { - return Type.Display; - } - - public void setTitle(String title){ - if (created.get()) - Display.setTitle(title); - } - - private ByteBuffer[] imagesToByteBuffers(Object[] images) { - ByteBuffer[] out = new ByteBuffer[images.length]; - for (int i = 0; i < images.length; i++) { - BufferedImage image = (BufferedImage) images[i]; - out[i] = imageToByteBuffer(image); - } - return out; - } - - private ByteBuffer imageToByteBuffer(BufferedImage image) { - if (image.getType() != BufferedImage.TYPE_INT_ARGB_PRE) { - BufferedImage convertedImage = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_INT_ARGB_PRE); - Graphics2D g = convertedImage.createGraphics(); - double width = image.getWidth() * (double) 1; - double height = image.getHeight() * (double) 1; - g.drawImage(image, (int) ((convertedImage.getWidth() - width) / 2), - (int) ((convertedImage.getHeight() - height) / 2), - (int) (width), (int) (height), null); - g.dispose(); - image = convertedImage; - } - - byte[] imageBuffer = new byte[image.getWidth() * image.getHeight() * 4]; - int counter = 0; - for (int i = 0; i < image.getHeight(); i++) { - for (int j = 0; j < image.getWidth(); j++) { - int colorSpace = image.getRGB(j, i); - imageBuffer[counter + 0] = (byte) ((colorSpace << 8) >> 24); - imageBuffer[counter + 1] = (byte) ((colorSpace << 16) >> 24); - imageBuffer[counter + 2] = (byte) ((colorSpace << 24) >> 24); - imageBuffer[counter + 3] = (byte) (colorSpace >> 24); - counter += 4; - } - } - return ByteBuffer.wrap(imageBuffer); - } - -} diff --git a/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglGLDebugOutputHandler.java b/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglGLDebugOutputHandler.java deleted file mode 100644 index d943fe6eef..0000000000 --- a/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglGLDebugOutputHandler.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2009-2015 jMonkeyEngine - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of 'jMonkeyEngine' nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package com.jme3.system.lwjgl; - -import java.util.HashMap; -import org.lwjgl.opengl.ARBDebugOutput; -import org.lwjgl.opengl.ARBDebugOutputCallback; - -class LwjglGLDebugOutputHandler implements ARBDebugOutputCallback.Handler { - - private static final HashMap constMap = new HashMap(); - private static final String MESSAGE_FORMAT = - "[JME3] OpenGL debug message\r\n" + - " ID: %d\r\n" + - " Source: %s\r\n" + - " Type: %s\r\n" + - " Severity: %s\r\n" + - " Message: %s"; - - static { - constMap.put(ARBDebugOutput.GL_DEBUG_SOURCE_API_ARB, "API"); - constMap.put(ARBDebugOutput.GL_DEBUG_SOURCE_APPLICATION_ARB, "APPLICATION"); - constMap.put(ARBDebugOutput.GL_DEBUG_SOURCE_OTHER_ARB, "OTHER"); - constMap.put(ARBDebugOutput.GL_DEBUG_SOURCE_SHADER_COMPILER_ARB, "SHADER_COMPILER"); - constMap.put(ARBDebugOutput.GL_DEBUG_SOURCE_THIRD_PARTY_ARB, "THIRD_PARTY"); - constMap.put(ARBDebugOutput.GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB, "WINDOW_SYSTEM"); - - constMap.put(ARBDebugOutput.GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB, "DEPRECATED_BEHAVIOR"); - constMap.put(ARBDebugOutput.GL_DEBUG_TYPE_ERROR_ARB, "ERROR"); - constMap.put(ARBDebugOutput.GL_DEBUG_TYPE_OTHER_ARB, "OTHER"); - constMap.put(ARBDebugOutput.GL_DEBUG_TYPE_PERFORMANCE_ARB, "PERFORMANCE"); - constMap.put(ARBDebugOutput.GL_DEBUG_TYPE_PORTABILITY_ARB, "PORTABILITY"); - constMap.put(ARBDebugOutput.GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB, "UNDEFINED_BEHAVIOR"); - - constMap.put(ARBDebugOutput.GL_DEBUG_SEVERITY_HIGH_ARB, "HIGH"); - constMap.put(ARBDebugOutput.GL_DEBUG_SEVERITY_MEDIUM_ARB, "MEDIUM"); - constMap.put(ARBDebugOutput.GL_DEBUG_SEVERITY_LOW_ARB, "LOW"); - } - - @Override - public void handleMessage(int source, int type, int id, int severity, String message) { - String sourceStr = constMap.get(source); - String typeStr = constMap.get(type); - String severityStr = constMap.get(severity); - - System.err.println(String.format(MESSAGE_FORMAT, id, sourceStr, typeStr, severityStr, message)); - Thread.dumpStack(); - } - -} diff --git a/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglOffscreenBuffer.java b/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglOffscreenBuffer.java deleted file mode 100644 index afd2c7508a..0000000000 --- a/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglOffscreenBuffer.java +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright (c) 2009-2012 jMonkeyEngine - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of 'jMonkeyEngine' nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package com.jme3.system.lwjgl; - -import com.jme3.input.JoyInput; -import com.jme3.input.KeyInput; -import com.jme3.input.MouseInput; -import com.jme3.input.TouchInput; -import com.jme3.input.dummy.DummyKeyInput; -import com.jme3.input.dummy.DummyMouseInput; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.lwjgl.LWJGLException; -import org.lwjgl.Sys; -import org.lwjgl.opengl.*; - -public class LwjglOffscreenBuffer extends LwjglContext implements Runnable { - - private static final Logger logger = Logger.getLogger(LwjglOffscreenBuffer.class.getName()); - private Pbuffer pbuffer; - protected AtomicBoolean needClose = new AtomicBoolean(false); - private int width; - private int height; - private PixelFormat pixelFormat; - - protected void initInThread(){ - if ((Pbuffer.getCapabilities() & Pbuffer.PBUFFER_SUPPORTED) == 0){ - logger.severe("Offscreen surfaces are not supported."); - return; - } - - int samples = getNumSamplesToUse(); - pixelFormat = new PixelFormat(settings.getBitsPerPixel(), - settings.getAlphaBits(), - settings.getDepthBits(), - settings.getStencilBits(), - samples); - - width = settings.getWidth(); - height = settings.getHeight(); - try{ - Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() { - public void uncaughtException(Thread thread, Throwable thrown) { - listener.handleError("Uncaught exception thrown in "+thread.toString(), thrown); - } - }); - - pbuffer = new Pbuffer(width, height, pixelFormat, null, null, createContextAttribs()); - pbuffer.makeCurrent(); - - renderable.set(true); - - logger.fine("Offscreen buffer created."); - printContextInitInfo(); - } catch (LWJGLException ex){ - listener.handleError("Failed to create display", ex); - } finally { - // TODO: It is possible to avoid "Failed to find pixel format" - // error here by creating a default display. - } - super.internalCreate(); - listener.initialize(); - } - - protected boolean checkGLError(){ - try { - Util.checkGLError(); - } catch (OpenGLException ex){ - listener.handleError("An OpenGL error has occured!", ex); - } - // NOTE: Always return true since this is used in an "assert" statement - return true; - } - - protected void runLoop(){ - if (!created.get()) { - throw new IllegalStateException(); - } - - if (pbuffer.isBufferLost()) { - pbuffer.destroy(); - - try { - pbuffer = new Pbuffer(width, height, pixelFormat, null); - pbuffer.makeCurrent(); - - // Context MUST be reset here to avoid invalid objects! - renderer.invalidateState(); - } catch (LWJGLException ex) { - listener.handleError("Failed to restore pbuffer content", ex); - } - } - - listener.update(); - assert checkGLError(); - - renderer.postFrame(); - - // Need to flush GL commands - // to see any result on the pbuffer's front buffer. - GL11.glFlush(); - - int frameRate = settings.getFrameRate(); - if (frameRate >= 1) { - Display.sync(frameRate); - } - } - - protected void deinitInThread(){ - renderable.set(false); - - listener.destroy(); - renderer.cleanup(); - pbuffer.destroy(); - logger.fine("Offscreen buffer destroyed."); - - super.internalDestroy(); - } - - public void run(){ - loadNatives(); - logger.log(Level.FINE, "Using LWJGL {0}", Sys.getVersion()); - initInThread(); - while (!needClose.get()){ - runLoop(); - } - deinitInThread(); - } - - public void destroy(boolean waitFor){ - needClose.set(true); - if (waitFor) - waitFor(false); - } - - public void create(boolean waitFor){ - if (created.get()){ - logger.warning("create() called when pbuffer is already created!"); - return; - } - - new Thread(this, THREAD_NAME).start(); - if (waitFor) - waitFor(true); - } - - public void restart() { - } - - public void setAutoFlushFrames(boolean enabled){ - } - - public Type getType() { - return Type.OffscreenSurface; - } - - public MouseInput getMouseInput() { - return new DummyMouseInput(); - } - - public KeyInput getKeyInput() { - return new DummyKeyInput(); - } - - public JoyInput getJoyInput() { - return null; - } - - public TouchInput getTouchInput() { - return null; - } - - public void setTitle(String title) { - } - -} diff --git a/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglSmoothingTimer.java b/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglSmoothingTimer.java deleted file mode 100644 index bd2e275edd..0000000000 --- a/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglSmoothingTimer.java +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Copyright (c) 2009-2012 jMonkeyEngine - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of 'jMonkeyEngine' nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package com.jme3.system.lwjgl; - -import com.jme3.math.FastMath; -import com.jme3.system.Timer; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.lwjgl.Sys; - -/** - * Timer handles the system's time related functionality. This - * allows the calculation of the framerate. To keep the framerate calculation - * accurate, a call to update each frame is required. Timer is a - * singleton object and must be created via the getTimer method. - * - * @author Mark Powell - * @version $Id: LWJGLTimer.java,v 1.21 2007/09/22 16:46:35 irrisor Exp $ - */ -public class LwjglSmoothingTimer extends Timer { - private static final Logger logger = Logger.getLogger(LwjglSmoothingTimer.class - .getName()); - - private long lastFrameDiff; - - //frame rate parameters. - private long oldTime; - - private float lastTPF, lastFPS; - - public static int TIMER_SMOOTHNESS = 32; - - private long[] tpf; - - private int smoothIndex; - - private final static long LWJGL_TIMER_RES = Sys.getTimerResolution(); - private final static float INV_LWJGL_TIMER_RES = ( 1f / LWJGL_TIMER_RES ); - private static float invTimerRezSmooth; - - public final static long LWJGL_TIME_TO_NANOS = (1000000000 / LWJGL_TIMER_RES); - - private long startTime; - - private boolean allSmooth = false; - - /** - * Constructor builds a Timer object. All values will be - * initialized to it's default values. - */ - public LwjglSmoothingTimer() { - reset(); - - //print timer resolution info - logger.log(Level.FINE, "Timer resolution: {0} ticks per second", LWJGL_TIMER_RES); - } - - public void reset() { - lastFrameDiff = 0; - lastFPS = 0; - lastTPF = 0; - - // init to -1 to indicate this is a new timer. - oldTime = -1; - //reset time - startTime = Sys.getTime(); - - tpf = new long[TIMER_SMOOTHNESS]; - smoothIndex = TIMER_SMOOTHNESS - 1; - invTimerRezSmooth = ( 1f / (LWJGL_TIMER_RES * TIMER_SMOOTHNESS)); - - // set tpf... -1 values will not be used for calculating the average in update() - for ( int i = tpf.length; --i >= 0; ) { - tpf[i] = -1; - } - } - - /** - * @see Timer#getTime() - */ - public long getTime() { - return Sys.getTime() - startTime; - } - - /** - * @see Timer#getResolution() - */ - public long getResolution() { - return LWJGL_TIMER_RES; - } - - /** - * getFrameRate returns the current frame rate since the last - * call to update. - * - * @return the current frame rate. - */ - public float getFrameRate() { - return lastFPS; - } - - public float getTimePerFrame() { - return lastTPF; - } - - /** - * update recalulates the frame rate based on the previous - * call to update. It is assumed that update is called each frame. - */ - public void update() { - long newTime = Sys.getTime(); - long oldTime = this.oldTime; - this.oldTime = newTime; - if ( oldTime == -1 ) { - // For the first frame use 60 fps. This value will not be counted in further averages. - // This is done so initialization code between creating the timer and the first - // frame is not counted as a single frame on it's own. - lastTPF = 1 / 60f; - lastFPS = 1f / lastTPF; - return; - } - - long frameDiff = newTime - oldTime; - long lastFrameDiff = this.lastFrameDiff; - if ( lastFrameDiff > 0 && frameDiff > lastFrameDiff *100 ) { - frameDiff = lastFrameDiff *100; - } - this.lastFrameDiff = frameDiff; - tpf[smoothIndex] = frameDiff; - smoothIndex--; - if ( smoothIndex < 0 ) { - smoothIndex = tpf.length - 1; - } - - lastTPF = 0.0f; - if (!allSmooth) { - int smoothCount = 0; - for ( int i = tpf.length; --i >= 0; ) { - if ( tpf[i] != -1 ) { - lastTPF += tpf[i]; - smoothCount++; - } - } - if (smoothCount == tpf.length) - allSmooth = true; - lastTPF *= ( INV_LWJGL_TIMER_RES / smoothCount ); - } else { - for ( int i = tpf.length; --i >= 0; ) { - if ( tpf[i] != -1 ) { - lastTPF += tpf[i]; - } - } - lastTPF *= invTimerRezSmooth; - } - if ( lastTPF < FastMath.FLT_EPSILON ) { - lastTPF = FastMath.FLT_EPSILON; - } - - lastFPS = 1f / lastTPF; - } - - /** - * toString returns the string representation of this timer - * in the format:
- *
- * jme.utility.Timer@1db699b
- * Time: {LONG}
- * FPS: {LONG}
- * - * @return the string representation of this object. - */ - @Override - public String toString() { - String string = super.toString(); - string += "\nTime: " + oldTime; - string += "\nFPS: " + getFrameRate(); - return string; - } -} \ No newline at end of file diff --git a/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglTimer.java b/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglTimer.java deleted file mode 100644 index 6adf03323f..0000000000 --- a/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglTimer.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright (c) 2009-2012 jMonkeyEngine - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of 'jMonkeyEngine' nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package com.jme3.system.lwjgl; - -import com.jme3.system.Timer; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.lwjgl.Sys; - -/** - * Timer handles the system's time related functionality. This - * allows the calculation of the framerate. To keep the framerate calculation - * accurate, a call to update each frame is required. Timer is a - * singleton object and must be created via the getTimer method. - * - * @author Mark Powell - * @version $Id: LWJGLTimer.java,v 1.21 2007/09/22 16:46:35 irrisor Exp $ - */ -public class LwjglTimer extends Timer { - private static final Logger logger = Logger.getLogger(LwjglTimer.class - .getName()); - - //frame rate parameters. - private long oldTime; - private long startTime; - - private float lastTPF, lastFPS; - - private final static long LWJGL_TIMER_RES = Sys.getTimerResolution(); - private final static float INV_LWJGL_TIMER_RES = ( 1f / LWJGL_TIMER_RES ); - - public final static long LWJGL_TIME_TO_NANOS = (1000000000 / LWJGL_TIMER_RES); - - /** - * Constructor builds a Timer object. All values will be - * initialized to it's default values. - */ - public LwjglTimer() { - reset(); - logger.log(Level.FINE, "Timer resolution: {0} ticks per second", LWJGL_TIMER_RES); - } - - public void reset() { - startTime = Sys.getTime(); - oldTime = getTime(); - } - - @Override - public float getTimeInSeconds() { - return getTime() * INV_LWJGL_TIMER_RES; - } - - /** - * @see Timer#getTime() - */ - public long getTime() { - return Sys.getTime() - startTime; - } - - /** - * @see Timer#getResolution() - */ - public long getResolution() { - return LWJGL_TIMER_RES; - } - - /** - * getFrameRate returns the current frame rate since the last - * call to update. - * - * @return the current frame rate. - */ - public float getFrameRate() { - return lastFPS; - } - - public float getTimePerFrame() { - return lastTPF; - } - - /** - * update recalulates the frame rate based on the previous - * call to update. It is assumed that update is called each frame. - */ - public void update() { - long curTime = getTime(); - lastTPF = (curTime - oldTime) * (1.0f / LWJGL_TIMER_RES); - lastFPS = 1.0f / lastTPF; - oldTime = curTime; - } - - /** - * toString returns the string representation of this timer - * in the format:
- *
- * jme.utility.Timer@1db699b
- * Time: {LONG}
- * FPS: {LONG}
- * - * @return the string representation of this object. - */ - @Override - public String toString() { - String string = super.toString(); - string += "\nTime: " + oldTime; - string += "\nFPS: " + getFrameRate(); - return string; - } -} \ No newline at end of file diff --git a/jme3-lwjgl3/build.gradle b/jme3-lwjgl3/build.gradle index 785ce75de2..f060fde9ca 100644 --- a/jme3-lwjgl3/build.gradle +++ b/jme3-lwjgl3/build.gradle @@ -2,7 +2,7 @@ if (!hasProperty('mainClass')) { ext.mainClass = '' } -def lwjglVersion = '3.1.2' +def lwjglVersion = '3.2.0' sourceCompatibility = '1.8' @@ -31,4 +31,4 @@ dependencies { runtime "org.lwjgl:lwjgl-openal:${lwjglVersion}:natives-windows" runtime "org.lwjgl:lwjgl-openal:${lwjglVersion}:natives-linux" runtime "org.lwjgl:lwjgl-openal:${lwjglVersion}:natives-macos" -} \ No newline at end of file +} diff --git a/jme3-vr/.fiplr-root b/jme3-vr/.fiplr-root new file mode 100644 index 0000000000..e69de29bb2 diff --git a/jme3-vr/build.gradle b/jme3-vr/build.gradle index d2c299eb06..d61a515dd8 100644 --- a/jme3-vr/build.gradle +++ b/jme3-vr/build.gradle @@ -2,7 +2,7 @@ if (!hasProperty('mainClass')) { ext.mainClass = '' } -def lwjglVersion = '3.1.3' +def lwjglVersion = '3.2.0' sourceCompatibility = '1.8' @@ -18,4 +18,7 @@ dependencies { // Native LibOVR/Oculus support compile "org.lwjgl:lwjgl-ovr:${lwjglVersion}" runtime "org.lwjgl:lwjgl-ovr:${lwjglVersion}:natives-windows" -} \ No newline at end of file + + compile "org.lwjgl:lwjgl-openvr:${lwjglVersion}" + runtime "org.lwjgl:lwjgl-openvr:${lwjglVersion}:natives-linux" +} diff --git a/jme3-vr/src/main/java/com/jme3/app/VRAppState.java b/jme3-vr/src/main/java/com/jme3/app/VRAppState.java index df329a5054..44b9bfea15 100644 --- a/jme3-vr/src/main/java/com/jme3/app/VRAppState.java +++ b/jme3-vr/src/main/java/com/jme3/app/VRAppState.java @@ -48,22 +48,25 @@ import com.jme3.system.AppSettings; import com.jme3.util.VRGUIPositioningMode; import com.jme3.util.VRGuiManager; +import org.lwjgl.system.MemoryStack; -import java.awt.GraphicsDevice; -import java.awt.GraphicsEnvironment; +import java.awt.*; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; +import java.nio.IntBuffer; import java.util.Iterator; import java.util.Locale; import java.util.logging.Level; import java.util.logging.Logger; +import static org.lwjgl.openvr.VRSystem.VRSystem_GetRecommendedRenderTargetSize; + /** - * A JMonkey app state dedicated to Virtual Reality. + * A JMonkey app state dedicated to Virtual Reality. * An application that want to use VR devices (HTC vive, ...) has to use this app state.
- * As this app state and the main {@link Application application} have to share {@link AppSettings application settings}, + * As this app state and the main {@link Application application} have to share {@link AppSettings application settings}, * the common way to use this app state is:
*
    *
  • To create {@link AppSettings application settings} and set the VR related settings (see {@link VRConstants}). @@ -77,33 +80,33 @@ public class VRAppState extends AbstractAppState { private static final Logger logger = Logger.getLogger(VRAppState.class.getName()); - + /** * Is the application has not to start within VR mode (default is false). */ public boolean DISABLE_VR = false; - + private float fFar = 1000f; private float fNear = 0.1f; private int xWin = 1920; private int yWin = 1080; - + private float resMult = 1f; - + /* where is the headset pointing, after all rotations are combined? depends on observer rotation, if any */ private Quaternion tempq = new Quaternion(); - + private Application application = null; private AppStateManager stateManager = null; private AppSettings settings = null; - + private VREnvironment environment = null; - + /** * Create a new default VR app state that relies on the given {@link VREnvironment VR environment}. * @param environment the {@link VREnvironment VR environment} that this app state is using. @@ -111,11 +114,11 @@ public class VRAppState extends AbstractAppState { public VRAppState(VREnvironment environment) { super(); - this.environment = environment; - + this.environment = environment; + this.setSettings(environment.getSettings()); } - + /** * Create a new VR app state with given settings. The app state relies on the the given {@link VREnvironment VR environment}. * @param settings the settings to use. @@ -127,7 +130,7 @@ public VRAppState(AppSettings settings, VREnvironment environment){ processSettings(settings); } - + /** * Simple update of the app state, this method should contains any spatial updates. * This method is called by the {@link #update(float) update()} method and should not be called manually. @@ -136,7 +139,7 @@ public VRAppState(AppSettings settings, VREnvironment environment){ public void simpleUpdate(float tpf) { return; } - + /** * Rendering callback of the app state. This method is called by the {@link #update(float) update()} method and should not be called manually. * @param renderManager the {@link RenderManager render manager}. @@ -154,7 +157,7 @@ public void setFrustrumNearFar(float near, float far) { fNear = near; fFar = far; } - + /** * Set the mirror window size in pixel. * @param width the width of the mirror window in pixel. @@ -164,7 +167,7 @@ public void setMirrorWindowSize(int width, int height) { xWin = width; yWin = height; } - + /** * Set the resolution multiplier. * @param val the resolution multiplier. @@ -175,8 +178,8 @@ public void setResolutionMultiplier(float val) { environment.getVRViewManager().setResolutionMultiplier(resMult); } } - - + + /** * Move filters from the main scene into the eye's. * This removes filters from the main scene. @@ -184,7 +187,7 @@ public void setResolutionMultiplier(float val) { public void moveScreenProcessingToVR() { environment.getVRViewManager().moveScreenProcessingToEyes(); } - + /** * Get the observer final rotation within the scene. * @return the observer final rotation within the scene. @@ -197,8 +200,8 @@ public Quaternion getFinalObserverRotation() { } else { return ((Spatial)environment.getObserver()).getWorldRotation(); } - } - + } + if( environment.getObserver() == null ) { tempq.set(environment.getDummyCamera().getRotation()); } else { @@ -206,7 +209,7 @@ public Quaternion getFinalObserverRotation() { } return tempq.multLocal(environment.getVRHardware().getOrientation()); } - + /** * Get the observer final position within the scene. * @return the observer position. @@ -217,10 +220,10 @@ public Vector3f getFinalObserverPosition() { if( environment.getObserver() == null ) { return environment.getCamera().getLocation(); } else{ - return ((Spatial)environment.getObserver()).getWorldTranslation(); + return ((Spatial)environment.getObserver()).getWorldTranslation(); } } - + Vector3f pos = environment.getVRHardware().getPosition(); if( environment.getObserver() == null ) { environment.getDummyCamera().getRotation().mult(pos, pos); @@ -230,7 +233,7 @@ public Vector3f getFinalObserverPosition() { return pos.addLocal(((Spatial)environment.getObserver()).getWorldTranslation()); } } - + /** * Get the VR headset left viewport. * @return the VR headset left viewport. @@ -240,10 +243,10 @@ public ViewPort getLeftViewPort() { if( environment.getVRViewManager() == null ){ return application.getViewPort(); } - + return environment.getVRViewManager().getLeftViewPort(); } - + /** * Get the VR headset right viewport. * @return the VR headset right viewport. @@ -255,7 +258,7 @@ public ViewPort getRightViewPort() { } return environment.getVRViewManager().getRightViewPort(); } - + /** * Set the background color for both left and right view ports. * @param clr the background color. @@ -264,15 +267,15 @@ public void setBackgroundColors(ColorRGBA clr) { if( environment.getVRViewManager() == null ) { application.getViewPort().setBackgroundColor(clr); } else if( environment.getVRViewManager().getLeftViewPort() != null ) { - + environment.getVRViewManager().getLeftViewPort().setBackgroundColor(clr); - + if( environment.getVRViewManager().getRightViewPort() != null ){ environment.getVRViewManager().getRightViewPort().setBackgroundColor(clr); } } } - + /** * Get the {@link Application} to which this app state is attached. * @return the {@link Application} to which this app state is attached. @@ -281,7 +284,7 @@ public void setBackgroundColors(ColorRGBA clr) { public Application getApplication(){ return application; } - + /** * Get the {@link AppStateManager state manager} to which this app state is attached. * @return the {@link AppStateManager state manager} to which this app state is attached. @@ -290,16 +293,16 @@ public Application getApplication(){ public AppStateManager getStateManager(){ return stateManager; } - + /** * Get the scene observer. If no observer has been set, this method return the application {@link #getCamera() camera}. - * @return the scene observer. + * @return the scene observer. * @see #setObserver(Spatial) */ public Object getObserver() { return environment.getObserver(); } - + /** * Set the scene observer. The VR headset will be linked to it. If no observer is set, the VR headset is linked to the the application {@link #getCamera() camera}. * @param observer the scene observer. @@ -307,7 +310,7 @@ public Object getObserver() { public void setObserver(Spatial observer) { environment.setObserver(observer); } - + /** * Check if the rendering is instanced (see Geometry instancing). * @return true if the rendering is instanced and false otherwise. @@ -315,15 +318,15 @@ public void setObserver(Spatial observer) { public boolean isInstanceRendering() { return environment.isInstanceRendering(); } - + /** - * Return the {@link VREnvironment VR environment} on which this app state relies. - * @return the {@link VREnvironment VR environment} on which this app state relies. + * Return the {@link VREnvironment VR environment} on which this app state relies. + * @return the {@link VREnvironment VR environment} on which this app state relies. */ public VREnvironment getVREnvironment(){ return environment; } - + /** * Get the VR underlying hardware. * @return the VR underlying hardware. @@ -331,7 +334,7 @@ public VREnvironment getVREnvironment(){ public VRAPI getVRHardware() { return getVREnvironment().getVRHardware(); } - + /** * Get the VR dedicated input. * @return the VR dedicated input. @@ -340,10 +343,10 @@ public VRInputAPI getVRinput() { if( getVREnvironment().getVRHardware() == null ){ return null; } - + return getVREnvironment().getVRHardware().getVRinput(); } - + /** * Get the VR view manager. * @return the VR view manager. @@ -351,7 +354,7 @@ public VRInputAPI getVRinput() { public VRViewManager getVRViewManager() { return getVREnvironment().getVRViewManager(); } - + /** * Get the GUI manager attached to this app state. * @return the GUI manager attached to this app state. @@ -359,7 +362,7 @@ public VRViewManager getVRViewManager() { public VRGuiManager getVRGUIManager(){ return getVREnvironment().getVRGUIManager(); } - + /** * Get the VR mouse manager attached to this app state. * @return the VR mouse manager attached to this application. @@ -367,7 +370,7 @@ public VRGuiManager getVRGUIManager(){ public VRMouseManager getVRMouseManager(){ return getVREnvironment().getVRMouseManager(); } - + /** * Get the {@link AppSettings settings} attached to this app state. * @return the {@link AppSettings settings} attached to this app state. @@ -376,7 +379,7 @@ public VRMouseManager getVRMouseManager(){ public AppSettings getSettings(){ return settings; } - + /** * Set the {@link AppSettings settings} attached to this app state. * @param settings the {@link AppSettings settings} attached to this app state. @@ -386,13 +389,13 @@ public void setSettings(AppSettings settings){ this.settings = settings; processSettings(settings); } - + @Override - public void update(float tpf) { - + public void update(float tpf) { + // update VR pose & cameras if( environment.getVRViewManager() != null ) { - environment.getVRViewManager().update(tpf); + environment.getVRViewManager().update(tpf); } else if( environment.getObserver() != null ) { environment.getCamera().setFrame(((Spatial)environment.getObserver()).getWorldTranslation(), ((Spatial)environment.getObserver()).getWorldRotation()); } @@ -404,7 +407,7 @@ public void update(float tpf) { for (Spatial spatial : application.getGuiViewPort().getScenes()) { //spatial.updateLogicalState(tpf); spatial.updateGeometricState(); - } + } } // use the analog control on the first tracked controller to push around the mouse @@ -414,17 +417,17 @@ public void update(float tpf) { @Override public void render(RenderManager rm) { super.render(rm); - + // update compositor if( environment.getVRViewManager() != null ) { environment.getVRViewManager().render(); } } - + @Override public void postRender() { super.postRender(); - + // update compositor if( environment.getVRViewManager() != null ) { environment.getVRViewManager().postRender(); @@ -434,28 +437,28 @@ public void postRender() { @Override public void initialize(AppStateManager stateManager, Application app) { super.initialize(stateManager, app); - + this.application = app; this.stateManager = stateManager; - + // disable annoying warnings about GUI stuff being updated, which is normal behavior // for late GUI placement for VR purposes - Logger.getLogger("com.jme3").setLevel(Level.SEVERE); - + Logger.getLogger("com.jme3").setLevel(Level.SEVERE); + app.getCamera().setFrustumFar(fFar); app.getCamera().setFrustumNear(fNear); if( environment.isInVR() ) { - + logger.config("VR mode enabled."); - + if( environment.getVRHardware() != null ) { environment.getVRHardware().initVRCompositor(environment.compositorAllowed()); } else { logger.warning("No VR system found."); } - - + + environment.getVRViewManager().setResolutionMultiplier(resMult); //inputManager.addMapping(RESET_HMD, new KeyTrigger(KeyInput.KEY_F9)); //setLostFocusBehavior(LostFocusBehavior.Disabled); @@ -464,135 +467,57 @@ public void initialize(AppStateManager stateManager, Application app) { //viewPort.attachScene(rootNode); //guiViewPort.attachScene(guiNode); } - + if( environment.getVRViewManager() != null ) { environment.getVRViewManager().initialize(); } } - + @Override public void stateAttached(AppStateManager stateManager) { super.stateAttached(stateManager); //To change body of generated methods, choose Tools | Templates. - + if (settings == null) { settings = new AppSettings(true); logger.config("Using default settings."); } else { logger.config("Using given settings."); } - + // Attach VR environment to the application if (!environment.isInitialized()){ environment.initialize(); } - + if (environment.isInitialized()){ environment.atttach(this, stateManager.getApplication()); } else { logger.severe("Cannot attach VR environment to the VR app state as its not initialized."); } - GraphicsDevice defDev = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice(); - - if( environment.isInVR() && !environment.compositorAllowed() ) { - // "easy extended" mode - // setup experimental JFrame on external device - // first, find the VR device - GraphicsDevice VRdev = null; - GraphicsDevice[] devs = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices(); - // pick the display that isn't the default one - for(GraphicsDevice gd : devs) { - if( gd != defDev ) { - VRdev = gd; - break; - } - } + if( environment.isInVR()) { + // TODO: make this cross-platform + // The values are in OpenVR + try (MemoryStack stack = MemoryStack.stackPush()) { + IntBuffer widthBuffer = stack.ints(1); + IntBuffer heightBuffer = stack.ints(1); + VRSystem_GetRecommendedRenderTargetSize(widthBuffer, heightBuffer); - // did we get the VR device? - if( VRdev != null ) { - // set properties for VR acceleration - try { - java.awt.DisplayMode useDM = null; - int max = 0; - for(java.awt.DisplayMode dm : VRdev.getDisplayModes()) { - int check = dm.getHeight() + dm.getWidth() + dm.getRefreshRate() + dm.getBitDepth(); - if( check > max ) { - max = check; - useDM = dm; - } - } - - // create a window for the VR device - settings.setWidth(useDM.getWidth()); - settings.setHeight(useDM.getHeight()); - settings.setBitsPerPixel(useDM.getBitDepth()); - settings.setFrequency(useDM.getRefreshRate()); - settings.setSwapBuffers(true); - settings.setVSync(true); // allow vsync on this display - stateManager.getApplication().setSettings(settings); - logger.config("Updated underlying application settings."); - - //VRdev.setFullScreenWindow(VRwindow); - // make sure we are in the right display mode - if( VRdev.getDisplayMode().equals(useDM) == false ) { - VRdev.setDisplayMode(useDM); - } - - return; - } catch(Exception e) { - logger.log(Level.SEVERE, e.getMessage(), e); - } - } else { - logger.config("Cannot access to external screen."); - } - } else { - if (!environment.isInVR()){ - logger.config("Cannot switch to VR mode (VR disabled by user)."); - } else if (!environment.compositorAllowed()){ - logger.warning("Cannot switch to VR mode (VR not supported)."); - } - } - - if( !environment.isInVR() ) { - - //FIXME: Handling GLFW workaround on MacOS - boolean macOs = false; - if (macOs) { - // GLFW workaround on macs - settings.setFrequency(defDev.getDisplayMode().getRefreshRate()); - settings.setDepthBits(24); - settings.setVSync(true); - // try and read resolution from file in local dir - File resfile = new File("resolution.txt"); - if( resfile.exists() ) { - try { - BufferedReader br = new BufferedReader(new FileReader(resfile)); - settings.setWidth(Integer.parseInt(br.readLine())); - settings.setHeight(Integer.parseInt(br.readLine())); - try { - settings.setFullscreen(br.readLine().toLowerCase(Locale.ENGLISH).contains("full")); - } catch(Exception e) { - settings.setFullscreen(false); - } - br.close(); - } catch(Exception e) { - settings.setWidth(1280); - settings.setHeight(720); - } - } else { - settings.setWidth(1280); - settings.setHeight(720); - settings.setFullscreen(false); - } - settings.setResizable(false); + // create a window for the VR device + settings.setWidth(widthBuffer.get(0)); + settings.setHeight(heightBuffer.get(0)); + //settings.setBitsPerPixel(24); + settings.setBitsPerPixel(-1); + settings.setFrequency(90); + settings.setSwapBuffers(true); + settings.setVSync(true); // allow vsync on this display } - settings.setSwapBuffers(true); } else { // use basic mirroring window, skip settings window settings.setSamples(1); settings.setWidth(xWin); settings.setHeight(yWin); - settings.setBitsPerPixel(32); + settings.setBitsPerPixel(32); settings.setFrameRate(0); settings.setFrequency(environment.getVRHardware().getDisplayFrequency()); settings.setFullscreen(false); @@ -603,24 +528,23 @@ public void stateAttached(AppStateManager stateManager) { // Updating application settings stateManager.getApplication().setSettings(settings); logger.config("Updated underlying application settings."); - } @Override public void cleanup() { if( environment.getVRHardware() != null ) { environment.getVRHardware().destroy(); - } - + } + this.application = null; this.stateManager = null; } - + @Override public void stateDetached(AppStateManager stateManager) { super.stateDetached(stateManager); } - + /** * Process the attached settings and apply changes to this app state. * @param settings the app settings to process. @@ -633,4 +557,4 @@ protected void processSettings(AppSettings settings){ } } } -} \ No newline at end of file +} diff --git a/jme3-vr/src/main/java/com/jme3/app/VRApplication.java b/jme3-vr/src/main/java/com/jme3/app/VRApplication.java deleted file mode 100644 index 2ad8ee1345..0000000000 --- a/jme3-vr/src/main/java/com/jme3/app/VRApplication.java +++ /dev/null @@ -1,1535 +0,0 @@ -package com.jme3.app; - -import com.jme3.app.AppTask; -import com.jme3.app.Application; -import com.jme3.app.LegacyApplication; -import com.jme3.app.LostFocusBehavior; -import com.jme3.app.ResetStatsState; -import com.jme3.app.SimpleApplication; -import com.jme3.app.state.AppState; -import com.jme3.app.state.AppStateManager; -import com.jme3.asset.AssetManager; -import com.jme3.audio.AudioContext; -import com.jme3.audio.AudioRenderer; -import com.jme3.audio.Listener; -import com.jme3.input.InputManager; -import com.jme3.input.JoyInput; -import com.jme3.input.KeyInput; -import com.jme3.input.MouseInput; -import com.jme3.input.TouchInput; -import com.jme3.input.controls.KeyTrigger; -import com.jme3.input.vr.VRAPI; -import com.jme3.input.vr.VRInputAPI; -import com.jme3.input.vr.openvr.OpenVR; -import com.jme3.input.vr.openvr.OpenVRMouseManager; -import com.jme3.input.vr.openvr.OpenVRViewManager; -import com.jme3.input.vr.osvr.OSVR; -import com.jme3.math.ColorRGBA; -import com.jme3.math.Quaternion; -import com.jme3.math.Vector3f; -import com.jme3.post.PreNormalCaching; -import com.jme3.profile.AppProfiler; -import com.jme3.renderer.Camera; -import com.jme3.renderer.RenderManager; -import com.jme3.renderer.Renderer; -import com.jme3.renderer.ViewPort; -import com.jme3.renderer.queue.RenderQueue.Bucket; -import com.jme3.scene.Node; -import com.jme3.scene.Spatial; -import com.jme3.scene.Spatial.CullHint; -import com.jme3.system.AppSettings; -import com.jme3.system.JmeContext; -import com.jme3.system.JmeContext.Type; -import com.jme3.system.jopenvr.JOpenVRLibrary; -import com.jme3.system.JmeSystem; -import com.jme3.system.NanoTimer; -import com.jme3.system.SystemListener; -import com.jme3.system.Timer; -import com.jme3.system.lwjgl.LwjglDisplayVR; -import com.jme3.system.lwjgl.LwjglOffscreenBufferVR; -import com.jme3.util.VRGUIPositioningMode; -import com.jme3.util.VRGuiManager; - -import java.awt.GraphicsDevice; -import java.awt.GraphicsEnvironment; -import java.io.BufferedReader; -import java.io.File; -import java.io.FileReader; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.Locale; -import java.util.concurrent.Callable; -import java.util.concurrent.ConcurrentLinkedQueue; -import java.util.concurrent.Future; -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.lwjgl.system.Platform; - - -/** - * A JMonkey application dedicated to Virtual Reality. An application that use VR devices (HTC vive, ...) has to extends this one.
    - *

    - * This class is no more functional and is deprecated. Please use {@link VRAppState VRAppState} instead. - * @author reden - phr00t - https://github.com/phr00t - * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr - * @deprecated use {@link VRAppState VRAppState} instead. - */ -public abstract class VRApplication implements Application, SystemListener { - - - private static final Logger logger = Logger.getLogger(LegacyApplication.class.getName()); - - /** - * The default FOV. - */ - public float DEFAULT_FOV = 108f; - - - /** - * The default aspect ratio. - */ - public float DEFAULT_ASPECT = 1f; - - /** - * Is the application is based on OSVR (default is false). - */ - public boolean CONSTRUCT_WITH_OSVR = false; - - /** - * Is the application has not to start within VR mode (default is false). - */ - public boolean DISABLE_VR = false; - - /** - * VR application configuration parameters. - * @author reden - phr00t - https://github.com/phr00t - * @author Julien Seinturier - (c) 2016 - JOrigin project - http:/www.jorigin.org - * - */ - public static enum PreconfigParameter { - /** - * Is the SteamVR compositor is used (kinda needed at the moment) - */ - USE_VR_COMPOSITOR, - - /** - * Render two eyes, regardless of VR API detection. - */ - FORCE_VR_MODE, - - /** - * Invert the eyes. - */ - FLIP_EYES, - - /** - * Show GUI even if it is behind objects. - */ - SET_GUI_OVERDRAW, - - /** - * - */ - SET_GUI_CURVED_SURFACE, - - /** - * Display a mirror rendering on the screen. Runs faster when set to false. - */ - ENABLE_MIRROR_WINDOW, - - /** - * - */ - PREFER_OPENGL3, - - /** - * Disable VR rendering, regardless VR API and devices are presents. - */ - DISABLE_VR, - - /** - * - */ - SEATED_EXPERIENCE, - - /** - * Remove GUI node from the application. - */ - NO_GUI, - - /** - * Faster VR rendering, requires some vertex shader changes (see Common/MatDefs/VR/Unshaded.j3md) - */ - INSTANCE_VR_RENDERING, - - /** - * - */ - FORCE_DISABLE_MSAA - } - - private VRAPI VRhardware = null; - private VRGuiManager guiManager = null; - private OpenVRMouseManager mouseManager = null; - private OpenVRViewManager viewmanager = null; - - private String OS; - - private Camera dummyCam; - private Spatial observer; - private boolean VRSupportedOS; - private boolean forceVR; - private boolean disableSwapBuffers = true; - private boolean tryOpenGL3 = true; - private boolean seated; - private boolean nogui; - private boolean instanceVR; - private boolean forceDisableMSAA; - - // things taken from LegacyApplication - private AppStateManager stateManager; - private Camera cam; - private AppSettings settings; - private JmeContext context; - private float speed = 1f; - private AudioRenderer audioRenderer; - private LostFocusBehavior lostFocusBehavior = LostFocusBehavior.ThrottleOnLostFocus; - private final ConcurrentLinkedQueue> taskQueue = new ConcurrentLinkedQueue>(); - private Timer timer = new NanoTimer(); - private boolean paused = false, inputEnabled = true; - private InputManager inputManager; - private RenderManager renderManager; - private ViewPort viewPort; - private ViewPort guiViewPort; - private AssetManager assetManager; - private Renderer renderer; - private Listener listener; - private MouseInput mouseInput; - private KeyInput keyInput; - private JoyInput joyInput; - private TouchInput touchInput; - - protected Node guiNode, rootNode; - - private float fFar = 1000f, fNear = 1f; - private int xWin = 1280, yWin = 720; - - private float resMult = 1f; - - private boolean useCompositor = true, compositorOS; - private final String RESET_HMD = "ResetHMD"; - - /** - * Create a new VR application and attach the given {@link AppState app states}.
    - * The application scene is made of a {@link #getRootNode() root node} that holds the scene spatials - * and a {@link #getGuiNode() GUI node} that is the root of the Graphical user interface. - * @param initialStates the {@link AppState app states} to attach to the application. - */ - public VRApplication(AppState... initialStates) { - this(); - - if (initialStates != null) { - for (AppState a : initialStates) { - if (a != null) { - stateManager.attach(a); - } - } - } - } - - /** - * Create a new VR application.
    - * The application scene is made of a {@link #getRootNode() root node} that holds the scene spatials - * and a {@link #getGuiNode() GUI node} that is the root of the Graphical user interface. - */ - public VRApplication() { - super(); - - rootNode = new Node("root"); - guiNode = new Node("guiNode"); - - guiNode.setQueueBucket(Bucket.Gui); - guiNode.setCullHint(CullHint.Never); - dummyCam = new Camera(); - - initStateManager(); - - // Create the GUI manager. - guiManager = new VRGuiManager(null); - - // Create a new view manager. - viewmanager = new OpenVRViewManager(null); - - // Create a new mouse manager. - mouseManager = new OpenVRMouseManager(null); - - // we are going to use OpenVR now, not the Oculus Rift - // OpenVR does support the Rift - OS = System.getProperty("os.name", "generic").toLowerCase(Locale.ENGLISH); - VRSupportedOS = !OS.contains("nux") && System.getProperty("sun.arch.data.model").equalsIgnoreCase("64"); //for the moment, linux/unix causes crashes, 64-bit only - compositorOS = OS.contains("indows"); - - if( !VRSupportedOS ) { - logger.warning("Non-supported OS: " + OS + ", architecture: " + System.getProperty("sun.arch.data.model")); - } else if( DISABLE_VR ) { - logger.warning("VR disabled via code."); - } else if( VRSupportedOS && DISABLE_VR == false ) { - if( CONSTRUCT_WITH_OSVR ) { - //FIXME: WARNING !! - VRhardware = new OSVR(null); - logger.config("Creating OSVR wrapper [SUCCESS]"); - } else { - //FIXME: WARNING !! - VRhardware = new OpenVR(null); - logger.config("Creating OpenVR wrapper [SUCCESS]"); - } - if( VRhardware.initialize() ) { - setPauseOnLostFocus(false); - } - } - } - - /** - * Get the VR underlying hardware. - * @return the VR underlying hardware. - */ - public VRAPI getVRHardware() { - return VRhardware; - } - - /** - * Get the VR dedicated input. - * @return the VR dedicated input. - */ - public VRInputAPI getVRinput() { - if( VRhardware == null ) return null; - return VRhardware.getVRinput(); - } - - /** - * Get the VR view manager. - * @return the VR view manager. - */ - public OpenVRViewManager getVRViewManager() { - return viewmanager; - } - - /** - * Get the GUI manager attached to this application. - * @return the GUI manager attached to this application. - */ - public VRGuiManager getVRGUIManager(){ - return guiManager; - } - - /** - * Get the VR mouse manager attached to this application. - * @return the VR mouse manager attached to this application. - */ - public OpenVRMouseManager getVRMouseManager(){ - return mouseManager; - } - - /** - * Set the frustrum values for the application. - * @param near the frustrum near value. - * @param far the frustrum far value. - */ - public void setFrustrumNearFar(float near, float far) { - fNear = near; - fFar = far; - } - - /** - * Set the mirror window size in pixel. - * @param width the width of the mirror window in pixel. - * @param height the height of the mirror window in pixel. - */ - public void setMirrorWindowSize(int width, int height) { - xWin = width; - yWin = height; - } - - /** - * Set the resolution multiplier. - * @param val the resolution multiplier. - */ - public void setResolutionMultiplier(float val) { - resMult = val; - if( viewmanager != null ) viewmanager.setResolutionMultiplier(resMult); - } - - - /** - * Is the SteamVR compositor is active. - * @return true if the SteamVR compositor is active and false otherwise. - */ - public boolean compositorAllowed() { - return useCompositor && compositorOS; - } - - /** - * Get if the system currently support VR. - * @return true if the system currently support VR and false otherwise. - */ - public boolean isOSVRSupported() { - return VRSupportedOS; - } - - /** - * Simple update of the application, this method should contains {@link #getRootNode() root node} updates. - * This method is called by the {@link #update() update()} method and should not be called manually. - * @param tpf the application time. - */ - public void simpleUpdate(float tpf) { } - - /** - * Rendering callback of the application. This method is called by the {@link #update() update()} method and should not be called manually. - * @param renderManager the {@link RenderManager render manager}. - */ - public void simpleRender(RenderManager renderManager) { - PreNormalCaching.resetCache(isInVR()); - } - - - /* - we do NOT want to get & modify the distortion scene camera, so - return the left viewport camera instead if we are in VR mode - */ - @Override - public Camera getCamera() { - if( isInVR() && viewmanager != null && viewmanager.getLeftCamera() != null ) { - return dummyCam; - } - return cam; - } - - /** - * Get the application internal camera. - * @return the application internal camera. - * @see #getCamera() - */ - public Camera getBaseCamera() { - return cam; - } - - - @Override - public JmeContext getContext(){ - return context; - } - - @Override - public AssetManager getAssetManager(){ - return assetManager; - } - - @Override - public InputManager getInputManager(){ - return inputManager; - } - - @Override - public AppStateManager getStateManager() { - return stateManager; - } - - @Override - public RenderManager getRenderManager() { - return renderManager; - } - - @Override - public Renderer getRenderer(){ - return renderer; - } - - @Override - public AudioRenderer getAudioRenderer() { - return audioRenderer; - } - - @Override - public Listener getListener() { - return listener; - } - - @Override - public Timer getTimer(){ - return timer; - } - - /** - * Handle the error given in parameters by creating a log entry and a dialog window. Internal use only. - */ - public void handleError(String errMsg, Throwable t){ - // Print error to log. - logger.log(Level.SEVERE, errMsg, t); - // Display error message on screen if not in headless mode - if (context.getType() != JmeContext.Type.Headless) { - if (t != null) { - JmeSystem.showErrorDialog(errMsg + "\n" + t.getClass().getSimpleName() + - (t.getMessage() != null ? ": " + t.getMessage() : "")); - } else { - JmeSystem.showErrorDialog(errMsg); - } - } - - stop(); // stop the application - } - - - /** - * Force the focus gain for the application. Internal use only. - */ - public void gainFocus(){ - if (lostFocusBehavior != LostFocusBehavior.Disabled) { - if (lostFocusBehavior == LostFocusBehavior.PauseOnLostFocus) { - paused = false; - } - context.setAutoFlushFrames(true); - if (inputManager != null) { - inputManager.reset(); - } - } - } - - /** - * Force the focus lost for the application. Internal use only. - */ - public void loseFocus(){ - if (lostFocusBehavior != LostFocusBehavior.Disabled){ - if (lostFocusBehavior == LostFocusBehavior.PauseOnLostFocus) { - paused = true; - } - context.setAutoFlushFrames(false); - } - } - - /** - * Reshape the display window. Internal use only. - */ - public void reshape(int w, int h){ - if (renderManager != null) { - renderManager.notifyReshape(w, h); - } - } - - /** - * Request the application to close. Internal use only. - */ - public void requestClose(boolean esc){ - context.destroy(false); - } - - /** - * Set the {@link AppSettings display settings} to define the display created. - *

    - * Examples of display parameters include display frame {@link AppSettings#getWidth() width} and {@link AppSettings#getHeight() height}, - * pixel {@link AppSettings#getBitsPerPixel() color bit depth}, {@link AppSettings#getDepthBits() z-buffer bits}, {@link AppSettings#getSamples() anti-aliasing samples}, {@link AppSettings#getFrequency() update frequency}, ... - *

    If this method is called while the application is already running, then - * {@link #restart() } must be called to apply the settings to the display. - * - * @param settings The settings to set. - */ - public void setSettings(AppSettings settings){ - this.settings = settings; - if (context != null && settings.useInput() != inputEnabled){ - // may need to create or destroy input based - // on settings change - inputEnabled = !inputEnabled; - if (inputEnabled){ - initInput(); - }else{ - destroyInput(); - } - }else{ - inputEnabled = settings.useInput(); - } - } - - /** - * Sets the {@link Timer} implementation that will be used for calculating - * frame times.

    - * By default, Application will use the Timer as returned by the current {@link JmeContext} implementation. - * @param timer the timer to use. - */ - public void setTimer(Timer timer){ - this.timer = timer; - - if (timer != null) { - timer.reset(); - } - - if (renderManager != null) { - renderManager.setTimer(timer); - } - } - - - /** - * Determine the application's behavior when unfocused. - * @return The lost focus behavior of the application. - */ - public LostFocusBehavior getLostFocusBehavior() { - return lostFocusBehavior; - } - - /** - * Change the application's behavior when unfocused. By default, the application will - * {@link LostFocusBehavior#ThrottleOnLostFocus throttle the update loop} - * so as to not take 100% CPU usage when it is not in focus, e.g. - * alt-tabbed, minimized, or obstructed by another window. - * - * @param lostFocusBehavior The new {@link LostFocusBehavior lost focus behavior} to use. - */ - public void setLostFocusBehavior(LostFocusBehavior lostFocusBehavior) { - this.lostFocusBehavior = lostFocusBehavior; - } - - /** - * Get if the application has to pause then it lost the focus. - * @return true if pause on lost focus is enabled, false otherwise. - * @see #getLostFocusBehavior() - */ - public boolean isPauseOnLostFocus() { - return getLostFocusBehavior() == LostFocusBehavior.PauseOnLostFocus; - } - - /** - * Enable or disable pause on lost focus. - *

    - * By default, pause on lost focus is enabled. - * If enabled, the application will stop updating - * when it loses focus or becomes inactive (e.g. alt-tab). - * For online or real-time applications, this might not be preferable, - * so this feature should be set to disabled. For other applications, - * it is best to keep it on so that CPU usage is not used when - * not necessary. - * - * @param pauseOnLostFocus true to enable pause on lost focus, false - * otherwise. - * - * @see #setLostFocusBehavior(com.jme3.app.LostFocusBehavior) - */ - public void setPauseOnLostFocus(boolean pauseOnLostFocus) { - if (pauseOnLostFocus) { - setLostFocusBehavior(LostFocusBehavior.PauseOnLostFocus); - } else { - setLostFocusBehavior(LostFocusBehavior.Disabled); - } - } - - @Override - public void start() { - - logger.config("Starting application..."); - - // set some default settings in-case - // settings dialog is not shown - boolean loadSettings = false; - if (settings == null) { - setSettings(new AppSettings(true)); - loadSettings = true; - } - - GraphicsDevice defDev = null; - try { - GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); - defDev = ge.getDefaultScreenDevice(); - } catch (Throwable e1) { - logger.log(Level.SEVERE, "Cannot access default screen device: "+e1.getMessage(), e1); - } - - if( isInVR() && !compositorAllowed() ) { - logger.warning("VR Composition is not allowed."); - // "easy extended" mode - // TO-DO: JFrame was removed in LWJGL 3, need to use new GLFW library to pick "monitor" display of VR device - // first, find the VR device - GraphicsDevice VRdev = null; - GraphicsDevice[] devs = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices(); - // pick the display that isn't the default one - for(GraphicsDevice gd : devs) { - if( gd != defDev ) { - VRdev = gd; - break; - } - } - // did we get the VR device? - if( VRdev != null ) { - // set properties for VR acceleration - try { - java.awt.DisplayMode useDM = null; - int max = 0; - for(java.awt.DisplayMode dm : VRdev.getDisplayModes()) { - int check = dm.getHeight() + dm.getWidth() + dm.getRefreshRate() + dm.getBitDepth(); - if( check > max ) { - max = check; - useDM = dm; - } - } - // create a window for the VR device - settings.setWidth(useDM.getWidth()); - settings.setHeight(useDM.getHeight()); - settings.setBitsPerPixel(useDM.getBitDepth()); - settings.setFrequency(useDM.getRefreshRate()); - settings.setSwapBuffers(true); - settings.setVSync(true); // allow vsync on this display - setSettings(settings); - //VRdev.setFullScreenWindow(VRwindow); - // make sure we are in the right display mode - if( VRdev.getDisplayMode().equals(useDM) == false ) { - VRdev.setDisplayMode(useDM); - } - // make a blank cursor to hide it - //BufferedImage cursorImg = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB); - //Cursor blankCursor = Toolkit.getDefaultToolkit().createCustomCursor(cursorImg, new Point(0, 0), "blank cursor"); - //VRwindow.setCursor(blankCursor); - //jmeCanvas.getCanvas().setCursor(blankCursor); - //VRwindow.pack(); - //VRwindow.setVisible(true); - //startCanvas(); - logger.config("Starting application [SUCCESS]"); - return; - } catch(Exception e) { - logger.log(Level.SEVERE, "Error during application start: "+e.getMessage(), e); - } - } - } - - if( !isInVR() ) { - - logger.config("VR mode disabled."); - - // not in VR, show settings dialog - if( Platform.get() != Platform.MACOSX ) { - if (!JmeSystem.showSettingsDialog(settings, loadSettings)) { - logger.config("Starting application [SUCCESS]"); - return; - } - } else { - // GLFW workaround on macs - settings.setFrequency(defDev.getDisplayMode().getRefreshRate()); - settings.setDepthBits(24); - settings.setVSync(true); - // try and read resolution from file in local dir - File resfile = new File("resolution.txt"); - if( resfile.exists() ) { - try { - BufferedReader br = new BufferedReader(new FileReader(resfile)); - settings.setWidth(Integer.parseInt(br.readLine())); - settings.setHeight(Integer.parseInt(br.readLine())); - try { - settings.setFullscreen(br.readLine().toLowerCase(Locale.ENGLISH).contains("full")); - } catch(Exception e) { - settings.setFullscreen(false); - } - br.close(); - } catch(Exception e) { - settings.setWidth(1280); - settings.setHeight(720); - } - } else { - settings.setWidth(1280); - settings.setHeight(720); - settings.setFullscreen(false); - } - settings.setResizable(false); - } - settings.setSwapBuffers(true); - } else { - - logger.config("VR mode enabled."); - - // use basic mirroring window, skip settings window - settings.setWidth(xWin); - settings.setHeight(yWin); - settings.setBitsPerPixel(24); - settings.setFrameRate(0); // never sleep in main loop - settings.setFrequency(VRhardware.getDisplayFrequency()); - settings.setFullscreen(false); - settings.setVSync(false); // stop vsyncing on primary monitor! - settings.setSwapBuffers(!disableSwapBuffers || VRhardware instanceof OSVR); - settings.setTitle("Put Headset On Now: " + settings.getTitle()); - settings.setResizable(true); - } - - if( forceDisableMSAA ) { - logger.config("Disabling multisampling."); - // disable multisampling, which is more likely to break things than be useful - settings.setSamples(1); - } - - // set opengl mode - if( tryOpenGL3 ) { - logger.config("Using LWJGL OpenGL 3 renderer."); - settings.setRenderer(AppSettings.LWJGL_OPENGL3); - } else { - logger.config("Using LWJGL OpenGL 2 renderer."); - settings.setRenderer(AppSettings.LWJGL_OPENGL2); - } - - - setSettings(settings); - start(JmeContext.Type.Display, false); - - // disable annoying warnings about GUI stuff being updated, which is normal behavior - // for late GUI placement for VR purposes - Logger.getLogger("com.jme3").setLevel(Level.SEVERE); - } - - /** - * Starts the application in {@link com.jme3.system.JmeContext.Type#Display display} mode. - * @param waitFor if true, the method will wait until the application is started. - * @see #start(com.jme3.system.JmeContext.Type, boolean) - */ - public void start(boolean waitFor){ - start(JmeContext.Type.Display, waitFor); - } - - /** - * Starts the application. - * Creating a rendering context and executing the main loop in a separate thread. - * @param contextType the {@link com.jme3.system.JmeContext.Type type} of the context to create. - * @param waitFor if true, the method will wait until the application is started. - * @throws IllegalArgumentException if the context type is not supported. - */ - public void start(JmeContext.Type contextType, boolean waitFor){ - if (context != null && context.isCreated()){ - logger.warning("start() called when application already created!"); - return; - } - - if (settings == null){ - settings = new AppSettings(true); - } - - logger.log(Level.FINE, "Starting application: {0}", getClass().getName()); - - // Create VR decicated context - if (contextType == Type.Display){ - context = new LwjglDisplayVR(); - context.setSettings(settings); - } else if (contextType == Type.OffscreenSurface){ - context = new LwjglOffscreenBufferVR(); - context.setSettings(settings); - } else { - logger.severe("Unsupported context type \""+contextType+"\". Supported are \"Display\" and \"OffscreenSurface\""); - throw new IllegalArgumentException("Unsupported context type \""+contextType+"\". Supported are \"Display\" and \"OffscreenSurface\""); - } - - context.setSystemListener(this); - context.create(waitFor); - } - - /** - * Move filters from the main scene into the eye's. - * This removes filters from the main scene. - */ - public void moveScreenProcessingToVR() { - if( isInVR() ) { - viewmanager.moveScreenProcessingToEyes(); - } - } - - /** - * Set VR application {@link PreconfigParameter specific parameter}. - * If making changes to default values, this must be called before the VRApplication starts - * @param parm the parameter to set. - * @param value the value of the parameter. - */ - public void preconfigureVRApp(PreconfigParameter parm, boolean value) { - switch( parm ) { - case SET_GUI_OVERDRAW: - guiManager.setGuiOverdraw(value); - break; - case SET_GUI_CURVED_SURFACE: - guiManager.setCurvedSurface(value); - break; - case FORCE_VR_MODE: - forceVR = value; - break; - //case USE_CUSTOM_DISTORTION: //deprecated, always using a render manager - // VRViewManager._setCustomDistortion(value); - // break; - case USE_VR_COMPOSITOR: - useCompositor = value; - if( value == false ) disableSwapBuffers = false; - break; - case FLIP_EYES: - if( VRhardware == null ) return; - VRhardware.setFlipEyes(value); - break; - case INSTANCE_VR_RENDERING: - instanceVR = value; - break; - case ENABLE_MIRROR_WINDOW: - if( useCompositor == false ) { - disableSwapBuffers = false; - } else disableSwapBuffers = !value; - break; - case PREFER_OPENGL3: - tryOpenGL3 = value; - break; - case DISABLE_VR: - DISABLE_VR = value; - break; - case NO_GUI: - nogui = value; - break; - case SEATED_EXPERIENCE: - seated = value; - break; - case FORCE_DISABLE_MSAA: - forceDisableMSAA = value; - break; - } - } - - /** - * Can be used to change seated experience during runtime. - * @param isSeated true if designed for sitting, false for standing/roomscale - * @see #isSeatedExperience() - */ - public void setSeatedExperience(boolean isSeated) { - seated = isSeated; - if( VRhardware instanceof OpenVR ) { - if( VRhardware.getCompositor() == null ) return; - if( seated ) { - ((OpenVR)VRhardware).getCompositor().SetTrackingSpace.apply(JOpenVRLibrary.ETrackingUniverseOrigin.ETrackingUniverseOrigin_TrackingUniverseSeated); - } else { - ((OpenVR)VRhardware).getCompositor().SetTrackingSpace.apply(JOpenVRLibrary.ETrackingUniverseOrigin.ETrackingUniverseOrigin_TrackingUniverseStanding); - } - } - } - - /** - * Check if the application is configured as a seated experience. - * @return true if the application is configured as a seated experience and false otherwise. - * @see #setSeatedExperience(boolean) - */ - public boolean isSeatedExperience() { - return seated; - } - - /** - * Reset headset pose if seating experience. - */ - public void resetSeatedPose(){ - if( VRSupportedOS == false || isSeatedExperience() == false ) return; - VRhardware.reset(); - } - - /** - * Check if the rendering is instanced (see Geometry instancing). - * @return true if the rendering is instanced and false otherwise. - */ - public boolean isInstanceVRRendering() { - return instanceVR && isInVR(); - } - - /** - * Check if the VR mode is enabled. - * @return true if the VR mode is enabled and false otherwise. - */ - public boolean isInVR() { - return DISABLE_VR == false && (forceVR || VRSupportedOS && VRhardware != null && VRhardware.isInitialized()); - } - - - /** - * Get the GUI node from the application. - * @return the GUI node from the application. - * @see #setGuiNode(Node) - */ - public Node getGuiNode(){ - return guiNode; - } - - /** - * Set the GUI node that is displayed within the GUI viewport. - * Calling this method involve clearing all the scenes previously attached to the gui viewport. - * @param node the GUI node to attach. - * @see #getGuiNode() - */ - public void setGuiNode(Node node){ - if (node != null){ - if (guiViewPort != null){ - - enqueue(new Callable(){ - - @Override - public Object call() throws Exception { - guiViewPort.clearScenes(); - guiViewPort.attachScene(node); - guiNode = node; - return null; - } - - }); - - } else { - throw new IllegalArgumentException("GUI view port is not initialized."); - } - } - - } - - /** - * Get the root node of the application. - * @return the root node of the application. - */ - public Node getRootNode() { - return rootNode; - } - - /** - * Check if the application has a GUI overlay attached. - * @return true if the application has a GUI overlay attached and false otherwise. - */ - public boolean hasTraditionalGUIOverlay() { - return !nogui; - } - - - /** - * Get the scene observer. If no observer has been set, this method return the application {@link #getCamera() camera}. - * @return the scene observer. - * @see #setObserver(Spatial) - */ - public Object getObserver() { - if( observer == null ) { - return getCamera(); - } - return observer; - } - - /** - * Set the scene observer. The VR headset will be linked to it. If no observer is set, the VR headset is linked to the the application {@link #getCamera() camera}. - * @param observer the scene observer. - */ - public void setObserver(Spatial observer) { - this.observer = observer; - } - - /* - where is the headset pointing, after all rotations are combined? - depends on observer rotation, if any - */ - private static Quaternion tempq = new Quaternion(); - - /** - * Get the observer final rotation within the scene. - * @return the observer final rotation within the scene. - * @see #getFinalObserverPosition() - */ - public Quaternion getFinalObserverRotation() { - if( viewmanager == null ) { - if( observer == null ) { - return getCamera().getRotation(); - } else return observer.getWorldRotation(); - } - if( observer == null ) { - tempq.set(dummyCam.getRotation()); - } else { - tempq.set(observer.getWorldRotation()); - } - return tempq.multLocal(VRhardware.getOrientation()); - } - - /** - * Get the observer final position within the scene. - * @return the observer position. - * @see #getFinalObserverRotation() - */ - public Vector3f getFinalObserverPosition() { - if( viewmanager == null ) { - if( observer == null ) { - return getCamera().getLocation(); - } else return observer.getWorldTranslation(); - } - Vector3f pos = VRhardware.getPosition(); - if( observer == null ) { - dummyCam.getRotation().mult(pos, pos); - return pos.addLocal(dummyCam.getLocation()); - } else { - observer.getWorldRotation().mult(pos, pos); - return pos.addLocal(observer.getWorldTranslation()); - } - } - - /** - * Set the VR headset height from the ground. - * @param amount the VR headset height from the ground. - * @see #getVRHeightAdjustment() - */ - public void setVRHeightAdjustment(float amount) { - if( viewmanager != null ) viewmanager.setHeightAdjustment(amount); - } - - /** - * Get the VR headset height from the ground. - * @return the VR headset height from the ground. - * @see #setVRHeightAdjustment(float) - */ - public float getVRHeightAdjustment() { - if( viewmanager != null ) return viewmanager.getHeightAdjustment(); - return 0f; - } - - /** - * Get the VR headset left viewport. - * @return the VR headset left viewport. - * @see #getRightViewPort() - */ - public ViewPort getLeftViewPort() { - if( viewmanager == null ) return getViewPort(); - return viewmanager.getLeftViewPort(); - } - - /** - * Get the VR headset right viewport. - * @return the VR headset right viewport. - * @see #getLeftViewPort() - */ - public ViewPort getRightViewPort() { - if( viewmanager == null ) return getViewPort(); - return viewmanager.getRightViewPort(); - } - - - /** - * Set the background color for both left and right view ports. - * @param clr the background color. - */ - public void setBackgroundColors(ColorRGBA clr) { - if( viewmanager == null ) { - getViewPort().setBackgroundColor(clr); - } else if( viewmanager.getLeftViewPort() != null ) { - viewmanager.getLeftViewPort().setBackgroundColor(clr); - if( viewmanager.getRightViewPort() != null ) viewmanager.getRightViewPort().setBackgroundColor(clr); - } - } - - - /** - * Runs tasks enqueued via {@link #enqueue(Callable)} - */ - protected void runQueuedTasks() { - AppTask task; - while( (task = taskQueue.poll()) != null ) { - if (!task.isCancelled()) { - task.invoke(); - } - } - } - - @Override - public void update() { - // Make sure the audio renderer is available to callables - AudioContext.setAudioRenderer(audioRenderer); - - runQueuedTasks(); - - if (speed != 0 && !paused) { - - timer.update(); - - if (inputEnabled){ - inputManager.update(timer.getTimePerFrame()); - } - - if (audioRenderer != null){ - audioRenderer.update(timer.getTimePerFrame()); - } - } - - if (speed == 0 || paused) { - try { - Thread.sleep(50); // throttle the CPU when paused - } catch (InterruptedException ex) { - Logger.getLogger(SimpleApplication.class.getName()).log(Level.SEVERE, null, ex); - } - return; - } - - float tpf = timer.getTimePerFrame() * speed; - - // update states - stateManager.update(tpf); - - // simple update and root node - simpleUpdate(tpf); - - - // render states - stateManager.render(renderManager); - - // update VR pose & cameras - if( viewmanager != null ) { - viewmanager.update(tpf); - } else if( observer != null ) { - getCamera().setFrame(observer.getWorldTranslation(), observer.getWorldRotation()); - } - - //FIXME: check if this code is necessary. - // Updates scene and gui states. - rootNode.updateLogicalState(tpf); - guiNode.updateLogicalState(tpf); - - rootNode.updateGeometricState(); - - if( isInVR() == false || guiManager.getPositioningMode() == VRGUIPositioningMode.MANUAL ) { - // only update geometric state here if GUI is in manual mode, or not in VR - // it will get updated automatically in the viewmanager update otherwise - guiNode.updateGeometricState(); - } - - renderManager.render(tpf, context.isRenderable()); - simpleRender(renderManager); - stateManager.postRender(); - - // update compositor? - if( viewmanager != null ) { - viewmanager.postRender(); - } - } - - private void initAssetManager(){ - URL assetCfgUrl = null; - - if (settings != null){ - String assetCfg = settings.getString("AssetConfigURL"); - if (assetCfg != null){ - try { - assetCfgUrl = new URL(assetCfg); - } catch (MalformedURLException ex) { - } - if (assetCfgUrl == null) { - assetCfgUrl = LegacyApplication.class.getClassLoader().getResource(assetCfg); - if (assetCfgUrl == null) { - logger.log(Level.SEVERE, "Unable to access AssetConfigURL in asset config:{0}", assetCfg); - return; - } - } - } - } - if (assetCfgUrl == null) { - assetCfgUrl = JmeSystem.getPlatformAssetConfigURL(); - } - if (assetManager == null){ - assetManager = JmeSystem.newAssetManager(assetCfgUrl); - logger.config("Created asset manager from "+assetCfgUrl); - } - } - - - private void initDisplay(){ - // aquire important objects - // from the context - settings = context.getSettings(); - - // Only reset the timer if a user has not already provided one - if (timer == null) { - timer = context.getTimer(); - } - - renderer = context.getRenderer(); - } - - private void initAudio(){ - if (settings.getAudioRenderer() != null && context.getType() != JmeContext.Type.Headless){ - audioRenderer = JmeSystem.newAudioRenderer(settings); - audioRenderer.initialize(); - AudioContext.setAudioRenderer(audioRenderer); - - listener = new Listener(); - audioRenderer.setListener(listener); - } - } - - /** - * Creates the camera to use for rendering. Default values are perspective - * projection with 45° field of view, with near and far values 1 and 1000 - * units respectively. - */ - private void initCamera(){ - cam = new Camera(settings.getWidth(), settings.getHeight()); - - cam.setFrustumPerspective(45f, (float)cam.getWidth() / cam.getHeight(), 1f, 1000f); - cam.setLocation(new Vector3f(0f, 0f, 10f)); - cam.lookAt(new Vector3f(0f, 0f, 0f), Vector3f.UNIT_Y); - - renderManager = new RenderManager(renderer); - //Remy - 09/14/2010 setted the timer in the renderManager - renderManager.setTimer(timer); - - viewPort = renderManager.createMainView("Default", cam); - viewPort.setClearFlags(true, true, true); - - // Create a new cam for the gui - Camera guiCam = new Camera(settings.getWidth(), settings.getHeight()); - guiViewPort = renderManager.createPostView("Gui Default", guiCam); - guiViewPort.setClearFlags(false, false, false); - } - - /** - * Initializes mouse and keyboard input. Also - * initializes joystick input if joysticks are enabled in the - * AppSettings. - */ - private void initInput(){ - mouseInput = context.getMouseInput(); - if (mouseInput != null) - mouseInput.initialize(); - - keyInput = context.getKeyInput(); - if (keyInput != null) - keyInput.initialize(); - - touchInput = context.getTouchInput(); - if (touchInput != null) - touchInput.initialize(); - - if (!settings.getBoolean("DisableJoysticks")){ - joyInput = context.getJoyInput(); - if (joyInput != null) - joyInput.initialize(); - } - - inputManager = new InputManager(mouseInput, keyInput, joyInput, touchInput); - } - - private void initStateManager(){ - stateManager = new AppStateManager(this); - - // Always register a ResetStatsState to make sure - // that the stats are cleared every frame - stateManager.attach(new ResetStatsState()); - } - - /** - * Do not call manually. - * Callback from ContextListener. - *

    - * Initializes the Application, by creating a display and - * default camera. If display settings are not specified, a default - * 640x480 display is created. Default values are used for the camera; - * perspective projection with 45° field of view, with near - * and far values 1 and 1000 units respectively. - */ - private void initialize_internal(){ - if (assetManager == null){ - initAssetManager(); - } - - initDisplay(); - initCamera(); - - if (inputEnabled){ - initInput(); - } - initAudio(); - - // update timer so that the next delta is not too large -// timer.update(); - timer.reset(); - - // user code here.. - } - - @Override - public void initialize() { - - logger.config("Initialize VR application..."); - - initialize_internal(); - cam.setFrustumFar(fFar); - cam.setFrustumNear(fNear); - dummyCam = cam.clone(); - if( isInVR() ) { - - logger.config("VR mode enabled."); - - if( VRhardware != null ) { - VRhardware.initVRCompositor(compositorAllowed()); - } else { - logger.warning("No VR system found."); - } - - //FIXME: WARNING !! - viewmanager = new OpenVRViewManager(null); - viewmanager.setResolutionMultiplier(resMult); - inputManager.addMapping(RESET_HMD, new KeyTrigger(KeyInput.KEY_F9)); - setLostFocusBehavior(LostFocusBehavior.Disabled); - } else { - logger.config("VR mode disabled."); - viewPort.attachScene(rootNode); - guiViewPort.attachScene(guiNode); - } - - if( viewmanager != null ) { - viewmanager.initialize(); - } - - simpleInitApp(); - - // any filters created, move them now - if( viewmanager != null ) { - viewmanager.moveScreenProcessingToEyes(); - - // print out camera information - if( isInVR() ) { - logger.info("VR Initialization Information"); - if( viewmanager.getLeftCamera() != null ){ - logger.info("camLeft: " + viewmanager.getLeftCamera().toString()); - } - - if( viewmanager.getRightCamera() != null ){ - logger.info("camRight: " + viewmanager.getRightCamera().toString()); - } - } - } - } - - /** - * Initialize the application. This method has to be overridden by implementations. - */ - public abstract void simpleInitApp(); - - /** - * Destroy the application (release all resources). - */ - public void destroy() { - if( VRhardware != null ) { - VRhardware.destroy(); - VRhardware = null; - } - DISABLE_VR = true; - stateManager.cleanup(); - - destroyInput(); - if (audioRenderer != null) - audioRenderer.cleanup(); - - timer.reset(); - Runtime.getRuntime().exit(0); - } - - protected void destroyInput(){ - if (mouseInput != null) - mouseInput.destroy(); - - if (keyInput != null) - keyInput.destroy(); - - if (joyInput != null) - joyInput.destroy(); - - if (touchInput != null) - touchInput.destroy(); - - inputManager = null; - } - - @Override - public ViewPort getGuiViewPort() { - return guiViewPort; - } - - @Override - public ViewPort getViewPort() { - return viewPort; - } - - @Override - public Future enqueue(Callable callable) { - AppTask task = new AppTask(callable); - taskQueue.add(task); - return task; - } - - /** - * Enqueues a runnable object to execute in the jME3 - * rendering thread. - *

    - * Runnables are executed right at the beginning of the main loop. - * They are executed even if the application is currently paused - * or out of focus. - * - * @param runnable The runnable to run in the main jME3 thread - */ - public void enqueue(Runnable runnable){ - enqueue(new RunnableWrapper(runnable)); - } - - private class RunnableWrapper implements Callable{ - private final Runnable runnable; - - public RunnableWrapper(Runnable runnable){ - this.runnable = runnable; - } - - @Override - public Object call(){ - runnable.run(); - return null; - } - - } - - /** - * Requests the context to close, shutting down the main loop - * and making necessary cleanup operations. - * - * Same as calling stop(false) - * - * @see #stop(boolean) - */ - @Override - public void stop(){ - stop(false); - } - - /** - * Requests the context to close, shutting down the main loop - * and making necessary cleanup operations. - * After the application has stopped, it cannot be used anymore. - */ - @Override - public void stop(boolean waitFor){ - logger.log(Level.FINE, "Closing application: {0}", getClass().getName()); - context.destroy(waitFor); - } - - /** - * Restarts the context, applying any changed settings. - *

    - * Changes to the {@link AppSettings} of this Application are not - * applied immediately; calling this method forces the context - * to restart, applying the new settings. - */ - @Override - public void restart(){ - context.setSettings(settings); - context.restart(); - } - - /** - * Sets an AppProfiler hook that will be called back for - * specific steps within a single update frame. Value defaults - * to null. - */ - - public void setAppProfiler(AppProfiler prof) { - return; - } - - /** - * Returns the current AppProfiler hook, or null if none is set. - */ - public AppProfiler getAppProfiler() { - return null; - } -} \ No newline at end of file diff --git a/jme3-vr/src/main/java/com/jme3/app/VREnvironment.java b/jme3-vr/src/main/java/com/jme3/app/VREnvironment.java index 400d5396cd..cd4a5c395c 100644 --- a/jme3-vr/src/main/java/com/jme3/app/VREnvironment.java +++ b/jme3-vr/src/main/java/com/jme3/app/VREnvironment.java @@ -16,14 +16,17 @@ import com.jme3.input.vr.openvr.OpenVR; import com.jme3.input.vr.openvr.OpenVRMouseManager; import com.jme3.input.vr.openvr.OpenVRViewManager; -import com.jme3.input.vr.osvr.OSVR; -import com.jme3.input.vr.osvr.OSVRViewManager; +//import com.jme3.input.vr.osvr.OSVR; +//import com.jme3.input.vr.osvr.OSVRViewManager; import com.jme3.renderer.Camera; import com.jme3.scene.Spatial; import com.jme3.system.AppSettings; -import com.jme3.system.jopenvr.JOpenVRLibrary; import com.jme3.util.VRGuiManager; +import static org.lwjgl.openvr.VR.ETrackingUniverseOrigin_TrackingUniverseSeated; +import static org.lwjgl.openvr.VR.ETrackingUniverseOrigin_TrackingUniverseStanding; +import static org.lwjgl.openvr.VRCompositor.VRCompositor_SetTrackingSpace; + /** * * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr @@ -51,11 +54,11 @@ public class VREnvironment { private boolean forceVR = false; - private boolean vrSupportedOS = false; + private boolean vrSupportedOS = true; private boolean nogui = false; - private boolean compositorOS; + private boolean compositorOS = true; private boolean useCompositor = true; @@ -162,9 +165,9 @@ public void setSeatedExperience(boolean isSeated) { } if( seated ) { - ((OpenVR)hardware).getCompositor().SetTrackingSpace.apply(JOpenVRLibrary.ETrackingUniverseOrigin.ETrackingUniverseOrigin_TrackingUniverseSeated); + VRCompositor_SetTrackingSpace(ETrackingUniverseOrigin_TrackingUniverseSeated); } else { - ((OpenVR)hardware).getCompositor().SetTrackingSpace.apply(JOpenVRLibrary.ETrackingUniverseOrigin.ETrackingUniverseOrigin_TrackingUniverseStanding); + VRCompositor_SetTrackingSpace(ETrackingUniverseOrigin_TrackingUniverseStanding); } } } @@ -403,7 +406,8 @@ public void atttach(AppState appState, Application application){ if (vrBinding == VRConstants.SETTING_VRAPI_OPENVR_VALUE){ viewmanager = new OpenVRViewManager(this); } else if (vrBinding == VRConstants.SETTING_VRAPI_OSVR_VALUE){ - viewmanager = new OSVRViewManager(this); + throw new RuntimeException("OSVR support removed for now."); +// viewmanager = new OSVRViewManager(this); } else if (vrBinding == VRConstants.SETTING_VRAPI_OCULUSVR_VALUE) { viewmanager = new OculusViewManager(this); } else { @@ -422,54 +426,41 @@ public boolean initialize(){ initialized = false; - // we are going to use OpenVR now, not the Oculus Rift - // OpenVR does support the Rift - String OS = System.getProperty("os.name", "generic").toLowerCase(Locale.ENGLISH); - vrSupportedOS = !OS.contains("nux") && System.getProperty("sun.arch.data.model").equalsIgnoreCase("64"); //for the moment, linux/unix causes crashes, 64-bit only - compositorOS = OS.contains("indows"); - - if( vrSupportedOS) { - if( vrBinding == VRConstants.SETTING_VRAPI_OSVR_VALUE ) { - - guiManager = new VRGuiManager(this); - mouseManager = new OpenVRMouseManager(this); - - hardware = new OSVR(this); - initialized = true; - logger.config("Creating OSVR wrapper [SUCCESS]"); - } else if( vrBinding == VRConstants.SETTING_VRAPI_OPENVR_VALUE ) { - - guiManager = new VRGuiManager(this); - mouseManager = new OpenVRMouseManager(this); + if( vrBinding == VRConstants.SETTING_VRAPI_OSVR_VALUE ) { + throw new RuntimeException("OSVR support removed for now."); +// guiManager = new VRGuiManager(this); +// mouseManager = new OpenVRMouseManager(this); +// +// hardware = new OSVR(this); +// initialized = true; +// logger.config("Creating OSVR wrapper [SUCCESS]"); + } else if( vrBinding == VRConstants.SETTING_VRAPI_OPENVR_VALUE ) { + guiManager = new VRGuiManager(this); + mouseManager = new OpenVRMouseManager(this); - hardware = new OpenVR(this); - initialized = true; - logger.config("Creating OpenVR wrapper [SUCCESS]"); - } else if (vrBinding == VRConstants.SETTING_VRAPI_OCULUSVR_VALUE) { - - guiManager = new VRGuiManager(this); - mouseManager = new OculusMouseManager(this); - - hardware = new OculusVR(this); - initialized = true; - logger.config("Creating Occulus Rift wrapper [SUCCESS]"); - } else { - logger.config("Cannot create VR binding: "+vrBinding+" [FAILED]"); - logger.log(Level.SEVERE, "Cannot initialize VR environment [FAILED]"); - } - - if( hardware.initialize() ) { - initialized &= true; - logger.config("VR native wrapper initialized [SUCCESS]"); - } else { - initialized &= false; - logger.warning("VR native wrapper initialized [FAILED]"); - logger.log(Level.SEVERE, "Cannot initialize VR environment [FAILED]"); - } - } else { - logger.log(Level.SEVERE, "System does not support VR capabilities."); - logger.log(Level.SEVERE, "Cannot initialize VR environment [FAILED]"); - } + hardware = new OpenVR(this); + initialized = true; + logger.config("Creating OpenVR wrapper [SUCCESS]"); + } else if (vrBinding == VRConstants.SETTING_VRAPI_OCULUSVR_VALUE) { + guiManager = new VRGuiManager(this); + mouseManager = new OculusMouseManager(this); + + hardware = new OculusVR(this); + initialized = true; + logger.config("Creating Occulus Rift wrapper [SUCCESS]"); + } else { + logger.config("Cannot create VR binding: "+vrBinding+" [FAILED]"); + logger.log(Level.SEVERE, "Cannot initialize VR environment [FAILED]"); + } + + if( hardware.initialize() ) { + initialized &= true; + logger.config("VR native wrapper initialized [SUCCESS]"); + } else { + initialized &= false; + logger.warning("VR native wrapper initialized [FAILED]"); + logger.log(Level.SEVERE, "Cannot initialize VR environment [FAILED]"); + } return initialized; } diff --git a/jme3-vr/src/main/java/com/jme3/input/lwjgl/GlfwMouseInputVR.java b/jme3-vr/src/main/java/com/jme3/input/lwjgl/GlfwMouseInputVR.java index 5dbb958fb7..991bfc0162 100644 --- a/jme3-vr/src/main/java/com/jme3/input/lwjgl/GlfwMouseInputVR.java +++ b/jme3-vr/src/main/java/com/jme3/input/lwjgl/GlfwMouseInputVR.java @@ -38,7 +38,7 @@ import com.jme3.input.event.MouseButtonEvent; import com.jme3.input.event.MouseMotionEvent; import com.jme3.system.lwjgl.LwjglWindowVR; -import com.jme3.util.BufferUtils; +import org.lwjgl.BufferUtils; import org.lwjgl.glfw.GLFWCursorPosCallback; import org.lwjgl.glfw.GLFWMouseButtonCallback; diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/AbstractVRViewManager.java b/jme3-vr/src/main/java/com/jme3/input/vr/AbstractVRViewManager.java index 54251fadf3..fc82f9f0e9 100644 --- a/jme3-vr/src/main/java/com/jme3/input/vr/AbstractVRViewManager.java +++ b/jme3-vr/src/main/java/com/jme3/input/vr/AbstractVRViewManager.java @@ -145,12 +145,10 @@ public void moveScreenProcessingToEyes() { } else { throw new IllegalStateException("The VR environment is not attached to any application."); } - } else { throw new IllegalStateException("This VR view manager is not attached to any VR environment."); } - } diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/oculus/OculusViewManager.java b/jme3-vr/src/main/java/com/jme3/input/vr/oculus/OculusViewManager.java index ac97ab3efa..c6c27a40a9 100644 --- a/jme3-vr/src/main/java/com/jme3/input/vr/oculus/OculusViewManager.java +++ b/jme3-vr/src/main/java/com/jme3/input/vr/oculus/OculusViewManager.java @@ -39,7 +39,7 @@ import com.jme3.renderer.ViewPort; import com.jme3.scene.Spatial; import com.jme3.texture.*; -import com.jme3.util.BufferUtils; +import org.lwjgl.BufferUtils; import com.jme3.util.VRGUIPositioningMode; import java.nio.IntBuffer; diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/openvr/OpenVR.java b/jme3-vr/src/main/java/com/jme3/input/vr/openvr/OpenVR.java index 8e10ecd0a6..2e39072a16 100644 --- a/jme3-vr/src/main/java/com/jme3/input/vr/openvr/OpenVR.java +++ b/jme3-vr/src/main/java/com/jme3/input/vr/openvr/OpenVR.java @@ -13,122 +13,139 @@ import com.jme3.math.Vector2f; import com.jme3.math.Vector3f; import com.jme3.renderer.Camera; -import com.jme3.system.jopenvr.HmdMatrix34_t; -import com.jme3.system.jopenvr.HmdMatrix44_t; -import com.jme3.system.jopenvr.JOpenVRLibrary; -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.system.NativeLibraryLoader; import com.jme3.util.VRUtil; -import com.sun.jna.Memory; -import com.sun.jna.Pointer; -import com.sun.jna.ptr.FloatByReference; -import com.sun.jna.ptr.IntByReference; -import com.sun.jna.ptr.LongByReference; +import org.lwjgl.BufferUtils; +import org.lwjgl.openvr.HmdMatrix34; +import org.lwjgl.openvr.HmdMatrix44; +import org.lwjgl.openvr.TrackedDevicePose; +import org.lwjgl.system.MemoryStack; +import java.nio.ByteBuffer; +import java.nio.FloatBuffer; import java.nio.IntBuffer; +import java.nio.LongBuffer; +import java.util.Arrays; +import java.util.HashSet; import java.util.Locale; +import java.util.Vector; import java.util.concurrent.TimeUnit; -import java.util.logging.Level; import java.util.logging.Logger; +import static org.lwjgl.openvr.VR.*; +import static org.lwjgl.openvr.VRCompositor.VRCompositor_SetTrackingSpace; +import static org.lwjgl.openvr.VRCompositor.VRCompositor_WaitGetPoses; +import static org.lwjgl.openvr.VRSystem.*; + /** - * A class that wraps an OpenVR system. + * A class that wraps an OpenVR system. * @author reden - phr00t - https://github.com/phr00t * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr */ public class OpenVR implements VRAPI { - + private static final Logger logger = Logger.getLogger(OpenVR.class.getName()); - - private static VR_IVRCompositor_FnTable compositorFunctions; - private static VR_IVRSystem_FnTable vrsystemFunctions; - private static VR_IVRTrackedCamera_FnTable cameraFunctions; - + private static final boolean DEBUG = false; + private static boolean initSuccess = false; private static boolean flipEyes = false; - + + private long vrsystemFunctions; + private IntBuffer hmdDisplayFrequency; - private TrackedDevicePose_t.ByReference hmdTrackedDevicePoseReference; - protected TrackedDevicePose_t[] hmdTrackedDevicePoses; - - protected IntByReference hmdErrorStore; - + protected TrackedDevicePose.Buffer trackedDeviceRenderPoses; + protected TrackedDevicePose.Buffer trackedDeviceGamePoses; + + // TODO: we aren't able to clear this for some reason + public static IntBuffer hmdErrorStore = BufferUtils.createIntBuffer(1); + private final Quaternion rotStore = new Quaternion(); private final Vector3f posStore = new Vector3f(); - - private static FloatByReference tlastVsync; - + + private static FloatBuffer tlastVsync; + /** * The actual frame count. */ - public static LongByReference _tframeCount; - + public static LongBuffer _tframeCount; + // for debugging latency - private int frames = 0; - + private int frames = 0; + protected Matrix4f[] poseMatrices; - + private final Matrix4f hmdPose = Matrix4f.IDENTITY.clone(); private Matrix4f hmdProjectionLeftEye; private Matrix4f hmdProjectionRightEye; private Matrix4f hmdPoseLeftEye; private Matrix4f hmdPoseRightEye; - + private Vector3f hmdPoseLeftEyeVec, hmdPoseRightEyeVec, hmdSeatToStand; - + private float vsyncToPhotons; private double timePerFrame, frameCountRun; private long frameCount; private OpenVRInput VRinput; - - + + private boolean enableDebugLatency = false; + private VREnvironment environment = null; - + private Object compositorPlaceholder = new Object(); + private Object systemPlaceholder = new Object(); + /** - * Create a new OpenVR system + * Create a new OpenVR system * attached to the given {@link VREnvironment VR environment}. * @param environment the VR environment to which this API is attached. */ public OpenVR(VREnvironment environment){ this.environment = environment; } - + @Override public OpenVRInput getVRinput() { return VRinput; } - - @Override - public VR_IVRSystem_FnTable getVRSystem() { - return vrsystemFunctions; - } - - @Override - public VR_IVRCompositor_FnTable getCompositor() { - return compositorFunctions; - } - - public VR_IVRTrackedCamera_FnTable getTrackedCamera(){ - return cameraFunctions; - } - + +// @Override +// public VR_IVRSystem_FnTable getVRSystem() { +// return vrsystemFunctions; +// } +// +// @Override +// public VR_IVRCompositor_FnTable getCompositor() { +// return compositorFunctions; +// } + +// public VR_IVRTrackedCamera_FnTable getTrackedCamera(){ +// return cameraFunctions; +// } + @Override public String getName() { return "OpenVR"; } - + private static long latencyWaitTime = 0; - + @Override public void setFlipEyes(boolean set) { flipEyes = set; } - - private boolean enableDebugLatency = false; - + + @Override + public Object getVRSystem() { + // TODO: is this used anywhere? + return systemPlaceholder; + } + + @Override + public Object getCompositor() { + // Looks like this is our way of saying we have a validp + // compositor + return compositorPlaceholder; + } + @Override public void printLatencyInfoToConsole(boolean set) { enableDebugLatency = set; @@ -139,147 +156,116 @@ public int getDisplayFrequency() { if( hmdDisplayFrequency == null ) return 0; return hmdDisplayFrequency.get(0); } - + +// private static final java.lang.reflect.Field LIBRARIES; + static { + + } + public static String[] getLoadedLibraries(final ClassLoader loader) { + java.lang.reflect.Field LIBRARIES = null; + try { + LIBRARIES = ClassLoader.class.getDeclaredField("loadedLibraryNames"); + LIBRARIES.setAccessible(true); + + final Vector libraries = (Vector) LIBRARIES.get(loader); + return libraries.toArray(new String[] {}); + } catch (NoSuchFieldException | IllegalAccessException e) { + e.printStackTrace(); + throw new RuntimeException("was unable to get native libraries!"); + } + } + @Override public boolean initialize() { - + logger.config("Initializing OpenVR system..."); - - hmdErrorStore = new IntByReference(); - vrsystemFunctions = null; - - // Init the native linking to the OpenVR library. - try{ - JOpenVRLibrary.init(); - } catch(Throwable t){ - logger.log(Level.SEVERE, "Cannot link to OpenVR system library: "+t.getMessage(), t); - return false; + + String[] loadedLibraries = getLoadedLibraries(ClassLoader.getSystemClassLoader()); + logger.config("Loaded native libs: " + Arrays.toString(loadedLibraries)); + +// if (VR_IsHmdPresent()) { throw new RuntimeException("Error : HMD not detected on the system"); } + + if (!VR_IsRuntimeInstalled()) { + throw new RuntimeException("Error : OpenVR Runtime not detected on the system"); } - - JOpenVRLibrary.VR_InitInternal(hmdErrorStore, JOpenVRLibrary.EVRApplicationType.EVRApplicationType_VRApplication_Scene); - - if( hmdErrorStore.getValue() == 0 ) { - vrsystemFunctions = new VR_IVRSystem_FnTable(JOpenVRLibrary.VR_GetGenericInterface(JOpenVRLibrary.IVRSystem_Version, hmdErrorStore).getPointer()); + + // Init the native linking to the OpenVR library. + VR_InitInternal(hmdErrorStore, EVRApplicationType_VRApplication_Scene); + int token = VR_GetInitToken(); + org.lwjgl.openvr.OpenVR.create(token); + + if( hmdErrorStore.get(0) == 0 ) { + vrsystemFunctions = VR_GetGenericInterface(IVRSystem_Version, hmdErrorStore); + initSuccess = true; } - - if( vrsystemFunctions == null || hmdErrorStore.getValue() != 0 ) { - logger.severe("OpenVR Initialize Result: " + JOpenVRLibrary.VR_GetVRInitErrorAsEnglishDescription(hmdErrorStore.getValue()).getString(0)); + + if( !initSuccess || hmdErrorStore.get(0) != 0 ) { + logger.severe("OpenVR Initialize Result: " + VR_GetVRInitErrorAsEnglishDescription(hmdErrorStore.get(0))); logger.severe("Initializing OpenVR system [FAILED]"); return false; } else { logger.config("OpenVR initialized & VR connected."); - - vrsystemFunctions.setAutoSynch(false); - vrsystemFunctions.read(); - - - tlastVsync = new FloatByReference(); - _tframeCount = new LongByReference(); - + + tlastVsync = BufferUtils.createFloatBuffer(1); + _tframeCount = BufferUtils.createLongBuffer(1); + hmdDisplayFrequency = IntBuffer.allocate(1); - hmdDisplayFrequency.put( (int) JOpenVRLibrary.ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_DisplayFrequency_Float); - hmdTrackedDevicePoseReference = new TrackedDevicePose_t.ByReference(); - hmdTrackedDevicePoses = (TrackedDevicePose_t[])hmdTrackedDevicePoseReference.toArray(JOpenVRLibrary.k_unMaxTrackedDeviceCount); - poseMatrices = new Matrix4f[JOpenVRLibrary.k_unMaxTrackedDeviceCount]; + hmdDisplayFrequency.put(ETrackedDeviceProperty_Prop_DisplayFrequency_Float); + trackedDeviceRenderPoses = new TrackedDevicePose.Buffer(BufferUtils.createByteBuffer(TrackedDevicePose.SIZEOF * k_unMaxTrackedDeviceCount)); + trackedDeviceGamePoses = new TrackedDevicePose.Buffer(BufferUtils.createByteBuffer(TrackedDevicePose.SIZEOF * k_unMaxTrackedDeviceCount)); + + poseMatrices = new Matrix4f[k_unMaxTrackedDeviceCount]; for(int i=0;itrue is the use of the headset camera is allowed and false otherwise. - */ - 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"); - } - } - } + private void resetErrorStore() { + System.out.println("resetting error store: " + hmdErrorStore); + //hmdErrorStore.clear(); } - + @Override public void destroy() { - JOpenVRLibrary.VR_ShutdownInternal(); + VR_ShutdownInternal(); } @Override @@ -289,31 +275,32 @@ public boolean isInitialized() { @Override public void reset() { - if( vrsystemFunctions == null ) return; - vrsystemFunctions.ResetSeatedZeroPose.apply(); + VRSystem_ResetSeatedZeroPose(); hmdSeatToStand = null; } @Override public void getRenderSize(Vector2f store) { - if( vrsystemFunctions == null ) { + if( !initSuccess ) { // 1344x1512 store.x = 1344f; store.y = 1512f; } else { - IntByReference x = new IntByReference(); - IntByReference y = new IntByReference(); - vrsystemFunctions.GetRecommendedRenderTargetSize.apply(x, y); - store.x = x.getValue(); - store.y = y.getValue(); + try (MemoryStack stack = MemoryStack.stackPush()) { + IntBuffer x = stack.ints(1); + IntBuffer y = stack.ints(1); + VRSystem_GetRecommendedRenderTargetSize(x, y); + store.x = x.get(0); + store.y = y.get(0); + } } } /* @Override public float getFOV(int dir) { float val = 0f; - if( vrsystemFunctions != null ) { - val = vrsystemFunctions.GetFloatTrackedDeviceProperty.apply(JOpenVRLibrary.k_unTrackedDeviceIndex_Hmd, dir, hmdErrorStore); + if( vrsystemFunctions != null ) { + val = VRSystem_GetFloatTrackedDeviceProperty.apply(JOpenVRLibrary.k_unTrackedDeviceIndex_Hmd, dir, hmdErrorStore); } // verification of number if( val == 0f ) { @@ -325,13 +312,13 @@ public float getFOV(int dir) { return val; } */ - + @Override public float getInterpupillaryDistance() { - if( vrsystemFunctions == null ) return 0.065f; - return vrsystemFunctions.GetFloatTrackedDeviceProperty.apply(JOpenVRLibrary.k_unTrackedDeviceIndex_Hmd, JOpenVRLibrary.ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_UserIpdMeters_Float, hmdErrorStore); + if( !initSuccess ) return 0.065f; + return VRSystem_GetFloatTrackedDeviceProperty(k_unTrackedDeviceIndex_Hmd, ETrackedDeviceProperty_Prop_UserIpdMeters_Float, hmdErrorStore); } - + @Override public Quaternion getOrientation() { VRUtil.convertMatrix4toQuat(hmdPose, rotStore); @@ -346,37 +333,38 @@ public Vector3f getPosition() { posStore.z = -posStore.z; return posStore; } - + @Override public void getPositionAndOrientation(Vector3f storePos, Quaternion storeRot) { hmdPose.toTranslationVector(storePos); storePos.x = -storePos.x; storePos.z = -storePos.z; storeRot.set(getOrientation()); - } - + } + @Override public void updatePose(){ - if(vrsystemFunctions == null) return; - if(compositorFunctions != null) { - compositorFunctions.WaitGetPoses.apply(hmdTrackedDevicePoseReference, JOpenVRLibrary.k_unMaxTrackedDeviceCount, null, 0); + if(!initSuccess) return; + + if(!DEBUG) { + VRCompositor_WaitGetPoses(trackedDeviceRenderPoses, trackedDeviceGamePoses); } else { // wait if( latencyWaitTime > 0 ) VRUtil.sleepNanos(latencyWaitTime); - - vrsystemFunctions.GetTimeSinceLastVsync.apply(tlastVsync, _tframeCount); - float fSecondsUntilPhotons = (float)timePerFrame - tlastVsync.getValue() + vsyncToPhotons; - + + VRSystem_GetTimeSinceLastVsync(tlastVsync,_tframeCount); + float fSecondsUntilPhotons = (float)timePerFrame - tlastVsync.get(0) + vsyncToPhotons; + if( enableDebugLatency ) { if( frames == 10 ) { System.out.println("Waited (nanos): " + Long.toString(latencyWaitTime)); System.out.println("Predict ahead time: " + Float.toString(fSecondsUntilPhotons)); } - frames = (frames + 1) % 60; - } - + frames = (frames + 1) % 60; + } + // handle skipping frame stuff - long nowCount = _tframeCount.getValue(); + long nowCount = _tframeCount.get(0); if( nowCount - frameCount > 1 ) { // skipped a frame! if( enableDebugLatency ) System.out.println("Frame skipped!"); @@ -392,13 +380,15 @@ public void updatePose(){ } frameCount = nowCount; - - vrsystemFunctions.GetDeviceToAbsoluteTrackingPose.apply( - environment.isSeatedExperience()?JOpenVRLibrary.ETrackingUniverseOrigin.ETrackingUniverseOrigin_TrackingUniverseSeated: - JOpenVRLibrary.ETrackingUniverseOrigin.ETrackingUniverseOrigin_TrackingUniverseStanding, - fSecondsUntilPhotons, hmdTrackedDevicePoseReference, JOpenVRLibrary.k_unMaxTrackedDeviceCount); + + VRSystem_GetDeviceToAbsoluteTrackingPose( + environment.isSeatedExperience() ? ETrackingUniverseOrigin_TrackingUniverseSeated: + ETrackingUniverseOrigin_TrackingUniverseStanding, + fSecondsUntilPhotons, + trackedDeviceRenderPoses + ); } - + // deal with controllers being plugged in and out // causing an invalid memory crash... skipping for now /*boolean hasEvent = false; @@ -412,51 +402,55 @@ public void updatePose(){ }*/ //update controllers pose information environment.getVRinput().updateControllerStates(); - + // read pose data from native - for (int nDevice = 0; nDevice < JOpenVRLibrary.k_unMaxTrackedDeviceCount; ++nDevice ){ - hmdTrackedDevicePoses[nDevice].readField("bPoseIsValid"); - if( hmdTrackedDevicePoses[nDevice].bPoseIsValid != 0 ){ - hmdTrackedDevicePoses[nDevice].readField("mDeviceToAbsoluteTracking"); - VRUtil.convertSteamVRMatrix3ToMatrix4f(hmdTrackedDevicePoses[nDevice].mDeviceToAbsoluteTracking, poseMatrices[nDevice]); - } + for (int nDevice = 0; nDevice < k_unMaxTrackedDeviceCount; ++nDevice ){ + trackedDeviceRenderPoses.get(nDevice).bPoseIsValid(); + if( trackedDeviceRenderPoses.get(nDevice).bPoseIsValid()){ + HmdMatrix34 absolute = trackedDeviceRenderPoses.get(nDevice).mDeviceToAbsoluteTracking(); + VRUtil.convertSteamVRMatrix3ToMatrix4f(absolute, poseMatrices[nDevice]); + } } - - if ( hmdTrackedDevicePoses[JOpenVRLibrary.k_unTrackedDeviceIndex_Hmd].bPoseIsValid != 0 ){ - hmdPose.set(poseMatrices[JOpenVRLibrary.k_unTrackedDeviceIndex_Hmd]); + + if (trackedDeviceRenderPoses.get(k_unTrackedDeviceIndex_Hmd).bPoseIsValid() ){ + hmdPose.set(poseMatrices[k_unTrackedDeviceIndex_Hmd]); } else { hmdPose.set(Matrix4f.IDENTITY); } } @Override - public Matrix4f getHMDMatrixProjectionLeftEye(Camera cam){ - if( hmdProjectionLeftEye != null ) { + public Matrix4f getHMDMatrixProjectionLeftEye(Camera cam) { + if (hmdProjectionLeftEye != null) { return hmdProjectionLeftEye; - } else if(vrsystemFunctions == null){ + } else if (!initSuccess) { return cam.getProjectionMatrix(); } else { - HmdMatrix44_t mat = vrsystemFunctions.GetProjectionMatrix.apply(JOpenVRLibrary.EVREye.EVREye_Eye_Left, cam.getFrustumNear(), cam.getFrustumFar()); - hmdProjectionLeftEye = new Matrix4f(); - VRUtil.convertSteamVRMatrix4ToMatrix4f(mat, hmdProjectionLeftEye); - return hmdProjectionLeftEye; + try (MemoryStack stack = MemoryStack.stackPush()) { + HmdMatrix44 mat = VRSystem_GetProjectionMatrix(EVREye_Eye_Left, cam.getFrustumNear(), cam.getFrustumFar(), new HmdMatrix44(stack.malloc(HmdMatrix44.SIZEOF))); + hmdProjectionLeftEye = new Matrix4f(); + VRUtil.convertSteamVRMatrix4ToMatrix4f(mat, hmdProjectionLeftEye); + return hmdProjectionLeftEye; + } } } - + @Override public Matrix4f getHMDMatrixProjectionRightEye(Camera cam){ if( hmdProjectionRightEye != null ) { return hmdProjectionRightEye; - } else if(vrsystemFunctions == null){ + } else if(!initSuccess){ return cam.getProjectionMatrix(); } else { - HmdMatrix44_t mat = vrsystemFunctions.GetProjectionMatrix.apply(JOpenVRLibrary.EVREye.EVREye_Eye_Right, cam.getFrustumNear(), cam.getFrustumFar()); - hmdProjectionRightEye = new Matrix4f(); - VRUtil.convertSteamVRMatrix4ToMatrix4f(mat, hmdProjectionRightEye); - return hmdProjectionRightEye; + try (MemoryStack stack = MemoryStack.stackPush()) { + HmdMatrix44 mat = VRSystem_GetProjectionMatrix(EVREye_Eye_Right, cam.getFrustumNear(), cam.getFrustumFar(), new HmdMatrix44(stack.malloc(HmdMatrix44.SIZEOF))); + hmdProjectionRightEye = new Matrix4f(); + VRUtil.convertSteamVRMatrix4ToMatrix4f(mat, hmdProjectionRightEye); + return hmdProjectionRightEye; + } } } - + @Override public Vector3f getHMDVectorPoseLeftEye() { if( hmdPoseLeftEyeVec == null ) { @@ -469,7 +463,7 @@ public Vector3f getHMDVectorPoseLeftEye() { } return hmdPoseLeftEyeVec; } - + @Override public Vector3f getHMDVectorPoseRightEye() { if( hmdPoseRightEyeVec == null ) { @@ -482,85 +476,97 @@ public Vector3f getHMDVectorPoseRightEye() { } return hmdPoseRightEyeVec; } - + @Override public Vector3f getSeatedToAbsolutePosition() { if( environment.isSeatedExperience() == false ) return Vector3f.ZERO; if( hmdSeatToStand == null ) { hmdSeatToStand = new Vector3f(); - HmdMatrix34_t mat = vrsystemFunctions.GetSeatedZeroPoseToStandingAbsoluteTrackingPose.apply(); - Matrix4f tempmat = new Matrix4f(); - VRUtil.convertSteamVRMatrix3ToMatrix4f(mat, tempmat); - tempmat.toTranslationVector(hmdSeatToStand); + try (MemoryStack stack = MemoryStack.stackPush()) { + HmdMatrix34 mat = VRSystem_GetSeatedZeroPoseToStandingAbsoluteTrackingPose(new HmdMatrix34(stack.malloc(HmdMatrix34.SIZEOF))); + Matrix4f tempmat = new Matrix4f(); + VRUtil.convertSteamVRMatrix3ToMatrix4f(mat, tempmat); + tempmat.toTranslationVector(hmdSeatToStand); + } } return hmdSeatToStand; } - + @Override public Matrix4f getHMDMatrixPoseLeftEye(){ if( hmdPoseLeftEye != null ) { return hmdPoseLeftEye; - } else if(vrsystemFunctions == null) { + } else if(!initSuccess) { return Matrix4f.IDENTITY; } else { - HmdMatrix34_t mat = vrsystemFunctions.GetEyeToHeadTransform.apply(JOpenVRLibrary.EVREye.EVREye_Eye_Left); - hmdPoseLeftEye = new Matrix4f(); - return VRUtil.convertSteamVRMatrix3ToMatrix4f(mat, hmdPoseLeftEye); - } - } - - @Override - public HmdType getType() { - if( vrsystemFunctions != null ) { - Pointer str1 = new Memory(128); - Pointer str2 = new Memory(128); - String completeName = ""; - vrsystemFunctions.GetStringTrackedDeviceProperty.apply(JOpenVRLibrary.k_unTrackedDeviceIndex_Hmd, - JOpenVRLibrary.ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_ManufacturerName_String, - str1, 128, hmdErrorStore); - if( hmdErrorStore.getValue() == 0 ) completeName += str1.getString(0); - vrsystemFunctions.GetStringTrackedDeviceProperty.apply(JOpenVRLibrary.k_unTrackedDeviceIndex_Hmd, - JOpenVRLibrary.ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_ModelNumber_String, - str2, 128, hmdErrorStore); - if( hmdErrorStore.getValue() == 0 ) completeName += " " + str2.getString(0); - if( completeName.length() > 0 ) { - completeName = completeName.toLowerCase(Locale.ENGLISH).trim(); - if( completeName.contains("htc") || completeName.contains("vive") ) { - return HmdType.HTC_VIVE; - } else if( completeName.contains("osvr") ) { - return HmdType.OSVR; - } else if( completeName.contains("oculus") || completeName.contains("rift") || - completeName.contains("dk1") || completeName.contains("dk2") || completeName.contains("cv1") ) { - return HmdType.OCULUS_RIFT; - } else if( completeName.contains("fove") ) { - return HmdType.FOVE; - } else if( completeName.contains("game") && completeName.contains("face") ) { - return HmdType.GAMEFACE; - } else if( completeName.contains("morpheus") ) { - return HmdType.MORPHEUS; - } else if( completeName.contains("gear") ) { - return HmdType.GEARVR; - } else if( completeName.contains("star") ) { - return HmdType.STARVR; - } else if( completeName.contains("null") ) { - return HmdType.NULL; - } + try (MemoryStack stack = MemoryStack.stackPush()) { + HmdMatrix34 mat = VRSystem_GetEyeToHeadTransform(EVREye_Eye_Left, new HmdMatrix34(stack.malloc(HmdMatrix34.SIZEOF))); + hmdPoseLeftEye = new Matrix4f(); + return VRUtil.convertSteamVRMatrix3ToMatrix4f(mat, hmdPoseLeftEye); } - } else return HmdType.NONE; - return HmdType.OTHER; + } } - + @Override public Matrix4f getHMDMatrixPoseRightEye(){ if( hmdPoseRightEye != null ) { return hmdPoseRightEye; - } else if(vrsystemFunctions == null) { + } else if(!initSuccess) { return Matrix4f.IDENTITY; } else { - HmdMatrix34_t mat = vrsystemFunctions.GetEyeToHeadTransform.apply(JOpenVRLibrary.EVREye.EVREye_Eye_Right); - hmdPoseRightEye = new Matrix4f(); - return VRUtil.convertSteamVRMatrix3ToMatrix4f(mat, hmdPoseRightEye); + try (MemoryStack stack = MemoryStack.stackPush()) { + HmdMatrix34 mat = VRSystem_GetEyeToHeadTransform(EVREye_Eye_Right, new HmdMatrix34(stack.malloc(HmdMatrix34.SIZEOF))); + hmdPoseRightEye = new Matrix4f(); + return VRUtil.convertSteamVRMatrix3ToMatrix4f(mat, hmdPoseRightEye); + } + } + } + + @Override + public HmdType getType() { + if (initSuccess) { + try (MemoryStack stack = MemoryStack.stackPush()) { + ByteBuffer str1 = stack.malloc(k_unMaxPropertyStringSize); + ByteBuffer str2 = stack.malloc(k_unMaxPropertyStringSize); + + VRSystem_GetStringTrackedDeviceProperty(k_unTrackedDeviceIndex_Hmd, + ETrackedDeviceProperty_Prop_ManufacturerName_String, + str1, + hmdErrorStore); + + String completeName = ""; + if (hmdErrorStore.get(0) == 0) completeName += new String(str1.array()); + VRSystem_GetStringTrackedDeviceProperty(k_unTrackedDeviceIndex_Hmd, + ETrackedDeviceProperty_Prop_ModelNumber_String, + str2, hmdErrorStore); + if (hmdErrorStore.get(0) == 0) completeName += " " + new String(str2.array()); + if (completeName.length() > 0) { + completeName = completeName.toLowerCase(Locale.ENGLISH).trim(); + if (completeName.contains("htc") || completeName.contains("vive")) { + return HmdType.HTC_VIVE; + } else if (completeName.contains("osvr")) { + return HmdType.OSVR; + } else if (completeName.contains("oculus") || completeName.contains("rift") || + completeName.contains("dk1") || completeName.contains("dk2") || completeName.contains("cv1")) { + return HmdType.OCULUS_RIFT; + } else if (completeName.contains("fove")) { + return HmdType.FOVE; + } else if (completeName.contains("game") && completeName.contains("face")) { + return HmdType.GAMEFACE; + } else if (completeName.contains("morpheus")) { + return HmdType.MORPHEUS; + } else if (completeName.contains("gear")) { + return HmdType.GEARVR; + } else if (completeName.contains("star")) { + return HmdType.STARVR; + } else if (completeName.contains("null")) { + return HmdType.NULL; + } + } + } + return HmdType.NONE; } + return HmdType.OTHER; } - + } diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/openvr/OpenVRBounds.java b/jme3-vr/src/main/java/com/jme3/input/vr/openvr/OpenVRBounds.java index b487a5f22f..190dca7c4f 100644 --- a/jme3-vr/src/main/java/com/jme3/input/vr/openvr/OpenVRBounds.java +++ b/jme3-vr/src/main/java/com/jme3/input/vr/openvr/OpenVRBounds.java @@ -2,12 +2,14 @@ import com.jme3.input.vr.VRBounds; import com.jme3.math.Vector2f; -import com.jme3.system.jopenvr.JOpenVRLibrary; -import com.jme3.system.jopenvr.VR_IVRChaperone_FnTable; -import com.sun.jna.ptr.FloatByReference; +import org.lwjgl.openvr.VRChaperone; +import org.lwjgl.system.MemoryStack; +import java.nio.FloatBuffer; import java.util.logging.Logger; +import static org.lwjgl.system.MemoryStack.stackPush; + /** * A class that represents VR world bounds. * @author reden - phr00t - https://github.com/phr00t @@ -15,45 +17,34 @@ */ public class OpenVRBounds implements VRBounds { - private static Logger logger = Logger.getLogger(OpenVRBounds.class.getName()); - - private VR_IVRChaperone_FnTable vrChaperone; + private static Logger logger = Logger.getLogger(OpenVRBounds.class.getName()); + private Vector2f playSize; - - /** - * Initialize the VR bounds. - * @return true if the initialization is a success and false otherwise. - */ + + /** + * Initialize the VR bounds. + * @return true if the initialization is a success and false otherwise. + */ public boolean init(OpenVR api) { - - logger.config("Initialize VR bounds..."); - - if( vrChaperone == null ) { - vrChaperone = new VR_IVRChaperone_FnTable(JOpenVRLibrary.VR_GetGenericInterface(JOpenVRLibrary.IVRChaperone_Version, api.hmdErrorStore).getPointer()); - if( vrChaperone != null ) { - vrChaperone.setAutoSynch(false); - vrChaperone.read(); - FloatByReference fbX = new FloatByReference(); - FloatByReference fbZ = new FloatByReference(); - vrChaperone.GetPlayAreaSize.apply(fbX, fbZ); - playSize = new Vector2f(fbX.getValue(), fbZ.getValue()); - - logger.config("Initialize VR bounds [SUCCESS]"); - return true; // init success - } - - logger.warning("Initialize VR bounds [FAILED]."); - return false; // failed to init + logger.config("Initialize VR bounds..."); + + try (MemoryStack stack = stackPush()) { + FloatBuffer fbX = stack.mallocFloat(1); + FloatBuffer fbZ = stack.mallocFloat(1); + + VRChaperone.VRChaperone_GetPlayAreaSize(fbX, fbZ); + + playSize = new Vector2f(fbX.get(0), fbZ.get(0)); + + logger.config("Initialize VR bounds [SUCCESS]"); + return true; // init success } - - logger.config("Initialize VR bounds already done."); - return true; // already initialized } - + @Override public Vector2f getPlaySize() { return playSize; } - + } diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/openvr/OpenVRInput.java b/jme3-vr/src/main/java/com/jme3/input/vr/openvr/OpenVRInput.java index 1619d7a9ff..c79f1d4abc 100644 --- a/jme3-vr/src/main/java/com/jme3/input/vr/openvr/OpenVRInput.java +++ b/jme3-vr/src/main/java/com/jme3/input/vr/openvr/OpenVRInput.java @@ -5,6 +5,9 @@ */ package com.jme3.input.vr.openvr; +import java.nio.ByteBuffer; +import java.nio.IntBuffer; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; import java.util.logging.Level; @@ -19,11 +22,13 @@ import com.jme3.math.Vector3f; import com.jme3.renderer.Camera; import com.jme3.scene.Spatial; -import com.jme3.system.jopenvr.JOpenVRLibrary; -import com.jme3.system.jopenvr.OpenVRUtil; -import com.jme3.system.jopenvr.VRControllerState_t; -import com.jme3.system.jopenvr.VR_IVRSystem_FnTable; import com.jme3.util.VRUtil; +import org.lwjgl.BufferUtils; +import org.lwjgl.openvr.VRControllerState; +import org.lwjgl.system.MemoryStack; + +import static org.lwjgl.openvr.VR.*; +import static org.lwjgl.openvr.VRSystem.*; /* make helper functions to pull the following easily from raw data (DONE) @@ -70,39 +75,42 @@ make helper functions to pull the following easily from raw data (DONE) * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr */ public class OpenVRInput implements VRInputAPI { - + private static final Logger logger = Logger.getLogger(OpenVRInput.class.getName()); - - private final VRControllerState_t[] cStates = new VRControllerState_t[JOpenVRLibrary.k_unMaxTrackedDeviceCount]; - - private final Quaternion[] rotStore = new Quaternion[JOpenVRLibrary.k_unMaxTrackedDeviceCount]; - - private final Vector3f[] posStore = new Vector3f[JOpenVRLibrary.k_unMaxTrackedDeviceCount]; - - private static final int[] controllerIndex = new int[JOpenVRLibrary.k_unMaxTrackedDeviceCount]; - + + private final VRControllerState[] cStates = new VRControllerState[k_unMaxTrackedDeviceCount]; + + private final Quaternion[] rotStore = new Quaternion[k_unMaxTrackedDeviceCount]; + + private final Vector3f[] posStore = new Vector3f[k_unMaxTrackedDeviceCount]; + + private static final int[] controllerIndex = new int[k_unMaxTrackedDeviceCount]; + private int controllerCount = 0; - + private final Vector2f tempAxis = new Vector2f(), temp2Axis = new Vector2f(); - - private final Vector2f lastCallAxis[] = new Vector2f[JOpenVRLibrary.k_unMaxTrackedDeviceCount]; - - private final boolean needsNewVelocity[] = new boolean[JOpenVRLibrary.k_unMaxTrackedDeviceCount]; - - private final boolean needsNewAngVelocity[] = new boolean[JOpenVRLibrary.k_unMaxTrackedDeviceCount]; - - private final boolean buttonDown[][] = new boolean[JOpenVRLibrary.k_unMaxTrackedDeviceCount][16]; - + + private final Vector2f lastCallAxis[] = new Vector2f[k_unMaxTrackedDeviceCount]; + + private final boolean needsNewVelocity[] = new boolean[k_unMaxTrackedDeviceCount]; + + private final boolean needsNewAngVelocity[] = new boolean[k_unMaxTrackedDeviceCount]; + + private final boolean buttonDown[][] = new boolean[k_unMaxTrackedDeviceCount][16]; + private float axisMultiplier = 1f; - + private final Vector3f tempVel = new Vector3f(); - + private final Quaternion tempq = new Quaternion(); + //public static ByteBuffer stringPropBuffer = BufferUtils.createByteBuffer(k_unMaxPropertyStringSize); + //public static IntBuffer errBuffer = BufferUtils.createIntBuffer(1); + private VREnvironment environment; private List trackedControllers = null; - + /** * Create a new OpenVR input attached to the given VR environment. * @param environment the VR environment to which the input is attached. @@ -110,42 +118,42 @@ public class OpenVRInput implements VRInputAPI { public OpenVRInput(VREnvironment environment){ this.environment = environment; } - + @Override public float getAxisMultiplier() { return axisMultiplier; } - + @Override public void setAxisMultiplier(float set) { axisMultiplier = set; } - + @Override public void swapHands() { - if( controllerCount != 2 ) return; + if( controllerCount != 2 ) return; int temp = controllerIndex[0]; controllerIndex[0] = controllerIndex[1]; controllerIndex[1] = temp; } - + @Override public boolean isButtonDown(int controllerIndex, VRInputType checkButton) { - VRControllerState_t cs = cStates[OpenVRInput.controllerIndex[controllerIndex]]; + VRControllerState cs = cStates[OpenVRInput.controllerIndex[controllerIndex]]; switch( checkButton ) { default: return false; case ViveGripButton: - return (cs.ulButtonPressed & 4) != 0; + return (cs.ulButtonPressed() & 4) != 0; case ViveMenuButton: - return (cs.ulButtonPressed & 2) != 0; + return (cs.ulButtonPressed() & 2) != 0; case ViveTrackpadAxis: - return (cs.ulButtonPressed & 4294967296l) != 0; + return (cs.ulButtonPressed() & 4294967296l) != 0; case ViveTriggerAxis: - return (cs.ulButtonPressed & 8589934592l) != 0; + return (cs.ulButtonPressed() & 8589934592l) != 0; } } - + @Override public boolean wasButtonPressedSinceLastCall(int controllerIndex, VRInputType checkButton) { boolean buttonDownNow = isButtonDown(controllerIndex, checkButton); @@ -155,27 +163,27 @@ public boolean wasButtonPressedSinceLastCall(int controllerIndex, VRInputType ch buttonDown[cIndex][checkButtonValue] = buttonDownNow; return retval; } - + @Override public void resetInputSinceLastCall() { for(int i=0;i= controllerCount ){ return false; } - + if (environment != null){ - if (environment.getVRHardware() instanceof OpenVR){ - return ((OpenVR)environment.getVRHardware()).hmdTrackedDevicePoses[controllerIndex[index]].bPoseIsValid != 0; + return ((OpenVR)environment.getVRHardware()).trackedDeviceRenderPoses.get(controllerIndex[index]).bPoseIsValid(); } else { throw new IllegalStateException("VR hardware "+environment.getVRHardware().getClass().getSimpleName()+" is not a subclass of "+OpenVR.class.getSimpleName()); } @@ -345,15 +352,15 @@ public boolean isInputDeviceTracking(int index) { throw new IllegalStateException("VR input is not attached to a VR environment."); } } - + @Override public Quaternion getOrientation(int index) { if( isInputDeviceTracking(index) == false ){ return null; } - + if (environment != null){ - + if (environment.getVRHardware() instanceof OpenVR){ index = controllerIndex[index]; VRUtil.convertMatrix4toQuat(((OpenVR)environment.getVRHardware()).poseMatrices[index], rotStore[index]); @@ -371,9 +378,9 @@ public Vector3f getPosition(int index) { if( isInputDeviceTracking(index) == false ){ return null; } - + if (environment != null){ - + if (environment.getVRHardware() instanceof OpenVR){ // the hmdPose comes in rotated funny, fix that here index = controllerIndex[index]; @@ -387,45 +394,45 @@ public Vector3f getPosition(int index) { } else { throw new IllegalStateException("VR input is not attached to a VR environment."); } - + } - + @Override public Quaternion getFinalObserverRotation(int index) { - + if (environment != null){ OpenVRViewManager vrvm = (OpenVRViewManager)environment.getVRViewManager(); - + if (vrvm != null){ if(isInputDeviceTracking(index) == false ){ return null; } - + Object obs = environment.getObserver(); if( obs instanceof Camera ) { tempq.set(((Camera)obs).getRotation()); } else { tempq.set(((Spatial)obs).getWorldRotation()); } - + return tempq.multLocal(getOrientation(index)); } else { throw new IllegalStateException("VR environment has no valid view manager."); } - + } else { throw new IllegalStateException("VR input is not attached to a VR environment."); } } - - @Override + + @Override public Vector3f getFinalObserverPosition(int index) { - + if (environment != null){ OpenVRViewManager vrvm = (OpenVRViewManager)environment.getVRViewManager(); - + if (vrvm != null){ if(isInputDeviceTracking(index) == false ){ return null; @@ -442,57 +449,82 @@ public Vector3f getFinalObserverPosition(int index) { } else { throw new IllegalStateException("VR environment has no valid view manager."); } - + } else { throw new IllegalStateException("VR input is not attached to a VR environment."); } - } - + } + @Override public void triggerHapticPulse(int controllerIndex, float seconds) { if( environment.isInVR() == false || isInputDeviceTracking(controllerIndex) == false ){ return; } - + // apparently only axis ID of 0 works - ((VR_IVRSystem_FnTable)environment.getVRHardware().getVRSystem()).TriggerHapticPulse.apply(OpenVRInput.controllerIndex[controllerIndex], - 0, (short)Math.round(3f * seconds / 1e-3f)); + VRSystem_TriggerHapticPulse(OpenVRInput.controllerIndex[controllerIndex], + 0, (short) Math.round(3f * seconds / 1e-3f)); + } + + private String bufferToString(ByteBuffer b) { + return StandardCharsets.UTF_8.decode(b).toString(); + } + + private String fetchDeviceProperty(int i, int propType) { + try (MemoryStack stack = MemoryStack.stackPush()) { + + ByteBuffer stringPropBuffer = stack.malloc(k_unMaxPropertyStringSize); + IntBuffer errBuffer = stack.ints(1); +// stringPropBuffer.flip(); +// errBuffer.flip(); + //errBuffer.clear(); + + VRSystem_GetStringTrackedDeviceProperty(i, propType, stringPropBuffer, errBuffer); + + if (errBuffer.get(0) != 0) { + throw new RuntimeException("Error in fetching device property:" + errBuffer.get(0)); + } + +// String s = new String(stringPropBuffer.array()); + //stringPropBuffer.clear(); + return bufferToString(stringPropBuffer); + } } - + @Override public void updateConnectedControllers() { logger.config("Updating connected controllers."); - + if (environment != null){ controllerCount = 0; - for(int i=0;i(JOpenVRLibrary.k_unMaxTrackedDeviceCount); + trackedControllers = new ArrayList(k_unMaxTrackedDeviceCount); } trackedControllers.add(new OpenVRTrackedController(i, this, controllerName, manufacturerName, environment)); - + // Send an Haptic pulse to the controller triggerHapticPulse(controllerCount, 1.0f); - + controllerCount++; - logger.config(" Tracked controller "+(i+1)+"/"+JOpenVRLibrary.k_unMaxTrackedDeviceCount+" "+controllerName+" ("+manufacturerName+") attached."); + logger.config(" Tracked controller "+(i+1)+"/"+k_unMaxTrackedDeviceCount+" "+controllerName+" ("+manufacturerName+") attached."); } else { - logger.config(" Controller "+(i+1)+"/"+JOpenVRLibrary.k_unMaxTrackedDeviceCount+" ignored."); + logger.config(" Controller "+(i+1)+"/"+k_unMaxTrackedDeviceCount+" ignored."); } } } else { @@ -502,13 +534,13 @@ public void updateConnectedControllers() { @Override public void updateControllerStates() { - + if (environment != null){ for(int i=0;i spatialIter = environment.getApplication().getViewPort().getScenes().iterator(); - while(spatialIter.hasNext()){ - environment.getApplication().getViewPort().detachScene(spatialIter.next()); + Iterator mainViewportScenes = environment.getApplication().getViewPort().getScenes().iterator(); + while(mainViewportScenes.hasNext()){ + environment.getApplication().getViewPort().detachScene(mainViewportScenes.next()); } - - spatialIter = environment.getApplication().getGuiViewPort().getScenes().iterator(); - while(spatialIter.hasNext()){ - environment.getApplication().getGuiViewPort().detachScene(spatialIter.next()); - } - - // only setup distortion scene if compositor isn't running (or using custom mesh distortion option) - if( environment.getVRHardware().getCompositor() == null ) { - Node distortionScene = new Node(); - Material leftMat = new Material(environment.getApplication().getAssetManager(), "Common/MatDefs/VR/OpenVR.j3md"); - leftMat.setTexture("Texture", leftEyeTexture); - Geometry leftEye = new Geometry("box", setupDistortionMesh(JOpenVRLibrary.EVREye.EVREye_Eye_Left, environment.getVRHardware())); - leftEye.setMaterial(leftMat); - distortionScene.attachChild(leftEye); - - Material rightMat = new Material(environment.getApplication().getAssetManager(), "Common/MatDefs/VR/OpenVR.j3md"); - rightMat.setTexture("Texture", rightEyeTexture); - Geometry rightEye = new Geometry("box", setupDistortionMesh(JOpenVRLibrary.EVREye.EVREye_Eye_Right, environment.getVRHardware())); - rightEye.setMaterial(rightMat); - distortionScene.attachChild(rightEye); - - distortionScene.updateGeometricState(); - - environment.getApplication().getViewPort().attachScene(distortionScene); - - //if( useCustomDistortion ) setupFinalFullTexture(app.getViewPort().getCamera()); + + mainViewportScenes = environment.getApplication().getGuiViewPort().getScenes().iterator(); + while(mainViewportScenes.hasNext()){ + environment.getApplication().getGuiViewPort().detachScene(mainViewportScenes.next()); } - + if( environment.getApplication().getContext().getSettings().isSwapBuffers() ) { setupMirrorBuffers(environment.getCamera(), leftEyeTexture, false); - - } + } } else { throw new IllegalStateException("This VR environment is not attached to any application."); } } else { throw new IllegalStateException("This VR view manager is not attached to any VR environment."); - } + } } - + @Override public void update(float tpf) { - + if (environment != null){ // grab the observer Object obs = environment.getObserver(); @@ -421,53 +482,29 @@ public void update(float tpf) { // grab the hardware handle VRAPI dev = environment.getVRHardware(); if( dev != null ) { - // update the HMD's position & orientation dev.updatePose(); dev.getPositionAndOrientation(hmdPos, hmdRot); -/* - // TOREMOVE - Vector3f v = dev.getVRinput().getTrackedController(0).getPosition(); - Quaternion q = dev.getVRinput().getTrackedController(0).getOrientation(); - if ((v != null)&&(q != null)){ - hmdPos.set(v); - hmdRot.set(q); - } - - logger.severe("HMD controller "); - logger.severe(" Position "+hmdPos); - logger.severe(" Orientation "+hmdRot); - - VRTrackedController tc = null; - for(int i = 0; i < dev.getVRinput().getTrackedControllerCount(); i++){ - tc = dev.getVRinput().getTrackedController(i); - logger.severe("Tracked controller "+i+": "+tc.getControllerName()); - logger.severe(" Position "+tc.getPosition()); - logger.severe(" Orientation "+tc.getOrientation()); - logger.severe(""); - } -*/ - // TOREMOVE - + if( obs != null ) { // update hmdPos based on obs rotation finalRotation.set(objRot); finalRotation.mult(hmdPos, hmdPos); finalRotation.multLocal(hmdRot); } - + finalizeCamera(dev.getHMDVectorPoseLeftEye(), objPos, getLeftCamera()); finalizeCamera(dev.getHMDVectorPoseRightEye(), objPos, getRightCamera()); } else { getLeftCamera().setFrame(objPos, objRot); getRightCamera().setFrame(objPos, objRot); } - + if( environment.hasTraditionalGUIOverlay() ) { // update the mouse? environment.getVRMouseManager().update(tpf); - + // update GUI position? if( environment.getVRGUIManager().isWantsReposition() || environment.getVRGUIManager().getPositioningMode() != VRGUIPositioningMode.MANUAL ) { environment.getVRGUIManager().positionGuiNow(tpf); @@ -476,9 +513,9 @@ public void update(float tpf) { } } else { throw new IllegalStateException("This VR view manager is not attached to any VR environment."); - } + } } - + /** * Place the camera within the scene. * @param eyePos the eye position. @@ -492,36 +529,35 @@ private void finalizeCamera(Vector3f eyePos, Vector3f obsPosition, Camera cam) { finalPosition.y += getHeightAdjustment(); cam.setFrame(finalPosition, finalRotation); } - - private void setupCamerasAndViews() { - + private void setupCamerasAndViews() { + if (environment != null){ // get desired frustrum from original camera - Camera origCam = environment.getCamera(); + Camera origCam = environment.getCamera(); float fFar = origCam.getFrustumFar(); float fNear = origCam.getFrustumNear(); - + // restore frustrum on distortion scene cam, if needed if( environment.isInstanceRendering() ) { leftCamera = origCam; } else if( environment.compositorAllowed() == false ) { origCam.setFrustumFar(100f); - origCam.setFrustumNear(1f); - leftCamera = origCam.clone(); + origCam.setFrustumNear(1f); + leftCamera = origCam.clone(); prepareCameraSize(origCam, 2f); } else { leftCamera = origCam.clone(); } - - getLeftCamera().setFrustumPerspective(environment.getDefaultFOV(), environment.getDefaultAspect(), fNear, fFar); - + + getLeftCamera().setFrustumPerspective(environment.getDefaultFOV(), environment.getDefaultAspect(), fNear, fFar); + prepareCameraSize(getLeftCamera(), 1f); if( environment.getVRHardware() != null ) { getLeftCamera().setProjectionMatrix(environment.getVRHardware().getHMDMatrixProjectionLeftEye(getLeftCamera())); } //org.lwjgl.opengl.GL11.glEnable(org.lwjgl.opengl.GL30.GL_FRAMEBUFFER_SRGB); - + if( !environment.isInstanceRendering()) { leftViewPort = setupViewBuffers(getLeftCamera(), LEFT_VIEW_NAME); rightCamera = getLeftCamera().clone(); @@ -530,31 +566,27 @@ private void setupCamerasAndViews() { } rightViewPort = setupViewBuffers(getRightCamera(), RIGHT_VIEW_NAME); } else { - if (environment.getApplication() != null){ - logger.severe("THIS CODE NEED CHANGES !!!"); leftViewPort = environment.getApplication().getViewPort(); - //leftViewport.attachScene(app.getRootNode()); rightCamera = getLeftCamera().clone(); if( environment.getVRHardware() != null ){ getRightCamera().setProjectionMatrix(environment.getVRHardware().getHMDMatrixProjectionRightEye(getRightCamera())); } - + org.lwjgl.opengl.GL11.glEnable(org.lwjgl.opengl.GL30.GL_CLIP_DISTANCE0); - + //FIXME: [jme-vr] Fix with JMonkey next release //RenderManager._VRInstancing_RightCamProjection = camRight.getViewProjectionMatrix(); - setupFinalFullTexture(environment.getApplication().getViewPort().getCamera()); + setupFinalFullTexture(environment.getApplication().getViewPort().getCamera()); } else { - throw new IllegalStateException("This VR environment is not attached to any application."); - } - + throw new IllegalStateException("This VR environment is not attached to any application."); + } } - + // setup gui environment.getVRGUIManager().setupGui(getLeftCamera(), getRightCamera(), getLeftViewPort(), getRightViewPort()); - + if( environment.getVRHardware() != null ) { // call these to cache the results internally environment.getVRHardware().getHMDMatrixPoseLeftEye(); @@ -562,11 +594,10 @@ private void setupCamerasAndViews() { } } else { throw new IllegalStateException("This VR view manager is not attached to any VR environment."); - } + } } - - private ViewPort setupMirrorBuffers(Camera cam, Texture tex, boolean expand) { - + + private ViewPort setupMirrorBuffers(Camera cam, Texture tex, boolean expand) { if (environment != null){ if (environment.getApplication() != null){ Camera clonecam = cam.clone(); @@ -579,28 +610,28 @@ private ViewPort setupMirrorBuffers(Camera cam, Texture tex, boolean expand) { if( expand ) { pic.setLocalScale(3f, 1f, 1f); } else { - pic.setLocalScale(1.5f, 1f, 1f); + pic.setLocalScale(1.5f, 1f, 1f); } pic.setQueueBucket(Bucket.Opaque); pic.setTexture(environment.getApplication().getAssetManager(), (Texture2D)tex, false); viewPort.attachScene(pic); viewPort.setOutputFrameBuffer(null); - + pic.updateGeometricState(); - + return viewPort; } else { throw new IllegalStateException("This VR environment is not attached to any application."); } } else { throw new IllegalStateException("This VR view manager is not attached to any VR environment."); - } + } } - + private void setupFinalFullTexture(Camera cam) { - + if (environment != null){ - if (environment.getApplication() != null){ + if (environment.getApplication() != null) { // create offscreen framebuffer FrameBuffer out = new FrameBuffer(cam.getWidth(), cam.getHeight(), 1); //offBuffer.setSrgb(true); @@ -616,10 +647,10 @@ private void setupFinalFullTexture(Camera cam) { logger.config(" Image depth: "+dualEyeTex.getImage().getDepth()); logger.config(" Image format: "+dualEyeTex.getImage().getFormat()); logger.config(" Image color space: "+dualEyeTex.getImage().getColorSpace()); - + //setup framebuffer to use texture out.setDepthBuffer(Image.Format.Depth); - out.setColorTexture(dualEyeTex); + out.setColorTexture(dualEyeTex); ViewPort viewPort = environment.getApplication().getViewPort(); viewPort.setClearFlags(true, true, true); @@ -630,46 +661,45 @@ private void setupFinalFullTexture(Camera cam) { } } else { throw new IllegalStateException("This VR view manager is not attached to any VR environment."); - } + } } - + private ViewPort setupViewBuffers(Camera cam, String viewName){ - if (environment != null){ if (environment.getApplication() != null){ // create offscreen framebuffer - FrameBuffer offBufferLeft = new FrameBuffer(cam.getWidth(), cam.getHeight(), 1); - //offBufferLeft.setSrgb(true); - + FrameBuffer offscreenBuffer = new FrameBuffer(cam.getWidth(), cam.getHeight(), 1); + //offscreenBuffer.setSrgb(true); + //setup framebuffer's texture Texture2D offTex = new Texture2D(cam.getWidth(), cam.getHeight(), Image.Format.RGBA8); offTex.setMinFilter(Texture.MinFilter.BilinearNoMipMaps); offTex.setMagFilter(Texture.MagFilter.Bilinear); //setup framebuffer to use texture - offBufferLeft.setDepthBuffer(Image.Format.Depth); - offBufferLeft.setColorTexture(offTex); - + offscreenBuffer.setDepthBuffer(Image.Format.Depth); + offscreenBuffer.setColorTexture(offTex); + ViewPort viewPort = environment.getApplication().getRenderManager().createPreView(viewName, cam); viewPort.setClearFlags(true, true, true); viewPort.setBackgroundColor(ColorRGBA.Black); - + Iterator spatialIter = environment.getApplication().getViewPort().getScenes().iterator(); while(spatialIter.hasNext()){ viewPort.attachScene(spatialIter.next()); } //set viewport to render to offscreen framebuffer - viewPort.setOutputFrameBuffer(offBufferLeft); + viewPort.setOutputFrameBuffer(offscreenBuffer); return viewPort; } else { throw new IllegalStateException("This VR environment is not attached to any application."); } } else { throw new IllegalStateException("This VR view manager is not attached to any VR environment."); - } + } } - + /** * Setup a distortion mesh for the stereo view. * @param eye the eye to apply. @@ -679,7 +709,7 @@ private ViewPort setupViewBuffers(Camera cam, String viewName){ public static Mesh setupDistortionMesh(int eye, VRAPI api) { Mesh distortionMesh = new Mesh(); float m_iLensGridSegmentCountH = 43, m_iLensGridSegmentCountV = 43; - + float w = 1f / (m_iLensGridSegmentCountH - 1f); float h = 1f / (m_iLensGridSegmentCountV - 1f); @@ -692,38 +722,43 @@ public static Mesh setupDistortionMesh(int eye, VRAPI api) { float texcoordB[] = new float[(int) (m_iLensGridSegmentCountV * m_iLensGridSegmentCountH) * 2]; int vertPos = 0, coordPos = 0; - - float Xoffset = eye == JOpenVRLibrary.EVREye.EVREye_Eye_Left ? -1f : 0; - for (int y = 0; y < m_iLensGridSegmentCountV; y++) { - for (int x = 0; x < m_iLensGridSegmentCountH; x++) { - u = x * w; - v = 1 - y * h; - verts[vertPos] = Xoffset + u; // x - verts[vertPos + 1] = -1 + 2 * y * h; // y - verts[vertPos + 2] = 0f; // z - vertPos += 3; - - DistortionCoordinates_t dc0 = new DistortionCoordinates_t(); - if( api.getVRSystem() == null ) { - // default to no distortion - texcoordR[coordPos] = u; - texcoordR[coordPos + 1] = 1 - v; - texcoordG[coordPos] = u; - texcoordG[coordPos + 1] = 1 - v; - texcoordB[coordPos] = u; - texcoordB[coordPos + 1] = 1 - v; - } else { - ((VR_IVRSystem_FnTable)api.getVRSystem()).ComputeDistortion.apply(eye, u, v, dc0); - - texcoordR[coordPos] = dc0.rfRed[0]; - texcoordR[coordPos + 1] = 1 - dc0.rfRed[1]; - texcoordG[coordPos] = dc0.rfGreen[0]; - texcoordG[coordPos + 1] = 1 - dc0.rfGreen[1]; - texcoordB[coordPos] = dc0.rfBlue[0]; - texcoordB[coordPos + 1] = 1 - dc0.rfBlue[1]; - } - - coordPos += 2; + + float Xoffset = eye == EVREye_Eye_Left ? -1f : 0; + try (MemoryStack stack = MemoryStack.stackPush()) { + ByteBuffer distortionBuffer = stack.malloc(DistortionCoordinates.SIZEOF); + for (int y = 0; y < m_iLensGridSegmentCountV; y++) { + for (int x = 0; x < m_iLensGridSegmentCountH; x++) { + u = x * w; + v = 1 - y * h; + verts[vertPos] = Xoffset + u; // x + verts[vertPos + 1] = -1 + 2 * y * h; // y + verts[vertPos + 2] = 0f; // z + vertPos += 3; + + if( api.getVRSystem() == null ) { + // default to no distortion + texcoordR[coordPos] = u; + texcoordR[coordPos + 1] = 1 - v; + texcoordG[coordPos] = u; + texcoordG[coordPos + 1] = 1 - v; + texcoordB[coordPos] = u; + texcoordB[coordPos + 1] = 1 - v; + } else { + distortionBuffer.flip(); + DistortionCoordinates dc0 = new DistortionCoordinates(distortionBuffer); + VRSystem_ComputeDistortion(eye, u, v, dc0); + + texcoordR[coordPos] = dc0.rfRed(0); + texcoordR[coordPos + 1] = 1 - dc0.rfRed(1); + texcoordG[coordPos] = dc0.rfGreen(0); + texcoordG[coordPos + 1] = 1 - dc0.rfGreen(1); + texcoordB[coordPos] = dc0.rfBlue(0); + texcoordB[coordPos + 1] = 1 - dc0.rfBlue(1); + distortionBuffer.clear(); + } + + coordPos += 2; + } } } @@ -740,7 +775,7 @@ public static Mesh setupDistortionMesh(int eye, VRAPI api) { b = (int) (m_iLensGridSegmentCountH * y + x + 1 + offset); c = (int) ((y + 1) * m_iLensGridSegmentCountH + x + 1 + offset); d = (int) ((y + 1) * m_iLensGridSegmentCountH + x + offset); - + indices[indexPos] = a; indices[indexPos + 1] = b; indices[indexPos + 2] = c; @@ -752,8 +787,8 @@ public static Mesh setupDistortionMesh(int eye, VRAPI api) { indexPos += 6; } } - - // OK, create the mesh + + // OK, create the mesh distortionMesh.setBuffer(VertexBuffer.Type.Position, 3, verts); distortionMesh.setBuffer(VertexBuffer.Type.Index, 1, indices); distortionMesh.setBuffer(VertexBuffer.Type.TexCoord, 2, texcoordR); diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/osvr/OSVR.java b/jme3-vr/src/main/java/com/jme3/input/vr/osvr/OSVR.java deleted file mode 100644 index 28d7aac069..0000000000 --- a/jme3-vr/src/main/java/com/jme3/input/vr/osvr/OSVR.java +++ /dev/null @@ -1,464 +0,0 @@ -/* - -https://github.com/sensics/OSVR-RenderManager/blob/master/examples/RenderManagerOpenGLCAPIExample.cpp - -- JVM crashes often.. placing breakpoints during initialization clears it up most of the time (WHY!?) - - OSVR is just unstable.. any way to improve things? -- render manager looks good, but left eye seems stretched - - */ -package com.jme3.input.vr.osvr; - -import com.jme3.app.VREnvironment; -import com.jme3.input.vr.HmdType; -import com.jme3.input.vr.VRAPI; -import com.jme3.input.vr.VRInputAPI; -import com.jme3.math.Matrix4f; -import com.jme3.math.Quaternion; -import com.jme3.math.Vector2f; -import com.jme3.math.Vector3f; -import com.jme3.renderer.Camera; -import com.jme3.system.osvr.osvrclientkit.OsvrClientKitLibrary; -import com.jme3.system.osvr.osvrdisplay.OsvrDisplayLibrary; -import com.jme3.system.osvr.osvrdisplay.OsvrDisplayLibrary.OSVR_DisplayConfig; -import com.jme3.system.osvr.osvrmatrixconventions.OSVR_Pose3; -import com.jme3.system.osvr.osvrrendermanageropengl.OSVR_OpenResultsOpenGL; -import com.jme3.system.osvr.osvrrendermanageropengl.OSVR_RenderBufferOpenGL; -import com.jme3.system.osvr.osvrrendermanageropengl.OSVR_RenderInfoOpenGL; -import com.jme3.system.osvr.osvrrendermanageropengl.OSVR_RenderParams; -import com.jme3.system.osvr.osvrrendermanageropengl.OSVR_ViewportDescription; -import com.jme3.system.osvr.osvrrendermanageropengl.OsvrRenderManagerOpenGLLibrary; -import com.ochafik.lang.jnaerator.runtime.NativeSize; -import com.ochafik.lang.jnaerator.runtime.NativeSizeByReference; -import com.sun.jna.Pointer; -import com.sun.jna.ptr.PointerByReference; -import java.nio.FloatBuffer; -import java.util.logging.Logger; - -/** - * A class that wraps an OSVR system. - * @author reden - phr00t - https://github.com/phr00t - * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr - */ -public class OSVR implements VRAPI { - - private static final Logger logger = Logger.getLogger(OSVR.class.getName()); - - /** - * The first viewer index. - */ - public static final int FIRST_VIEWER = 0; - - /** - * The left eye index. - */ - public static final int EYE_LEFT = 0; - - /** - * The right eye index. - */ - public static final int EYE_RIGHT = 1; - - /** - * The size of the left eye. - */ - public static final NativeSize EYE_LEFT_SIZE = new NativeSize(EYE_LEFT); - - /** - * The size of the right eye. - */ - public static final NativeSize EYE_RIGHT_SIZE = new NativeSize(EYE_RIGHT); - - /** - * The default J String. - */ - public static byte[] defaultJString = { 'j', (byte)0 }; - - /** - * The default OpenGL String. - */ - public static byte[] OpenGLString = { 'O', 'p', 'e', 'n', 'G', 'L', (byte)0 }; - - private final Matrix4f[] eyeMatrix = new Matrix4f[2]; - - private PointerByReference grabRM; - private PointerByReference grabRMOGL; - private PointerByReference grabRIC; - - OSVR_RenderParams.ByValue renderParams; - OsvrClientKitLibrary.OSVR_ClientContext context; - com.jme3.system.osvr.osvrrendermanageropengl.OSVR_GraphicsLibraryOpenGL.ByValue graphicsLibrary; - Pointer renderManager, renderManagerOpenGL, renderInfoCollection, registerBufferState; - OSVRInput VRinput; - NativeSize numRenderInfo; - NativeSizeByReference grabNumInfo = new NativeSizeByReference(); - OSVR_RenderInfoOpenGL.ByValue eyeLeftInfo, eyeRightInfo; - Matrix4f hmdPoseLeftEye; - Matrix4f hmdPoseRightEye; - Vector3f hmdPoseLeftEyeVec, hmdPoseRightEyeVec, hmdSeatToStand; - OSVR_DisplayConfig displayConfig; - OSVR_Pose3 hmdPose = new OSVR_Pose3(); - Vector3f storePos = new Vector3f(); - Quaternion storeRot = new Quaternion(); - PointerByReference presentState = new PointerByReference(); - OSVR_OpenResultsOpenGL openResults = new OSVR_OpenResultsOpenGL(); - - long glfwContext; - long renderManagerContext; - long wglGLFW; - long wglRM; - - boolean initSuccess = false; - boolean flipEyes = false; - - private VREnvironment environment = null; - - /** - * Create a new OSVR system attached to the given {@link VREnvironment VR environment}. - * @param environment the {@link VREnvironment VR environment} to which the input is attached. - */ - public OSVR(VREnvironment environment){ - this.environment = environment; - } - - /** - * Access to the underlying OSVR structures. - * @param leftView the left viewport. - * @param rightView the right viewport. - * @param leftBuffer the left buffer. - * @param rightBuffer the right buffer. - * @return true if the structure are accessible and false otherwise. - */ - public boolean handleRenderBufferPresent(OSVR_ViewportDescription.ByValue leftView, OSVR_ViewportDescription.ByValue rightView, - OSVR_RenderBufferOpenGL.ByValue leftBuffer, OSVR_RenderBufferOpenGL.ByValue rightBuffer) { - if( eyeLeftInfo == null || eyeRightInfo == null ) return false; - byte retval; - OsvrRenderManagerOpenGLLibrary.osvrRenderManagerStartPresentRenderBuffers(presentState); - getEyeInfo(); - OsvrRenderManagerOpenGLLibrary.osvrRenderManagerPresentRenderBufferOpenGL(presentState.getValue(), leftBuffer, eyeLeftInfo, leftView); - OsvrRenderManagerOpenGLLibrary.osvrRenderManagerPresentRenderBufferOpenGL(presentState.getValue(), rightBuffer, eyeRightInfo, rightView); - retval = OsvrRenderManagerOpenGLLibrary.osvrRenderManagerFinishPresentRenderBuffers(renderManager, presentState.getValue(), renderParams, (byte)0); - return retval == 0; // only check the last error, since if something errored above, the last call won't work & all calls will log to syserr - } - - - - @Override - public boolean initialize() { - - logger.config("Initialize OSVR system."); - - hmdPose.setAutoSynch(false); - context = OsvrClientKitLibrary.osvrClientInit(defaultJString, 0); - VRinput = new OSVRInput(environment); - initSuccess = context != null && VRinput.init(); - if( initSuccess ) { - PointerByReference grabDisplay = new PointerByReference(); - byte retval = OsvrDisplayLibrary.osvrClientGetDisplay(context, grabDisplay); - if( retval != 0 ) { - System.out.println("OSVR Get Display Error: " + retval); - initSuccess = false; - return false; - } - displayConfig = new OSVR_DisplayConfig(grabDisplay.getValue()); - System.out.println("Waiting for the display to fully start up, including receiving initial pose update..."); - int i = 400; - while (OsvrDisplayLibrary.osvrClientCheckDisplayStartup(displayConfig) != 0) { - if( i-- < 0 ) { - System.out.println("Couldn't get display startup update in time, continuing anyway..."); - break; - } - OsvrClientKitLibrary.osvrClientUpdate(context); - try { - Thread.sleep(5); - } catch(Exception e) { } - } - System.out.println("OK, display startup status is good!"); - } - return initSuccess; - } - - - /** - * Grab the current GLFW context. - */ - public void grabGLFWContext() { - // get current conext - wglGLFW = org.lwjgl.opengl.WGL.wglGetCurrentContext(); - glfwContext = org.lwjgl.glfw.GLFW.glfwGetCurrentContext(); - } - - /** - * Enable context sharing. - * @return true if the context is successfully shared and false otherwise. - */ - public boolean shareContext() { - if( org.lwjgl.opengl.WGL.wglShareLists(wglRM, wglGLFW)) { - System.out.println("Context sharing success!"); - return true; - } else { - System.out.println("Context sharing problem..."); - return false; - } - } - - @Override - public boolean initVRCompositor(boolean allowed) { - if( !allowed || renderManager != null ) return false; - grabGLFWContext(); - graphicsLibrary = new com.jme3.system.osvr.osvrrendermanageropengl.OSVR_GraphicsLibraryOpenGL.ByValue(); - graphicsLibrary.toolkit = null; - graphicsLibrary.setAutoSynch(false); - grabRM = new PointerByReference(); grabRMOGL = new PointerByReference(); - byte retval = OsvrRenderManagerOpenGLLibrary.osvrCreateRenderManagerOpenGL(context, OpenGLString, graphicsLibrary, grabRM, grabRMOGL); - if( retval == 0 ) { - renderManager = grabRM.getValue(); renderManagerOpenGL = grabRMOGL.getValue(); - if( renderManager == null || renderManagerOpenGL == null ) { - System.out.println("Render Manager Created NULL, error!"); - return false; - } - openResults.setAutoSynch(false); - retval = OsvrRenderManagerOpenGLLibrary.osvrRenderManagerOpenDisplayOpenGL(renderManager, openResults); - if( retval == 0 ) { - wglRM = org.lwjgl.opengl.WGL.wglGetCurrentContext(); - renderManagerContext = org.lwjgl.glfw.GLFW.glfwGetCurrentContext(); - shareContext(); - OsvrClientKitLibrary.osvrClientUpdate(context); - renderParams = new OSVR_RenderParams.ByValue(); - renderParams.setAutoSynch(false); - OsvrRenderManagerOpenGLLibrary.osvrRenderManagerGetDefaultRenderParams(renderParams); - grabRIC = new PointerByReference(); - retval = OsvrRenderManagerOpenGLLibrary.osvrRenderManagerGetRenderInfoCollection(renderManager, renderParams, grabRIC); - if( retval == 0 ) { - renderInfoCollection = grabRIC.getValue(); - OsvrRenderManagerOpenGLLibrary.osvrRenderManagerGetNumRenderInfoInCollection(renderInfoCollection, grabNumInfo); - numRenderInfo = grabNumInfo.getValue(); - eyeLeftInfo = new OSVR_RenderInfoOpenGL.ByValue(); - eyeRightInfo = new OSVR_RenderInfoOpenGL.ByValue(); - eyeLeftInfo.setAutoSynch(false); - eyeRightInfo.setAutoSynch(false); - return true; - } - OsvrRenderManagerOpenGLLibrary.osvrDestroyRenderManager(renderManager); - System.out.println("OSVR Render Manager Info Collection Error: " + retval); - return false; - } - OsvrRenderManagerOpenGLLibrary.osvrDestroyRenderManager(renderManager); - System.out.println("OSVR Open Render Manager Display Error: " + retval); - return false; - } - System.out.println("OSVR Create Render Manager Error: " + retval); - return false; - } - - @Override - public OsvrClientKitLibrary.OSVR_ClientContext getVRSystem() { - return context; - } - - @Override - public Pointer getCompositor() { - return renderManager; - } - - @Override - public String getName() { - return "OSVR"; - } - - @Override - public VRInputAPI getVRinput() { - return VRinput; - } - - @Override - public void setFlipEyes(boolean set) { - flipEyes = set; - } - - @Override - public void printLatencyInfoToConsole(boolean set) { - - } - - @Override - public int getDisplayFrequency() { - return 60; //debug display frequency - } - - @Override - public void destroy() { - if( renderManager != null ) OsvrRenderManagerOpenGLLibrary.osvrDestroyRenderManager(renderManager); - if( displayConfig != null ) OsvrDisplayLibrary.osvrClientFreeDisplay(displayConfig); - } - - @Override - public boolean isInitialized() { - return initSuccess; - } - - @Override - public void reset() { - // TODO: no native OSVR reset function - // may need to take current position and negate it from future values - } - - @Override - public void getRenderSize(Vector2f store) { - if( eyeLeftInfo == null || eyeLeftInfo.viewport.width == 0.0 ) { - store.x = 1280f; store.y = 720f; - } else { - store.x = (float)eyeLeftInfo.viewport.width; - store.y = (float)eyeLeftInfo.viewport.height; - } - } - - /** - * Read and update the eye info from the underlying OSVR system. - */ - public void getEyeInfo() { - OsvrRenderManagerOpenGLLibrary.osvrRenderManagerGetRenderInfoFromCollectionOpenGL(renderInfoCollection, EYE_LEFT_SIZE, eyeLeftInfo); - OsvrRenderManagerOpenGLLibrary.osvrRenderManagerGetRenderInfoFromCollectionOpenGL(renderInfoCollection, EYE_RIGHT_SIZE, eyeRightInfo); - eyeLeftInfo.read(); eyeRightInfo.read(); - } -/* - @Override - public float getFOV(int dir) { - return 105f; //default FOV - } -*/ - @Override - public float getInterpupillaryDistance() { - return 0.065f; //default IPD - } - - @Override - public Quaternion getOrientation() { - storeRot.set((float)-hmdPose.rotation.data[1], - (float)hmdPose.rotation.data[2], - (float)-hmdPose.rotation.data[3], - (float)hmdPose.rotation.data[0]); - if( storeRot.equals(Quaternion.ZERO) ) storeRot.set(Quaternion.DIRECTION_Z); - return storeRot; - } - - @Override - public Vector3f getPosition() { - storePos.x = (float)-hmdPose.translation.data[0]; - storePos.y = (float)hmdPose.translation.data[1]; - storePos.z = (float)-hmdPose.translation.data[2]; - return storePos; - } - - @Override - public void getPositionAndOrientation(Vector3f storePos, Quaternion storeRot) { - storePos.x = (float)-hmdPose.translation.data[0]; - storePos.y = (float)hmdPose.translation.data[1]; - storePos.z = (float)-hmdPose.translation.data[2]; - storeRot.set((float)-hmdPose.rotation.data[1], - (float)hmdPose.rotation.data[2], - (float)-hmdPose.rotation.data[3], - (float)hmdPose.rotation.data[0]); - if( storeRot.equals(Quaternion.ZERO) ) storeRot.set(Quaternion.DIRECTION_Z); - } - - @Override - public void updatePose() { - if( context == null || displayConfig == null ) return; - OsvrClientKitLibrary.osvrClientUpdate(context); - OsvrDisplayLibrary.osvrClientGetViewerPose(displayConfig, FIRST_VIEWER, hmdPose.getPointer()); - VRinput.updateControllerStates(); - hmdPose.read(); - } - - @Override - public Matrix4f getHMDMatrixProjectionLeftEye(Camera cam) { - if( eyeLeftInfo == null ) return cam.getProjectionMatrix(); - if( eyeMatrix[EYE_LEFT] == null ) { - FloatBuffer tfb = FloatBuffer.allocate(16); - com.jme3.system.osvr.osvrdisplay.OsvrDisplayLibrary.osvrClientGetViewerEyeSurfaceProjectionMatrixf(displayConfig, 0, (byte)EYE_LEFT, 0, cam.getFrustumNear(), cam.getFrustumFar(), (short)0, tfb); - eyeMatrix[EYE_LEFT] = new Matrix4f(); - eyeMatrix[EYE_LEFT].set(tfb.get(0), tfb.get(4), tfb.get(8), tfb.get(12), - tfb.get(1), tfb.get(5), tfb.get(9), tfb.get(13), - tfb.get(2), tfb.get(6), tfb.get(10), tfb.get(14), - tfb.get(3), tfb.get(7), tfb.get(11), tfb.get(15)); - } - return eyeMatrix[EYE_LEFT]; - } - - @Override - public Matrix4f getHMDMatrixProjectionRightEye(Camera cam) { - if( eyeRightInfo == null ) return cam.getProjectionMatrix(); - if( eyeMatrix[EYE_RIGHT] == null ) { - FloatBuffer tfb = FloatBuffer.allocate(16); - com.jme3.system.osvr.osvrdisplay.OsvrDisplayLibrary.osvrClientGetViewerEyeSurfaceProjectionMatrixf(displayConfig, 0, (byte)EYE_RIGHT, 0, cam.getFrustumNear(), cam.getFrustumFar(), (short)0, tfb); - eyeMatrix[EYE_RIGHT] = new Matrix4f(); - eyeMatrix[EYE_RIGHT].set(tfb.get(0), tfb.get(4), tfb.get(8), tfb.get(12), - tfb.get(1), tfb.get(5), tfb.get(9), tfb.get(13), - tfb.get(2), tfb.get(6), tfb.get(10), tfb.get(14), - tfb.get(3), tfb.get(7), tfb.get(11), tfb.get(15)); - } - return eyeMatrix[EYE_RIGHT]; - } - - @Override - public Vector3f getHMDVectorPoseLeftEye() { - if( hmdPoseLeftEyeVec == null ) { - hmdPoseLeftEyeVec = new Vector3f(); - hmdPoseLeftEyeVec.x = 0.065f * -0.5f; - if( flipEyes == false ) hmdPoseLeftEyeVec.x *= -1f; // it seems these need flipping - } - return hmdPoseLeftEyeVec; - } - - @Override - public Vector3f getHMDVectorPoseRightEye() { - if( hmdPoseRightEyeVec == null ) { - hmdPoseRightEyeVec = new Vector3f(); - hmdPoseRightEyeVec.x = 0.065f * 0.5f; - if( flipEyes == false ) hmdPoseRightEyeVec.x *= -1f; // it seems these need flipping - } - return hmdPoseRightEyeVec; - } - - @Override - public Vector3f getSeatedToAbsolutePosition() { - return Vector3f.ZERO; - } - - @Override - public Matrix4f getHMDMatrixPoseLeftEye() { - // not actually used internally... - /*if( hmdPoseLeftEye != null ) { - return hmdPoseLeftEye; - } else { - FloatBuffer mat = FloatBuffer.allocate(16); - OsvrDisplayLibrary.osvrClientGetViewerEyeViewMatrixf(displayConfig, FIRST_VIEWER, (byte)EYE_LEFT, - (short)(OsvrMatrixConventionsLibrary.OSVR_MatrixVectorFlags.OSVR_MATRIX_COLVECTORS | - OsvrMatrixConventionsLibrary.OSVR_MatrixOrderingFlags.OSVR_MATRIX_COLMAJOR), tempfb); - hmdPoseLeftEye = new Matrix4f(tempfb.array()); - return hmdPoseLeftEye; - }*/ - return null; - } - - @Override - public Matrix4f getHMDMatrixPoseRightEye() { - // not actually used internally... - /*if( hmdPoseRightEye != null ) { - return hmdPoseRightEye; - } else { - OsvrDisplayLibrary.osvrClientGetViewerEyeViewMatrixf(displayConfig, FIRST_VIEWER, (byte)EYE_RIGHT, - (short)(OsvrMatrixConventionsLibrary.OSVR_MatrixVectorFlags.OSVR_MATRIX_COLVECTORS | - OsvrMatrixConventionsLibrary.OSVR_MatrixOrderingFlags.OSVR_MATRIX_COLMAJOR), tempfb); - hmdPoseRightEye = new Matrix4f(tempfb.array()); - return hmdPoseRightEye; - }*/ - return null; - } - - @Override - public HmdType getType() { - return HmdType.OSVR; - } -} diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/osvr/OSVRInput.java b/jme3-vr/src/main/java/com/jme3/input/vr/osvr/OSVRInput.java deleted file mode 100644 index ab18f62888..0000000000 --- a/jme3-vr/src/main/java/com/jme3/input/vr/osvr/OSVRInput.java +++ /dev/null @@ -1,358 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package com.jme3.input.vr.osvr; - -import java.util.logging.Logger; - -import com.jme3.app.VREnvironment; -import com.jme3.input.vr.VRInputAPI; -import com.jme3.input.vr.VRInputType; -import com.jme3.input.vr.VRTrackedController; -import com.jme3.math.Quaternion; -import com.jme3.math.Vector2f; -import com.jme3.math.Vector3f; -import com.jme3.renderer.Camera; -import com.jme3.scene.Spatial; -import com.jme3.system.osvr.osvrclientkit.OsvrClientKitLibrary; -import com.jme3.system.osvr.osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface; -import com.jme3.system.osvr.osvrclientreporttypes.OSVR_AnalogReport; -import com.jme3.system.osvr.osvrclientreporttypes.OSVR_ButtonReport; -import com.jme3.system.osvr.osvrclientreporttypes.OSVR_Pose3; -import com.jme3.system.osvr.osvrinterface.OsvrInterfaceLibrary; -import com.jme3.system.osvr.osvrtimevalue.OSVR_TimeValue; -import com.sun.jna.Callback; -import com.sun.jna.Pointer; -import com.sun.jna.ptr.PointerByReference; - - -/** - * A class that wraps an OSVR input. - * @author reden - phr00t - https://github.com/phr00t - * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr - */ -public class OSVRInput implements VRInputAPI { - - private static final Logger logger = Logger.getLogger(OSVRInput.class.getName()); - - // position example: https://github.com/OSVR/OSVR-Core/blob/master/examples/clients/TrackerState.c - // button example: https://github.com/OSVR/OSVR-Core/blob/master/examples/clients/ButtonCallback.c - // analog example: https://github.com/OSVR/OSVR-Core/blob/master/examples/clients/AnalogCallback.c - - private static final int ANALOG_COUNT = 3, BUTTON_COUNT = 7, CHANNEL_COUNT = 3; - - OSVR_ClientInterface[][] buttons; - OSVR_ClientInterface[][][] analogs; - OSVR_ClientInterface[] hands; - - OSVR_Pose3[] handState; - Callback buttonHandler, analogHandler; - OSVR_TimeValue tv = new OSVR_TimeValue(); - boolean[] isHandTracked = new boolean[2]; - - private float[][][] analogState; - private float[][] buttonState; - - private final Quaternion tempq = new Quaternion(); - private final Vector3f tempv = new Vector3f(); - private final Vector2f temp2 = new Vector2f(); - private final boolean[][] buttonDown = new boolean[16][16]; - - private static final Vector2f temp2Axis = new Vector2f(); - private static final Vector2f lastCallAxis[] = new Vector2f[16]; - private static float axisMultiplier = 1f; - - private VREnvironment environment = null; - - /** - * Get the system String that identifies a controller. - * @param left is the controller is the left one (false if the right controller is needed). - * @param index the index of the controller. - * @return the system String that identifies the controller. - */ - public static byte[] getButtonString(boolean left, byte index) { - if( left ) { - return new byte[] { '/', 'c', 'o', 'n', 't', 'r', 'o', 'l', 'l', 'e', 'r', '/', 'l', 'e', 'f', 't', '/', index, (byte)0 }; - } - return new byte[] { '/', 'c', 'o', 'n', 't', 'r', 'o', 'l', 'l', 'e', 'r', '/', 'r', 'i', 'g', 'h', 't', '/', index, (byte)0 }; - } - - /** - * The left hand system String. - */ - public static byte[] leftHand = { '/', 'm', 'e', '/', 'h', 'a', 'n', 'd', 's', '/', 'l', 'e', 'f', 't', (byte)0 }; - - /** - * The right hand system String. - */ - public static byte[] rightHand = { '/', 'm', 'e', '/', 'h', 'a', 'n', 'd', 's', '/', 'r', 'i', 'g', 'h', 't', (byte)0 }; - - - /** - * Create a new OSVR input attached to the given {@link VREnvironment VR environment}. - * @param environment the {@link VREnvironment VR environment} to which the input is attached. - */ - public OSVRInput(VREnvironment environment){ - this.environment = environment; - } - - - @Override - public boolean isButtonDown(int controllerIndex, VRInputType checkButton) { - return buttonState[controllerIndex][checkButton.getValue()] != 0f; - } - - @Override - public boolean wasButtonPressedSinceLastCall(int controllerIndex, VRInputType checkButton) { - boolean buttonDownNow = isButtonDown(controllerIndex, checkButton); - int checkButtonValue = checkButton.getValue(); - boolean retval = buttonDownNow == true && buttonDown[controllerIndex][checkButtonValue] == false; - buttonDown[controllerIndex][checkButtonValue] = buttonDownNow; - return retval; - } - - @Override - public void resetInputSinceLastCall() { - for(int i=0;ihttp://www.seinturier.fr - */ -public class OSVRMouseManager extends AbstractVRMouseManager { - - private final int AVERAGE_AMNT = 4; - - private int avgCounter; - - private final float[] lastXmv = new float[AVERAGE_AMNT]; - - private final float[] lastYmv = new float[AVERAGE_AMNT]; - - /** - * Create a new VR mouse manager within the given {@link VREnvironment VR environment}. - * @param environment the VR environment of the mouse manager. - */ - public OSVRMouseManager(VREnvironment environment){ - super(environment); - } - - - @Override - public void updateAnalogAsMouse(int inputIndex, AnalogListener mouseListener, String mouseXName, String mouseYName, float tpf) { - - if (getVREnvironment() != null){ - if (getVREnvironment().getApplication() != null){ - // got a tracked controller to use as the "mouse" - if( getVREnvironment().isInVR() == false || - getVREnvironment().getVRinput() == null || - getVREnvironment().getVRinput().isInputDeviceTracking(inputIndex) == false ){ - return; - } - - Vector2f tpDelta; - // TODO option to use Touch joysticks - if( isThumbstickMode() ) { - tpDelta = getVREnvironment().getVRinput().getAxis(inputIndex, VRInputType.ViveTrackpadAxis); - } else { - tpDelta = getVREnvironment().getVRinput().getAxisDeltaSinceLastCall(inputIndex, VRInputType.ViveTrackpadAxis); - } - - float Xamount = (float)Math.pow(Math.abs(tpDelta.x) * getSpeedSensitivity(), getSpeedAcceleration()); - float Yamount = (float)Math.pow(Math.abs(tpDelta.y) * getSpeedSensitivity(), getSpeedAcceleration()); - - if( tpDelta.x < 0f ){ - Xamount = -Xamount; - } - - if( tpDelta.y < 0f ){ - Yamount = -Yamount; - } - - Xamount *= getMouseMoveScale(); - Yamount *= getMouseMoveScale(); - - if( mouseListener != null ) { - if( tpDelta.x != 0f && mouseXName != null ) mouseListener.onAnalog(mouseXName, Xamount * 0.2f, tpf); - if( tpDelta.y != 0f && mouseYName != null ) mouseListener.onAnalog(mouseYName, Yamount * 0.2f, tpf); - } - - if( getVREnvironment().getApplication().getInputManager().isCursorVisible() ) { - int index = (avgCounter+1) % AVERAGE_AMNT; - lastXmv[index] = Xamount * 133f; - lastYmv[index] = Yamount * 133f; - cursorPos.x -= avg(lastXmv); - cursorPos.y -= avg(lastYmv); - Vector2f maxsize = getVREnvironment().getVRGUIManager().getCanvasSize(); - - if( cursorPos.x > maxsize.x ){ - cursorPos.x = maxsize.x; - } - - if( cursorPos.x < 0f ){ - cursorPos.x = 0f; - } - - if( cursorPos.y > maxsize.y ){ - cursorPos.y = maxsize.y; - } - - if( cursorPos.y < 0f ){ - cursorPos.y = 0f; - } - } - } else { - throw new IllegalStateException("This VR environment is not attached to any application."); - } - } else { - throw new IllegalStateException("This VR view manager is not attached to any VR environment."); - } - } - - private float avg(float[] arr) { - float amt = 0f; - for(float f : arr) amt += f; - return amt / arr.length; - } -} diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/osvr/OSVRViewManager.java b/jme3-vr/src/main/java/com/jme3/input/vr/osvr/OSVRViewManager.java deleted file mode 100644 index 077a19f12b..0000000000 --- a/jme3-vr/src/main/java/com/jme3/input/vr/osvr/OSVRViewManager.java +++ /dev/null @@ -1,881 +0,0 @@ -package com.jme3.input.vr.osvr; - -import java.awt.GraphicsEnvironment; -import java.util.Iterator; -import java.util.logging.Logger; - -import com.jme3.app.VREnvironment; -import com.jme3.input.vr.AbstractVRViewManager; -import com.jme3.input.vr.VRAPI; -import com.jme3.input.vr.openvr.OpenVRViewManager; -import com.jme3.material.Material; -import com.jme3.math.ColorRGBA; -import com.jme3.math.Quaternion; -import com.jme3.math.Vector2f; -import com.jme3.math.Vector3f; -import com.jme3.post.CartoonSSAO; -import com.jme3.post.Filter; -import com.jme3.post.FilterPostProcessor; -import com.jme3.post.FilterUtil; -import com.jme3.post.SceneProcessor; -import com.jme3.post.filters.FogFilter; -import com.jme3.post.filters.TranslucentBucketFilter; -import com.jme3.post.ssao.SSAOFilter; -import com.jme3.renderer.Camera; -import com.jme3.renderer.ViewPort; -import com.jme3.renderer.queue.RenderQueue.Bucket; -import com.jme3.scene.Geometry; -import com.jme3.scene.Mesh; -import com.jme3.scene.Node; -import com.jme3.scene.Spatial; -import com.jme3.scene.VertexBuffer; -import com.jme3.shadow.DirectionalLightShadowFilter; -import com.jme3.shadow.VRDirectionalLightShadowRenderer; -import com.jme3.system.jopenvr.DistortionCoordinates_t; -import com.jme3.system.jopenvr.JOpenVRLibrary; -import com.jme3.system.jopenvr.OpenVRUtil; -import com.jme3.system.jopenvr.Texture_t; -import com.jme3.system.jopenvr.VR_IVRSystem_FnTable; -import com.jme3.system.lwjgl.LwjglWindow; -import com.jme3.system.osvr.osvrrendermanageropengl.OSVR_RenderBufferOpenGL; -import com.jme3.system.osvr.osvrrendermanageropengl.OSVR_ViewportDescription; -import com.jme3.system.osvr.osvrrendermanageropengl.OsvrRenderManagerOpenGLLibrary; -import com.jme3.texture.FrameBuffer; -import com.jme3.texture.Image; -import com.jme3.texture.Texture; -import com.jme3.texture.Texture2D; -import com.jme3.ui.Picture; -import com.jme3.util.VRGUIPositioningMode; -import com.sun.jna.Pointer; -import com.sun.jna.ptr.PointerByReference; - -/** - * - * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr - * - */ -public class OSVRViewManager extends AbstractVRViewManager{ - private static final Logger logger = Logger.getLogger(OpenVRViewManager.class.getName()); - - // OpenVR values - private Texture_t leftTextureType; - private Texture_t rightTextureType; - - // OSVR values - OSVR_RenderBufferOpenGL.ByValue[] osvr_renderBuffer; - OSVR_ViewportDescription.ByValue osvr_viewDescFull; - OSVR_ViewportDescription.ByValue osvr_viewDescLeft; - OSVR_ViewportDescription.ByValue osvr_viewDescRight; - Pointer osvr_rmBufferState; - - private Texture2D dualEyeTex; - - private final PointerByReference grabRBS = new PointerByReference(); - - //final & temp values for camera calculations - private final Vector3f finalPosition = new Vector3f(); - private final Quaternion finalRotation = new Quaternion(); - private final Vector3f hmdPos = new Vector3f(); - private final Quaternion hmdRot = new Quaternion(); - - /** - * Create a new VR view manager attached to the given {@link VREnvironment VR environment}. - * @param environment the {@link VREnvironment VR environment} to which this view manager is attached. - */ - public OSVRViewManager(VREnvironment environment){ - this.environment = environment; - } - - /** - * Get the identifier of the left eye texture. - * @return the identifier of the left eye texture. - * @see #getRightTexId() - * @see #getFullTexId() - */ - protected int getLeftTexId() { - return (int)leftEyeTexture.getImage().getId(); - } - - /** - * Get the identifier of the right eye texture. - * @return the identifier of the right eye texture. - * @see #getLeftTexId() - * @see #getFullTexId() - */ - protected int getRightTexId() { - return (int)rightEyeTexture.getImage().getId(); - } - - /** - * Get the identifier of the full (dual eye) texture. - * @return the identifier of the full (dual eye) texture. - * @see #getLeftTexId() - * @see #getRightTexId() - */ - private int getFullTexId() { - return (int)dualEyeTex.getImage().getId(); - } - - /** - * Initialize the system binds of the textures. - */ - private void initTextureSubmitStructs() { - leftTextureType = new Texture_t(); - rightTextureType = new Texture_t(); - - // must be OSVR - osvr_renderBuffer = new OSVR_RenderBufferOpenGL.ByValue[2]; - osvr_renderBuffer[OSVR.EYE_LEFT] = new OSVR_RenderBufferOpenGL.ByValue(); - osvr_renderBuffer[OSVR.EYE_RIGHT] = new OSVR_RenderBufferOpenGL.ByValue(); - osvr_renderBuffer[OSVR.EYE_LEFT].setAutoSynch(false); - osvr_renderBuffer[OSVR.EYE_RIGHT].setAutoSynch(false); - osvr_viewDescFull = new OSVR_ViewportDescription.ByValue(); - osvr_viewDescFull.setAutoSynch(false); - osvr_viewDescFull.left = osvr_viewDescFull.lower = 0.0; - osvr_viewDescFull.width = osvr_viewDescFull.height = 1.0; - osvr_viewDescLeft = new OSVR_ViewportDescription.ByValue(); - osvr_viewDescLeft.setAutoSynch(false); - osvr_viewDescLeft.left = osvr_viewDescLeft.lower = 0.0; - osvr_viewDescLeft.width = 0.5; - osvr_viewDescLeft.height = 1.0; - osvr_viewDescRight = new OSVR_ViewportDescription.ByValue(); - osvr_viewDescRight.setAutoSynch(false); - osvr_viewDescRight.left = 0.5; - osvr_viewDescRight.lower = 0.0; - osvr_viewDescRight.width = 0.5; - osvr_viewDescRight.height = 1.0; - osvr_viewDescRight.write(); - osvr_viewDescLeft.write(); - osvr_viewDescFull.write(); - osvr_renderBuffer[OSVR.EYE_LEFT].depthStencilBufferName = -1; - osvr_renderBuffer[OSVR.EYE_LEFT].colorBufferName = -1; - osvr_renderBuffer[OSVR.EYE_RIGHT].depthStencilBufferName = -1; - osvr_renderBuffer[OSVR.EYE_RIGHT].colorBufferName = -1; - } - - /** - * Register the OSVR OpenGL buffer. - * @param buf the OSVR OpenGL buffer. - */ - private void registerOSVRBuffer(OSVR_RenderBufferOpenGL.ByValue buf) { - - if (environment != null){ - OsvrRenderManagerOpenGLLibrary.osvrRenderManagerStartRegisterRenderBuffers(grabRBS); - OsvrRenderManagerOpenGLLibrary.osvrRenderManagerRegisterRenderBufferOpenGL(grabRBS.getValue(), buf); - OsvrRenderManagerOpenGLLibrary.osvrRenderManagerFinishRegisterRenderBuffers(((OSVR)environment.getVRHardware()).getCompositor(), grabRBS.getValue(), (byte)0); - - } else { - throw new IllegalStateException("This VR view manager is not attached to any VR environment."); - } - } - - /** - * Send the textures to the two eyes. - */ - public void postRender() { - - if (environment != null){ - if( environment.isInVR() ) { - VRAPI api = environment.getVRHardware(); - if( api.getCompositor() != null ) { - // using the compositor... - int errl = 0, errr = 0; - if( environment.isInstanceRendering() ) { - if( leftTextureType.handle == -1 || leftTextureType.handle != getFullTexId() ) { - leftTextureType.handle = getFullTexId(); - if( leftTextureType.handle != -1 ) { - leftTextureType.write(); - if( api instanceof OSVR ) { - osvr_renderBuffer[OSVR.EYE_LEFT].colorBufferName = leftTextureType.handle; - osvr_renderBuffer[OSVR.EYE_LEFT].depthStencilBufferName = dualEyeTex.getImage().getId(); - osvr_renderBuffer[OSVR.EYE_LEFT].write(); - registerOSVRBuffer(osvr_renderBuffer[OSVR.EYE_LEFT]); - } - } - } else { - if( api instanceof OSVR ) { - ((OSVR)api).handleRenderBufferPresent(osvr_viewDescLeft, osvr_viewDescRight, - osvr_renderBuffer[OSVR.EYE_LEFT], osvr_renderBuffer[OSVR.EYE_LEFT]); - } - } - } else if( leftTextureType.handle == -1 || rightTextureType.handle == -1 || - leftTextureType.handle != getLeftTexId() || rightTextureType.handle != getRightTexId() ) { - leftTextureType.handle = getLeftTexId(); - if( leftTextureType.handle != -1 ) { - logger.fine("Writing Left texture to native memory at " + leftTextureType.getPointer()); - leftTextureType.write(); - if( api instanceof OSVR ) { - osvr_renderBuffer[OSVR.EYE_LEFT].colorBufferName = leftTextureType.handle; - if( leftEyeDepth != null ) osvr_renderBuffer[OSVR.EYE_LEFT].depthStencilBufferName = leftEyeDepth.getImage().getId(); - osvr_renderBuffer[OSVR.EYE_LEFT].write(); - registerOSVRBuffer(osvr_renderBuffer[OSVR.EYE_LEFT]); - } - } - rightTextureType.handle = getRightTexId(); - if( rightTextureType.handle != -1 ) { - logger.fine("Writing Right texture to native memory at " + leftTextureType.getPointer()); - rightTextureType.write(); - if( api instanceof OSVR ) { - osvr_renderBuffer[OSVR.EYE_RIGHT].colorBufferName = rightTextureType.handle; - if( rightEyeDepth != null ) osvr_renderBuffer[OSVR.EYE_RIGHT].depthStencilBufferName = rightEyeDepth.getImage().getId(); - osvr_renderBuffer[OSVR.EYE_RIGHT].write(); - registerOSVRBuffer(osvr_renderBuffer[OSVR.EYE_RIGHT]); - } - } - } else { - if( api instanceof OSVR ) { - ((OSVR)api).handleRenderBufferPresent(osvr_viewDescFull, osvr_viewDescFull, - osvr_renderBuffer[OSVR.EYE_LEFT], osvr_renderBuffer[OSVR.EYE_RIGHT]); - } - } - - if( errl != 0 ){ - logger.severe("Submit to left compositor error: " + OpenVRUtil.getEVRCompositorErrorString(errl)+" ("+Integer.toString(errl)+")"); - logger.severe(" Texture color space: "+OpenVRUtil.getEColorSpaceString(leftTextureType.eColorSpace)); - logger.severe(" Texture type: "+OpenVRUtil.getETextureTypeString(leftTextureType.eType)); - logger.severe(" Texture handle: "+leftTextureType.handle); - - logger.severe(" Left eye texture "+leftEyeTexture.getName()+" ("+leftEyeTexture.getImage().getId()+")"); - logger.severe(" Type: "+leftEyeTexture.getType()); - logger.severe(" Size: "+leftEyeTexture.getImage().getWidth()+"x"+leftEyeTexture.getImage().getHeight()); - logger.severe(" Image depth: "+leftEyeTexture.getImage().getDepth()); - logger.severe(" Image format: "+leftEyeTexture.getImage().getFormat()); - logger.severe(" Image color space: "+leftEyeTexture.getImage().getColorSpace()); - - } - - if( errr != 0 ){ - logger.severe("Submit to right compositor error: " + OpenVRUtil.getEVRCompositorErrorString(errl)+" ("+Integer.toString(errl)+")"); - logger.severe(" Texture color space: "+OpenVRUtil.getEColorSpaceString(rightTextureType.eColorSpace)); - logger.severe(" Texture type: "+OpenVRUtil.getETextureTypeString(rightTextureType.eType)); - logger.severe(" Texture handle: "+rightTextureType.handle); - - logger.severe(" Right eye texture "+rightEyeTexture.getName()+" ("+rightEyeTexture.getImage().getId()+")"); - logger.severe(" Type: "+rightEyeTexture.getType()); - logger.severe(" Size: "+rightEyeTexture.getImage().getWidth()+"x"+rightEyeTexture.getImage().getHeight()); - logger.severe(" Image depth: "+rightEyeTexture.getImage().getDepth()); - logger.severe(" Image format: "+rightEyeTexture.getImage().getFormat()); - logger.severe(" Image color space: "+rightEyeTexture.getImage().getColorSpace()); - } - } - } - } else { - throw new IllegalStateException("This VR view manager is not attached to any VR environment."); - } - } - - - /** - * Initialize the VR view manager. - */ - public void initialize() { - - logger.config("Initializing VR view manager."); - - if (environment != null){ - initTextureSubmitStructs(); - setupCamerasAndViews(); - setupVRScene(); - moveScreenProcessingToEyes(); - if( environment.hasTraditionalGUIOverlay() ) { - - environment.getVRMouseManager().initialize(); - - // update the pose to position the gui correctly on start - update(0f); - environment.getVRGUIManager().positionGui(); - } - - if (environment.getApplication() != null){ - // if we are OSVR, our primary mirror window needs to be the same size as the render manager's output... - if( environment.getVRHardware() instanceof OSVR ) { - int origWidth = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode().getWidth(); - int origHeight = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode().getHeight(); - long window = ((LwjglWindow)environment.getApplication().getContext()).getWindowHandle(); - Vector2f windowSize = new Vector2f(); - ((OSVR)environment.getVRHardware()).getRenderSize(windowSize); - windowSize.x = Math.max(windowSize.x * 2f, leftCamera.getWidth()); - org.lwjgl.glfw.GLFW.glfwSetWindowSize(window, (int)windowSize.x, (int)windowSize.y); - environment.getApplication().getContext().getSettings().setResolution((int)windowSize.x, (int)windowSize.y); - - if (environment.getApplication().getRenderManager() != null) { - environment.getApplication().getRenderManager().notifyReshape((int)windowSize.x, (int)windowSize.y); - } - - org.lwjgl.glfw.GLFW.glfwSetWindowPos(window, origWidth - (int)windowSize.x, 32); - - org.lwjgl.glfw.GLFW.glfwFocusWindow(window); - - org.lwjgl.glfw.GLFW.glfwSetCursorPos(window, origWidth / 2.0, origHeight / 2.0); - - logger.config("Initialized VR view manager [SUCCESS]"); - } else { - throw new IllegalStateException("Underlying VR hardware should be "+OSVR.class.getSimpleName()); - } - } else { - throw new IllegalStateException("This VR environment is not attached to any application."); - } - } else { - throw new IllegalStateException("This VR view manager is not attached to any VR environment."); - } - - - } - - /** - * Prepare the size of the given {@link Camera camera} to adapt it to the underlying rendering context. - * @param cam the {@link Camera camera} to prepare. - * @param xMult the camera width multiplier. - */ - private void prepareCameraSize(Camera cam, float xMult) { - - if (environment != null){ - - if (environment.getApplication() != null){ - - } else { - throw new IllegalStateException("This VR environment is not attached to any application."); - } - - Vector2f size = new Vector2f(); - VRAPI vrhmd = environment.getVRHardware(); - - if( vrhmd == null ) { - size.x = 1280f; - size.y = 720f; - } else { - vrhmd.getRenderSize(size); - } - - if( size.x < environment.getApplication().getContext().getSettings().getWidth() ) { - size.x = environment.getApplication().getContext().getSettings().getWidth(); - } - if( size.y < environment.getApplication().getContext().getSettings().getHeight() ) { - size.y = environment.getApplication().getContext().getSettings().getHeight(); - } - - if( environment.isInstanceRendering() ){ - size.x *= 2f; - } - - // other adjustments - size.x *= xMult; - size.x *= getResolutionMuliplier(); - size.y *= getResolutionMuliplier(); - - if( cam.getWidth() != size.x || cam.getHeight() != size.y ){ - cam.resize((int)size.x, (int)size.y, false); - } - } else { - throw new IllegalStateException("This VR view manager is not attached to any VR environment."); - } - } - - /** - * Replaces rootNode as the main cameras scene with the distortion mesh - */ - private void setupVRScene(){ - - if (environment != null){ - if (environment.getApplication() != null){ - // no special scene to setup if we are doing instancing - if( environment.isInstanceRendering() ) { - // distortion has to be done with compositor here... we want only one pass on our end! - if( environment.getApplication().getContext().getSettings().isSwapBuffers() ) { - setupMirrorBuffers(environment.getCamera(), dualEyeTex, true); - } - return; - } - - leftEyeTexture = (Texture2D) getLeftViewPort().getOutputFrameBuffer().getColorBuffer().getTexture(); - rightEyeTexture = (Texture2D)getRightViewPort().getOutputFrameBuffer().getColorBuffer().getTexture(); - leftEyeDepth = (Texture2D) getLeftViewPort().getOutputFrameBuffer().getDepthBuffer().getTexture(); - rightEyeDepth = (Texture2D)getRightViewPort().getOutputFrameBuffer().getDepthBuffer().getTexture(); - - // main viewport is either going to be a distortion scene or nothing - // mirroring is handled by copying framebuffers - Iterator spatialIter = environment.getApplication().getViewPort().getScenes().iterator(); - while(spatialIter.hasNext()){ - environment.getApplication().getViewPort().detachScene(spatialIter.next()); - } - - spatialIter = environment.getApplication().getGuiViewPort().getScenes().iterator(); - while(spatialIter.hasNext()){ - environment.getApplication().getGuiViewPort().detachScene(spatialIter.next()); - } - - // only setup distortion scene if compositor isn't running (or using custom mesh distortion option) - if( environment.getVRHardware().getCompositor() == null ) { - Node distortionScene = new Node(); - Material leftMat = new Material(environment.getApplication().getAssetManager(), "Common/MatDefs/VR/OpenVR.j3md"); - leftMat.setTexture("Texture", leftEyeTexture); - Geometry leftEye = new Geometry("box", setupDistortionMesh(JOpenVRLibrary.EVREye.EVREye_Eye_Left, environment.getVRHardware())); - leftEye.setMaterial(leftMat); - distortionScene.attachChild(leftEye); - - Material rightMat = new Material(environment.getApplication().getAssetManager(), "Common/MatDefs/VR/OpenVR.j3md"); - rightMat.setTexture("Texture", rightEyeTexture); - Geometry rightEye = new Geometry("box", setupDistortionMesh(JOpenVRLibrary.EVREye.EVREye_Eye_Right, environment.getVRHardware())); - rightEye.setMaterial(rightMat); - distortionScene.attachChild(rightEye); - - distortionScene.updateGeometricState(); - - environment.getApplication().getViewPort().attachScene(distortionScene); - - //if( useCustomDistortion ) setupFinalFullTexture(app.getViewPort().getCamera()); - } - - if( environment.getApplication().getContext().getSettings().isSwapBuffers() ) { - setupMirrorBuffers(environment.getCamera(), leftEyeTexture, false); - } - } else { - throw new IllegalStateException("This VR environment is not attached to any application."); - } - } else { - throw new IllegalStateException("This VR view manager is not attached to any VR environment."); - } - - - } - - /** - * Update the VR view manager. - * This method is called by the attached {@link VRApplication VR application} and should not be called manually. - * @param tpf the time per frame. - */ - public void update(float tpf) { - - if (environment != null){ - // grab the observer - Object obs = environment.getObserver(); - Quaternion objRot; - Vector3f objPos; - if( obs instanceof Camera ) { - objRot = ((Camera)obs).getRotation(); - objPos = ((Camera)obs).getLocation(); - } else { - objRot = ((Spatial)obs).getWorldRotation(); - objPos = ((Spatial)obs).getWorldTranslation(); - } - // grab the hardware handle - VRAPI dev = environment.getVRHardware(); - if( dev != null ) { - // update the HMD's position & orientation - dev.updatePose(); - dev.getPositionAndOrientation(hmdPos, hmdRot); - if( obs != null ) { - // update hmdPos based on obs rotation - finalRotation.set(objRot); - finalRotation.mult(hmdPos, hmdPos); - finalRotation.multLocal(hmdRot); - } - - finalizeCamera(dev.getHMDVectorPoseLeftEye(), objPos, leftCamera); - finalizeCamera(dev.getHMDVectorPoseRightEye(), objPos, rightCamera); - } else { - leftCamera.setFrame(objPos, objRot); - rightCamera.setFrame(objPos, objRot); - } - - if( environment.hasTraditionalGUIOverlay() ) { - // update the mouse? - environment.getVRMouseManager().update(tpf); - - // update GUI position? - if( environment.getVRGUIManager().isWantsReposition() || environment.getVRGUIManager().getPositioningMode() != VRGUIPositioningMode.MANUAL ) { - environment.getVRGUIManager().positionGuiNow(tpf); - environment.getVRGUIManager().updateGuiQuadGeometricState(); - } - } - } else { - throw new IllegalStateException("This VR view manager is not attached to any VR environment."); - } - } - - /** - * Place the camera within the scene. - * @param eyePos the eye position. - * @param obsPosition the observer position. - * @param cam the camera to place. - */ - private void finalizeCamera(Vector3f eyePos, Vector3f obsPosition, Camera cam) { - finalRotation.mult(eyePos, finalPosition); - finalPosition.addLocal(hmdPos); - if( obsPosition != null ){ - finalPosition.addLocal(obsPosition); - } - finalPosition.y += getHeightAdjustment(); - cam.setFrame(finalPosition, finalRotation); - } - - /** - * Handles moving filters from the main view to each eye - */ - public void moveScreenProcessingToEyes() { - if( getRightViewPort() == null ){ - return; - } - - if (environment != null){ - if (environment.getApplication() != null){ - - syncScreenProcessing(environment.getApplication().getViewPort()); - environment.getApplication().getViewPort().clearProcessors(); - } else { - throw new IllegalStateException("This VR environment is not attached to any application."); - } - } else { - throw new IllegalStateException("This VR view manager is not attached to any VR environment."); - } - } - - /** - * Sets the two views to use the list of {@link SceneProcessor processors}. - * @param sourceViewport the {@link ViewPort viewport} that contains the processors to use. - */ - public void syncScreenProcessing(ViewPort sourceViewport) { - if( getRightViewPort() == null ){ - return; - } - - if (environment != null){ - if (environment.getApplication() != null){ - // setup post processing filters - if( rightPostProcessor == null ) { - rightPostProcessor = new FilterPostProcessor(environment.getApplication().getAssetManager()); - leftPostProcessor = new FilterPostProcessor(environment.getApplication().getAssetManager()); - } - // clear out all filters & processors, to start from scratch - rightPostProcessor.removeAllFilters(); - leftPostProcessor.removeAllFilters(); - getLeftViewPort().clearProcessors(); - getRightViewPort().clearProcessors(); - // if we have no processors to sync, don't add the FilterPostProcessor - if( sourceViewport.getProcessors().isEmpty() ) return; - // add post processors we just made, which are empty - getLeftViewPort().addProcessor(leftPostProcessor); - getRightViewPort().addProcessor(rightPostProcessor); - // go through all of the filters in the processors list - // add them to the left viewport processor & clone them to the right - for(SceneProcessor sceneProcessor : sourceViewport.getProcessors()) { - if (sceneProcessor instanceof FilterPostProcessor) { - for(Filter f : ((FilterPostProcessor)sceneProcessor).getFilterList() ) { - if( f instanceof TranslucentBucketFilter ) { - // just remove this filter, we will add it at the end manually - ((FilterPostProcessor)sceneProcessor).removeFilter(f); - } else { - leftPostProcessor.addFilter(f); - // clone to the right - Filter f2; - if(f instanceof FogFilter){ - f2 = FilterUtil.cloneFogFilter((FogFilter)f); - } else if (f instanceof CartoonSSAO ) { - f2 = new CartoonSSAO((CartoonSSAO)f); - } else if (f instanceof SSAOFilter){ - f2 = FilterUtil.cloneSSAOFilter((SSAOFilter)f); - } else if (f instanceof DirectionalLightShadowFilter){ - f2 = FilterUtil.cloneDirectionalLightShadowFilter(environment.getApplication().getAssetManager(), (DirectionalLightShadowFilter)f); - } else { - f2 = f; // dof, bloom, lightscattering etc. - } - rightPostProcessor.addFilter(f2); - } - } - } else if (sceneProcessor instanceof VRDirectionalLightShadowRenderer) { - // shadow processing - // TODO: make right shadow processor use same left shadow maps for performance - VRDirectionalLightShadowRenderer dlsr = (VRDirectionalLightShadowRenderer) sceneProcessor; - VRDirectionalLightShadowRenderer dlsrRight = dlsr.clone(); - dlsrRight.setLight(dlsr.getLight()); - getRightViewPort().getProcessors().add(0, dlsrRight); - getLeftViewPort().getProcessors().add(0, sceneProcessor); - } - } - // make sure each has a translucent filter renderer - leftPostProcessor.addFilter(new TranslucentBucketFilter()); - rightPostProcessor.addFilter(new TranslucentBucketFilter()); - } else { - throw new IllegalStateException("This VR environment is not attached to any application."); - } - } else { - throw new IllegalStateException("This VR view manager is not attached to any VR environment."); - } - } - - private void setupCamerasAndViews() { - - if (environment != null){ - if (environment.getApplication() != null){ - // get desired frustrum from original camera - Camera origCam = environment.getCamera(); - float fFar = origCam.getFrustumFar(); - float fNear = origCam.getFrustumNear(); - - // if we are using OSVR get the eye info here - if( environment.getVRHardware() instanceof OSVR ) { - ((OSVR)environment.getVRHardware()).getEyeInfo(); - } - - // restore frustrum on distortion scene cam, if needed - if( environment.isInstanceRendering() ) { - leftCamera = origCam; - } else if( environment.compositorAllowed() == false ) { - origCam.setFrustumFar(100f); - origCam.setFrustumNear(1f); - leftCamera = origCam.clone(); - prepareCameraSize(origCam, 2f); - } else { - leftCamera = origCam.clone(); - } - - leftCamera.setFrustumPerspective(environment.getDefaultFOV(), environment.getDefaultAspect(), fNear, fFar); - - prepareCameraSize(leftCamera, 1f); - if( environment.getVRHardware() != null ) leftCamera.setProjectionMatrix(environment.getVRHardware().getHMDMatrixProjectionLeftEye(leftCamera)); - //org.lwjgl.opengl.GL11.glEnable(org.lwjgl.opengl.GL30.GL_FRAMEBUFFER_SRGB); - - if( !environment.isInstanceRendering()) { - leftViewPort = setupViewBuffers(leftCamera, LEFT_VIEW_NAME); - rightCamera = leftCamera.clone(); - if( environment.getVRHardware() != null ){ - rightCamera.setProjectionMatrix(environment.getVRHardware().getHMDMatrixProjectionRightEye(rightCamera)); - } - rightViewPort = setupViewBuffers(rightCamera, RIGHT_VIEW_NAME); - } else { - - System.err.println("[VRViewManager] THIS CODE NEED CHANGES !!!"); - leftViewPort = environment.getApplication().getViewPort(); - //leftViewport.attachScene(app.getRootNode()); - rightCamera = leftCamera.clone(); - if( environment.getVRHardware() != null ){ - rightCamera.setProjectionMatrix(environment.getVRHardware().getHMDMatrixProjectionRightEye(rightCamera)); - } - - org.lwjgl.opengl.GL11.glEnable(org.lwjgl.opengl.GL30.GL_CLIP_DISTANCE0); - - //FIXME: [jme-vr] Fix with JMonkey next release - //RenderManager._VRInstancing_RightCamProjection = camRight.getViewProjectionMatrix(); - setupFinalFullTexture(environment.getApplication().getViewPort().getCamera()); - } - - // setup gui - environment.getVRGUIManager().setupGui(leftCamera, rightCamera, getLeftViewPort(), getRightViewPort()); - - if( environment.getVRHardware() != null ) { - // call these to cache the results internally - environment.getVRHardware().getHMDMatrixPoseLeftEye(); - environment.getVRHardware().getHMDMatrixPoseRightEye(); - } - } else { - throw new IllegalStateException("This VR environment is not attached to any application."); - } - } else { - throw new IllegalStateException("This VR view manager is not attached to any VR environment."); - } - } - - private ViewPort setupMirrorBuffers(Camera cam, Texture tex, boolean expand) { - - if (environment != null){ - if (environment.getApplication() != null){ - Camera clonecam = cam.clone(); - ViewPort viewPort = environment.getApplication().getRenderManager().createPostView("MirrorView", clonecam); - clonecam.setParallelProjection(true); - viewPort.setClearFlags(true, true, true); - viewPort.setBackgroundColor(ColorRGBA.Black); - Picture pic = new Picture("fullscene"); - pic.setLocalTranslation(-0.75f, -0.5f, 0f); - if( expand ) { - pic.setLocalScale(3f, 1f, 1f); - } else { - pic.setLocalScale(1.5f, 1f, 1f); - } - pic.setQueueBucket(Bucket.Opaque); - pic.setTexture(environment.getApplication().getAssetManager(), (Texture2D)tex, false); - viewPort.attachScene(pic); - viewPort.setOutputFrameBuffer(null); - - pic.updateGeometricState(); - - return viewPort; - } else { - throw new IllegalStateException("This VR environment is not attached to any application."); - } - } else { - throw new IllegalStateException("This VR view manager is not attached to any VR environment."); - } - } - - private void setupFinalFullTexture(Camera cam) { - - if (environment != null){ - if (environment.getApplication() != null){ - // create offscreen framebuffer - FrameBuffer out = new FrameBuffer(cam.getWidth(), cam.getHeight(), 1); - //offBuffer.setSrgb(true); - - //setup framebuffer's texture - dualEyeTex = new Texture2D(cam.getWidth(), cam.getHeight(), Image.Format.RGBA8); - dualEyeTex.setMinFilter(Texture.MinFilter.BilinearNoMipMaps); - dualEyeTex.setMagFilter(Texture.MagFilter.Bilinear); - - logger.config("Dual eye texture "+dualEyeTex.getName()+" ("+dualEyeTex.getImage().getId()+")"); - logger.config(" Type: "+dualEyeTex.getType()); - logger.config(" Size: "+dualEyeTex.getImage().getWidth()+"x"+dualEyeTex.getImage().getHeight()); - logger.config(" Image depth: "+dualEyeTex.getImage().getDepth()); - logger.config(" Image format: "+dualEyeTex.getImage().getFormat()); - logger.config(" Image color space: "+dualEyeTex.getImage().getColorSpace()); - - //setup framebuffer to use texture - out.setDepthBuffer(Image.Format.Depth); - out.setColorTexture(dualEyeTex); - - ViewPort viewPort = environment.getApplication().getViewPort(); - viewPort.setClearFlags(true, true, true); - viewPort.setBackgroundColor(ColorRGBA.Black); - viewPort.setOutputFrameBuffer(out); - } else { - throw new IllegalStateException("This VR environment is not attached to any application."); - } - } else { - throw new IllegalStateException("This VR view manager is not attached to any VR environment."); - } - } - - private ViewPort setupViewBuffers(Camera cam, String viewName){ - - if (environment != null){ - if (environment.getApplication() != null){ - // create offscreen framebuffer - FrameBuffer offBufferLeft = new FrameBuffer(cam.getWidth(), cam.getHeight(), 1); - //offBufferLeft.setSrgb(true); - - //setup framebuffer's texture - Texture2D offTex = new Texture2D(cam.getWidth(), cam.getHeight(), Image.Format.RGBA8); - offTex.setMinFilter(Texture.MinFilter.BilinearNoMipMaps); - offTex.setMagFilter(Texture.MagFilter.Bilinear); - - //setup framebuffer to use texture - offBufferLeft.setDepthBuffer(Image.Format.Depth); - offBufferLeft.setColorTexture(offTex); - - ViewPort viewPort = environment.getApplication().getRenderManager().createPreView(viewName, cam); - viewPort.setClearFlags(true, true, true); - viewPort.setBackgroundColor(ColorRGBA.Black); - - Iterator spatialIter = environment.getApplication().getViewPort().getScenes().iterator(); - while(spatialIter.hasNext()){ - viewPort.attachScene(spatialIter.next()); - } - - //set viewport to render to offscreen framebuffer - viewPort.setOutputFrameBuffer(offBufferLeft); - return viewPort; - } else { - throw new IllegalStateException("This VR environment is not attached to any application."); - } - } else { - throw new IllegalStateException("This VR view manager is not attached to any VR environment."); - } - } - - /** - * Setup a distortion mesh for the stereo view. - * @param eye the eye to apply. - * @param api the underlying VR api - * @return the distorted mesh. - */ - public static Mesh setupDistortionMesh(int eye, VRAPI api) { - Mesh distortionMesh = new Mesh(); - float m_iLensGridSegmentCountH = 43, m_iLensGridSegmentCountV = 43; - - float w = 1f / (m_iLensGridSegmentCountH - 1f); - float h = 1f / (m_iLensGridSegmentCountV - 1f); - - float u, v; - - float verts[] = new float[(int) (m_iLensGridSegmentCountV * m_iLensGridSegmentCountH) * 3]; - - float texcoordR[] = new float[(int) (m_iLensGridSegmentCountV * m_iLensGridSegmentCountH) * 2]; - float texcoordG[] = new float[(int) (m_iLensGridSegmentCountV * m_iLensGridSegmentCountH) * 2]; - float texcoordB[] = new float[(int) (m_iLensGridSegmentCountV * m_iLensGridSegmentCountH) * 2]; - - int vertPos = 0, coordPos = 0; - - float Xoffset = eye == JOpenVRLibrary.EVREye.EVREye_Eye_Left ? -1f : 0; - for (int y = 0; y < m_iLensGridSegmentCountV; y++) { - for (int x = 0; x < m_iLensGridSegmentCountH; x++) { - u = x * w; - v = 1 - y * h; - verts[vertPos] = Xoffset + u; // x - verts[vertPos + 1] = -1 + 2 * y * h; // y - verts[vertPos + 2] = 0f; // z - vertPos += 3; - - DistortionCoordinates_t dc0 = new DistortionCoordinates_t(); - if( api.getVRSystem() == null ) { - // default to no distortion - texcoordR[coordPos] = u; - texcoordR[coordPos + 1] = 1 - v; - texcoordG[coordPos] = u; - texcoordG[coordPos + 1] = 1 - v; - texcoordB[coordPos] = u; - texcoordB[coordPos + 1] = 1 - v; - } else { - ((VR_IVRSystem_FnTable)api.getVRSystem()).ComputeDistortion.apply(eye, u, v, dc0); - - texcoordR[coordPos] = dc0.rfRed[0]; - texcoordR[coordPos + 1] = 1 - dc0.rfRed[1]; - texcoordG[coordPos] = dc0.rfGreen[0]; - texcoordG[coordPos + 1] = 1 - dc0.rfGreen[1]; - texcoordB[coordPos] = dc0.rfBlue[0]; - texcoordB[coordPos + 1] = 1 - dc0.rfBlue[1]; - } - - coordPos += 2; - } - } - - // have UV coordinates & positions, now to setup indices - - int[] indices = new int[(int) ((m_iLensGridSegmentCountV - 1) * (m_iLensGridSegmentCountH - 1)) * 6]; - int indexPos = 0; - int a, b, c, d; - - int offset = 0; - for (int y = 0; y < m_iLensGridSegmentCountV - 1; y++) { - for (int x = 0; x < m_iLensGridSegmentCountH - 1; x++) { - a = (int) (m_iLensGridSegmentCountH * y + x + offset); - b = (int) (m_iLensGridSegmentCountH * y + x + 1 + offset); - c = (int) ((y + 1) * m_iLensGridSegmentCountH + x + 1 + offset); - d = (int) ((y + 1) * m_iLensGridSegmentCountH + x + offset); - - indices[indexPos] = a; - indices[indexPos + 1] = b; - indices[indexPos + 2] = c; - - indices[indexPos + 3] = a; - indices[indexPos + 4] = c; - indices[indexPos + 5] = d; - - indexPos += 6; - } - } - - // OK, create the mesh - distortionMesh.setBuffer(VertexBuffer.Type.Position, 3, verts); - distortionMesh.setBuffer(VertexBuffer.Type.Index, 1, indices); - distortionMesh.setBuffer(VertexBuffer.Type.TexCoord, 2, texcoordR); - distortionMesh.setBuffer(VertexBuffer.Type.TexCoord2, 2, texcoordG); - distortionMesh.setBuffer(VertexBuffer.Type.TexCoord3, 2, texcoordB); - distortionMesh.setStatic(); - return distortionMesh; - } - - @Override - public void render() { - // TODO Auto-generated method stub - - } -} diff --git a/jme3-vr/src/main/java/com/jme3/post/OpenVRFilter.java b/jme3-vr/src/main/java/com/jme3/post/OpenVRFilter.java deleted file mode 100644 index 61cf840ede..0000000000 --- a/jme3-vr/src/main/java/com/jme3/post/OpenVRFilter.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -package com.jme3.post; - -import com.jme3.app.VRApplication; -import com.jme3.asset.AssetManager; -import com.jme3.material.Material; -import com.jme3.post.Filter; -import com.jme3.renderer.RenderManager; -import com.jme3.renderer.Renderer; -import com.jme3.renderer.ViewPort; -import com.jme3.scene.Mesh; -import com.jme3.scene.VertexBuffer; -import com.jme3.system.jopenvr.DistortionCoordinates_t; -import com.jme3.system.jopenvr.JOpenVRLibrary; -import com.jme3.system.jopenvr.VR_IVRSystem_FnTable; -import com.jme3.texture.FrameBuffer; - -/** - * DO NOT USE - * @author phr00t - * @deprecated DO NOT USE - */ -@Deprecated -public class OpenVRFilter extends Filter { - - private Mesh distortionMesh; - - private VRApplication application = null; - - /** - * DO NOT USE - * @param application the VR application. - */ - public OpenVRFilter(VRApplication application) { - this.application = application; - } - - /** - * DO NOT USE - * @return the distortion mesh. - */ - public Mesh getDistortionMesh() { - return distortionMesh; - } - - @Override - protected void initFilter(AssetManager manager, RenderManager renderManager, ViewPort vp, int w, int h) { - material = new Material(manager, "Common/MatDefs/VR/OpenVR.j3md"); - configureDistortionMesh(); - } - - @Override - protected Material getMaterial() { - return material; - - } - - @Override - protected void preFrame(float tpf) { - super.preFrame(tpf); - } - - @Override - protected void postFrame(RenderManager renderManager, ViewPort viewPort, FrameBuffer prevFilterBuffer, FrameBuffer sceneBuffer) { - super.postFrame(renderManager, viewPort, prevFilterBuffer, sceneBuffer); - } - - @Override - protected void postFilter(Renderer r, FrameBuffer buffer) { - super.postFilter(r, buffer); - } - - /* - function converted from: - https://github.com/ValveSoftware/openvr/blob/master/samples/hellovr_opengl/hellovr_opengl_main.cpp#L1335 - */ - private void configureDistortionMesh() { - float m_iLensGridSegmentCountH = 43, m_iLensGridSegmentCountV = 43; - - float w = 1f / m_iLensGridSegmentCountH - 1f; - float h = 1f / m_iLensGridSegmentCountV - 1f; - - float u, v; - - distortionMesh = new Mesh(); - float verts[] = new float[(int)(m_iLensGridSegmentCountV * m_iLensGridSegmentCountH) * 3]; - - float texcoordR[] = new float[(int)(m_iLensGridSegmentCountV * m_iLensGridSegmentCountH) * 2]; - float texcoordG[] = new float[(int)(m_iLensGridSegmentCountV * m_iLensGridSegmentCountH) * 2]; - float texcoordB[] = new float[(int)(m_iLensGridSegmentCountV * m_iLensGridSegmentCountH) * 2]; - - int vertPos = 0, coordPos = 0; - - //left eye distortion verts - float Xoffset = -1f; - for( int y=0; y vIndices; - int[] indices = new int[(int)((m_iLensGridSegmentCountV - 1) * (m_iLensGridSegmentCountH - 1)) * 6]; - int indexPos = 0; - int a,b,c,d; - - int offset = 0; - for( int y=0; ynative declaration : headers\openvr_capi.h:1160
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class AppOverrideKeys_t extends Structure { - /** - * const char *
    - * C type : char* - */ - public Pointer pchKey; - /** - * const char *
    - * C type : char* - */ - public Pointer pchValue; - public AppOverrideKeys_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("pchKey", "pchValue"); - } - /** - * @param pchKey const char *
    - * C type : char*
    - * @param pchValue const char *
    - * C type : char* - */ - public AppOverrideKeys_t(Pointer pchKey, Pointer pchValue) { - super(); - this.pchKey = pchKey; - this.pchValue = pchValue; - } - public AppOverrideKeys_t(Pointer peer) { - super(peer); - } - public static class ByReference extends AppOverrideKeys_t implements Structure.ByReference { - - }; - public static class ByValue extends AppOverrideKeys_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/COpenVRContext.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/COpenVRContext.java deleted file mode 100644 index 8f85d1e5c7..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/COpenVRContext.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.ptr.IntByReference; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1291
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class COpenVRContext extends Structure { - /** - * class vr::IVRSystem *
    - * C type : intptr_t - */ - public IntByReference m_pVRSystem; - /** - * class vr::IVRChaperone *
    - * C type : intptr_t - */ - public IntByReference m_pVRChaperone; - /** - * class vr::IVRChaperoneSetup *
    - * C type : intptr_t - */ - public IntByReference m_pVRChaperoneSetup; - /** - * class vr::IVRCompositor *
    - * C type : intptr_t - */ - public IntByReference m_pVRCompositor; - /** - * class vr::IVROverlay *
    - * C type : intptr_t - */ - public IntByReference m_pVROverlay; - /** - * class vr::IVRResources *
    - * C type : intptr_t - */ - public IntByReference m_pVRResources; - /** - * class vr::IVRRenderModels *
    - * C type : intptr_t - */ - public IntByReference m_pVRRenderModels; - /** - * class vr::IVRExtendedDisplay *
    - * C type : intptr_t - */ - public IntByReference m_pVRExtendedDisplay; - /** - * class vr::IVRSettings *
    - * C type : intptr_t - */ - public IntByReference m_pVRSettings; - /** - * class vr::IVRApplications *
    - * C type : intptr_t - */ - public IntByReference m_pVRApplications; - /** - * class vr::IVRTrackedCamera *
    - * C type : intptr_t - */ - public IntByReference m_pVRTrackedCamera; - /** - * class vr::IVRScreenshots *
    - * C type : intptr_t - */ - public IntByReference m_pVRScreenshots; - /** - * class vr::IVRDriverManager *
    - * C type : intptr_t - */ - public IntByReference m_pVRDriverManager; - public COpenVRContext() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("m_pVRSystem", "m_pVRChaperone", "m_pVRChaperoneSetup", "m_pVRCompositor", "m_pVROverlay", "m_pVRResources", "m_pVRRenderModels", "m_pVRExtendedDisplay", "m_pVRSettings", "m_pVRApplications", "m_pVRTrackedCamera", "m_pVRScreenshots", "m_pVRDriverManager"); - } - public COpenVRContext(Pointer peer) { - super(peer); - } - public static class ByReference extends COpenVRContext implements Structure.ByReference { - - }; - public static class ByValue extends COpenVRContext implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/CameraVideoStreamFrameHeader_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/CameraVideoStreamFrameHeader_t.java deleted file mode 100644 index d7f7f690b4..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/CameraVideoStreamFrameHeader_t.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1154
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class CameraVideoStreamFrameHeader_t extends Structure { - /** - * @see EVRTrackedCameraFrameType
    - * C type : EVRTrackedCameraFrameType - */ - public int eFrameType; - public int nWidth; - public int nHeight; - public int nBytesPerPixel; - public int nFrameSequence; - /** C type : TrackedDevicePose_t */ - public TrackedDevicePose_t standingTrackedDevicePose; - public CameraVideoStreamFrameHeader_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("eFrameType", "nWidth", "nHeight", "nBytesPerPixel", "nFrameSequence", "standingTrackedDevicePose"); - } - /** - * @param eFrameType @see EVRTrackedCameraFrameType
    - * C type : EVRTrackedCameraFrameType
    - * @param standingTrackedDevicePose C type : TrackedDevicePose_t - */ - public CameraVideoStreamFrameHeader_t(int eFrameType, int nWidth, int nHeight, int nBytesPerPixel, int nFrameSequence, TrackedDevicePose_t standingTrackedDevicePose) { - super(); - this.eFrameType = eFrameType; - this.nWidth = nWidth; - this.nHeight = nHeight; - this.nBytesPerPixel = nBytesPerPixel; - this.nFrameSequence = nFrameSequence; - this.standingTrackedDevicePose = standingTrackedDevicePose; - } - public CameraVideoStreamFrameHeader_t(Pointer peer) { - super(peer); - } - public static class ByReference extends CameraVideoStreamFrameHeader_t implements Structure.ByReference { - - }; - public static class ByValue extends CameraVideoStreamFrameHeader_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/Compositor_CumulativeStats.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/Compositor_CumulativeStats.java deleted file mode 100644 index 23f44fb911..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/Compositor_CumulativeStats.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1203
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class Compositor_CumulativeStats extends Structure { - public int m_nPid; - public int m_nNumFramePresents; - public int m_nNumDroppedFrames; - public int m_nNumReprojectedFrames; - public int m_nNumFramePresentsOnStartup; - public int m_nNumDroppedFramesOnStartup; - public int m_nNumReprojectedFramesOnStartup; - public int m_nNumLoading; - public int m_nNumFramePresentsLoading; - public int m_nNumDroppedFramesLoading; - public int m_nNumReprojectedFramesLoading; - public int m_nNumTimedOut; - public int m_nNumFramePresentsTimedOut; - public int m_nNumDroppedFramesTimedOut; - public int m_nNumReprojectedFramesTimedOut; - public Compositor_CumulativeStats() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("m_nPid", "m_nNumFramePresents", "m_nNumDroppedFrames", "m_nNumReprojectedFrames", "m_nNumFramePresentsOnStartup", "m_nNumDroppedFramesOnStartup", "m_nNumReprojectedFramesOnStartup", "m_nNumLoading", "m_nNumFramePresentsLoading", "m_nNumDroppedFramesLoading", "m_nNumReprojectedFramesLoading", "m_nNumTimedOut", "m_nNumFramePresentsTimedOut", "m_nNumDroppedFramesTimedOut", "m_nNumReprojectedFramesTimedOut"); - } - public Compositor_CumulativeStats(Pointer peer) { - super(peer); - } - public static class ByReference extends Compositor_CumulativeStats implements Structure.ByReference { - - }; - public static class ByValue extends Compositor_CumulativeStats implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/Compositor_FrameTiming.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/Compositor_FrameTiming.java deleted file mode 100644 index 680c463fd1..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/Compositor_FrameTiming.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1186
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class Compositor_FrameTiming extends Structure { - public int m_nSize; - public int m_nFrameIndex; - public int m_nNumFramePresents; - public int m_nNumMisPresented; - public int m_nNumDroppedFrames; - public int m_nReprojectionFlags; - public double m_flSystemTimeInSeconds; - public float m_flPreSubmitGpuMs; - public float m_flPostSubmitGpuMs; - public float m_flTotalRenderGpuMs; - public float m_flCompositorRenderGpuMs; - public float m_flCompositorRenderCpuMs; - public float m_flCompositorIdleCpuMs; - public float m_flClientFrameIntervalMs; - public float m_flPresentCallCpuMs; - public float m_flWaitForPresentCpuMs; - public float m_flSubmitFrameMs; - public float m_flWaitGetPosesCalledMs; - public float m_flNewPosesReadyMs; - public float m_flNewFrameReadyMs; - public float m_flCompositorUpdateStartMs; - public float m_flCompositorUpdateEndMs; - public float m_flCompositorRenderStartMs; - /** C type : TrackedDevicePose_t */ - public TrackedDevicePose_t m_HmdPose; - public Compositor_FrameTiming() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("m_nSize", "m_nFrameIndex", "m_nNumFramePresents", "m_nNumMisPresented", "m_nNumDroppedFrames", "m_nReprojectionFlags", "m_flSystemTimeInSeconds", "m_flPreSubmitGpuMs", "m_flPostSubmitGpuMs", "m_flTotalRenderGpuMs", "m_flCompositorRenderGpuMs", "m_flCompositorRenderCpuMs", "m_flCompositorIdleCpuMs", "m_flClientFrameIntervalMs", "m_flPresentCallCpuMs", "m_flWaitForPresentCpuMs", "m_flSubmitFrameMs", "m_flWaitGetPosesCalledMs", "m_flNewPosesReadyMs", "m_flNewFrameReadyMs", "m_flCompositorUpdateStartMs", "m_flCompositorUpdateEndMs", "m_flCompositorRenderStartMs", "m_HmdPose"); - } - public Compositor_FrameTiming(Pointer peer) { - super(peer); - } - public static class ByReference extends Compositor_FrameTiming implements Structure.ByReference { - - }; - public static class ByValue extends Compositor_FrameTiming implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/Compositor_OverlaySettings.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/Compositor_OverlaySettings.java deleted file mode 100644 index 9875cc9524..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/Compositor_OverlaySettings.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1144
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class Compositor_OverlaySettings extends Structure { - public int size; - public byte curved; - public byte antialias; - public float scale; - public float distance; - public float alpha; - public float uOffset; - public float vOffset; - public float uScale; - public float vScale; - public float gridDivs; - public float gridWidth; - public float gridScale; - /** C type : HmdMatrix44_t */ - public HmdMatrix44_t transform; - public Compositor_OverlaySettings() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("size", "curved", "antialias", "scale", "distance", "alpha", "uOffset", "vOffset", "uScale", "vScale", "gridDivs", "gridWidth", "gridScale", "transform"); - } - public Compositor_OverlaySettings(Pointer peer) { - super(peer); - } - public static class ByReference extends Compositor_OverlaySettings implements Structure.ByReference { - - }; - public static class ByValue extends Compositor_OverlaySettings implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/D3D12TextureData_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/D3D12TextureData_t.java deleted file mode 100644 index 5639198ca9..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/D3D12TextureData_t.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.jme3.system.jopenvr; -import com.jme3.system.jopenvr.JOpenVRLibrary.ID3D12CommandQueue; -import com.jme3.system.jopenvr.JOpenVRLibrary.ID3D12Resource; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1030
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class D3D12TextureData_t extends Structure { - /** - * struct ID3D12Resource *
    - * C type : ID3D12Resource* - */ - public ID3D12Resource m_pResource; - /** - * struct ID3D12CommandQueue *
    - * C type : ID3D12CommandQueue* - */ - public ID3D12CommandQueue m_pCommandQueue; - public int m_nNodeMask; - public D3D12TextureData_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("m_pResource", "m_pCommandQueue", "m_nNodeMask"); - } - /** - * @param m_pResource struct ID3D12Resource *
    - * C type : ID3D12Resource*
    - * @param m_pCommandQueue struct ID3D12CommandQueue *
    - * C type : ID3D12CommandQueue* - */ - public D3D12TextureData_t(ID3D12Resource m_pResource, ID3D12CommandQueue m_pCommandQueue, int m_nNodeMask) { - super(); - this.m_pResource = m_pResource; - this.m_pCommandQueue = m_pCommandQueue; - this.m_nNodeMask = m_nNodeMask; - } - public D3D12TextureData_t(Pointer peer) { - super(peer); - } - public static class ByReference extends D3D12TextureData_t implements Structure.ByReference { - - }; - public static class ByValue extends D3D12TextureData_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/DistortionCoordinates_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/DistortionCoordinates_t.java deleted file mode 100644 index 780da58451..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/DistortionCoordinates_t.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:981
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class DistortionCoordinates_t extends Structure { - /** - * float[2]
    - * C type : float[2] - */ - public float[] rfRed = new float[2]; - /** - * float[2]
    - * C type : float[2] - */ - public float[] rfGreen = new float[2]; - /** - * float[2]
    - * C type : float[2] - */ - public float[] rfBlue = new float[2]; - public DistortionCoordinates_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("rfRed", "rfGreen", "rfBlue"); - } - /** - * @param rfRed float[2]
    - * C type : float[2]
    - * @param rfGreen float[2]
    - * C type : float[2]
    - * @param rfBlue float[2]
    - * C type : float[2] - */ - public DistortionCoordinates_t(float rfRed[], float rfGreen[], float rfBlue[]) { - super(); - if ((rfRed.length != this.rfRed.length)) - throw new IllegalArgumentException("Wrong array size !"); - this.rfRed = rfRed; - if ((rfGreen.length != this.rfGreen.length)) - throw new IllegalArgumentException("Wrong array size !"); - this.rfGreen = rfGreen; - if ((rfBlue.length != this.rfBlue.length)) - throw new IllegalArgumentException("Wrong array size !"); - this.rfBlue = rfBlue; - } - public DistortionCoordinates_t(Pointer peer) { - super(peer); - } - public static class ByReference extends DistortionCoordinates_t implements Structure.ByReference { - - }; - public static class ByValue extends DistortionCoordinates_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HiddenAreaMesh_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HiddenAreaMesh_t.java deleted file mode 100644 index 582f296c27..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HiddenAreaMesh_t.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1117
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class HiddenAreaMesh_t extends Structure { - /** - * const struct vr::HmdVector2_t *
    - * C type : HmdVector2_t* - */ - public com.jme3.system.jopenvr.HmdVector2_t.ByReference pVertexData; - public int unTriangleCount; - public HiddenAreaMesh_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("pVertexData", "unTriangleCount"); - } - /** - * @param pVertexData const struct vr::HmdVector2_t *
    - * C type : HmdVector2_t* - */ - public HiddenAreaMesh_t(com.jme3.system.jopenvr.HmdVector2_t.ByReference pVertexData, int unTriangleCount) { - super(); - this.pVertexData = pVertexData; - this.unTriangleCount = unTriangleCount; - } - public HiddenAreaMesh_t(Pointer peer) { - super(peer); - } - public static class ByReference extends HiddenAreaMesh_t implements Structure.ByReference { - - }; - public static class ByValue extends HiddenAreaMesh_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdColor_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdColor_t.java deleted file mode 100644 index 32e3ef1fb3..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdColor_t.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:965
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class HmdColor_t extends Structure { - public float r; - public float g; - public float b; - public float a; - public HmdColor_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("r", "g", "b", "a"); - } - public HmdColor_t(float r, float g, float b, float a) { - super(); - this.r = r; - this.g = g; - this.b = b; - this.a = a; - } - public HmdColor_t(Pointer peer) { - super(peer); - } - public static class ByReference extends HmdColor_t implements Structure.ByReference { - - }; - public static class ByValue extends HmdColor_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdMatrix34_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdMatrix34_t.java deleted file mode 100644 index e28e27c1dc..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdMatrix34_t.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:933
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class HmdMatrix34_t extends Structure { - /** - * float[3][4]
    - * C type : float[3][4] - */ - public float[] m = new float[((3) * (4))]; - public HmdMatrix34_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("m"); - } - /** - * @param m float[3][4]
    - * C type : float[3][4] - */ - public HmdMatrix34_t(float m[]) { - super(); - if ((m.length != this.m.length)) - throw new IllegalArgumentException("Wrong array size !"); - this.m = m; - } - public HmdMatrix34_t(Pointer peer) { - super(peer); - } - public static class ByReference extends HmdMatrix34_t implements Structure.ByReference { - - }; - public static class ByValue extends HmdMatrix34_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdMatrix44_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdMatrix44_t.java deleted file mode 100644 index 83a093abd5..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdMatrix44_t.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:937
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class HmdMatrix44_t extends Structure { - /** - * float[4][4]
    - * C type : float[4][4] - */ - public float[] m = new float[((4) * (4))]; - public HmdMatrix44_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("m"); - } - /** - * @param m float[4][4]
    - * C type : float[4][4] - */ - public HmdMatrix44_t(float m[]) { - super(); - if ((m.length != this.m.length)) - throw new IllegalArgumentException("Wrong array size !"); - this.m = m; - } - public HmdMatrix44_t(Pointer peer) { - super(peer); - } - public static class ByReference extends HmdMatrix44_t implements Structure.ByReference { - - }; - public static class ByValue extends HmdMatrix44_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdQuad_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdQuad_t.java deleted file mode 100644 index f0ddccb70b..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdQuad_t.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:969
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class HmdQuad_t extends Structure { - /** - * struct vr::HmdVector3_t[4]
    - * C type : HmdVector3_t[4] - */ - public HmdVector3_t[] vCorners = new HmdVector3_t[4]; - public HmdQuad_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("vCorners"); - } - /** - * @param vCorners struct vr::HmdVector3_t[4]
    - * C type : HmdVector3_t[4] - */ - public HmdQuad_t(HmdVector3_t vCorners[]) { - super(); - if ((vCorners.length != this.vCorners.length)) - throw new IllegalArgumentException("Wrong array size !"); - this.vCorners = vCorners; - } - public HmdQuad_t(Pointer peer) { - super(peer); - } - public static class ByReference extends HmdQuad_t implements Structure.ByReference { - - }; - public static class ByValue extends HmdQuad_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdQuaternion_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdQuaternion_t.java deleted file mode 100644 index a02389493d..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdQuaternion_t.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:959
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class HmdQuaternion_t extends Structure { - public double w; - public double x; - public double y; - public double z; - public HmdQuaternion_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("w", "x", "y", "z"); - } - public HmdQuaternion_t(double w, double x, double y, double z) { - super(); - this.w = w; - this.x = x; - this.y = y; - this.z = z; - } - public HmdQuaternion_t(Pointer peer) { - super(peer); - } - public static class ByReference extends HmdQuaternion_t implements Structure.ByReference { - - }; - public static class ByValue extends HmdQuaternion_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdRect2_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdRect2_t.java deleted file mode 100644 index 39fce7ebbd..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdRect2_t.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:973
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class HmdRect2_t extends Structure { - /** C type : HmdVector2_t */ - public HmdVector2_t vTopLeft; - /** C type : HmdVector2_t */ - public HmdVector2_t vBottomRight; - public HmdRect2_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("vTopLeft", "vBottomRight"); - } - /** - * @param vTopLeft C type : HmdVector2_t
    - * @param vBottomRight C type : HmdVector2_t - */ - public HmdRect2_t(HmdVector2_t vTopLeft, HmdVector2_t vBottomRight) { - super(); - this.vTopLeft = vTopLeft; - this.vBottomRight = vBottomRight; - } - public HmdRect2_t(Pointer peer) { - super(peer); - } - public static class ByReference extends HmdRect2_t implements Structure.ByReference { - - }; - public static class ByValue extends HmdRect2_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector2_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector2_t.java deleted file mode 100644 index 700bf9a5e2..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector2_t.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:953
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class HmdVector2_t extends Structure { - /** - * float[2]
    - * C type : float[2] - */ - public float[] v = new float[2]; - public HmdVector2_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("v"); - } - /** - * @param v float[2]
    - * C type : float[2] - */ - public HmdVector2_t(float v[]) { - super(); - if ((v.length != this.v.length)) - throw new IllegalArgumentException("Wrong array size !"); - this.v = v; - } - public HmdVector2_t(Pointer peer) { - super(peer); - } - public static class ByReference extends HmdVector2_t implements Structure.ByReference { - - }; - public static class ByValue extends HmdVector2_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector3_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector3_t.java deleted file mode 100644 index b136791e12..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector3_t.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:941
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class HmdVector3_t extends Structure { - /** - * float[3]
    - * C type : float[3] - */ - public float[] v = new float[3]; - public HmdVector3_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("v"); - } - /** - * @param v float[3]
    - * C type : float[3] - */ - public HmdVector3_t(float v[]) { - super(); - if ((v.length != this.v.length)) - throw new IllegalArgumentException("Wrong array size !"); - this.v = v; - } - public HmdVector3_t(Pointer peer) { - super(peer); - } - public static class ByReference extends HmdVector3_t implements Structure.ByReference { - - }; - public static class ByValue extends HmdVector3_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector3d_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector3d_t.java deleted file mode 100644 index 8a4f0b4994..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector3d_t.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:949
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class HmdVector3d_t extends Structure { - /** - * double[3]
    - * C type : double[3] - */ - public double[] v = new double[3]; - public HmdVector3d_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("v"); - } - /** - * @param v double[3]
    - * C type : double[3] - */ - public HmdVector3d_t(double v[]) { - super(); - if ((v.length != this.v.length)) - throw new IllegalArgumentException("Wrong array size !"); - this.v = v; - } - public HmdVector3d_t(Pointer peer) { - super(peer); - } - public static class ByReference extends HmdVector3d_t implements Structure.ByReference { - - }; - public static class ByValue extends HmdVector3d_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector4_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector4_t.java deleted file mode 100644 index c2c3d06a35..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector4_t.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:945
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class HmdVector4_t extends Structure { - /** - * float[4]
    - * C type : float[4] - */ - public float[] v = new float[4]; - public HmdVector4_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("v"); - } - /** - * @param v float[4]
    - * C type : float[4] - */ - public HmdVector4_t(float v[]) { - super(); - if ((v.length != this.v.length)) - throw new IllegalArgumentException("Wrong array size !"); - this.v = v; - } - public HmdVector4_t(Pointer peer) { - super(peer); - } - public static class ByReference extends HmdVector4_t implements Structure.ByReference { - - }; - public static class ByValue extends HmdVector4_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/IntersectionMaskCircle_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/IntersectionMaskCircle_t.java deleted file mode 100644 index 2cf98516fd..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/IntersectionMaskCircle_t.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1227
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class IntersectionMaskCircle_t extends Structure { - public float m_flCenterX; - public float m_flCenterY; - public float m_flRadius; - public IntersectionMaskCircle_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("m_flCenterX", "m_flCenterY", "m_flRadius"); - } - public IntersectionMaskCircle_t(float m_flCenterX, float m_flCenterY, float m_flRadius) { - super(); - this.m_flCenterX = m_flCenterX; - this.m_flCenterY = m_flCenterY; - this.m_flRadius = m_flRadius; - } - public IntersectionMaskCircle_t(Pointer peer) { - super(peer); - } - public static class ByReference extends IntersectionMaskCircle_t implements Structure.ByReference { - - }; - public static class ByValue extends IntersectionMaskCircle_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/IntersectionMaskRectangle_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/IntersectionMaskRectangle_t.java deleted file mode 100644 index bb9b3e0da5..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/IntersectionMaskRectangle_t.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1222
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class IntersectionMaskRectangle_t extends Structure { - public float m_flTopLeftX; - public float m_flTopLeftY; - public float m_flWidth; - public float m_flHeight; - public IntersectionMaskRectangle_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("m_flTopLeftX", "m_flTopLeftY", "m_flWidth", "m_flHeight"); - } - public IntersectionMaskRectangle_t(float m_flTopLeftX, float m_flTopLeftY, float m_flWidth, float m_flHeight) { - super(); - this.m_flTopLeftX = m_flTopLeftX; - this.m_flTopLeftY = m_flTopLeftY; - this.m_flWidth = m_flWidth; - this.m_flHeight = m_flHeight; - } - public IntersectionMaskRectangle_t(Pointer peer) { - super(peer); - } - public static class ByReference extends IntersectionMaskRectangle_t implements Structure.ByReference { - - }; - public static class ByValue extends IntersectionMaskRectangle_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/JOpenVRLibrary.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/JOpenVRLibrary.java deleted file mode 100644 index 2a3b99733f..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/JOpenVRLibrary.java +++ /dev/null @@ -1,1892 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Library; -import com.sun.jna.Native; -import com.sun.jna.NativeLibrary; -import com.sun.jna.Pointer; -import com.sun.jna.PointerType; -import com.sun.jna.ptr.IntByReference; -import java.nio.IntBuffer; -import java.util.logging.Logger; -/** - * JNA Wrapper for library JOpenVR
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class JOpenVRLibrary implements Library { - - private static final Logger logger = Logger.getLogger(JOpenVRLibrary.class.getName()); - - private static String JNA_LIBRARY_NAME; - private static NativeLibrary JNA_NATIVE_LIB; - - /** - * The system property that specifies an implementation of OpenVR (openvr_api file) to use. - * This property has to be set at the program launch using -D connector. - * If this property is not set, the embedded library is loaded. - */ - public static final String JNA_OPENVR_LIBRARY_PATH = "openvr.library.path"; -/* - static { - init(); - } -*/ - /** - * Init the native binding to the underlying system library. - * @return true if the link is effective and false otherwise. - */ - public static void init() throws UnsatisfiedLinkError { - Native.unregister(JOpenVRLibrary.class); - - String path = System.getProperty(JNA_OPENVR_LIBRARY_PATH); - if (path != null){ - - JNA_LIBRARY_NAME = path; - - logger.config("Using OpenVR implementation located at "+JNA_LIBRARY_NAME); - - JNA_NATIVE_LIB = NativeLibrary.getInstance(JOpenVRLibrary.JNA_LIBRARY_NAME); - Native.register(JOpenVRLibrary.class, JOpenVRLibrary.JNA_NATIVE_LIB); - } else { - - JNA_LIBRARY_NAME = "openvr_api"; - - logger.config("Using embedded OpenVR implementation "+JOpenVRLibrary.JNA_LIBRARY_NAME); - - JNA_NATIVE_LIB = NativeLibrary.getInstance(JOpenVRLibrary.JNA_LIBRARY_NAME); - Native.register(JOpenVRLibrary.class, JOpenVRLibrary.JNA_NATIVE_LIB); - } - } - - /** - * Get the name of the underlying system library. - * @return the name of the underlying system library. - */ - public static String getSystemLibraryName(){ - return ""+JNA_LIBRARY_NAME; - } - - /** - * native declaration : headers\openvr_capi.h:181
    - * enum values - */ - public static interface EVREye { - /** native declaration : headers\openvr_capi.h:179 */ - public static final int EVREye_Eye_Left = 0; - /** native declaration : headers\openvr_capi.h:180 */ - public static final int EVREye_Eye_Right = 1; - }; - /** - * native declaration : headers\openvr_capi.h:188
    - * enum values - */ - public static interface ETextureType { - /** native declaration : headers\openvr_capi.h:183 */ - public static final int ETextureType_TextureType_DirectX = 0; - /** native declaration : headers\openvr_capi.h:184 */ - public static final int ETextureType_TextureType_OpenGL = 1; - /** native declaration : headers\openvr_capi.h:185 */ - public static final int ETextureType_TextureType_Vulkan = 2; - /** native declaration : headers\openvr_capi.h:186 */ - public static final int ETextureType_TextureType_IOSurface = 3; - /** native declaration : headers\openvr_capi.h:187 */ - public static final int ETextureType_TextureType_DirectX12 = 4; - }; - /** - * native declaration : headers\openvr_capi.h:193
    - * enum values - */ - public static interface EColorSpace { - /** native declaration : headers\openvr_capi.h:190 */ - public static final int EColorSpace_ColorSpace_Auto = 0; - /** native declaration : headers\openvr_capi.h:191 */ - public static final int EColorSpace_ColorSpace_Gamma = 1; - /** native declaration : headers\openvr_capi.h:192 */ - public static final int EColorSpace_ColorSpace_Linear = 2; - }; - /** - * native declaration : headers\openvr_capi.h:200
    - * enum values - */ - public static interface ETrackingResult { - /** native declaration : headers\openvr_capi.h:195 */ - public static final int ETrackingResult_TrackingResult_Uninitialized = 1; - /** native declaration : headers\openvr_capi.h:196 */ - public static final int ETrackingResult_TrackingResult_Calibrating_InProgress = 100; - /** native declaration : headers\openvr_capi.h:197 */ - public static final int ETrackingResult_TrackingResult_Calibrating_OutOfRange = 101; - /** native declaration : headers\openvr_capi.h:198 */ - public static final int ETrackingResult_TrackingResult_Running_OK = 200; - /** native declaration : headers\openvr_capi.h:199 */ - public static final int ETrackingResult_TrackingResult_Running_OutOfRange = 201; - }; - /** - * native declaration : headers\openvr_capi.h:208
    - * enum values - */ - public static interface ETrackedDeviceClass { - /** native declaration : headers\openvr_capi.h:202 */ - public static final int ETrackedDeviceClass_TrackedDeviceClass_Invalid = 0; - /** native declaration : headers\openvr_capi.h:203 */ - public static final int ETrackedDeviceClass_TrackedDeviceClass_HMD = 1; - /** native declaration : headers\openvr_capi.h:204 */ - public static final int ETrackedDeviceClass_TrackedDeviceClass_Controller = 2; - /** native declaration : headers\openvr_capi.h:205 */ - public static final int ETrackedDeviceClass_TrackedDeviceClass_GenericTracker = 3; - /** native declaration : headers\openvr_capi.h:206 */ - public static final int ETrackedDeviceClass_TrackedDeviceClass_TrackingReference = 4; - /** native declaration : headers\openvr_capi.h:207 */ - public static final int ETrackedDeviceClass_TrackedDeviceClass_DisplayRedirect = 5; - }; - /** - * native declaration : headers\openvr_capi.h:213
    - * enum values - */ - public static interface ETrackedControllerRole { - /** native declaration : headers\openvr_capi.h:210 */ - public static final int ETrackedControllerRole_TrackedControllerRole_Invalid = 0; - /** native declaration : headers\openvr_capi.h:211 */ - public static final int ETrackedControllerRole_TrackedControllerRole_LeftHand = 1; - /** native declaration : headers\openvr_capi.h:212 */ - public static final int ETrackedControllerRole_TrackedControllerRole_RightHand = 2; - }; - /** - * native declaration : headers\openvr_capi.h:218
    - * enum values - */ - public static interface ETrackingUniverseOrigin { - /** native declaration : headers\openvr_capi.h:215 */ - public static final int ETrackingUniverseOrigin_TrackingUniverseSeated = 0; - /** native declaration : headers\openvr_capi.h:216 */ - public static final int ETrackingUniverseOrigin_TrackingUniverseStanding = 1; - /** native declaration : headers\openvr_capi.h:217 */ - public static final int ETrackingUniverseOrigin_TrackingUniverseRawAndUncalibrated = 2; - }; - /** - * native declaration : headers\openvr_capi.h:339
    - * enum values - */ - public static interface ETrackedDeviceProperty { - /** native declaration : headers\openvr_capi.h:220 */ - public static final int ETrackedDeviceProperty_Prop_Invalid = 0; - /** native declaration : headers\openvr_capi.h:221 */ - public static final int ETrackedDeviceProperty_Prop_TrackingSystemName_String = 1000; - /** native declaration : headers\openvr_capi.h:222 */ - public static final int ETrackedDeviceProperty_Prop_ModelNumber_String = 1001; - /** native declaration : headers\openvr_capi.h:223 */ - public static final int ETrackedDeviceProperty_Prop_SerialNumber_String = 1002; - /** native declaration : headers\openvr_capi.h:224 */ - public static final int ETrackedDeviceProperty_Prop_RenderModelName_String = 1003; - /** native declaration : headers\openvr_capi.h:225 */ - public static final int ETrackedDeviceProperty_Prop_WillDriftInYaw_Bool = 1004; - /** native declaration : headers\openvr_capi.h:226 */ - public static final int ETrackedDeviceProperty_Prop_ManufacturerName_String = 1005; - /** native declaration : headers\openvr_capi.h:227 */ - public static final int ETrackedDeviceProperty_Prop_TrackingFirmwareVersion_String = 1006; - /** native declaration : headers\openvr_capi.h:228 */ - public static final int ETrackedDeviceProperty_Prop_HardwareRevision_String = 1007; - /** native declaration : headers\openvr_capi.h:229 */ - public static final int ETrackedDeviceProperty_Prop_AllWirelessDongleDescriptions_String = 1008; - /** native declaration : headers\openvr_capi.h:230 */ - public static final int ETrackedDeviceProperty_Prop_ConnectedWirelessDongle_String = 1009; - /** native declaration : headers\openvr_capi.h:231 */ - public static final int ETrackedDeviceProperty_Prop_DeviceIsWireless_Bool = 1010; - /** native declaration : headers\openvr_capi.h:232 */ - public static final int ETrackedDeviceProperty_Prop_DeviceIsCharging_Bool = 1011; - /** native declaration : headers\openvr_capi.h:233 */ - public static final int ETrackedDeviceProperty_Prop_DeviceBatteryPercentage_Float = 1012; - /** native declaration : headers\openvr_capi.h:234 */ - public static final int ETrackedDeviceProperty_Prop_StatusDisplayTransform_Matrix34 = 1013; - /** native declaration : headers\openvr_capi.h:235 */ - public static final int ETrackedDeviceProperty_Prop_Firmware_UpdateAvailable_Bool = 1014; - /** native declaration : headers\openvr_capi.h:236 */ - public static final int ETrackedDeviceProperty_Prop_Firmware_ManualUpdate_Bool = 1015; - /** native declaration : headers\openvr_capi.h:237 */ - public static final int ETrackedDeviceProperty_Prop_Firmware_ManualUpdateURL_String = 1016; - /** native declaration : headers\openvr_capi.h:238 */ - public static final int ETrackedDeviceProperty_Prop_HardwareRevision_Uint64 = 1017; - /** native declaration : headers\openvr_capi.h:239 */ - public static final int ETrackedDeviceProperty_Prop_FirmwareVersion_Uint64 = 1018; - /** native declaration : headers\openvr_capi.h:240 */ - public static final int ETrackedDeviceProperty_Prop_FPGAVersion_Uint64 = 1019; - /** native declaration : headers\openvr_capi.h:241 */ - public static final int ETrackedDeviceProperty_Prop_VRCVersion_Uint64 = 1020; - /** native declaration : headers\openvr_capi.h:242 */ - public static final int ETrackedDeviceProperty_Prop_RadioVersion_Uint64 = 1021; - /** native declaration : headers\openvr_capi.h:243 */ - public static final int ETrackedDeviceProperty_Prop_DongleVersion_Uint64 = 1022; - /** native declaration : headers\openvr_capi.h:244 */ - public static final int ETrackedDeviceProperty_Prop_BlockServerShutdown_Bool = 1023; - /** native declaration : headers\openvr_capi.h:245 */ - public static final int ETrackedDeviceProperty_Prop_CanUnifyCoordinateSystemWithHmd_Bool = 1024; - /** native declaration : headers\openvr_capi.h:246 */ - public static final int ETrackedDeviceProperty_Prop_ContainsProximitySensor_Bool = 1025; - /** native declaration : headers\openvr_capi.h:247 */ - public static final int ETrackedDeviceProperty_Prop_DeviceProvidesBatteryStatus_Bool = 1026; - /** native declaration : headers\openvr_capi.h:248 */ - public static final int ETrackedDeviceProperty_Prop_DeviceCanPowerOff_Bool = 1027; - /** native declaration : headers\openvr_capi.h:249 */ - public static final int ETrackedDeviceProperty_Prop_Firmware_ProgrammingTarget_String = 1028; - /** native declaration : headers\openvr_capi.h:250 */ - public static final int ETrackedDeviceProperty_Prop_DeviceClass_Int32 = 1029; - /** native declaration : headers\openvr_capi.h:251 */ - public static final int ETrackedDeviceProperty_Prop_HasCamera_Bool = 1030; - /** native declaration : headers\openvr_capi.h:252 */ - public static final int ETrackedDeviceProperty_Prop_DriverVersion_String = 1031; - /** native declaration : headers\openvr_capi.h:253 */ - public static final int ETrackedDeviceProperty_Prop_Firmware_ForceUpdateRequired_Bool = 1032; - /** native declaration : headers\openvr_capi.h:254 */ - public static final int ETrackedDeviceProperty_Prop_ViveSystemButtonFixRequired_Bool = 1033; - /** native declaration : headers\openvr_capi.h:255 */ - public static final int ETrackedDeviceProperty_Prop_ParentDriver_Uint64 = 1034; - /** native declaration : headers\openvr_capi.h:256 */ - public static final int ETrackedDeviceProperty_Prop_ResourceRoot_String = 1035; - /** native declaration : headers\openvr_capi.h:257 */ - public static final int ETrackedDeviceProperty_Prop_ReportsTimeSinceVSync_Bool = 2000; - /** native declaration : headers\openvr_capi.h:258 */ - public static final int ETrackedDeviceProperty_Prop_SecondsFromVsyncToPhotons_Float = 2001; - /** native declaration : headers\openvr_capi.h:259 */ - public static final int ETrackedDeviceProperty_Prop_DisplayFrequency_Float = 2002; - /** native declaration : headers\openvr_capi.h:260 */ - public static final int ETrackedDeviceProperty_Prop_UserIpdMeters_Float = 2003; - /** native declaration : headers\openvr_capi.h:261 */ - public static final int ETrackedDeviceProperty_Prop_CurrentUniverseId_Uint64 = 2004; - /** native declaration : headers\openvr_capi.h:262 */ - public static final int ETrackedDeviceProperty_Prop_PreviousUniverseId_Uint64 = 2005; - /** native declaration : headers\openvr_capi.h:263 */ - public static final int ETrackedDeviceProperty_Prop_DisplayFirmwareVersion_Uint64 = 2006; - /** native declaration : headers\openvr_capi.h:264 */ - public static final int ETrackedDeviceProperty_Prop_IsOnDesktop_Bool = 2007; - /** native declaration : headers\openvr_capi.h:265 */ - public static final int ETrackedDeviceProperty_Prop_DisplayMCType_Int32 = 2008; - /** native declaration : headers\openvr_capi.h:266 */ - public static final int ETrackedDeviceProperty_Prop_DisplayMCOffset_Float = 2009; - /** native declaration : headers\openvr_capi.h:267 */ - public static final int ETrackedDeviceProperty_Prop_DisplayMCScale_Float = 2010; - /** native declaration : headers\openvr_capi.h:268 */ - public static final int ETrackedDeviceProperty_Prop_EdidVendorID_Int32 = 2011; - /** native declaration : headers\openvr_capi.h:269 */ - public static final int ETrackedDeviceProperty_Prop_DisplayMCImageLeft_String = 2012; - /** native declaration : headers\openvr_capi.h:270 */ - public static final int ETrackedDeviceProperty_Prop_DisplayMCImageRight_String = 2013; - /** native declaration : headers\openvr_capi.h:271 */ - public static final int ETrackedDeviceProperty_Prop_DisplayGCBlackClamp_Float = 2014; - /** native declaration : headers\openvr_capi.h:272 */ - public static final int ETrackedDeviceProperty_Prop_EdidProductID_Int32 = 2015; - /** native declaration : headers\openvr_capi.h:273 */ - public static final int ETrackedDeviceProperty_Prop_CameraToHeadTransform_Matrix34 = 2016; - /** native declaration : headers\openvr_capi.h:274 */ - public static final int ETrackedDeviceProperty_Prop_DisplayGCType_Int32 = 2017; - /** native declaration : headers\openvr_capi.h:275 */ - public static final int ETrackedDeviceProperty_Prop_DisplayGCOffset_Float = 2018; - /** native declaration : headers\openvr_capi.h:276 */ - public static final int ETrackedDeviceProperty_Prop_DisplayGCScale_Float = 2019; - /** native declaration : headers\openvr_capi.h:277 */ - public static final int ETrackedDeviceProperty_Prop_DisplayGCPrescale_Float = 2020; - /** native declaration : headers\openvr_capi.h:278 */ - public static final int ETrackedDeviceProperty_Prop_DisplayGCImage_String = 2021; - /** native declaration : headers\openvr_capi.h:279 */ - public static final int ETrackedDeviceProperty_Prop_LensCenterLeftU_Float = 2022; - /** native declaration : headers\openvr_capi.h:280 */ - public static final int ETrackedDeviceProperty_Prop_LensCenterLeftV_Float = 2023; - /** native declaration : headers\openvr_capi.h:281 */ - public static final int ETrackedDeviceProperty_Prop_LensCenterRightU_Float = 2024; - /** native declaration : headers\openvr_capi.h:282 */ - public static final int ETrackedDeviceProperty_Prop_LensCenterRightV_Float = 2025; - /** native declaration : headers\openvr_capi.h:283 */ - public static final int ETrackedDeviceProperty_Prop_UserHeadToEyeDepthMeters_Float = 2026; - /** native declaration : headers\openvr_capi.h:284 */ - public static final int ETrackedDeviceProperty_Prop_CameraFirmwareVersion_Uint64 = 2027; - /** native declaration : headers\openvr_capi.h:285 */ - public static final int ETrackedDeviceProperty_Prop_CameraFirmwareDescription_String = 2028; - /** native declaration : headers\openvr_capi.h:286 */ - public static final int ETrackedDeviceProperty_Prop_DisplayFPGAVersion_Uint64 = 2029; - /** native declaration : headers\openvr_capi.h:287 */ - public static final int ETrackedDeviceProperty_Prop_DisplayBootloaderVersion_Uint64 = 2030; - /** native declaration : headers\openvr_capi.h:288 */ - public static final int ETrackedDeviceProperty_Prop_DisplayHardwareVersion_Uint64 = 2031; - /** native declaration : headers\openvr_capi.h:289 */ - public static final int ETrackedDeviceProperty_Prop_AudioFirmwareVersion_Uint64 = 2032; - /** native declaration : headers\openvr_capi.h:290 */ - public static final int ETrackedDeviceProperty_Prop_CameraCompatibilityMode_Int32 = 2033; - /** native declaration : headers\openvr_capi.h:291 */ - public static final int ETrackedDeviceProperty_Prop_ScreenshotHorizontalFieldOfViewDegrees_Float = 2034; - /** native declaration : headers\openvr_capi.h:292 */ - public static final int ETrackedDeviceProperty_Prop_ScreenshotVerticalFieldOfViewDegrees_Float = 2035; - /** native declaration : headers\openvr_capi.h:293 */ - public static final int ETrackedDeviceProperty_Prop_DisplaySuppressed_Bool = 2036; - /** native declaration : headers\openvr_capi.h:294 */ - public static final int ETrackedDeviceProperty_Prop_DisplayAllowNightMode_Bool = 2037; - /** native declaration : headers\openvr_capi.h:295 */ - public static final int ETrackedDeviceProperty_Prop_DisplayMCImageWidth_Int32 = 2038; - /** native declaration : headers\openvr_capi.h:296 */ - public static final int ETrackedDeviceProperty_Prop_DisplayMCImageHeight_Int32 = 2039; - /** native declaration : headers\openvr_capi.h:297 */ - public static final int ETrackedDeviceProperty_Prop_DisplayMCImageNumChannels_Int32 = 2040; - /** native declaration : headers\openvr_capi.h:298 */ - public static final int ETrackedDeviceProperty_Prop_DisplayMCImageData_Binary = 2041; - /** native declaration : headers\openvr_capi.h:299 */ - public static final int ETrackedDeviceProperty_Prop_SecondsFromPhotonsToVblank_Float = 2042; - /** native declaration : headers\openvr_capi.h:300 */ - public static final int ETrackedDeviceProperty_Prop_DriverDirectModeSendsVsyncEvents_Bool = 2043; - /** native declaration : headers\openvr_capi.h:301 */ - public static final int ETrackedDeviceProperty_Prop_DisplayDebugMode_Bool = 2044; - /** native declaration : headers\openvr_capi.h:302 */ - public static final int ETrackedDeviceProperty_Prop_GraphicsAdapterLuid_Uint64 = 2045; - /** native declaration : headers\openvr_capi.h:303 */ - public static final int ETrackedDeviceProperty_Prop_DriverProvidedChaperonePath_String = 2048; - /** native declaration : headers\openvr_capi.h:304 */ - public static final int ETrackedDeviceProperty_Prop_AttachedDeviceId_String = 3000; - /** native declaration : headers\openvr_capi.h:305 */ - public static final int ETrackedDeviceProperty_Prop_SupportedButtons_Uint64 = 3001; - /** native declaration : headers\openvr_capi.h:306 */ - public static final int ETrackedDeviceProperty_Prop_Axis0Type_Int32 = 3002; - /** native declaration : headers\openvr_capi.h:307 */ - public static final int ETrackedDeviceProperty_Prop_Axis1Type_Int32 = 3003; - /** native declaration : headers\openvr_capi.h:308 */ - public static final int ETrackedDeviceProperty_Prop_Axis2Type_Int32 = 3004; - /** native declaration : headers\openvr_capi.h:309 */ - public static final int ETrackedDeviceProperty_Prop_Axis3Type_Int32 = 3005; - /** native declaration : headers\openvr_capi.h:310 */ - public static final int ETrackedDeviceProperty_Prop_Axis4Type_Int32 = 3006; - /** native declaration : headers\openvr_capi.h:311 */ - public static final int ETrackedDeviceProperty_Prop_ControllerRoleHint_Int32 = 3007; - /** native declaration : headers\openvr_capi.h:312 */ - public static final int ETrackedDeviceProperty_Prop_FieldOfViewLeftDegrees_Float = 4000; - /** native declaration : headers\openvr_capi.h:313 */ - public static final int ETrackedDeviceProperty_Prop_FieldOfViewRightDegrees_Float = 4001; - /** native declaration : headers\openvr_capi.h:314 */ - public static final int ETrackedDeviceProperty_Prop_FieldOfViewTopDegrees_Float = 4002; - /** native declaration : headers\openvr_capi.h:315 */ - public static final int ETrackedDeviceProperty_Prop_FieldOfViewBottomDegrees_Float = 4003; - /** native declaration : headers\openvr_capi.h:316 */ - public static final int ETrackedDeviceProperty_Prop_TrackingRangeMinimumMeters_Float = 4004; - /** native declaration : headers\openvr_capi.h:317 */ - public static final int ETrackedDeviceProperty_Prop_TrackingRangeMaximumMeters_Float = 4005; - /** native declaration : headers\openvr_capi.h:318 */ - public static final int ETrackedDeviceProperty_Prop_ModeLabel_String = 4006; - /** native declaration : headers\openvr_capi.h:319 */ - public static final int ETrackedDeviceProperty_Prop_IconPathName_String = 5000; - /** native declaration : headers\openvr_capi.h:320 */ - public static final int ETrackedDeviceProperty_Prop_NamedIconPathDeviceOff_String = 5001; - /** native declaration : headers\openvr_capi.h:321 */ - public static final int ETrackedDeviceProperty_Prop_NamedIconPathDeviceSearching_String = 5002; - /** native declaration : headers\openvr_capi.h:322 */ - public static final int ETrackedDeviceProperty_Prop_NamedIconPathDeviceSearchingAlert_String = 5003; - /** native declaration : headers\openvr_capi.h:323 */ - public static final int ETrackedDeviceProperty_Prop_NamedIconPathDeviceReady_String = 5004; - /** native declaration : headers\openvr_capi.h:324 */ - public static final int ETrackedDeviceProperty_Prop_NamedIconPathDeviceReadyAlert_String = 5005; - /** native declaration : headers\openvr_capi.h:325 */ - public static final int ETrackedDeviceProperty_Prop_NamedIconPathDeviceNotReady_String = 5006; - /** native declaration : headers\openvr_capi.h:326 */ - public static final int ETrackedDeviceProperty_Prop_NamedIconPathDeviceStandby_String = 5007; - /** native declaration : headers\openvr_capi.h:327 */ - public static final int ETrackedDeviceProperty_Prop_NamedIconPathDeviceAlertLow_String = 5008; - /** native declaration : headers\openvr_capi.h:328 */ - public static final int ETrackedDeviceProperty_Prop_DisplayHiddenArea_Binary_Start = 5100; - /** native declaration : headers\openvr_capi.h:329 */ - public static final int ETrackedDeviceProperty_Prop_DisplayHiddenArea_Binary_End = 5150; - /** native declaration : headers\openvr_capi.h:330 */ - public static final int ETrackedDeviceProperty_Prop_UserConfigPath_String = 6000; - /** native declaration : headers\openvr_capi.h:331 */ - public static final int ETrackedDeviceProperty_Prop_InstallPath_String = 6001; - /** native declaration : headers\openvr_capi.h:332 */ - public static final int ETrackedDeviceProperty_Prop_HasDisplayComponent_Bool = 6002; - /** native declaration : headers\openvr_capi.h:333 */ - public static final int ETrackedDeviceProperty_Prop_HasControllerComponent_Bool = 6003; - /** native declaration : headers\openvr_capi.h:334 */ - public static final int ETrackedDeviceProperty_Prop_HasCameraComponent_Bool = 6004; - /** native declaration : headers\openvr_capi.h:335 */ - public static final int ETrackedDeviceProperty_Prop_HasDriverDirectModeComponent_Bool = 6005; - /** native declaration : headers\openvr_capi.h:336 */ - public static final int ETrackedDeviceProperty_Prop_HasVirtualDisplayComponent_Bool = 6006; - /** native declaration : headers\openvr_capi.h:337 */ - public static final int ETrackedDeviceProperty_Prop_VendorSpecific_Reserved_Start = 10000; - /** native declaration : headers\openvr_capi.h:338 */ - public static final int ETrackedDeviceProperty_Prop_VendorSpecific_Reserved_End = 10999; - }; - /** - * native declaration : headers\openvr_capi.h:353
    - * enum values - */ - public static interface ETrackedPropertyError { - /** native declaration : headers\openvr_capi.h:341 */ - public static final int ETrackedPropertyError_TrackedProp_Success = 0; - /** native declaration : headers\openvr_capi.h:342 */ - public static final int ETrackedPropertyError_TrackedProp_WrongDataType = 1; - /** native declaration : headers\openvr_capi.h:343 */ - public static final int ETrackedPropertyError_TrackedProp_WrongDeviceClass = 2; - /** native declaration : headers\openvr_capi.h:344 */ - public static final int ETrackedPropertyError_TrackedProp_BufferTooSmall = 3; - /** native declaration : headers\openvr_capi.h:345 */ - public static final int ETrackedPropertyError_TrackedProp_UnknownProperty = 4; - /** native declaration : headers\openvr_capi.h:346 */ - public static final int ETrackedPropertyError_TrackedProp_InvalidDevice = 5; - /** native declaration : headers\openvr_capi.h:347 */ - public static final int ETrackedPropertyError_TrackedProp_CouldNotContactServer = 6; - /** native declaration : headers\openvr_capi.h:348 */ - public static final int ETrackedPropertyError_TrackedProp_ValueNotProvidedByDevice = 7; - /** native declaration : headers\openvr_capi.h:349 */ - public static final int ETrackedPropertyError_TrackedProp_StringExceedsMaximumLength = 8; - /** native declaration : headers\openvr_capi.h:350 */ - public static final int ETrackedPropertyError_TrackedProp_NotYetAvailable = 9; - /** native declaration : headers\openvr_capi.h:351 */ - public static final int ETrackedPropertyError_TrackedProp_PermissionDenied = 10; - /** native declaration : headers\openvr_capi.h:352 */ - public static final int ETrackedPropertyError_TrackedProp_InvalidOperation = 11; - }; - /** - * native declaration : headers\openvr_capi.h:359
    - * enum values - */ - public static interface EVRSubmitFlags { - /** native declaration : headers\openvr_capi.h:355 */ - public static final int EVRSubmitFlags_Submit_Default = 0; - /** native declaration : headers\openvr_capi.h:356 */ - public static final int EVRSubmitFlags_Submit_LensDistortionAlreadyApplied = 1; - /** native declaration : headers\openvr_capi.h:357 */ - public static final int EVRSubmitFlags_Submit_GlRenderBuffer = 2; - /** native declaration : headers\openvr_capi.h:358 */ - public static final int EVRSubmitFlags_Submit_Reserved = 4; - }; - /** - * native declaration : headers\openvr_capi.h:370
    - * enum values - */ - public static interface EVRState { - /** native declaration : headers\openvr_capi.h:361 */ - public static final int EVRState_VRState_Undefined = -1; - /** native declaration : headers\openvr_capi.h:362 */ - public static final int EVRState_VRState_Off = 0; - /** native declaration : headers\openvr_capi.h:363 */ - public static final int EVRState_VRState_Searching = 1; - /** native declaration : headers\openvr_capi.h:364 */ - public static final int EVRState_VRState_Searching_Alert = 2; - /** native declaration : headers\openvr_capi.h:365 */ - public static final int EVRState_VRState_Ready = 3; - /** native declaration : headers\openvr_capi.h:366 */ - public static final int EVRState_VRState_Ready_Alert = 4; - /** native declaration : headers\openvr_capi.h:367 */ - public static final int EVRState_VRState_NotReady = 5; - /** native declaration : headers\openvr_capi.h:368 */ - public static final int EVRState_VRState_Standby = 6; - /** native declaration : headers\openvr_capi.h:369 */ - public static final int EVRState_VRState_Ready_Alert_Low = 7; - }; - /** - * native declaration : headers\openvr_capi.h:486
    - * enum values - */ - public static interface EVREventType { - /** native declaration : headers\openvr_capi.h:372 */ - public static final int EVREventType_VREvent_None = 0; - /** native declaration : headers\openvr_capi.h:373 */ - public static final int EVREventType_VREvent_TrackedDeviceActivated = 100; - /** native declaration : headers\openvr_capi.h:374 */ - public static final int EVREventType_VREvent_TrackedDeviceDeactivated = 101; - /** native declaration : headers\openvr_capi.h:375 */ - public static final int EVREventType_VREvent_TrackedDeviceUpdated = 102; - /** native declaration : headers\openvr_capi.h:376 */ - public static final int EVREventType_VREvent_TrackedDeviceUserInteractionStarted = 103; - /** native declaration : headers\openvr_capi.h:377 */ - public static final int EVREventType_VREvent_TrackedDeviceUserInteractionEnded = 104; - /** native declaration : headers\openvr_capi.h:378 */ - public static final int EVREventType_VREvent_IpdChanged = 105; - /** native declaration : headers\openvr_capi.h:379 */ - public static final int EVREventType_VREvent_EnterStandbyMode = 106; - /** native declaration : headers\openvr_capi.h:380 */ - public static final int EVREventType_VREvent_LeaveStandbyMode = 107; - /** native declaration : headers\openvr_capi.h:381 */ - public static final int EVREventType_VREvent_TrackedDeviceRoleChanged = 108; - /** native declaration : headers\openvr_capi.h:382 */ - public static final int EVREventType_VREvent_WatchdogWakeUpRequested = 109; - /** native declaration : headers\openvr_capi.h:383 */ - public static final int EVREventType_VREvent_LensDistortionChanged = 110; - /** native declaration : headers\openvr_capi.h:384 */ - public static final int EVREventType_VREvent_PropertyChanged = 111; - /** native declaration : headers\openvr_capi.h:385 */ - public static final int EVREventType_VREvent_WirelessDisconnect = 112; - /** native declaration : headers\openvr_capi.h:386 */ - public static final int EVREventType_VREvent_WirelessReconnect = 113; - /** native declaration : headers\openvr_capi.h:387 */ - public static final int EVREventType_VREvent_ButtonPress = 200; - /** native declaration : headers\openvr_capi.h:388 */ - public static final int EVREventType_VREvent_ButtonUnpress = 201; - /** native declaration : headers\openvr_capi.h:389 */ - public static final int EVREventType_VREvent_ButtonTouch = 202; - /** native declaration : headers\openvr_capi.h:390 */ - public static final int EVREventType_VREvent_ButtonUntouch = 203; - /** native declaration : headers\openvr_capi.h:391 */ - public static final int EVREventType_VREvent_MouseMove = 300; - /** native declaration : headers\openvr_capi.h:392 */ - public static final int EVREventType_VREvent_MouseButtonDown = 301; - /** native declaration : headers\openvr_capi.h:393 */ - public static final int EVREventType_VREvent_MouseButtonUp = 302; - /** native declaration : headers\openvr_capi.h:394 */ - public static final int EVREventType_VREvent_FocusEnter = 303; - /** native declaration : headers\openvr_capi.h:395 */ - public static final int EVREventType_VREvent_FocusLeave = 304; - /** native declaration : headers\openvr_capi.h:396 */ - public static final int EVREventType_VREvent_Scroll = 305; - /** native declaration : headers\openvr_capi.h:397 */ - public static final int EVREventType_VREvent_TouchPadMove = 306; - /** native declaration : headers\openvr_capi.h:398 */ - public static final int EVREventType_VREvent_OverlayFocusChanged = 307; - /** native declaration : headers\openvr_capi.h:399 */ - public static final int EVREventType_VREvent_InputFocusCaptured = 400; - /** native declaration : headers\openvr_capi.h:400 */ - public static final int EVREventType_VREvent_InputFocusReleased = 401; - /** native declaration : headers\openvr_capi.h:401 */ - public static final int EVREventType_VREvent_SceneFocusLost = 402; - /** native declaration : headers\openvr_capi.h:402 */ - public static final int EVREventType_VREvent_SceneFocusGained = 403; - /** native declaration : headers\openvr_capi.h:403 */ - public static final int EVREventType_VREvent_SceneApplicationChanged = 404; - /** native declaration : headers\openvr_capi.h:404 */ - public static final int EVREventType_VREvent_SceneFocusChanged = 405; - /** native declaration : headers\openvr_capi.h:405 */ - public static final int EVREventType_VREvent_InputFocusChanged = 406; - /** native declaration : headers\openvr_capi.h:406 */ - public static final int EVREventType_VREvent_SceneApplicationSecondaryRenderingStarted = 407; - /** native declaration : headers\openvr_capi.h:407 */ - public static final int EVREventType_VREvent_HideRenderModels = 410; - /** native declaration : headers\openvr_capi.h:408 */ - public static final int EVREventType_VREvent_ShowRenderModels = 411; - /** native declaration : headers\openvr_capi.h:409 */ - public static final int EVREventType_VREvent_OverlayShown = 500; - /** native declaration : headers\openvr_capi.h:410 */ - public static final int EVREventType_VREvent_OverlayHidden = 501; - /** native declaration : headers\openvr_capi.h:411 */ - public static final int EVREventType_VREvent_DashboardActivated = 502; - /** native declaration : headers\openvr_capi.h:412 */ - public static final int EVREventType_VREvent_DashboardDeactivated = 503; - /** native declaration : headers\openvr_capi.h:413 */ - public static final int EVREventType_VREvent_DashboardThumbSelected = 504; - /** native declaration : headers\openvr_capi.h:414 */ - public static final int EVREventType_VREvent_DashboardRequested = 505; - /** native declaration : headers\openvr_capi.h:415 */ - public static final int EVREventType_VREvent_ResetDashboard = 506; - /** native declaration : headers\openvr_capi.h:416 */ - public static final int EVREventType_VREvent_RenderToast = 507; - /** native declaration : headers\openvr_capi.h:417 */ - public static final int EVREventType_VREvent_ImageLoaded = 508; - /** native declaration : headers\openvr_capi.h:418 */ - public static final int EVREventType_VREvent_ShowKeyboard = 509; - /** native declaration : headers\openvr_capi.h:419 */ - public static final int EVREventType_VREvent_HideKeyboard = 510; - /** native declaration : headers\openvr_capi.h:420 */ - public static final int EVREventType_VREvent_OverlayGamepadFocusGained = 511; - /** native declaration : headers\openvr_capi.h:421 */ - public static final int EVREventType_VREvent_OverlayGamepadFocusLost = 512; - /** native declaration : headers\openvr_capi.h:422 */ - public static final int EVREventType_VREvent_OverlaySharedTextureChanged = 513; - /** native declaration : headers\openvr_capi.h:423 */ - public static final int EVREventType_VREvent_DashboardGuideButtonDown = 514; - /** native declaration : headers\openvr_capi.h:424 */ - public static final int EVREventType_VREvent_DashboardGuideButtonUp = 515; - /** native declaration : headers\openvr_capi.h:425 */ - public static final int EVREventType_VREvent_ScreenshotTriggered = 516; - /** native declaration : headers\openvr_capi.h:426 */ - public static final int EVREventType_VREvent_ImageFailed = 517; - /** native declaration : headers\openvr_capi.h:427 */ - public static final int EVREventType_VREvent_DashboardOverlayCreated = 518; - /** native declaration : headers\openvr_capi.h:428 */ - public static final int EVREventType_VREvent_RequestScreenshot = 520; - /** native declaration : headers\openvr_capi.h:429 */ - public static final int EVREventType_VREvent_ScreenshotTaken = 521; - /** native declaration : headers\openvr_capi.h:430 */ - public static final int EVREventType_VREvent_ScreenshotFailed = 522; - /** native declaration : headers\openvr_capi.h:431 */ - public static final int EVREventType_VREvent_SubmitScreenshotToDashboard = 523; - /** native declaration : headers\openvr_capi.h:432 */ - public static final int EVREventType_VREvent_ScreenshotProgressToDashboard = 524; - /** native declaration : headers\openvr_capi.h:433 */ - public static final int EVREventType_VREvent_PrimaryDashboardDeviceChanged = 525; - /** native declaration : headers\openvr_capi.h:434 */ - public static final int EVREventType_VREvent_Notification_Shown = 600; - /** native declaration : headers\openvr_capi.h:435 */ - public static final int EVREventType_VREvent_Notification_Hidden = 601; - /** native declaration : headers\openvr_capi.h:436 */ - public static final int EVREventType_VREvent_Notification_BeginInteraction = 602; - /** native declaration : headers\openvr_capi.h:437 */ - public static final int EVREventType_VREvent_Notification_Destroyed = 603; - /** native declaration : headers\openvr_capi.h:438 */ - public static final int EVREventType_VREvent_Quit = 700; - /** native declaration : headers\openvr_capi.h:439 */ - public static final int EVREventType_VREvent_ProcessQuit = 701; - /** native declaration : headers\openvr_capi.h:440 */ - public static final int EVREventType_VREvent_QuitAborted_UserPrompt = 702; - /** native declaration : headers\openvr_capi.h:441 */ - public static final int EVREventType_VREvent_QuitAcknowledged = 703; - /** native declaration : headers\openvr_capi.h:442 */ - public static final int EVREventType_VREvent_DriverRequestedQuit = 704; - /** native declaration : headers\openvr_capi.h:443 */ - public static final int EVREventType_VREvent_ChaperoneDataHasChanged = 800; - /** native declaration : headers\openvr_capi.h:444 */ - public static final int EVREventType_VREvent_ChaperoneUniverseHasChanged = 801; - /** native declaration : headers\openvr_capi.h:445 */ - public static final int EVREventType_VREvent_ChaperoneTempDataHasChanged = 802; - /** native declaration : headers\openvr_capi.h:446 */ - public static final int EVREventType_VREvent_ChaperoneSettingsHaveChanged = 803; - /** native declaration : headers\openvr_capi.h:447 */ - public static final int EVREventType_VREvent_SeatedZeroPoseReset = 804; - /** native declaration : headers\openvr_capi.h:448 */ - public static final int EVREventType_VREvent_AudioSettingsHaveChanged = 820; - /** native declaration : headers\openvr_capi.h:449 */ - public static final int EVREventType_VREvent_BackgroundSettingHasChanged = 850; - /** native declaration : headers\openvr_capi.h:450 */ - public static final int EVREventType_VREvent_CameraSettingsHaveChanged = 851; - /** native declaration : headers\openvr_capi.h:451 */ - public static final int EVREventType_VREvent_ReprojectionSettingHasChanged = 852; - /** native declaration : headers\openvr_capi.h:452 */ - public static final int EVREventType_VREvent_ModelSkinSettingsHaveChanged = 853; - /** native declaration : headers\openvr_capi.h:453 */ - public static final int EVREventType_VREvent_EnvironmentSettingsHaveChanged = 854; - /** native declaration : headers\openvr_capi.h:454 */ - public static final int EVREventType_VREvent_PowerSettingsHaveChanged = 855; - /** native declaration : headers\openvr_capi.h:455 */ - public static final int EVREventType_VREvent_EnableHomeAppSettingsHaveChanged = 856; - /** native declaration : headers\openvr_capi.h:456 */ - public static final int EVREventType_VREvent_StatusUpdate = 900; - /** native declaration : headers\openvr_capi.h:457 */ - public static final int EVREventType_VREvent_MCImageUpdated = 1000; - /** native declaration : headers\openvr_capi.h:458 */ - public static final int EVREventType_VREvent_FirmwareUpdateStarted = 1100; - /** native declaration : headers\openvr_capi.h:459 */ - public static final int EVREventType_VREvent_FirmwareUpdateFinished = 1101; - /** native declaration : headers\openvr_capi.h:460 */ - public static final int EVREventType_VREvent_KeyboardClosed = 1200; - /** native declaration : headers\openvr_capi.h:461 */ - public static final int EVREventType_VREvent_KeyboardCharInput = 1201; - /** native declaration : headers\openvr_capi.h:462 */ - public static final int EVREventType_VREvent_KeyboardDone = 1202; - /** native declaration : headers\openvr_capi.h:463 */ - public static final int EVREventType_VREvent_ApplicationTransitionStarted = 1300; - /** native declaration : headers\openvr_capi.h:464 */ - public static final int EVREventType_VREvent_ApplicationTransitionAborted = 1301; - /** native declaration : headers\openvr_capi.h:465 */ - public static final int EVREventType_VREvent_ApplicationTransitionNewAppStarted = 1302; - /** native declaration : headers\openvr_capi.h:466 */ - public static final int EVREventType_VREvent_ApplicationListUpdated = 1303; - /** native declaration : headers\openvr_capi.h:467 */ - public static final int EVREventType_VREvent_ApplicationMimeTypeLoad = 1304; - /** native declaration : headers\openvr_capi.h:468 */ - public static final int EVREventType_VREvent_ApplicationTransitionNewAppLaunchComplete = 1305; - /** native declaration : headers\openvr_capi.h:469 */ - public static final int EVREventType_VREvent_ProcessConnected = 1306; - /** native declaration : headers\openvr_capi.h:470 */ - public static final int EVREventType_VREvent_ProcessDisconnected = 1307; - /** native declaration : headers\openvr_capi.h:471 */ - public static final int EVREventType_VREvent_Compositor_MirrorWindowShown = 1400; - /** native declaration : headers\openvr_capi.h:472 */ - public static final int EVREventType_VREvent_Compositor_MirrorWindowHidden = 1401; - /** native declaration : headers\openvr_capi.h:473 */ - public static final int EVREventType_VREvent_Compositor_ChaperoneBoundsShown = 1410; - /** native declaration : headers\openvr_capi.h:474 */ - public static final int EVREventType_VREvent_Compositor_ChaperoneBoundsHidden = 1411; - /** native declaration : headers\openvr_capi.h:475 */ - public static final int EVREventType_VREvent_TrackedCamera_StartVideoStream = 1500; - /** native declaration : headers\openvr_capi.h:476 */ - public static final int EVREventType_VREvent_TrackedCamera_StopVideoStream = 1501; - /** native declaration : headers\openvr_capi.h:477 */ - public static final int EVREventType_VREvent_TrackedCamera_PauseVideoStream = 1502; - /** native declaration : headers\openvr_capi.h:478 */ - public static final int EVREventType_VREvent_TrackedCamera_ResumeVideoStream = 1503; - /** native declaration : headers\openvr_capi.h:479 */ - public static final int EVREventType_VREvent_TrackedCamera_EditingSurface = 1550; - /** native declaration : headers\openvr_capi.h:480 */ - public static final int EVREventType_VREvent_PerformanceTest_EnableCapture = 1600; - /** native declaration : headers\openvr_capi.h:481 */ - public static final int EVREventType_VREvent_PerformanceTest_DisableCapture = 1601; - /** native declaration : headers\openvr_capi.h:482 */ - public static final int EVREventType_VREvent_PerformanceTest_FidelityLevel = 1602; - /** native declaration : headers\openvr_capi.h:483 */ - public static final int EVREventType_VREvent_MessageOverlay_Closed = 1650; - /** native declaration : headers\openvr_capi.h:484 */ - public static final int EVREventType_VREvent_VendorSpecific_Reserved_Start = 10000; - /** native declaration : headers\openvr_capi.h:485 */ - public static final int EVREventType_VREvent_VendorSpecific_Reserved_End = 19999; - }; - /** - * native declaration : headers\openvr_capi.h:493
    - * enum values - */ - public static interface EDeviceActivityLevel { - /** native declaration : headers\openvr_capi.h:488 */ - public static final int EDeviceActivityLevel_k_EDeviceActivityLevel_Unknown = -1; - /** native declaration : headers\openvr_capi.h:489 */ - public static final int EDeviceActivityLevel_k_EDeviceActivityLevel_Idle = 0; - /** native declaration : headers\openvr_capi.h:490 */ - public static final int EDeviceActivityLevel_k_EDeviceActivityLevel_UserInteraction = 1; - /** native declaration : headers\openvr_capi.h:491 */ - public static final int EDeviceActivityLevel_k_EDeviceActivityLevel_UserInteraction_Timeout = 2; - /** native declaration : headers\openvr_capi.h:492 */ - public static final int EDeviceActivityLevel_k_EDeviceActivityLevel_Standby = 3; - }; - /** - * native declaration : headers\openvr_capi.h:513
    - * enum values - */ - public static interface EVRButtonId { - /** native declaration : headers\openvr_capi.h:495 */ - public static final int EVRButtonId_k_EButton_System = 0; - /** native declaration : headers\openvr_capi.h:496 */ - public static final int EVRButtonId_k_EButton_ApplicationMenu = 1; - /** native declaration : headers\openvr_capi.h:497 */ - public static final int EVRButtonId_k_EButton_Grip = 2; - /** native declaration : headers\openvr_capi.h:498 */ - public static final int EVRButtonId_k_EButton_DPad_Left = 3; - /** native declaration : headers\openvr_capi.h:499 */ - public static final int EVRButtonId_k_EButton_DPad_Up = 4; - /** native declaration : headers\openvr_capi.h:500 */ - public static final int EVRButtonId_k_EButton_DPad_Right = 5; - /** native declaration : headers\openvr_capi.h:501 */ - public static final int EVRButtonId_k_EButton_DPad_Down = 6; - /** native declaration : headers\openvr_capi.h:502 */ - public static final int EVRButtonId_k_EButton_A = 7; - /** native declaration : headers\openvr_capi.h:503 */ - public static final int EVRButtonId_k_EButton_ProximitySensor = 31; - /** native declaration : headers\openvr_capi.h:504 */ - public static final int EVRButtonId_k_EButton_Axis0 = 32; - /** native declaration : headers\openvr_capi.h:505 */ - public static final int EVRButtonId_k_EButton_Axis1 = 33; - /** native declaration : headers\openvr_capi.h:506 */ - public static final int EVRButtonId_k_EButton_Axis2 = 34; - /** native declaration : headers\openvr_capi.h:507 */ - public static final int EVRButtonId_k_EButton_Axis3 = 35; - /** native declaration : headers\openvr_capi.h:508 */ - public static final int EVRButtonId_k_EButton_Axis4 = 36; - /** native declaration : headers\openvr_capi.h:509 */ - public static final int EVRButtonId_k_EButton_SteamVR_Touchpad = 32; - /** native declaration : headers\openvr_capi.h:510 */ - public static final int EVRButtonId_k_EButton_SteamVR_Trigger = 33; - /** native declaration : headers\openvr_capi.h:511 */ - public static final int EVRButtonId_k_EButton_Dashboard_Back = 2; - /** native declaration : headers\openvr_capi.h:512 */ - public static final int EVRButtonId_k_EButton_Max = 64; - }; - /** - * native declaration : headers\openvr_capi.h:518
    - * enum values - */ - public static interface EVRMouseButton { - /** native declaration : headers\openvr_capi.h:515 */ - public static final int EVRMouseButton_VRMouseButton_Left = 1; - /** native declaration : headers\openvr_capi.h:516 */ - public static final int EVRMouseButton_VRMouseButton_Right = 2; - /** native declaration : headers\openvr_capi.h:517 */ - public static final int EVRMouseButton_VRMouseButton_Middle = 4; - }; - /** - * native declaration : headers\openvr_capi.h:524
    - * enum values - */ - public static interface EHiddenAreaMeshType { - /** native declaration : headers\openvr_capi.h:520 */ - public static final int EHiddenAreaMeshType_k_eHiddenAreaMesh_Standard = 0; - /** native declaration : headers\openvr_capi.h:521 */ - public static final int EHiddenAreaMeshType_k_eHiddenAreaMesh_Inverse = 1; - /** native declaration : headers\openvr_capi.h:522 */ - public static final int EHiddenAreaMeshType_k_eHiddenAreaMesh_LineLoop = 2; - /** native declaration : headers\openvr_capi.h:523 */ - public static final int EHiddenAreaMeshType_k_eHiddenAreaMesh_Max = 3; - }; - /** - * native declaration : headers\openvr_capi.h:530
    - * enum values - */ - public static interface EVRControllerAxisType { - /** native declaration : headers\openvr_capi.h:526 */ - public static final int EVRControllerAxisType_k_eControllerAxis_None = 0; - /** native declaration : headers\openvr_capi.h:527 */ - public static final int EVRControllerAxisType_k_eControllerAxis_TrackPad = 1; - /** native declaration : headers\openvr_capi.h:528 */ - public static final int EVRControllerAxisType_k_eControllerAxis_Joystick = 2; - /** native declaration : headers\openvr_capi.h:529 */ - public static final int EVRControllerAxisType_k_eControllerAxis_Trigger = 3; - }; - /** - * native declaration : headers\openvr_capi.h:534
    - * enum values - */ - public static interface EVRControllerEventOutputType { - /** native declaration : headers\openvr_capi.h:532 */ - public static final int EVRControllerEventOutputType_ControllerEventOutput_OSEvents = 0; - /** native declaration : headers\openvr_capi.h:533 */ - public static final int EVRControllerEventOutputType_ControllerEventOutput_VREvents = 1; - }; - /** - * native declaration : headers\openvr_capi.h:542
    - * enum values - */ - public static interface ECollisionBoundsStyle { - /** native declaration : headers\openvr_capi.h:536 */ - public static final int ECollisionBoundsStyle_COLLISION_BOUNDS_STYLE_BEGINNER = 0; - /** native declaration : headers\openvr_capi.h:537 */ - public static final int ECollisionBoundsStyle_COLLISION_BOUNDS_STYLE_INTERMEDIATE = 1; - /** native declaration : headers\openvr_capi.h:538 */ - public static final int ECollisionBoundsStyle_COLLISION_BOUNDS_STYLE_SQUARES = 2; - /** native declaration : headers\openvr_capi.h:539 */ - public static final int ECollisionBoundsStyle_COLLISION_BOUNDS_STYLE_ADVANCED = 3; - /** native declaration : headers\openvr_capi.h:540 */ - public static final int ECollisionBoundsStyle_COLLISION_BOUNDS_STYLE_NONE = 4; - /** native declaration : headers\openvr_capi.h:541 */ - public static final int ECollisionBoundsStyle_COLLISION_BOUNDS_STYLE_COUNT = 5; - }; - /** - * native declaration : headers\openvr_capi.h:565
    - * enum values - */ - public static interface EVROverlayError { - /** native declaration : headers\openvr_capi.h:544 */ - public static final int EVROverlayError_VROverlayError_None = 0; - /** native declaration : headers\openvr_capi.h:545 */ - public static final int EVROverlayError_VROverlayError_UnknownOverlay = 10; - /** native declaration : headers\openvr_capi.h:546 */ - public static final int EVROverlayError_VROverlayError_InvalidHandle = 11; - /** native declaration : headers\openvr_capi.h:547 */ - public static final int EVROverlayError_VROverlayError_PermissionDenied = 12; - /** native declaration : headers\openvr_capi.h:548 */ - public static final int EVROverlayError_VROverlayError_OverlayLimitExceeded = 13; - /** native declaration : headers\openvr_capi.h:549 */ - public static final int EVROverlayError_VROverlayError_WrongVisibilityType = 14; - /** native declaration : headers\openvr_capi.h:550 */ - public static final int EVROverlayError_VROverlayError_KeyTooLong = 15; - /** native declaration : headers\openvr_capi.h:551 */ - public static final int EVROverlayError_VROverlayError_NameTooLong = 16; - /** native declaration : headers\openvr_capi.h:552 */ - public static final int EVROverlayError_VROverlayError_KeyInUse = 17; - /** native declaration : headers\openvr_capi.h:553 */ - public static final int EVROverlayError_VROverlayError_WrongTransformType = 18; - /** native declaration : headers\openvr_capi.h:554 */ - public static final int EVROverlayError_VROverlayError_InvalidTrackedDevice = 19; - /** native declaration : headers\openvr_capi.h:555 */ - public static final int EVROverlayError_VROverlayError_InvalidParameter = 20; - /** native declaration : headers\openvr_capi.h:556 */ - public static final int EVROverlayError_VROverlayError_ThumbnailCantBeDestroyed = 21; - /** native declaration : headers\openvr_capi.h:557 */ - public static final int EVROverlayError_VROverlayError_ArrayTooSmall = 22; - /** native declaration : headers\openvr_capi.h:558 */ - public static final int EVROverlayError_VROverlayError_RequestFailed = 23; - /** native declaration : headers\openvr_capi.h:559 */ - public static final int EVROverlayError_VROverlayError_InvalidTexture = 24; - /** native declaration : headers\openvr_capi.h:560 */ - public static final int EVROverlayError_VROverlayError_UnableToLoadFile = 25; - /** native declaration : headers\openvr_capi.h:561 */ - public static final int EVROverlayError_VROverlayError_KeyboardAlreadyInUse = 26; - /** native declaration : headers\openvr_capi.h:562 */ - public static final int EVROverlayError_VROverlayError_NoNeighbor = 27; - /** native declaration : headers\openvr_capi.h:563 */ - public static final int EVROverlayError_VROverlayError_TooManyMaskPrimitives = 29; - /** native declaration : headers\openvr_capi.h:564 */ - public static final int EVROverlayError_VROverlayError_BadMaskPrimitive = 30; - }; - /** - * native declaration : headers\openvr_capi.h:576
    - * enum values - */ - public static interface EVRApplicationType { - /** native declaration : headers\openvr_capi.h:567 */ - public static final int EVRApplicationType_VRApplication_Other = 0; - /** native declaration : headers\openvr_capi.h:568 */ - public static final int EVRApplicationType_VRApplication_Scene = 1; - /** native declaration : headers\openvr_capi.h:569 */ - public static final int EVRApplicationType_VRApplication_Overlay = 2; - /** native declaration : headers\openvr_capi.h:570 */ - public static final int EVRApplicationType_VRApplication_Background = 3; - /** native declaration : headers\openvr_capi.h:571 */ - public static final int EVRApplicationType_VRApplication_Utility = 4; - /** native declaration : headers\openvr_capi.h:572 */ - public static final int EVRApplicationType_VRApplication_VRMonitor = 5; - /** native declaration : headers\openvr_capi.h:573 */ - public static final int EVRApplicationType_VRApplication_SteamWatchdog = 6; - /** native declaration : headers\openvr_capi.h:574 */ - public static final int EVRApplicationType_VRApplication_Bootstrapper = 7; - /** native declaration : headers\openvr_capi.h:575 */ - public static final int EVRApplicationType_VRApplication_Max = 8; - }; - /** - * native declaration : headers\openvr_capi.h:581
    - * enum values - */ - public static interface EVRFirmwareError { - /** native declaration : headers\openvr_capi.h:578 */ - public static final int EVRFirmwareError_VRFirmwareError_None = 0; - /** native declaration : headers\openvr_capi.h:579 */ - public static final int EVRFirmwareError_VRFirmwareError_Success = 1; - /** native declaration : headers\openvr_capi.h:580 */ - public static final int EVRFirmwareError_VRFirmwareError_Fail = 2; - }; - /** - * native declaration : headers\openvr_capi.h:588
    - * enum values - */ - public static interface EVRNotificationError { - /** native declaration : headers\openvr_capi.h:583 */ - public static final int EVRNotificationError_VRNotificationError_OK = 0; - /** native declaration : headers\openvr_capi.h:584 */ - public static final int EVRNotificationError_VRNotificationError_InvalidNotificationId = 100; - /** native declaration : headers\openvr_capi.h:585 */ - public static final int EVRNotificationError_VRNotificationError_NotificationQueueFull = 101; - /** native declaration : headers\openvr_capi.h:586 */ - public static final int EVRNotificationError_VRNotificationError_InvalidOverlayHandle = 102; - /** native declaration : headers\openvr_capi.h:587 */ - public static final int EVRNotificationError_VRNotificationError_SystemWithUserValueAlreadyExists = 103; - }; - /** - * native declaration : headers\openvr_capi.h:671
    - * enum values - */ - public static interface EVRInitError { - /** native declaration : headers\openvr_capi.h:590 */ - public static final int EVRInitError_VRInitError_None = 0; - /** native declaration : headers\openvr_capi.h:591 */ - public static final int EVRInitError_VRInitError_Unknown = 1; - /** native declaration : headers\openvr_capi.h:592 */ - public static final int EVRInitError_VRInitError_Init_InstallationNotFound = 100; - /** native declaration : headers\openvr_capi.h:593 */ - public static final int EVRInitError_VRInitError_Init_InstallationCorrupt = 101; - /** native declaration : headers\openvr_capi.h:594 */ - public static final int EVRInitError_VRInitError_Init_VRClientDLLNotFound = 102; - /** native declaration : headers\openvr_capi.h:595 */ - public static final int EVRInitError_VRInitError_Init_FileNotFound = 103; - /** native declaration : headers\openvr_capi.h:596 */ - public static final int EVRInitError_VRInitError_Init_FactoryNotFound = 104; - /** native declaration : headers\openvr_capi.h:597 */ - public static final int EVRInitError_VRInitError_Init_InterfaceNotFound = 105; - /** native declaration : headers\openvr_capi.h:598 */ - public static final int EVRInitError_VRInitError_Init_InvalidInterface = 106; - /** native declaration : headers\openvr_capi.h:599 */ - public static final int EVRInitError_VRInitError_Init_UserConfigDirectoryInvalid = 107; - /** native declaration : headers\openvr_capi.h:600 */ - public static final int EVRInitError_VRInitError_Init_HmdNotFound = 108; - /** native declaration : headers\openvr_capi.h:601 */ - public static final int EVRInitError_VRInitError_Init_NotInitialized = 109; - /** native declaration : headers\openvr_capi.h:602 */ - public static final int EVRInitError_VRInitError_Init_PathRegistryNotFound = 110; - /** native declaration : headers\openvr_capi.h:603 */ - public static final int EVRInitError_VRInitError_Init_NoConfigPath = 111; - /** native declaration : headers\openvr_capi.h:604 */ - public static final int EVRInitError_VRInitError_Init_NoLogPath = 112; - /** native declaration : headers\openvr_capi.h:605 */ - public static final int EVRInitError_VRInitError_Init_PathRegistryNotWritable = 113; - /** native declaration : headers\openvr_capi.h:606 */ - public static final int EVRInitError_VRInitError_Init_AppInfoInitFailed = 114; - /** native declaration : headers\openvr_capi.h:607 */ - public static final int EVRInitError_VRInitError_Init_Retry = 115; - /** native declaration : headers\openvr_capi.h:608 */ - public static final int EVRInitError_VRInitError_Init_InitCanceledByUser = 116; - /** native declaration : headers\openvr_capi.h:609 */ - public static final int EVRInitError_VRInitError_Init_AnotherAppLaunching = 117; - /** native declaration : headers\openvr_capi.h:610 */ - public static final int EVRInitError_VRInitError_Init_SettingsInitFailed = 118; - /** native declaration : headers\openvr_capi.h:611 */ - public static final int EVRInitError_VRInitError_Init_ShuttingDown = 119; - /** native declaration : headers\openvr_capi.h:612 */ - public static final int EVRInitError_VRInitError_Init_TooManyObjects = 120; - /** native declaration : headers\openvr_capi.h:613 */ - public static final int EVRInitError_VRInitError_Init_NoServerForBackgroundApp = 121; - /** native declaration : headers\openvr_capi.h:614 */ - public static final int EVRInitError_VRInitError_Init_NotSupportedWithCompositor = 122; - /** native declaration : headers\openvr_capi.h:615 */ - public static final int EVRInitError_VRInitError_Init_NotAvailableToUtilityApps = 123; - /** native declaration : headers\openvr_capi.h:616 */ - public static final int EVRInitError_VRInitError_Init_Internal = 124; - /** native declaration : headers\openvr_capi.h:617 */ - public static final int EVRInitError_VRInitError_Init_HmdDriverIdIsNone = 125; - /** native declaration : headers\openvr_capi.h:618 */ - public static final int EVRInitError_VRInitError_Init_HmdNotFoundPresenceFailed = 126; - /** native declaration : headers\openvr_capi.h:619 */ - public static final int EVRInitError_VRInitError_Init_VRMonitorNotFound = 127; - /** native declaration : headers\openvr_capi.h:620 */ - public static final int EVRInitError_VRInitError_Init_VRMonitorStartupFailed = 128; - /** native declaration : headers\openvr_capi.h:621 */ - public static final int EVRInitError_VRInitError_Init_LowPowerWatchdogNotSupported = 129; - /** native declaration : headers\openvr_capi.h:622 */ - public static final int EVRInitError_VRInitError_Init_InvalidApplicationType = 130; - /** native declaration : headers\openvr_capi.h:623 */ - public static final int EVRInitError_VRInitError_Init_NotAvailableToWatchdogApps = 131; - /** native declaration : headers\openvr_capi.h:624 */ - public static final int EVRInitError_VRInitError_Init_WatchdogDisabledInSettings = 132; - /** native declaration : headers\openvr_capi.h:625 */ - public static final int EVRInitError_VRInitError_Init_VRDashboardNotFound = 133; - /** native declaration : headers\openvr_capi.h:626 */ - public static final int EVRInitError_VRInitError_Init_VRDashboardStartupFailed = 134; - /** native declaration : headers\openvr_capi.h:627 */ - public static final int EVRInitError_VRInitError_Init_VRHomeNotFound = 135; - /** native declaration : headers\openvr_capi.h:628 */ - public static final int EVRInitError_VRInitError_Init_VRHomeStartupFailed = 136; - /** native declaration : headers\openvr_capi.h:629 */ - public static final int EVRInitError_VRInitError_Driver_Failed = 200; - /** native declaration : headers\openvr_capi.h:630 */ - public static final int EVRInitError_VRInitError_Driver_Unknown = 201; - /** native declaration : headers\openvr_capi.h:631 */ - public static final int EVRInitError_VRInitError_Driver_HmdUnknown = 202; - /** native declaration : headers\openvr_capi.h:632 */ - public static final int EVRInitError_VRInitError_Driver_NotLoaded = 203; - /** native declaration : headers\openvr_capi.h:633 */ - public static final int EVRInitError_VRInitError_Driver_RuntimeOutOfDate = 204; - /** native declaration : headers\openvr_capi.h:634 */ - public static final int EVRInitError_VRInitError_Driver_HmdInUse = 205; - /** native declaration : headers\openvr_capi.h:635 */ - public static final int EVRInitError_VRInitError_Driver_NotCalibrated = 206; - /** native declaration : headers\openvr_capi.h:636 */ - public static final int EVRInitError_VRInitError_Driver_CalibrationInvalid = 207; - /** native declaration : headers\openvr_capi.h:637 */ - public static final int EVRInitError_VRInitError_Driver_HmdDisplayNotFound = 208; - /** native declaration : headers\openvr_capi.h:638 */ - public static final int EVRInitError_VRInitError_Driver_TrackedDeviceInterfaceUnknown = 209; - /** native declaration : headers\openvr_capi.h:639 */ - public static final int EVRInitError_VRInitError_Driver_HmdDriverIdOutOfBounds = 211; - /** native declaration : headers\openvr_capi.h:640 */ - public static final int EVRInitError_VRInitError_Driver_HmdDisplayMirrored = 212; - /** native declaration : headers\openvr_capi.h:641 */ - public static final int EVRInitError_VRInitError_IPC_ServerInitFailed = 300; - /** native declaration : headers\openvr_capi.h:642 */ - public static final int EVRInitError_VRInitError_IPC_ConnectFailed = 301; - /** native declaration : headers\openvr_capi.h:643 */ - public static final int EVRInitError_VRInitError_IPC_SharedStateInitFailed = 302; - /** native declaration : headers\openvr_capi.h:644 */ - public static final int EVRInitError_VRInitError_IPC_CompositorInitFailed = 303; - /** native declaration : headers\openvr_capi.h:645 */ - public static final int EVRInitError_VRInitError_IPC_MutexInitFailed = 304; - /** native declaration : headers\openvr_capi.h:646 */ - public static final int EVRInitError_VRInitError_IPC_Failed = 305; - /** native declaration : headers\openvr_capi.h:647 */ - public static final int EVRInitError_VRInitError_IPC_CompositorConnectFailed = 306; - /** native declaration : headers\openvr_capi.h:648 */ - public static final int EVRInitError_VRInitError_IPC_CompositorInvalidConnectResponse = 307; - /** native declaration : headers\openvr_capi.h:649 */ - public static final int EVRInitError_VRInitError_IPC_ConnectFailedAfterMultipleAttempts = 308; - /** native declaration : headers\openvr_capi.h:650 */ - public static final int EVRInitError_VRInitError_Compositor_Failed = 400; - /** native declaration : headers\openvr_capi.h:651 */ - public static final int EVRInitError_VRInitError_Compositor_D3D11HardwareRequired = 401; - /** native declaration : headers\openvr_capi.h:652 */ - public static final int EVRInitError_VRInitError_Compositor_FirmwareRequiresUpdate = 402; - /** native declaration : headers\openvr_capi.h:653 */ - public static final int EVRInitError_VRInitError_Compositor_OverlayInitFailed = 403; - /** native declaration : headers\openvr_capi.h:654 */ - public static final int EVRInitError_VRInitError_Compositor_ScreenshotsInitFailed = 404; - /** native declaration : headers\openvr_capi.h:655 */ - public static final int EVRInitError_VRInitError_Compositor_UnableToCreateDevice = 405; - /** native declaration : headers\openvr_capi.h:656 */ - public static final int EVRInitError_VRInitError_VendorSpecific_UnableToConnectToOculusRuntime = 1000; - /** native declaration : headers\openvr_capi.h:657 */ - public static final int EVRInitError_VRInitError_VendorSpecific_HmdFound_CantOpenDevice = 1101; - /** native declaration : headers\openvr_capi.h:658 */ - public static final int EVRInitError_VRInitError_VendorSpecific_HmdFound_UnableToRequestConfigStart = 1102; - /** native declaration : headers\openvr_capi.h:659 */ - public static final int EVRInitError_VRInitError_VendorSpecific_HmdFound_NoStoredConfig = 1103; - /** native declaration : headers\openvr_capi.h:660 */ - public static final int EVRInitError_VRInitError_VendorSpecific_HmdFound_ConfigTooBig = 1104; - /** native declaration : headers\openvr_capi.h:661 */ - public static final int EVRInitError_VRInitError_VendorSpecific_HmdFound_ConfigTooSmall = 1105; - /** native declaration : headers\openvr_capi.h:662 */ - public static final int EVRInitError_VRInitError_VendorSpecific_HmdFound_UnableToInitZLib = 1106; - /** native declaration : headers\openvr_capi.h:663 */ - public static final int EVRInitError_VRInitError_VendorSpecific_HmdFound_CantReadFirmwareVersion = 1107; - /** native declaration : headers\openvr_capi.h:664 */ - public static final int EVRInitError_VRInitError_VendorSpecific_HmdFound_UnableToSendUserDataStart = 1108; - /** native declaration : headers\openvr_capi.h:665 */ - public static final int EVRInitError_VRInitError_VendorSpecific_HmdFound_UnableToGetUserDataStart = 1109; - /** native declaration : headers\openvr_capi.h:666 */ - public static final int EVRInitError_VRInitError_VendorSpecific_HmdFound_UnableToGetUserDataNext = 1110; - /** native declaration : headers\openvr_capi.h:667 */ - public static final int EVRInitError_VRInitError_VendorSpecific_HmdFound_UserDataAddressRange = 1111; - /** native declaration : headers\openvr_capi.h:668 */ - public static final int EVRInitError_VRInitError_VendorSpecific_HmdFound_UserDataError = 1112; - /** native declaration : headers\openvr_capi.h:669 */ - public static final int EVRInitError_VRInitError_VendorSpecific_HmdFound_ConfigFailedSanityCheck = 1113; - /** native declaration : headers\openvr_capi.h:670 */ - public static final int EVRInitError_VRInitError_Steam_SteamInstallationNotFound = 2000; - }; - /** - * native declaration : headers\openvr_capi.h:679
    - * enum values - */ - public static interface EVRScreenshotType { - /** native declaration : headers\openvr_capi.h:673 */ - public static final int EVRScreenshotType_VRScreenshotType_None = 0; - /** native declaration : headers\openvr_capi.h:674 */ - public static final int EVRScreenshotType_VRScreenshotType_Mono = 1; - /** native declaration : headers\openvr_capi.h:675 */ - public static final int EVRScreenshotType_VRScreenshotType_Stereo = 2; - /** native declaration : headers\openvr_capi.h:676 */ - public static final int EVRScreenshotType_VRScreenshotType_Cubemap = 3; - /** native declaration : headers\openvr_capi.h:677 */ - public static final int EVRScreenshotType_VRScreenshotType_MonoPanorama = 4; - /** native declaration : headers\openvr_capi.h:678 */ - public static final int EVRScreenshotType_VRScreenshotType_StereoPanorama = 5; - }; - /** - * native declaration : headers\openvr_capi.h:683
    - * enum values - */ - public static interface EVRScreenshotPropertyFilenames { - /** native declaration : headers\openvr_capi.h:681 */ - public static final int EVRScreenshotPropertyFilenames_VRScreenshotPropertyFilenames_Preview = 0; - /** native declaration : headers\openvr_capi.h:682 */ - public static final int EVRScreenshotPropertyFilenames_VRScreenshotPropertyFilenames_VR = 1; - }; - /** - * native declaration : headers\openvr_capi.h:702
    - * enum values - */ - public static interface EVRTrackedCameraError { - /** native declaration : headers\openvr_capi.h:685 */ - public static final int EVRTrackedCameraError_VRTrackedCameraError_None = 0; - /** native declaration : headers\openvr_capi.h:686 */ - public static final int EVRTrackedCameraError_VRTrackedCameraError_OperationFailed = 100; - /** native declaration : headers\openvr_capi.h:687 */ - public static final int EVRTrackedCameraError_VRTrackedCameraError_InvalidHandle = 101; - /** native declaration : headers\openvr_capi.h:688 */ - public static final int EVRTrackedCameraError_VRTrackedCameraError_InvalidFrameHeaderVersion = 102; - /** native declaration : headers\openvr_capi.h:689 */ - public static final int EVRTrackedCameraError_VRTrackedCameraError_OutOfHandles = 103; - /** native declaration : headers\openvr_capi.h:690 */ - public static final int EVRTrackedCameraError_VRTrackedCameraError_IPCFailure = 104; - /** native declaration : headers\openvr_capi.h:691 */ - public static final int EVRTrackedCameraError_VRTrackedCameraError_NotSupportedForThisDevice = 105; - /** native declaration : headers\openvr_capi.h:692 */ - public static final int EVRTrackedCameraError_VRTrackedCameraError_SharedMemoryFailure = 106; - /** native declaration : headers\openvr_capi.h:693 */ - public static final int EVRTrackedCameraError_VRTrackedCameraError_FrameBufferingFailure = 107; - /** native declaration : headers\openvr_capi.h:694 */ - public static final int EVRTrackedCameraError_VRTrackedCameraError_StreamSetupFailure = 108; - /** native declaration : headers\openvr_capi.h:695 */ - public static final int EVRTrackedCameraError_VRTrackedCameraError_InvalidGLTextureId = 109; - /** native declaration : headers\openvr_capi.h:696 */ - public static final int EVRTrackedCameraError_VRTrackedCameraError_InvalidSharedTextureHandle = 110; - /** native declaration : headers\openvr_capi.h:697 */ - public static final int EVRTrackedCameraError_VRTrackedCameraError_FailedToGetGLTextureId = 111; - /** native declaration : headers\openvr_capi.h:698 */ - public static final int EVRTrackedCameraError_VRTrackedCameraError_SharedTextureFailure = 112; - /** native declaration : headers\openvr_capi.h:699 */ - public static final int EVRTrackedCameraError_VRTrackedCameraError_NoFrameAvailable = 113; - /** native declaration : headers\openvr_capi.h:700 */ - public static final int EVRTrackedCameraError_VRTrackedCameraError_InvalidArgument = 114; - /** native declaration : headers\openvr_capi.h:701 */ - public static final int EVRTrackedCameraError_VRTrackedCameraError_InvalidFrameBufferSize = 115; - }; - /** - * native declaration : headers\openvr_capi.h:708
    - * enum values - */ - public static interface EVRTrackedCameraFrameType { - /** native declaration : headers\openvr_capi.h:704 */ - public static final int EVRTrackedCameraFrameType_VRTrackedCameraFrameType_Distorted = 0; - /** native declaration : headers\openvr_capi.h:705 */ - public static final int EVRTrackedCameraFrameType_VRTrackedCameraFrameType_Undistorted = 1; - /** native declaration : headers\openvr_capi.h:706 */ - public static final int EVRTrackedCameraFrameType_VRTrackedCameraFrameType_MaximumUndistorted = 2; - /** native declaration : headers\openvr_capi.h:707 */ - public static final int EVRTrackedCameraFrameType_MAX_CAMERA_FRAME_TYPES = 3; - }; - /** - * native declaration : headers\openvr_capi.h:731
    - * enum values - */ - public static interface EVRApplicationError { - /** native declaration : headers\openvr_capi.h:710 */ - public static final int EVRApplicationError_VRApplicationError_None = 0; - /** native declaration : headers\openvr_capi.h:711 */ - public static final int EVRApplicationError_VRApplicationError_AppKeyAlreadyExists = 100; - /** native declaration : headers\openvr_capi.h:712 */ - public static final int EVRApplicationError_VRApplicationError_NoManifest = 101; - /** native declaration : headers\openvr_capi.h:713 */ - public static final int EVRApplicationError_VRApplicationError_NoApplication = 102; - /** native declaration : headers\openvr_capi.h:714 */ - public static final int EVRApplicationError_VRApplicationError_InvalidIndex = 103; - /** native declaration : headers\openvr_capi.h:715 */ - public static final int EVRApplicationError_VRApplicationError_UnknownApplication = 104; - /** native declaration : headers\openvr_capi.h:716 */ - public static final int EVRApplicationError_VRApplicationError_IPCFailed = 105; - /** native declaration : headers\openvr_capi.h:717 */ - public static final int EVRApplicationError_VRApplicationError_ApplicationAlreadyRunning = 106; - /** native declaration : headers\openvr_capi.h:718 */ - public static final int EVRApplicationError_VRApplicationError_InvalidManifest = 107; - /** native declaration : headers\openvr_capi.h:719 */ - public static final int EVRApplicationError_VRApplicationError_InvalidApplication = 108; - /** native declaration : headers\openvr_capi.h:720 */ - public static final int EVRApplicationError_VRApplicationError_LaunchFailed = 109; - /** native declaration : headers\openvr_capi.h:721 */ - public static final int EVRApplicationError_VRApplicationError_ApplicationAlreadyStarting = 110; - /** native declaration : headers\openvr_capi.h:722 */ - public static final int EVRApplicationError_VRApplicationError_LaunchInProgress = 111; - /** native declaration : headers\openvr_capi.h:723 */ - public static final int EVRApplicationError_VRApplicationError_OldApplicationQuitting = 112; - /** native declaration : headers\openvr_capi.h:724 */ - public static final int EVRApplicationError_VRApplicationError_TransitionAborted = 113; - /** native declaration : headers\openvr_capi.h:725 */ - public static final int EVRApplicationError_VRApplicationError_IsTemplate = 114; - /** native declaration : headers\openvr_capi.h:726 */ - public static final int EVRApplicationError_VRApplicationError_SteamVRIsExiting = 115; - /** native declaration : headers\openvr_capi.h:727 */ - public static final int EVRApplicationError_VRApplicationError_BufferTooSmall = 200; - /** native declaration : headers\openvr_capi.h:728 */ - public static final int EVRApplicationError_VRApplicationError_PropertyNotSet = 201; - /** native declaration : headers\openvr_capi.h:729 */ - public static final int EVRApplicationError_VRApplicationError_UnknownProperty = 202; - /** native declaration : headers\openvr_capi.h:730 */ - public static final int EVRApplicationError_VRApplicationError_InvalidParameter = 203; - }; - /** - * native declaration : headers\openvr_capi.h:749
    - * enum values - */ - public static interface EVRApplicationProperty { - /** native declaration : headers\openvr_capi.h:733 */ - public static final int EVRApplicationProperty_VRApplicationProperty_Name_String = 0; - /** native declaration : headers\openvr_capi.h:734 */ - public static final int EVRApplicationProperty_VRApplicationProperty_LaunchType_String = 11; - /** native declaration : headers\openvr_capi.h:735 */ - public static final int EVRApplicationProperty_VRApplicationProperty_WorkingDirectory_String = 12; - /** native declaration : headers\openvr_capi.h:736 */ - public static final int EVRApplicationProperty_VRApplicationProperty_BinaryPath_String = 13; - /** native declaration : headers\openvr_capi.h:737 */ - public static final int EVRApplicationProperty_VRApplicationProperty_Arguments_String = 14; - /** native declaration : headers\openvr_capi.h:738 */ - public static final int EVRApplicationProperty_VRApplicationProperty_URL_String = 15; - /** native declaration : headers\openvr_capi.h:739 */ - public static final int EVRApplicationProperty_VRApplicationProperty_Description_String = 50; - /** native declaration : headers\openvr_capi.h:740 */ - public static final int EVRApplicationProperty_VRApplicationProperty_NewsURL_String = 51; - /** native declaration : headers\openvr_capi.h:741 */ - public static final int EVRApplicationProperty_VRApplicationProperty_ImagePath_String = 52; - /** native declaration : headers\openvr_capi.h:742 */ - public static final int EVRApplicationProperty_VRApplicationProperty_Source_String = 53; - /** native declaration : headers\openvr_capi.h:743 */ - public static final int EVRApplicationProperty_VRApplicationProperty_IsDashboardOverlay_Bool = 60; - /** native declaration : headers\openvr_capi.h:744 */ - public static final int EVRApplicationProperty_VRApplicationProperty_IsTemplate_Bool = 61; - /** native declaration : headers\openvr_capi.h:745 */ - public static final int EVRApplicationProperty_VRApplicationProperty_IsInstanced_Bool = 62; - /** native declaration : headers\openvr_capi.h:746 */ - public static final int EVRApplicationProperty_VRApplicationProperty_IsInternal_Bool = 63; - /** native declaration : headers\openvr_capi.h:747 */ - public static final int EVRApplicationProperty_VRApplicationProperty_WantsCompositorPauseInStandby_Bool = 64; - /** native declaration : headers\openvr_capi.h:748 */ - public static final int EVRApplicationProperty_VRApplicationProperty_LastLaunchTime_Uint64 = 70; - }; - /** - * native declaration : headers\openvr_capi.h:755
    - * enum values - */ - public static interface EVRApplicationTransitionState { - /** native declaration : headers\openvr_capi.h:751 */ - public static final int EVRApplicationTransitionState_VRApplicationTransition_None = 0; - /** native declaration : headers\openvr_capi.h:752 */ - public static final int EVRApplicationTransitionState_VRApplicationTransition_OldAppQuitSent = 10; - /** native declaration : headers\openvr_capi.h:753 */ - public static final int EVRApplicationTransitionState_VRApplicationTransition_WaitingForExternalLaunch = 11; - /** native declaration : headers\openvr_capi.h:754 */ - public static final int EVRApplicationTransitionState_VRApplicationTransition_NewAppLaunched = 20; - }; - /** - * native declaration : headers\openvr_capi.h:767
    - * enum values - */ - public static interface ChaperoneCalibrationState { - /** native declaration : headers\openvr_capi.h:757 */ - public static final int ChaperoneCalibrationState_OK = 1; - /** native declaration : headers\openvr_capi.h:758 */ - public static final int ChaperoneCalibrationState_Warning = 100; - /** native declaration : headers\openvr_capi.h:759 */ - public static final int ChaperoneCalibrationState_Warning_BaseStationMayHaveMoved = 101; - /** native declaration : headers\openvr_capi.h:760 */ - public static final int ChaperoneCalibrationState_Warning_BaseStationRemoved = 102; - /** native declaration : headers\openvr_capi.h:761 */ - public static final int ChaperoneCalibrationState_Warning_SeatedBoundsInvalid = 103; - /** native declaration : headers\openvr_capi.h:762 */ - public static final int ChaperoneCalibrationState_Error = 200; - /** native declaration : headers\openvr_capi.h:763 */ - public static final int ChaperoneCalibrationState_Error_BaseStationUninitialized = 201; - /** native declaration : headers\openvr_capi.h:764 */ - public static final int ChaperoneCalibrationState_Error_BaseStationConflict = 202; - /** native declaration : headers\openvr_capi.h:765 */ - public static final int ChaperoneCalibrationState_Error_PlayAreaInvalid = 203; - /** native declaration : headers\openvr_capi.h:766 */ - public static final int ChaperoneCalibrationState_Error_CollisionBoundsInvalid = 204; - }; - /** - * native declaration : headers\openvr_capi.h:771
    - * enum values - */ - public static interface EChaperoneConfigFile { - /** native declaration : headers\openvr_capi.h:769 */ - public static final int EChaperoneConfigFile_Live = 1; - /** native declaration : headers\openvr_capi.h:770 */ - public static final int EChaperoneConfigFile_Temp = 2; - }; - /** - * native declaration : headers\openvr_capi.h:774
    - * enum values - */ - public static interface EChaperoneImportFlags { - /** native declaration : headers\openvr_capi.h:773 */ - public static final int EChaperoneImportFlags_EChaperoneImport_BoundsOnly = 1; - }; - /** - * native declaration : headers\openvr_capi.h:788
    - * enum values - */ - public static interface EVRCompositorError { - /** native declaration : headers\openvr_capi.h:776 */ - public static final int EVRCompositorError_VRCompositorError_None = 0; - /** native declaration : headers\openvr_capi.h:777 */ - public static final int EVRCompositorError_VRCompositorError_RequestFailed = 1; - /** native declaration : headers\openvr_capi.h:778 */ - public static final int EVRCompositorError_VRCompositorError_IncompatibleVersion = 100; - /** native declaration : headers\openvr_capi.h:779 */ - public static final int EVRCompositorError_VRCompositorError_DoNotHaveFocus = 101; - /** native declaration : headers\openvr_capi.h:780 */ - public static final int EVRCompositorError_VRCompositorError_InvalidTexture = 102; - /** native declaration : headers\openvr_capi.h:781 */ - public static final int EVRCompositorError_VRCompositorError_IsNotSceneApplication = 103; - /** native declaration : headers\openvr_capi.h:782 */ - public static final int EVRCompositorError_VRCompositorError_TextureIsOnWrongDevice = 104; - /** native declaration : headers\openvr_capi.h:783 */ - public static final int EVRCompositorError_VRCompositorError_TextureUsesUnsupportedFormat = 105; - /** native declaration : headers\openvr_capi.h:784 */ - public static final int EVRCompositorError_VRCompositorError_SharedTexturesNotSupported = 106; - /** native declaration : headers\openvr_capi.h:785 */ - public static final int EVRCompositorError_VRCompositorError_IndexOutOfRange = 107; - /** native declaration : headers\openvr_capi.h:786 */ - public static final int EVRCompositorError_VRCompositorError_AlreadySubmitted = 108; - /** native declaration : headers\openvr_capi.h:787 */ - public static final int EVRCompositorError_VRCompositorError_InvalidBounds = 109; - }; - /** - * native declaration : headers\openvr_capi.h:792
    - * enum values - */ - public static interface VROverlayInputMethod { - /** native declaration : headers\openvr_capi.h:790 */ - public static final int VROverlayInputMethod_None = 0; - /** native declaration : headers\openvr_capi.h:791 */ - public static final int VROverlayInputMethod_Mouse = 1; - }; - /** - * native declaration : headers\openvr_capi.h:798
    - * enum values - */ - public static interface VROverlayTransformType { - /** native declaration : headers\openvr_capi.h:794 */ - public static final int VROverlayTransformType_VROverlayTransform_Absolute = 0; - /** native declaration : headers\openvr_capi.h:795 */ - public static final int VROverlayTransformType_VROverlayTransform_TrackedDeviceRelative = 1; - /** native declaration : headers\openvr_capi.h:796 */ - public static final int VROverlayTransformType_VROverlayTransform_SystemOverlay = 2; - /** native declaration : headers\openvr_capi.h:797 */ - public static final int VROverlayTransformType_VROverlayTransform_TrackedComponent = 3; - }; - /** - * native declaration : headers\openvr_capi.h:816
    - * enum values - */ - public static interface VROverlayFlags { - /** native declaration : headers\openvr_capi.h:800 */ - public static final int VROverlayFlags_None = 0; - /** native declaration : headers\openvr_capi.h:801 */ - public static final int VROverlayFlags_Curved = 1; - /** native declaration : headers\openvr_capi.h:802 */ - public static final int VROverlayFlags_RGSS4X = 2; - /** native declaration : headers\openvr_capi.h:803 */ - public static final int VROverlayFlags_NoDashboardTab = 3; - /** native declaration : headers\openvr_capi.h:804 */ - public static final int VROverlayFlags_AcceptsGamepadEvents = 4; - /** native declaration : headers\openvr_capi.h:805 */ - public static final int VROverlayFlags_ShowGamepadFocus = 5; - /** native declaration : headers\openvr_capi.h:806 */ - public static final int VROverlayFlags_SendVRScrollEvents = 6; - /** native declaration : headers\openvr_capi.h:807 */ - public static final int VROverlayFlags_SendVRTouchpadEvents = 7; - /** native declaration : headers\openvr_capi.h:808 */ - public static final int VROverlayFlags_ShowTouchPadScrollWheel = 8; - /** native declaration : headers\openvr_capi.h:809 */ - public static final int VROverlayFlags_TransferOwnershipToInternalProcess = 9; - /** native declaration : headers\openvr_capi.h:810 */ - public static final int VROverlayFlags_SideBySide_Parallel = 10; - /** native declaration : headers\openvr_capi.h:811 */ - public static final int VROverlayFlags_SideBySide_Crossed = 11; - /** native declaration : headers\openvr_capi.h:812 */ - public static final int VROverlayFlags_Panorama = 12; - /** native declaration : headers\openvr_capi.h:813 */ - public static final int VROverlayFlags_StereoPanorama = 13; - /** native declaration : headers\openvr_capi.h:814 */ - public static final int VROverlayFlags_SortWithNonSceneOverlays = 14; - /** native declaration : headers\openvr_capi.h:815 */ - public static final int VROverlayFlags_VisibleInDashboard = 15; - }; - /** - * native declaration : headers\openvr_capi.h:825
    - * enum values - */ - public static interface VRMessageOverlayResponse { - /** native declaration : headers\openvr_capi.h:818 */ - public static final int VRMessageOverlayResponse_ButtonPress_0 = 0; - /** native declaration : headers\openvr_capi.h:819 */ - public static final int VRMessageOverlayResponse_ButtonPress_1 = 1; - /** native declaration : headers\openvr_capi.h:820 */ - public static final int VRMessageOverlayResponse_ButtonPress_2 = 2; - /** native declaration : headers\openvr_capi.h:821 */ - public static final int VRMessageOverlayResponse_ButtonPress_3 = 3; - /** native declaration : headers\openvr_capi.h:822 */ - public static final int VRMessageOverlayResponse_CouldntFindSystemOverlay = 4; - /** native declaration : headers\openvr_capi.h:823 */ - public static final int VRMessageOverlayResponse_CouldntFindOrCreateClientOverlay = 5; - /** native declaration : headers\openvr_capi.h:824 */ - public static final int VRMessageOverlayResponse_ApplicationQuit = 6; - }; - /** - * native declaration : headers\openvr_capi.h:830
    - * enum values - */ - public static interface EGamepadTextInputMode { - /** native declaration : headers\openvr_capi.h:827 */ - public static final int EGamepadTextInputMode_k_EGamepadTextInputModeNormal = 0; - /** native declaration : headers\openvr_capi.h:828 */ - public static final int EGamepadTextInputMode_k_EGamepadTextInputModePassword = 1; - /** native declaration : headers\openvr_capi.h:829 */ - public static final int EGamepadTextInputMode_k_EGamepadTextInputModeSubmit = 2; - }; - /** - * native declaration : headers\openvr_capi.h:834
    - * enum values - */ - public static interface EGamepadTextInputLineMode { - /** native declaration : headers\openvr_capi.h:832 */ - public static final int EGamepadTextInputLineMode_k_EGamepadTextInputLineModeSingleLine = 0; - /** native declaration : headers\openvr_capi.h:833 */ - public static final int EGamepadTextInputLineMode_k_EGamepadTextInputLineModeMultipleLines = 1; - }; - /** - * native declaration : headers\openvr_capi.h:841
    - * enum values - */ - public static interface EOverlayDirection { - /** native declaration : headers\openvr_capi.h:836 */ - public static final int EOverlayDirection_OverlayDirection_Up = 0; - /** native declaration : headers\openvr_capi.h:837 */ - public static final int EOverlayDirection_OverlayDirection_Down = 1; - /** native declaration : headers\openvr_capi.h:838 */ - public static final int EOverlayDirection_OverlayDirection_Left = 2; - /** native declaration : headers\openvr_capi.h:839 */ - public static final int EOverlayDirection_OverlayDirection_Right = 3; - /** native declaration : headers\openvr_capi.h:840 */ - public static final int EOverlayDirection_OverlayDirection_Count = 4; - }; - /** - * native declaration : headers\openvr_capi.h:845
    - * enum values - */ - public static interface EVROverlayIntersectionMaskPrimitiveType { - /** native declaration : headers\openvr_capi.h:843 */ - public static final int EVROverlayIntersectionMaskPrimitiveType_OverlayIntersectionPrimitiveType_Rectangle = 0; - /** native declaration : headers\openvr_capi.h:844 */ - public static final int EVROverlayIntersectionMaskPrimitiveType_OverlayIntersectionPrimitiveType_Circle = 1; - }; - /** - * native declaration : headers\openvr_capi.h:860
    - * enum values - */ - public static interface EVRRenderModelError { - /** native declaration : headers\openvr_capi.h:847 */ - public static final int EVRRenderModelError_VRRenderModelError_None = 0; - /** native declaration : headers\openvr_capi.h:848 */ - public static final int EVRRenderModelError_VRRenderModelError_Loading = 100; - /** native declaration : headers\openvr_capi.h:849 */ - public static final int EVRRenderModelError_VRRenderModelError_NotSupported = 200; - /** native declaration : headers\openvr_capi.h:850 */ - public static final int EVRRenderModelError_VRRenderModelError_InvalidArg = 300; - /** native declaration : headers\openvr_capi.h:851 */ - public static final int EVRRenderModelError_VRRenderModelError_InvalidModel = 301; - /** native declaration : headers\openvr_capi.h:852 */ - public static final int EVRRenderModelError_VRRenderModelError_NoShapes = 302; - /** native declaration : headers\openvr_capi.h:853 */ - public static final int EVRRenderModelError_VRRenderModelError_MultipleShapes = 303; - /** native declaration : headers\openvr_capi.h:854 */ - public static final int EVRRenderModelError_VRRenderModelError_TooManyVertices = 304; - /** native declaration : headers\openvr_capi.h:855 */ - public static final int EVRRenderModelError_VRRenderModelError_MultipleTextures = 305; - /** native declaration : headers\openvr_capi.h:856 */ - public static final int EVRRenderModelError_VRRenderModelError_BufferTooSmall = 306; - /** native declaration : headers\openvr_capi.h:857 */ - public static final int EVRRenderModelError_VRRenderModelError_NotEnoughNormals = 307; - /** native declaration : headers\openvr_capi.h:858 */ - public static final int EVRRenderModelError_VRRenderModelError_NotEnoughTexCoords = 308; - /** native declaration : headers\openvr_capi.h:859 */ - public static final int EVRRenderModelError_VRRenderModelError_InvalidTexture = 400; - }; - /** - * native declaration : headers\openvr_capi.h:867
    - * enum values - */ - public static interface EVRComponentProperty { - /** native declaration : headers\openvr_capi.h:862 */ - public static final int EVRComponentProperty_VRComponentProperty_IsStatic = 1; - /** native declaration : headers\openvr_capi.h:863 */ - public static final int EVRComponentProperty_VRComponentProperty_IsVisible = 2; - /** native declaration : headers\openvr_capi.h:864 */ - public static final int EVRComponentProperty_VRComponentProperty_IsTouched = 4; - /** native declaration : headers\openvr_capi.h:865 */ - public static final int EVRComponentProperty_VRComponentProperty_IsPressed = 8; - /** native declaration : headers\openvr_capi.h:866 */ - public static final int EVRComponentProperty_VRComponentProperty_IsScrolled = 16; - }; - /** - * native declaration : headers\openvr_capi.h:872
    - * enum values - */ - public static interface EVRNotificationType { - /** native declaration : headers\openvr_capi.h:869 */ - public static final int EVRNotificationType_Transient = 0; - /** native declaration : headers\openvr_capi.h:870 */ - public static final int EVRNotificationType_Persistent = 1; - /** native declaration : headers\openvr_capi.h:871 */ - public static final int EVRNotificationType_Transient_SystemWithUserValue = 2; - }; - /** - * native declaration : headers\openvr_capi.h:879
    - * enum values - */ - public static interface EVRNotificationStyle { - /** native declaration : headers\openvr_capi.h:874 */ - public static final int EVRNotificationStyle_None = 0; - /** native declaration : headers\openvr_capi.h:875 */ - public static final int EVRNotificationStyle_Application = 100; - /** native declaration : headers\openvr_capi.h:876 */ - public static final int EVRNotificationStyle_Contact_Disabled = 200; - /** native declaration : headers\openvr_capi.h:877 */ - public static final int EVRNotificationStyle_Contact_Enabled = 201; - /** native declaration : headers\openvr_capi.h:878 */ - public static final int EVRNotificationStyle_Contact_Active = 202; - }; - /** - * native declaration : headers\openvr_capi.h:887
    - * enum values - */ - public static interface EVRSettingsError { - /** native declaration : headers\openvr_capi.h:881 */ - public static final int EVRSettingsError_VRSettingsError_None = 0; - /** native declaration : headers\openvr_capi.h:882 */ - public static final int EVRSettingsError_VRSettingsError_IPCFailed = 1; - /** native declaration : headers\openvr_capi.h:883 */ - public static final int EVRSettingsError_VRSettingsError_WriteFailed = 2; - /** native declaration : headers\openvr_capi.h:884 */ - public static final int EVRSettingsError_VRSettingsError_ReadFailed = 3; - /** native declaration : headers\openvr_capi.h:885 */ - public static final int EVRSettingsError_VRSettingsError_JsonParseFailed = 4; - /** native declaration : headers\openvr_capi.h:886 */ - public static final int EVRSettingsError_VRSettingsError_UnsetSettingHasNoDefault = 5; - }; - /** - * native declaration : headers\openvr_capi.h:895
    - * enum values - */ - public static interface EVRScreenshotError { - /** native declaration : headers\openvr_capi.h:889 */ - public static final int EVRScreenshotError_VRScreenshotError_None = 0; - /** native declaration : headers\openvr_capi.h:890 */ - public static final int EVRScreenshotError_VRScreenshotError_RequestFailed = 1; - /** native declaration : headers\openvr_capi.h:891 */ - public static final int EVRScreenshotError_VRScreenshotError_IncompatibleVersion = 100; - /** native declaration : headers\openvr_capi.h:892 */ - public static final int EVRScreenshotError_VRScreenshotError_NotFound = 101; - /** native declaration : headers\openvr_capi.h:893 */ - public static final int EVRScreenshotError_VRScreenshotError_BufferTooSmall = 102; - /** native declaration : headers\openvr_capi.h:894 */ - public static final int EVRScreenshotError_VRScreenshotError_ScreenshotAlreadyInProgress = 108; - }; - - /** OpenVR Constants */ - public static final long k_nDriverNone = 4294967295L; - public static final int k_unMaxDriverDebugResponseSize = 32768; - public static final int k_unTrackedDeviceIndex_Hmd = 0; - public static final int k_unMaxTrackedDeviceCount = 16; - public static final int k_unTrackedDeviceIndexOther = -2; - public static final long k_unTrackedDeviceIndexInvalid = 4294967295L; - public static final long k_ulInvalidPropertyContainer = 0; - public static final int k_unInvalidPropertyTag = 0; - public static final int k_unFloatPropertyTag = 1; - public static final int k_unInt32PropertyTag = 2; - public static final int k_unUint64PropertyTag = 3; - public static final int k_unBoolPropertyTag = 4; - public static final int k_unStringPropertyTag = 5; - public static final int k_unHmdMatrix34PropertyTag = 20; - public static final int k_unHmdMatrix44PropertyTag = 21; - public static final int k_unHmdVector3PropertyTag = 22; - public static final int k_unHmdVector4PropertyTag = 23; - public static final int k_unHiddenAreaPropertyTag = 30; - public static final int k_unOpenVRInternalReserved_Start = 1000; - public static final int k_unOpenVRInternalReserved_End = 10000; - public static final int k_unMaxPropertyStringSize = 32768; - public static final int k_unControllerStateAxisCount = 5; - public static final long k_ulOverlayHandleInvalid = 0; - public static final int k_unScreenshotHandleInvalid = 0; - - - public static final int k_unMaxApplicationKeyLength = 128; - - public static final String k_pch_MimeType_HomeApp = "vr/home"; - public static final String k_pch_MimeType_GameTheater = "vr/game_theater"; - - - public static final int k_unVROverlayMaxKeyLength = 128; - public static final int k_unVROverlayMaxNameLength = 128; - public static final int k_unMaxOverlayCount = 64; - public static final int k_unMaxOverlayIntersectionMaskPrimitivesCount = 32; - - - public static final String k_pch_Controller_Component_GDC2015 = "gdc2015"; - public static final String k_pch_Controller_Component_Base = "base"; - public static final String k_pch_Controller_Component_Tip = "tip"; - public static final String k_pch_Controller_Component_HandGrip = "handgrip"; - public static final String k_pch_Controller_Component_Status = "status"; - - - public static final int k_unNotificationTextMaxSize = 256; - - public static final int k_unMaxSettingsKeyLength = 128; - - public static final String k_pch_SteamVR_Section = "steamvr"; - public static final String k_pch_SteamVR_RequireHmd_String = "requireHmd"; - public static final String k_pch_SteamVR_ForcedDriverKey_String = "forcedDriver"; - public static final String k_pch_SteamVR_ForcedHmdKey_String = "forcedHmd"; - public static final String k_pch_SteamVR_DisplayDebug_Bool = "displayDebug"; - public static final String k_pch_SteamVR_DebugProcessPipe_String = "debugProcessPipe"; - public static final String k_pch_SteamVR_DisplayDebugX_Int32 = "displayDebugX"; - public static final String k_pch_SteamVR_DisplayDebugY_Int32 = "displayDebugY"; - public static final String k_pch_SteamVR_SendSystemButtonToAllApps_Bool = "sendSystemButtonToAllApps"; - public static final String k_pch_SteamVR_LogLevel_Int32 = "loglevel"; - public static final String k_pch_SteamVR_IPD_Float = "ipd"; - public static final String k_pch_SteamVR_Background_String = "background"; - public static final String k_pch_SteamVR_BackgroundUseDomeProjection_Bool = "backgroundUseDomeProjection"; - public static final String k_pch_SteamVR_BackgroundCameraHeight_Float = "backgroundCameraHeight"; - public static final String k_pch_SteamVR_BackgroundDomeRadius_Float = "backgroundDomeRadius"; - public static final String k_pch_SteamVR_GridColor_String = "gridColor"; - public static final String k_pch_SteamVR_PlayAreaColor_String = "playAreaColor"; - public static final String k_pch_SteamVR_ShowStage_Bool = "showStage"; - public static final String k_pch_SteamVR_ActivateMultipleDrivers_Bool = "activateMultipleDrivers"; - public static final String k_pch_SteamVR_DirectMode_Bool = "directMode"; - public static final String k_pch_SteamVR_DirectModeEdidVid_Int32 = "directModeEdidVid"; - public static final String k_pch_SteamVR_DirectModeEdidPid_Int32 = "directModeEdidPid"; - public static final String k_pch_SteamVR_UsingSpeakers_Bool = "usingSpeakers"; - public static final String k_pch_SteamVR_SpeakersForwardYawOffsetDegrees_Float = "speakersForwardYawOffsetDegrees"; - public static final String k_pch_SteamVR_BaseStationPowerManagement_Bool = "basestationPowerManagement"; - public static final String k_pch_SteamVR_NeverKillProcesses_Bool = "neverKillProcesses"; - public static final String k_pch_SteamVR_SupersampleScale_Float = "supersampleScale"; - public static final String k_pch_SteamVR_AllowAsyncReprojection_Bool = "allowAsyncReprojection"; - public static final String k_pch_SteamVR_AllowReprojection_Bool = "allowInterleavedReprojection"; - public static final String k_pch_SteamVR_ForceReprojection_Bool = "forceReprojection"; - public static final String k_pch_SteamVR_ForceFadeOnBadTracking_Bool = "forceFadeOnBadTracking"; - public static final String k_pch_SteamVR_DefaultMirrorView_Int32 = "defaultMirrorView"; - public static final String k_pch_SteamVR_ShowMirrorView_Bool = "showMirrorView"; - public static final String k_pch_SteamVR_MirrorViewGeometry_String = "mirrorViewGeometry"; - public static final String k_pch_SteamVR_StartMonitorFromAppLaunch = "startMonitorFromAppLaunch"; - public static final String k_pch_SteamVR_StartCompositorFromAppLaunch_Bool = "startCompositorFromAppLaunch"; - public static final String k_pch_SteamVR_StartDashboardFromAppLaunch_Bool = "startDashboardFromAppLaunch"; - public static final String k_pch_SteamVR_StartOverlayAppsFromDashboard_Bool = "startOverlayAppsFromDashboard"; - public static final String k_pch_SteamVR_EnableHomeApp = "enableHomeApp"; - public static final String k_pch_SteamVR_CycleBackgroundImageTimeSec_Int32 = "CycleBackgroundImageTimeSec"; - public static final String k_pch_SteamVR_RetailDemo_Bool = "retailDemo"; - public static final String k_pch_SteamVR_IpdOffset_Float = "ipdOffset"; - public static final String k_pch_SteamVR_AllowSupersampleFiltering_Bool = "allowSupersampleFiltering"; - public static final String k_pch_Lighthouse_Section = "driver_lighthouse"; - public static final String k_pch_Lighthouse_DisableIMU_Bool = "disableimu"; - public static final String k_pch_Lighthouse_UseDisambiguation_String = "usedisambiguation"; - public static final String k_pch_Lighthouse_DisambiguationDebug_Int32 = "disambiguationdebug"; - public static final String k_pch_Lighthouse_PrimaryBasestation_Int32 = "primarybasestation"; - public static final String k_pch_Lighthouse_DBHistory_Bool = "dbhistory"; - public static final String k_pch_Null_Section = "driver_null"; - public static final String k_pch_Null_SerialNumber_String = "serialNumber"; - public static final String k_pch_Null_ModelNumber_String = "modelNumber"; - public static final String k_pch_Null_WindowX_Int32 = "windowX"; - public static final String k_pch_Null_WindowY_Int32 = "windowY"; - public static final String k_pch_Null_WindowWidth_Int32 = "windowWidth"; - public static final String k_pch_Null_WindowHeight_Int32 = "windowHeight"; - public static final String k_pch_Null_RenderWidth_Int32 = "renderWidth"; - public static final String k_pch_Null_RenderHeight_Int32 = "renderHeight"; - public static final String k_pch_Null_SecondsFromVsyncToPhotons_Float = "secondsFromVsyncToPhotons"; - public static final String k_pch_Null_DisplayFrequency_Float = "displayFrequency"; - public static final String k_pch_UserInterface_Section = "userinterface"; - public static final String k_pch_UserInterface_StatusAlwaysOnTop_Bool = "StatusAlwaysOnTop"; - public static final String k_pch_UserInterface_MinimizeToTray_Bool = "MinimizeToTray"; - public static final String k_pch_UserInterface_Screenshots_Bool = "screenshots"; - public static final String k_pch_UserInterface_ScreenshotType_Int = "screenshotType"; - public static final String k_pch_Notifications_Section = "notifications"; - public static final String k_pch_Notifications_DoNotDisturb_Bool = "DoNotDisturb"; - public static final String k_pch_Keyboard_Section = "keyboard"; - public static final String k_pch_Keyboard_TutorialCompletions = "TutorialCompletions"; - public static final String k_pch_Keyboard_ScaleX = "ScaleX"; - public static final String k_pch_Keyboard_ScaleY = "ScaleY"; - public static final String k_pch_Keyboard_OffsetLeftX = "OffsetLeftX"; - public static final String k_pch_Keyboard_OffsetRightX = "OffsetRightX"; - public static final String k_pch_Keyboard_OffsetY = "OffsetY"; - public static final String k_pch_Keyboard_Smoothing = "Smoothing"; - public static final String k_pch_Perf_Section = "perfcheck"; - public static final String k_pch_Perf_HeuristicActive_Bool = "heuristicActive"; - public static final String k_pch_Perf_NotifyInHMD_Bool = "warnInHMD"; - public static final String k_pch_Perf_NotifyOnlyOnce_Bool = "warnOnlyOnce"; - public static final String k_pch_Perf_AllowTimingStore_Bool = "allowTimingStore"; - public static final String k_pch_Perf_SaveTimingsOnExit_Bool = "saveTimingsOnExit"; - public static final String k_pch_Perf_TestData_Float = "perfTestData"; - public static final String k_pch_Perf_LinuxGPUProfiling_Bool = "linuxGPUProfiling"; - public static final String k_pch_CollisionBounds_Section = "collisionBounds"; - public static final String k_pch_CollisionBounds_Style_Int32 = "CollisionBoundsStyle"; - public static final String k_pch_CollisionBounds_GroundPerimeterOn_Bool = "CollisionBoundsGroundPerimeterOn"; - public static final String k_pch_CollisionBounds_CenterMarkerOn_Bool = "CollisionBoundsCenterMarkerOn"; - public static final String k_pch_CollisionBounds_PlaySpaceOn_Bool = "CollisionBoundsPlaySpaceOn"; - public static final String k_pch_CollisionBounds_FadeDistance_Float = "CollisionBoundsFadeDistance"; - public static final String k_pch_CollisionBounds_ColorGammaR_Int32 = "CollisionBoundsColorGammaR"; - public static final String k_pch_CollisionBounds_ColorGammaG_Int32 = "CollisionBoundsColorGammaG"; - public static final String k_pch_CollisionBounds_ColorGammaB_Int32 = "CollisionBoundsColorGammaB"; - public static final String k_pch_CollisionBounds_ColorGammaA_Int32 = "CollisionBoundsColorGammaA"; - public static final String k_pch_Camera_Section = "camera"; - public static final String k_pch_Camera_EnableCamera_Bool = "enableCamera"; - public static final String k_pch_Camera_EnableCameraInDashboard_Bool = "enableCameraInDashboard"; - public static final String k_pch_Camera_EnableCameraForCollisionBounds_Bool = "enableCameraForCollisionBounds"; - public static final String k_pch_Camera_EnableCameraForRoomView_Bool = "enableCameraForRoomView"; - public static final String k_pch_Camera_BoundsColorGammaR_Int32 = "cameraBoundsColorGammaR"; - public static final String k_pch_Camera_BoundsColorGammaG_Int32 = "cameraBoundsColorGammaG"; - public static final String k_pch_Camera_BoundsColorGammaB_Int32 = "cameraBoundsColorGammaB"; - public static final String k_pch_Camera_BoundsColorGammaA_Int32 = "cameraBoundsColorGammaA"; - public static final String k_pch_Camera_BoundsStrength_Int32 = "cameraBoundsStrength"; - public static final String k_pch_audio_Section = "audio"; - public static final String k_pch_audio_OnPlaybackDevice_String = "onPlaybackDevice"; - public static final String k_pch_audio_OnRecordDevice_String = "onRecordDevice"; - public static final String k_pch_audio_OnPlaybackMirrorDevice_String = "onPlaybackMirrorDevice"; - public static final String k_pch_audio_OffPlaybackDevice_String = "offPlaybackDevice"; - public static final String k_pch_audio_OffRecordDevice_String = "offRecordDevice"; - public static final String k_pch_audio_VIVEHDMIGain = "viveHDMIGain"; - public static final String k_pch_Power_Section = "power"; - public static final String k_pch_Power_PowerOffOnExit_Bool = "powerOffOnExit"; - public static final String k_pch_Power_TurnOffScreensTimeout_Float = "turnOffScreensTimeout"; - public static final String k_pch_Power_TurnOffControllersTimeout_Float = "turnOffControllersTimeout"; - public static final String k_pch_Power_ReturnToWatchdogTimeout_Float = "returnToWatchdogTimeout"; - public static final String k_pch_Power_AutoLaunchSteamVROnButtonPress = "autoLaunchSteamVROnButtonPress"; - public static final String k_pch_Power_PauseCompositorOnStandby_Bool = "pauseCompositorOnStandby"; - public static final String k_pch_Dashboard_Section = "dashboard"; - public static final String k_pch_Dashboard_EnableDashboard_Bool = "enableDashboard"; - public static final String k_pch_Dashboard_ArcadeMode_Bool = "arcadeMode"; - public static final String k_pch_modelskin_Section = "modelskins"; - public static final String k_pch_Driver_Enable_Bool = "enable"; - - - public static final String IVRApplications_Version = "FnTable:IVRApplications_006"; - public static final String IVRChaperone_Version = "FnTable:IVRChaperone_003"; - public static final String IVRChaperoneSetup_Version = "FnTable:IVRChaperoneSetup_005"; - public static final String IVRCompositor_Version = "FnTable:IVRCompositor_020"; - public static final String IVRSystem_Version = "FnTable:IVRSystem_016"; - public static final String IVRExtendedDisplay_Version = "FnTable:IVRExtendedDisplay_001"; - public static final String IVRTrackedCamera_Version = "FnTable:IVRTrackedCamera_003"; - public static final String IVROverlay_Version = "FnTable:IVROverlay_016"; - public static final String IVRRenderModels_Version = "FnTable:IVRRenderModels_005"; - public static final String IVRNotifications_Version = "FnTable:IVRNotifications_002"; - public static final String IVRSettings_Version = "FnTable:IVRSettings_002"; - public static final String IVRScreenshots_Version = "FnTable:IVRScreenshots_001"; - public static final String IVRResources_Version = "FnTable:IVRResources_001"; - public static final String IVRDriverManager_Version = "FnTable:IVRDriverManager_001"; - - /** - * Global entry points
    - * Original signature : intptr_t VR_InitInternal(EVRInitError*, EVRApplicationType)
    - * native declaration : headers\openvr_capi.h:1923
    - * @deprecated use the safer methods {@link #VR_InitInternal(java.nio.IntBuffer, int)} and {@link #VR_InitInternal(com.sun.jna.ptr.IntByReference, int)} instead - */ - @Deprecated - public static native IntByReference VR_InitInternal(IntByReference peError, int eType); - /** - * Global entry points
    - * Original signature : intptr_t VR_InitInternal(EVRInitError*, EVRApplicationType)
    - * native declaration : headers\openvr_capi.h:1923 - */ - public static native IntByReference VR_InitInternal(IntBuffer peError, int eType); - /** - * Original signature : void VR_ShutdownInternal()
    - * native declaration : headers\openvr_capi.h:1925 - */ - public static native void VR_ShutdownInternal(); - /** - * Original signature : bool VR_IsHmdPresent()
    - * native declaration : headers\openvr_capi.h:1927 - */ - public static native byte VR_IsHmdPresent(); - /** - * Original signature : intptr_t VR_GetGenericInterface(const char*, EVRInitError*)
    - * native declaration : headers\openvr_capi.h:1929
    - * @deprecated use the safer methods {@link #VR_GetGenericInterface(java.lang.String, java.nio.IntBuffer)} and {@link #VR_GetGenericInterface(com.sun.jna.Pointer, com.sun.jna.ptr.IntByReference)} instead - */ - @Deprecated - public static native IntByReference VR_GetGenericInterface(Pointer pchInterfaceVersion, IntByReference peError); - /** - * Original signature : intptr_t VR_GetGenericInterface(const char*, EVRInitError*)
    - * native declaration : headers\openvr_capi.h:1929 - */ - public static native IntByReference VR_GetGenericInterface(String pchInterfaceVersion, IntByReference peError); - /** - * Original signature : bool VR_IsRuntimeInstalled()
    - * native declaration : headers\openvr_capi.h:1931 - */ - public static native byte VR_IsRuntimeInstalled(); - /** - * Original signature : char* VR_GetVRInitErrorAsSymbol(EVRInitError)
    - * native declaration : headers\openvr_capi.h:1933 - */ - public static native Pointer VR_GetVRInitErrorAsSymbol(int error); - /** - * Original signature : char* VR_GetVRInitErrorAsEnglishDescription(EVRInitError)
    - * native declaration : headers\openvr_capi.h:1935 - */ - public static native Pointer VR_GetVRInitErrorAsEnglishDescription(int error); - public static class VkQueue_T extends PointerType { - public VkQueue_T(Pointer address) { - super(address); - } - public VkQueue_T() { - super(); - } - }; - public static class VkPhysicalDevice_T extends PointerType { - public VkPhysicalDevice_T(Pointer address) { - super(address); - } - public VkPhysicalDevice_T() { - super(); - } - }; - public static class VkInstance_T extends PointerType { - public VkInstance_T(Pointer address) { - super(address); - } - public VkInstance_T() { - super(); - } - }; - public static class ID3D12CommandQueue extends PointerType { - public ID3D12CommandQueue(Pointer address) { - super(address); - } - public ID3D12CommandQueue() { - super(); - } - }; - public static class ID3D12Resource extends PointerType { - public ID3D12Resource(Pointer address) { - super(address); - } - public ID3D12Resource() { - super(); - } - }; - public static class VkDevice_T extends PointerType { - public VkDevice_T(Pointer address) { - super(address); - } - public VkDevice_T() { - super(); - } - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/NotificationBitmap_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/NotificationBitmap_t.java deleted file mode 100644 index 1a932f1ec0..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/NotificationBitmap_t.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1263
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class NotificationBitmap_t extends Structure { - /** - * void *
    - * C type : void* - */ - public Pointer m_pImageData; - public int m_nWidth; - public int m_nHeight; - public int m_nBytesPerPixel; - public NotificationBitmap_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("m_pImageData", "m_nWidth", "m_nHeight", "m_nBytesPerPixel"); - } - /** - * @param m_pImageData void *
    - * C type : void* - */ - public NotificationBitmap_t(Pointer m_pImageData, int m_nWidth, int m_nHeight, int m_nBytesPerPixel) { - super(); - this.m_pImageData = m_pImageData; - this.m_nWidth = m_nWidth; - this.m_nHeight = m_nHeight; - this.m_nBytesPerPixel = m_nBytesPerPixel; - } - public NotificationBitmap_t(Pointer peer) { - super(peer); - } - public static class ByReference extends NotificationBitmap_t implements Structure.ByReference { - - }; - public static class ByValue extends NotificationBitmap_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/OpenVRUtil.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/OpenVRUtil.java deleted file mode 100644 index 78b96e9620..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/OpenVRUtil.java +++ /dev/null @@ -1,774 +0,0 @@ -package com.jme3.system.jopenvr; - -import com.jme3.input.vr.openvr.OpenVRInput; -import com.jme3.system.jopenvr.JOpenVRLibrary.EColorSpace; -import com.jme3.system.jopenvr.JOpenVRLibrary.ETextureType; -import com.jme3.system.jopenvr.JOpenVRLibrary.ETrackedDeviceProperty; -import com.jme3.system.jopenvr.JOpenVRLibrary.ETrackedPropertyError; -import com.jme3.system.jopenvr.JOpenVRLibrary.EVRCompositorError; -import com.jme3.system.jopenvr.JOpenVRLibrary.EVRInitError; -import com.sun.jna.Memory; -import com.sun.jna.Pointer; -import com.sun.jna.ptr.IntByReference; - -/** - * A utility class that provide helper methods for OpenVR system. - * @author Julien Seinturier - 2017 - http://www.seinturier.fr - */ -public class OpenVRUtil { - - /** - * Get the value of the given string {@link JOpenVRLibrary.ETrackedDeviceProperty property} attached to the given device. - * @param system the underlying OpenVR system. - * @param deviceIndex the index of the device to query. - * @param property the property to query. - * @param bufferSize the size of the buffer to use for storing native string. - * @return the value of the given string property attached to the given device. - * @see OpenVRInput#getTrackedControllerCount() - * @see JOpenVRLibrary.ETrackedDeviceProperty - * @see #getTrackedDeviceStringProperty(VR_IVRSystem_FnTable, int, int) - */ - public static String getTrackedDeviceStringProperty(VR_IVRSystem_FnTable system, int deviceIndex, int property, int bufferSize){ - String str =""; - - int unBufferSize = 256; - Pointer pchValue = new Memory(unBufferSize); - IntByReference pError = new IntByReference(); - - system.GetStringTrackedDeviceProperty.apply(deviceIndex, property, pchValue, unBufferSize, pError); - - if (pError.getValue() == ETrackedPropertyError.ETrackedPropertyError_TrackedProp_Success){ - str = pchValue.getString(0); - } else if (pError.getValue() == ETrackedPropertyError.ETrackedPropertyError_TrackedProp_BufferTooSmall){ - throw new IllegalArgumentException("Cannot access property \""+getETrackedDevicePropertyString(property)+"\" ("+property+") for device "+deviceIndex+": "+getETrackedPropertyErrorString(pError.getValue())+" ("+pError.getValue()+")"); - } else if (pError.getValue() == ETrackedPropertyError.ETrackedPropertyError_TrackedProp_CouldNotContactServer){ - throw new IllegalArgumentException("Cannot access property \""+getETrackedDevicePropertyString(property)+"\" ("+property+") for device "+deviceIndex+": "+getETrackedPropertyErrorString(pError.getValue())+" ("+pError.getValue()+")"); - } else if (pError.getValue() == ETrackedPropertyError.ETrackedPropertyError_TrackedProp_InvalidDevice){ - throw new IllegalArgumentException("Cannot access property \""+getETrackedDevicePropertyString(property)+"\" ("+property+") for device "+deviceIndex+": "+getETrackedPropertyErrorString(pError.getValue())+" ("+pError.getValue()+")"); - } else if (pError.getValue() == ETrackedPropertyError.ETrackedPropertyError_TrackedProp_InvalidOperation){ - throw new IllegalArgumentException("Cannot access property \""+getETrackedDevicePropertyString(property)+"\" ("+property+") for device "+deviceIndex+": "+getETrackedPropertyErrorString(pError.getValue())+" ("+pError.getValue()+")"); - } else if (pError.getValue() == ETrackedPropertyError.ETrackedPropertyError_TrackedProp_NotYetAvailable){ - throw new IllegalArgumentException("Cannot access property \""+getETrackedDevicePropertyString(property)+"\" ("+property+") for device "+deviceIndex+": "+getETrackedPropertyErrorString(pError.getValue())+" ("+pError.getValue()+")"); - } else if (pError.getValue() == ETrackedPropertyError.ETrackedPropertyError_TrackedProp_PermissionDenied){ - throw new IllegalArgumentException("Cannot access property \""+getETrackedDevicePropertyString(property)+"\" ("+property+") for device "+deviceIndex+": "+getETrackedPropertyErrorString(pError.getValue())+" ("+pError.getValue()+")"); - } else if (pError.getValue() == ETrackedPropertyError.ETrackedPropertyError_TrackedProp_StringExceedsMaximumLength){ - throw new IllegalArgumentException("Cannot access property \""+getETrackedDevicePropertyString(property)+"\" ("+property+") for device "+deviceIndex+": "+getETrackedPropertyErrorString(pError.getValue())+" ("+pError.getValue()+")"); - } else if (pError.getValue() == ETrackedPropertyError.ETrackedPropertyError_TrackedProp_UnknownProperty){ - throw new IllegalArgumentException("Cannot access property \""+getETrackedDevicePropertyString(property)+"\" ("+property+") for device "+deviceIndex+": "+getETrackedPropertyErrorString(pError.getValue())+" ("+pError.getValue()+")"); - } else if (pError.getValue() == ETrackedPropertyError.ETrackedPropertyError_TrackedProp_ValueNotProvidedByDevice){ - throw new IllegalArgumentException("Cannot access property \""+getETrackedDevicePropertyString(property)+"\" ("+property+") for device "+deviceIndex+": "+getETrackedPropertyErrorString(pError.getValue())+" ("+pError.getValue()+")"); - } else if (pError.getValue() == ETrackedPropertyError.ETrackedPropertyError_TrackedProp_WrongDataType){ - throw new IllegalArgumentException("Cannot access property \""+getETrackedDevicePropertyString(property)+"\" ("+property+") for device "+deviceIndex+": "+getETrackedPropertyErrorString(pError.getValue())+" ("+pError.getValue()+")"); - } else if (pError.getValue() == ETrackedPropertyError.ETrackedPropertyError_TrackedProp_WrongDeviceClass){ - throw new IllegalArgumentException("Cannot access property \""+getETrackedDevicePropertyString(property)+"\" ("+property+") for device "+deviceIndex+": "+getETrackedPropertyErrorString(pError.getValue())+" ("+pError.getValue()+")"); - } else { - throw new IllegalArgumentException("Cannot access property \""+getETrackedDevicePropertyString(property)+"\" ("+property+") for device "+deviceIndex+": "+getETrackedPropertyErrorString(pError.getValue())+" ("+pError.getValue()+")"); - } - - return str; - } - - /** - * Get the value of the given string {@link JOpenVRLibrary.ETrackedDeviceProperty property} attached to the given device. - * @param system the underlying OpenVR system. - * @param deviceIndex the index of the device to query. - * @param property the property to query. - * @return the value of the given string property attached to the given device. - * @see OpenVRInput#getTrackedControllerCount() - * @see JOpenVRLibrary.ETrackedDeviceProperty - * @see #getTrackedDeviceStringProperty(VR_IVRSystem_FnTable, int, int, int) - */ - public static String getTrackedDeviceStringProperty(VR_IVRSystem_FnTable system, int deviceIndex, int property){ - return getTrackedDeviceStringProperty(system, deviceIndex, property, 256); - } - - /** - * Get the String description of the given {@link ETrackedPropertyError string tracked property error}. - * @param error the string tracked property error. - * @return the String description of the given string tracked property error. - */ - public static String getETrackedPropertyErrorString(int error){ - String str =""; - - switch(error){ - case ETrackedPropertyError.ETrackedPropertyError_TrackedProp_Success: - str = "Success"; - break; - case ETrackedPropertyError.ETrackedPropertyError_TrackedProp_WrongDataType: - str = "Wrong data type"; - break; - case ETrackedPropertyError.ETrackedPropertyError_TrackedProp_WrongDeviceClass: - str = "Wrong device class"; - break; - case ETrackedPropertyError.ETrackedPropertyError_TrackedProp_BufferTooSmall: - str = "Buffer too small"; - break; - case ETrackedPropertyError.ETrackedPropertyError_TrackedProp_UnknownProperty: - str = "Unknown property"; - break; - case ETrackedPropertyError.ETrackedPropertyError_TrackedProp_InvalidDevice: - str = "Invalid device"; - break; - case ETrackedPropertyError.ETrackedPropertyError_TrackedProp_CouldNotContactServer: - str = "Could not contact server"; - break; - case ETrackedPropertyError.ETrackedPropertyError_TrackedProp_ValueNotProvidedByDevice: - str = "Value not provided by device"; - break; - case ETrackedPropertyError.ETrackedPropertyError_TrackedProp_StringExceedsMaximumLength: - str = "String exceed maximum length"; - break; - case ETrackedPropertyError.ETrackedPropertyError_TrackedProp_NotYetAvailable: - str = "Not yet available"; - break; - case ETrackedPropertyError.ETrackedPropertyError_TrackedProp_PermissionDenied: - str = "Permission denied"; - break; - case ETrackedPropertyError.ETrackedPropertyError_TrackedProp_InvalidOperation: - str = "Invalid operation"; - break; - default: - str = "Not handled error"; - } - - return str; - } - - /** - * Get the description of the given {@link EColorSpace color space}. - * @param eColorSpace the color space. - * @return the description of the given color space. - */ - public static String getEColorSpaceString(int eColorSpace){ - String str = ""; - - switch(eColorSpace){ - case EColorSpace.EColorSpace_ColorSpace_Auto: - str = "Auto"; - break; - case EColorSpace.EColorSpace_ColorSpace_Gamma: - str = "Gamma"; - break; - case EColorSpace.EColorSpace_ColorSpace_Linear: - str = "Linear"; - break; - default: - str = "Unknown ("+eColorSpace+")"; - } - - return str; - } - - /** - * Get the description of the given {@link ETextureType texture type}. - * @param type the texture type - * @return the description of the given texture type. - */ - public static String getETextureTypeString(int type){ - - String str = ""; - - switch(type){ - case ETextureType.ETextureType_TextureType_DirectX: - str = "DirectX"; - break; - case ETextureType.ETextureType_TextureType_OpenGL: - str = "OpenGL"; - break; - case ETextureType.ETextureType_TextureType_Vulkan: - str = "Vulkan"; - break; - case ETextureType.ETextureType_TextureType_IOSurface: - str = "IOSurface"; - break; - case ETextureType.ETextureType_TextureType_DirectX12: - str = "DirectX12"; - break; - default: - str = "Unknown ("+type+")"; - } - - return str; - } - - /** - * Get the description of the given {@link EVRCompositorError EVR compositor error}. - * @param error the EVR compositor error. - * @return the description of the given EVR compositor error. - */ - public static String getEVRCompositorErrorString(int error){ - String str =""; - - switch(error){ - case EVRCompositorError.EVRCompositorError_VRCompositorError_None: - str = "None"; - break; - case EVRCompositorError.EVRCompositorError_VRCompositorError_RequestFailed: - str = "Request failed"; - break; - case EVRCompositorError.EVRCompositorError_VRCompositorError_IncompatibleVersion: - str = "Incompatible version"; - break; - case EVRCompositorError.EVRCompositorError_VRCompositorError_DoNotHaveFocus: - str = "Do not have focus"; - break; - case EVRCompositorError.EVRCompositorError_VRCompositorError_InvalidTexture: - str = "Invalid texture"; - break; - case EVRCompositorError.EVRCompositorError_VRCompositorError_IsNotSceneApplication: - str = "Is not scene application"; - break; - case EVRCompositorError.EVRCompositorError_VRCompositorError_TextureIsOnWrongDevice: - str = "Texture is on wrong device"; - break; - case EVRCompositorError.EVRCompositorError_VRCompositorError_TextureUsesUnsupportedFormat: - str = "Texture uses unsupported format"; - break; - case EVRCompositorError.EVRCompositorError_VRCompositorError_SharedTexturesNotSupported: - str = "Shared textures not supported"; - break; - case EVRCompositorError.EVRCompositorError_VRCompositorError_IndexOutOfRange: - str = "Index out of range"; - break; - case EVRCompositorError.EVRCompositorError_VRCompositorError_AlreadySubmitted: - str = "Already submitted"; - break; - } - return str; - } - - /** - * Get the description of the given {@link EVRInitError EVR init error}. - * @param error the EVR init error. - * @return the description of the given EVR init error. - */ - public static String getEVRInitErrorString(int error){ - String str = ""; - - switch(error){ - - - case EVRInitError.EVRInitError_VRInitError_None: - str="None"; - break; - case EVRInitError.EVRInitError_VRInitError_Unknown: - str="Unknown"; - break; - case EVRInitError.EVRInitError_VRInitError_Init_InstallationNotFound: - str="Installation not found"; - break; - case EVRInitError.EVRInitError_VRInitError_Init_InstallationCorrupt: - str="Installation corrupt"; - break; - case EVRInitError.EVRInitError_VRInitError_Init_VRClientDLLNotFound: - str="VR Client DLL not found"; - break; - case EVRInitError.EVRInitError_VRInitError_Init_FileNotFound: - str="File not found"; - break; - case EVRInitError.EVRInitError_VRInitError_Init_FactoryNotFound: - str="Factory not found"; - break; - case EVRInitError.EVRInitError_VRInitError_Init_InterfaceNotFound: - str="Interface not found"; - break; - case EVRInitError.EVRInitError_VRInitError_Init_InvalidInterface: - str="Invalid interface"; - break; - case EVRInitError.EVRInitError_VRInitError_Init_UserConfigDirectoryInvalid: - str="User config directory invalid"; - break; - case EVRInitError.EVRInitError_VRInitError_Init_HmdNotFound: - str="HMD not found"; - break; - case EVRInitError.EVRInitError_VRInitError_Init_NotInitialized: - str="Not initialized"; - break; - case EVRInitError.EVRInitError_VRInitError_Init_PathRegistryNotFound: - str="Path registry not found"; - break; - case EVRInitError.EVRInitError_VRInitError_Init_NoConfigPath: - str="No config path"; - break; - case EVRInitError.EVRInitError_VRInitError_Init_NoLogPath: - str="No log path"; - break; - case EVRInitError.EVRInitError_VRInitError_Init_PathRegistryNotWritable: - str="Path registry not writable"; - break; - case EVRInitError.EVRInitError_VRInitError_Init_AppInfoInitFailed: - str="AppInfo init failed"; - break; - case EVRInitError.EVRInitError_VRInitError_Init_Retry: - str="Init retry"; - break; - case EVRInitError.EVRInitError_VRInitError_Init_InitCanceledByUser: - str="Init canceled by user"; - break; - case EVRInitError.EVRInitError_VRInitError_Init_AnotherAppLaunching: - str="Another app launching"; - break; - case EVRInitError.EVRInitError_VRInitError_Init_SettingsInitFailed: - str="Setting init failed"; - break; - case EVRInitError.EVRInitError_VRInitError_Init_ShuttingDown: - str="Shutting down"; - break; - case EVRInitError.EVRInitError_VRInitError_Init_TooManyObjects: - str="Too many objects"; - break; - case EVRInitError.EVRInitError_VRInitError_Init_NoServerForBackgroundApp: - str="No server background app"; - break; - case EVRInitError.EVRInitError_VRInitError_Init_NotSupportedWithCompositor: - str="Not supported with compositor"; - break; - case EVRInitError.EVRInitError_VRInitError_Init_NotAvailableToUtilityApps: - str="Not available to utility apps"; - break; - case EVRInitError.EVRInitError_VRInitError_Init_Internal: - str="Internal"; - break; - case EVRInitError.EVRInitError_VRInitError_Init_HmdDriverIdIsNone: - str="Driver Id is None"; - break; - case EVRInitError.EVRInitError_VRInitError_Init_HmdNotFoundPresenceFailed: - str="HMD not found presence failed"; - break; - case EVRInitError.EVRInitError_VRInitError_Init_VRMonitorNotFound: - str="VR monitor not found"; - break; - case EVRInitError.EVRInitError_VRInitError_Init_VRMonitorStartupFailed: - str="VR monitor startup failed"; - break; - case EVRInitError.EVRInitError_VRInitError_Init_LowPowerWatchdogNotSupported: - str="Low power watchdog not supported"; - break; - case EVRInitError.EVRInitError_VRInitError_Init_InvalidApplicationType: - str="Invalid application type"; - break; - case EVRInitError.EVRInitError_VRInitError_Init_NotAvailableToWatchdogApps: - str="Not available to watchdog apps"; - break; - case EVRInitError.EVRInitError_VRInitError_Init_WatchdogDisabledInSettings: - str="Watchdog disabled in settings"; - break; - case EVRInitError.EVRInitError_VRInitError_Init_VRDashboardNotFound: - str="VR dashboard not found"; - break; - case EVRInitError.EVRInitError_VRInitError_Init_VRDashboardStartupFailed: - str="VR dashboard setup failed"; - break; - case EVRInitError.EVRInitError_VRInitError_Driver_Failed: - str="Driver failed"; - break; - case EVRInitError.EVRInitError_VRInitError_Driver_Unknown: - str="Driver unknown"; - break; - case EVRInitError.EVRInitError_VRInitError_Driver_HmdUnknown: - str="HMD unknown"; - break; - case EVRInitError.EVRInitError_VRInitError_Driver_NotLoaded: - str="Driver not loaded"; - break; - case EVRInitError.EVRInitError_VRInitError_Driver_RuntimeOutOfDate: - str="Driver runtime out of date"; - break; - case EVRInitError.EVRInitError_VRInitError_Driver_HmdInUse: - str="HMD in use"; - break; - case EVRInitError.EVRInitError_VRInitError_Driver_NotCalibrated: - str="Not calibrated"; - break; - case EVRInitError.EVRInitError_VRInitError_Driver_CalibrationInvalid: - str="Calibration invalid"; - break; - case EVRInitError.EVRInitError_VRInitError_Driver_HmdDisplayNotFound: - str="HMD display not found"; - break; - case EVRInitError.EVRInitError_VRInitError_Driver_TrackedDeviceInterfaceUnknown: - str="Tracked device interface unknown"; - break; - case EVRInitError.EVRInitError_VRInitError_Driver_HmdDriverIdOutOfBounds: - str="HMD driver Id out of bounds"; - break; - case EVRInitError.EVRInitError_VRInitError_Driver_HmdDisplayMirrored: - str="HMD display mirrored"; - break; - case EVRInitError.EVRInitError_VRInitError_IPC_ServerInitFailed: - str=""; - break; - case EVRInitError.EVRInitError_VRInitError_IPC_ConnectFailed: str=""; break; - case EVRInitError.EVRInitError_VRInitError_IPC_SharedStateInitFailed: str=""; break; - case EVRInitError.EVRInitError_VRInitError_IPC_CompositorInitFailed: str=""; break; - case EVRInitError.EVRInitError_VRInitError_IPC_MutexInitFailed: str=""; break; - case EVRInitError.EVRInitError_VRInitError_IPC_Failed: str=""; break; - case EVRInitError.EVRInitError_VRInitError_IPC_CompositorConnectFailed: str=""; break; - case EVRInitError.EVRInitError_VRInitError_IPC_CompositorInvalidConnectResponse: str=""; break; - case EVRInitError.EVRInitError_VRInitError_IPC_ConnectFailedAfterMultipleAttempts: str=""; break; - case EVRInitError.EVRInitError_VRInitError_Compositor_Failed: str=""; break; - case EVRInitError.EVRInitError_VRInitError_Compositor_D3D11HardwareRequired: str=""; break; - case EVRInitError.EVRInitError_VRInitError_Compositor_FirmwareRequiresUpdate: str=""; break; - case EVRInitError.EVRInitError_VRInitError_Compositor_OverlayInitFailed: str=""; break; - case EVRInitError.EVRInitError_VRInitError_Compositor_ScreenshotsInitFailed: str=""; break; - case EVRInitError.EVRInitError_VRInitError_VendorSpecific_UnableToConnectToOculusRuntime: str=""; break; - case EVRInitError.EVRInitError_VRInitError_VendorSpecific_HmdFound_CantOpenDevice: str=""; break; - case EVRInitError.EVRInitError_VRInitError_VendorSpecific_HmdFound_UnableToRequestConfigStart: str=""; break; - case EVRInitError.EVRInitError_VRInitError_VendorSpecific_HmdFound_NoStoredConfig: str=""; break; - case EVRInitError.EVRInitError_VRInitError_VendorSpecific_HmdFound_ConfigTooBig: str=""; break; - case EVRInitError.EVRInitError_VRInitError_VendorSpecific_HmdFound_ConfigTooSmall: str=""; break; - case EVRInitError.EVRInitError_VRInitError_VendorSpecific_HmdFound_UnableToInitZLib: str=""; break; - case EVRInitError.EVRInitError_VRInitError_VendorSpecific_HmdFound_CantReadFirmwareVersion: str=""; break; - case EVRInitError.EVRInitError_VRInitError_VendorSpecific_HmdFound_UnableToSendUserDataStart: str=""; break; - case EVRInitError.EVRInitError_VRInitError_VendorSpecific_HmdFound_UnableToGetUserDataStart: str=""; break; - case EVRInitError.EVRInitError_VRInitError_VendorSpecific_HmdFound_UnableToGetUserDataNext: str=""; break; - case EVRInitError.EVRInitError_VRInitError_VendorSpecific_HmdFound_UserDataAddressRange: str=""; break; - case EVRInitError.EVRInitError_VRInitError_VendorSpecific_HmdFound_UserDataError: str=""; break; - case EVRInitError.EVRInitError_VRInitError_VendorSpecific_HmdFound_ConfigFailedSanityCheck: str=""; break; - case EVRInitError.EVRInitError_VRInitError_Steam_SteamInstallationNotFound: str=""; break; - default: - } - - return str; - } - - /** - * Get the description of the given tracked device property. - * @param property the tracked device property. - * @return the description of the given tracked device property. - */ - public static String getETrackedDevicePropertyString(int property){ - String str = ""; - - switch(property){ - - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_Invalid: - str = "Invalid"; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_TrackingSystemName_String: - str = "Tracking system name"; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_ModelNumber_String: - str = "Model number"; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_SerialNumber_String: - str = "Serial number"; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_RenderModelName_String: - str = "Render model name"; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_WillDriftInYaw_Bool: - str = "Will drift in yaw"; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_ManufacturerName_String: - str = "Manufacturer name"; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_TrackingFirmwareVersion_String: - str = "Tracking firmware version"; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_HardwareRevision_String: - str = "Hardware revision"; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_AllWirelessDongleDescriptions_String: - str = "All wireless dongle descriptions"; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_ConnectedWirelessDongle_String: - str = "Connect wireless dongle"; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_DeviceIsWireless_Bool: - str = "Device is wireless"; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_DeviceIsCharging_Bool: - str = "Device is charging"; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_DeviceBatteryPercentage_Float: - str = "Device battery percentage"; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_StatusDisplayTransform_Matrix34: - str = "Status display transform"; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_Firmware_UpdateAvailable_Bool: - str = "Update available"; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_Firmware_ManualUpdate_Bool: - str = "Firmware manual update"; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_Firmware_ManualUpdateURL_String: - str = "Firmware manual update URL"; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_HardwareRevision_Uint64: - str = "Hardware revision"; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_FirmwareVersion_Uint64: - str = "Firmware version"; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_FPGAVersion_Uint64: - str = "FPGA version"; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_VRCVersion_Uint64: - str = "VRC version"; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_RadioVersion_Uint64: - str = "Radio version"; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_DongleVersion_Uint64: - str = "Dongle version"; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_BlockServerShutdown_Bool: - str = "Block server shutdown"; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_CanUnifyCoordinateSystemWithHmd_Bool: - str = "Can unify coordinate system with HMD"; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_ContainsProximitySensor_Bool: - str = "Contains proximity sensor"; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_DeviceProvidesBatteryStatus_Bool: - str = "Device provides battery status"; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_DeviceCanPowerOff_Bool: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_Firmware_ProgrammingTarget_String: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_DeviceClass_Int32: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_HasCamera_Bool: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_DriverVersion_String: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_Firmware_ForceUpdateRequired_Bool: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_ViveSystemButtonFixRequired_Bool: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_ParentDriver_Uint64: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_ReportsTimeSinceVSync_Bool: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_SecondsFromVsyncToPhotons_Float: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_DisplayFrequency_Float: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_UserIpdMeters_Float: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_CurrentUniverseId_Uint64: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_PreviousUniverseId_Uint64: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_DisplayFirmwareVersion_Uint64: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_IsOnDesktop_Bool: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_DisplayMCType_Int32: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_DisplayMCOffset_Float: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_DisplayMCScale_Float: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_EdidVendorID_Int32: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_DisplayMCImageLeft_String: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_DisplayMCImageRight_String: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_DisplayGCBlackClamp_Float: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_EdidProductID_Int32: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_CameraToHeadTransform_Matrix34: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_DisplayGCType_Int32: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_DisplayGCOffset_Float: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_DisplayGCScale_Float: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_DisplayGCPrescale_Float: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_DisplayGCImage_String: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_LensCenterLeftU_Float: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_LensCenterLeftV_Float: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_LensCenterRightU_Float: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_LensCenterRightV_Float: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_UserHeadToEyeDepthMeters_Float: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_CameraFirmwareVersion_Uint64: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_CameraFirmwareDescription_String: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_DisplayFPGAVersion_Uint64: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_DisplayBootloaderVersion_Uint64: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_DisplayHardwareVersion_Uint64: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_AudioFirmwareVersion_Uint64: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_CameraCompatibilityMode_Int32: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_ScreenshotHorizontalFieldOfViewDegrees_Float: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_ScreenshotVerticalFieldOfViewDegrees_Float: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_DisplaySuppressed_Bool: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_DisplayAllowNightMode_Bool: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_DisplayMCImageWidth_Int32: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_DisplayMCImageHeight_Int32: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_DisplayMCImageNumChannels_Int32: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_DisplayMCImageData_Binary: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_AttachedDeviceId_String: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_SupportedButtons_Uint64: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_Axis0Type_Int32: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_Axis1Type_Int32: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_Axis2Type_Int32: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_Axis3Type_Int32: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_Axis4Type_Int32: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_ControllerRoleHint_Int32: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_FieldOfViewLeftDegrees_Float: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_FieldOfViewRightDegrees_Float: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_FieldOfViewTopDegrees_Float: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_FieldOfViewBottomDegrees_Float: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_TrackingRangeMinimumMeters_Float: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_TrackingRangeMaximumMeters_Float: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_ModeLabel_String: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_IconPathName_String: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_NamedIconPathDeviceOff_String: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_NamedIconPathDeviceSearching_String: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_NamedIconPathDeviceSearchingAlert_String: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_NamedIconPathDeviceReady_String: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_NamedIconPathDeviceReadyAlert_String: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_NamedIconPathDeviceNotReady_String: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_NamedIconPathDeviceStandby_String: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_NamedIconPathDeviceAlertLow_String: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_DisplayHiddenArea_Binary_Start: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_DisplayHiddenArea_Binary_End: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_UserConfigPath_String: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_InstallPath_String: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_VendorSpecific_Reserved_Start: - str = ""; - break; - case ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_VendorSpecific_Reserved_End: - str = ""; - break; - } - - - return str; - } -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_ComponentState_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_ComponentState_t.java deleted file mode 100644 index 4bd2b75bc8..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_ComponentState_t.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1232
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class RenderModel_ComponentState_t extends Structure { - /** C type : HmdMatrix34_t */ - public HmdMatrix34_t mTrackingToComponentRenderModel; - /** C type : HmdMatrix34_t */ - public HmdMatrix34_t mTrackingToComponentLocal; - /** C type : VRComponentProperties */ - public int uProperties; - public RenderModel_ComponentState_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("mTrackingToComponentRenderModel", "mTrackingToComponentLocal", "uProperties"); - } - /** - * @param mTrackingToComponentRenderModel C type : HmdMatrix34_t
    - * @param mTrackingToComponentLocal C type : HmdMatrix34_t
    - * @param uProperties C type : VRComponentProperties - */ - public RenderModel_ComponentState_t(HmdMatrix34_t mTrackingToComponentRenderModel, HmdMatrix34_t mTrackingToComponentLocal, int uProperties) { - super(); - this.mTrackingToComponentRenderModel = mTrackingToComponentRenderModel; - this.mTrackingToComponentLocal = mTrackingToComponentLocal; - this.uProperties = uProperties; - } - public RenderModel_ComponentState_t(Pointer peer) { - super(peer); - } - public static class ByReference extends RenderModel_ComponentState_t implements Structure.ByReference { - - }; - public static class ByValue extends RenderModel_ComponentState_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_ControllerMode_State_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_ControllerMode_State_t.java deleted file mode 100644 index 84a2c0b555..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_ControllerMode_State_t.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1256
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class RenderModel_ControllerMode_State_t extends Structure { - public byte bScrollWheelVisible; - public RenderModel_ControllerMode_State_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("bScrollWheelVisible"); - } - public RenderModel_ControllerMode_State_t(byte bScrollWheelVisible) { - super(); - this.bScrollWheelVisible = bScrollWheelVisible; - } - public RenderModel_ControllerMode_State_t(Pointer peer) { - super(peer); - } - public static class ByReference extends RenderModel_ControllerMode_State_t implements Structure.ByReference { - - }; - public static class ByValue extends RenderModel_ControllerMode_State_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_TextureMap_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_TextureMap_t.java deleted file mode 100644 index 06a5d714b0..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_TextureMap_t.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1244
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class RenderModel_TextureMap_t extends Structure { - public short unWidth; - public short unHeight; - /** - * const uint8_t *
    - * C type : uint8_t* - */ - public Pointer rubTextureMapData; - public RenderModel_TextureMap_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("unWidth", "unHeight", "rubTextureMapData"); - } - /** - * @param rubTextureMapData const uint8_t *
    - * C type : uint8_t* - */ - public RenderModel_TextureMap_t(short unWidth, short unHeight, Pointer rubTextureMapData) { - super(); - this.unWidth = unWidth; - this.unHeight = unHeight; - this.rubTextureMapData = rubTextureMapData; - } - public RenderModel_TextureMap_t(Pointer peer) { - super(peer); - } - public static class ByReference extends RenderModel_TextureMap_t implements Structure.ByReference { - - }; - public static class ByValue extends RenderModel_TextureMap_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_Vertex_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_Vertex_t.java deleted file mode 100644 index 5cd761b24f..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_Vertex_t.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1238
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class RenderModel_Vertex_t extends Structure { - /** C type : HmdVector3_t */ - public HmdVector3_t vPosition; - /** C type : HmdVector3_t */ - public HmdVector3_t vNormal; - /** - * float[2]
    - * C type : float[2] - */ - public float[] rfTextureCoord = new float[2]; - public RenderModel_Vertex_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("vPosition", "vNormal", "rfTextureCoord"); - } - /** - * @param vPosition C type : HmdVector3_t
    - * @param vNormal C type : HmdVector3_t
    - * @param rfTextureCoord float[2]
    - * C type : float[2] - */ - public RenderModel_Vertex_t(HmdVector3_t vPosition, HmdVector3_t vNormal, float rfTextureCoord[]) { - super(); - this.vPosition = vPosition; - this.vNormal = vNormal; - if ((rfTextureCoord.length != this.rfTextureCoord.length)) - throw new IllegalArgumentException("Wrong array size !"); - this.rfTextureCoord = rfTextureCoord; - } - public RenderModel_Vertex_t(Pointer peer) { - super(peer); - } - public static class ByReference extends RenderModel_Vertex_t implements Structure.ByReference { - - }; - public static class ByValue extends RenderModel_Vertex_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_t.java deleted file mode 100644 index 9c1f5db2d6..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_t.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.ptr.ShortByReference; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1253
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class RenderModel_t extends Structure { - /** - * const struct vr::RenderModel_Vertex_t *
    - * C type : RenderModel_Vertex_t* - */ - public com.jme3.system.jopenvr.RenderModel_Vertex_t.ByReference rVertexData; - public int unVertexCount; - /** - * const uint16_t *
    - * C type : uint16_t* - */ - public ShortByReference rIndexData; - public int unTriangleCount; - /** C type : TextureID_t */ - public int diffuseTextureId; - public RenderModel_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("rVertexData", "unVertexCount", "rIndexData", "unTriangleCount", "diffuseTextureId"); - } - /** - * @param rVertexData const struct vr::RenderModel_Vertex_t *
    - * C type : RenderModel_Vertex_t*
    - * @param rIndexData const uint16_t *
    - * C type : uint16_t*
    - * @param diffuseTextureId C type : TextureID_t - */ - public RenderModel_t(com.jme3.system.jopenvr.RenderModel_Vertex_t.ByReference rVertexData, int unVertexCount, ShortByReference rIndexData, int unTriangleCount, int diffuseTextureId) { - super(); - this.rVertexData = rVertexData; - this.unVertexCount = unVertexCount; - this.rIndexData = rIndexData; - this.unTriangleCount = unTriangleCount; - this.diffuseTextureId = diffuseTextureId; - } - public RenderModel_t(Pointer peer) { - super(peer); - } - public static class ByReference extends RenderModel_t implements Structure.ByReference { - - }; - public static class ByValue extends RenderModel_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/Texture_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/Texture_t.java deleted file mode 100644 index a9f326f09d..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/Texture_t.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:991
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class Texture_t extends Structure { - /** - * void *
    - * C type : void* - */ - public int handle; - /** - * @see ETextureType
    - * C type : ETextureType - */ - public int eType; - /** - * @see EColorSpace
    - * C type : EColorSpace - */ - public int eColorSpace; - public Texture_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("handle", "eType", "eColorSpace"); - } - /** - * @param handle void *
    - * C type : void*
    - * @param eType @see ETextureType
    - * C type : ETextureType
    - * @param eColorSpace @see EColorSpace
    - * C type : EColorSpace - */ - public Texture_t(int handle, int eType, int eColorSpace) { - super(); - this.handle = handle; - this.eType = eType; - this.eColorSpace = eColorSpace; - } - public Texture_t(Pointer peer) { - super(peer); - } - public static class ByReference extends Texture_t implements Structure.ByReference { - - }; - public static class ByValue extends Texture_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/TrackedDevicePose_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/TrackedDevicePose_t.java deleted file mode 100644 index 9ccdab58ad..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/TrackedDevicePose_t.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1001
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class TrackedDevicePose_t extends Structure { - /** C type : HmdMatrix34_t */ - public HmdMatrix34_t mDeviceToAbsoluteTracking; - /** C type : HmdVector3_t */ - public HmdVector3_t vVelocity; - /** C type : HmdVector3_t */ - public HmdVector3_t vAngularVelocity; - /** - * @see ETrackingResult
    - * C type : ETrackingResult - */ - public int eTrackingResult; - public byte bPoseIsValid; - public byte bDeviceIsConnected; - public TrackedDevicePose_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("mDeviceToAbsoluteTracking", "vVelocity", "vAngularVelocity", "eTrackingResult", "bPoseIsValid", "bDeviceIsConnected"); - } - /** - * @param mDeviceToAbsoluteTracking C type : HmdMatrix34_t
    - * @param vVelocity C type : HmdVector3_t
    - * @param vAngularVelocity C type : HmdVector3_t
    - * @param eTrackingResult @see ETrackingResult
    - * C type : ETrackingResult - */ - public TrackedDevicePose_t(HmdMatrix34_t mDeviceToAbsoluteTracking, HmdVector3_t vVelocity, HmdVector3_t vAngularVelocity, int eTrackingResult, byte bPoseIsValid, byte bDeviceIsConnected) { - super(); - this.mDeviceToAbsoluteTracking = mDeviceToAbsoluteTracking; - this.vVelocity = vVelocity; - this.vAngularVelocity = vAngularVelocity; - this.eTrackingResult = eTrackingResult; - this.bPoseIsValid = bPoseIsValid; - this.bDeviceIsConnected = bDeviceIsConnected; - } - public TrackedDevicePose_t(Pointer peer) { - super(peer); - } - public static class ByReference extends TrackedDevicePose_t implements Structure.ByReference { - - }; - public static class ByValue extends TrackedDevicePose_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRControllerAxis_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRControllerAxis_t.java deleted file mode 100644 index b6fea53aed..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRControllerAxis_t.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1121
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VRControllerAxis_t extends Structure { - public float x; - public float y; - public VRControllerAxis_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("x", "y"); - } - public VRControllerAxis_t(float x, float y) { - super(); - this.x = x; - this.y = y; - } - public VRControllerAxis_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VRControllerAxis_t implements Structure.ByReference { - - }; - public static class ByValue extends VRControllerAxis_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRControllerState_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRControllerState_t.java deleted file mode 100644 index b1415c56bd..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRControllerState_t.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1128
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VRControllerState_t extends Structure { - public int unPacketNum; - public long ulButtonPressed; - public long ulButtonTouched; - /** - * struct vr::VRControllerAxis_t[5]
    - * C type : VRControllerAxis_t[5] - */ - public VRControllerAxis_t[] rAxis = new VRControllerAxis_t[5]; - public VRControllerState_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("unPacketNum", "ulButtonPressed", "ulButtonTouched", "rAxis"); - } - /** - * @param rAxis struct vr::VRControllerAxis_t[5]
    - * C type : VRControllerAxis_t[5] - */ - public VRControllerState_t(int unPacketNum, long ulButtonPressed, long ulButtonTouched, VRControllerAxis_t rAxis[]) { - super(); - this.unPacketNum = unPacketNum; - this.ulButtonPressed = ulButtonPressed; - this.ulButtonTouched = ulButtonTouched; - if ((rAxis.length != this.rAxis.length)) - throw new IllegalArgumentException("Wrong array size !"); - this.rAxis = rAxis; - } - public VRControllerState_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VRControllerState_t implements Structure.ByReference { - - }; - public static class ByValue extends VRControllerState_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_ApplicationLaunch_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_ApplicationLaunch_t.java deleted file mode 100644 index 1a60765616..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_ApplicationLaunch_t.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1099
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_ApplicationLaunch_t extends Structure { - public int pid; - public int unArgsHandle; - public VREvent_ApplicationLaunch_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("pid", "unArgsHandle"); - } - public VREvent_ApplicationLaunch_t(int pid, int unArgsHandle) { - super(); - this.pid = pid; - this.unArgsHandle = unArgsHandle; - } - public VREvent_ApplicationLaunch_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_ApplicationLaunch_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_ApplicationLaunch_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Chaperone_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Chaperone_t.java deleted file mode 100644 index a9f49cfded..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Chaperone_t.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1078
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_Chaperone_t extends Structure { - public long m_nPreviousUniverse; - public long m_nCurrentUniverse; - public VREvent_Chaperone_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("m_nPreviousUniverse", "m_nCurrentUniverse"); - } - public VREvent_Chaperone_t(long m_nPreviousUniverse, long m_nCurrentUniverse) { - super(); - this.m_nPreviousUniverse = m_nPreviousUniverse; - this.m_nCurrentUniverse = m_nCurrentUniverse; - } - public VREvent_Chaperone_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_Chaperone_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_Chaperone_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Controller_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Controller_t.java deleted file mode 100644 index 289bc79cc3..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Controller_t.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1033
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_Controller_t extends Structure { - public int button; - public VREvent_Controller_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("button"); - } - public VREvent_Controller_t(int button) { - super(); - this.button = button; - } - public VREvent_Controller_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_Controller_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_Controller_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Data_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Data_t.java deleted file mode 100644 index be4f2229a6..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Data_t.java +++ /dev/null @@ -1,135 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Union; -/** - * native declaration : headers\openvr_capi.h:1307
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_Data_t extends Union { - /** C type : VREvent_Reserved_t */ - public VREvent_Reserved_t reserved; - /** C type : VREvent_Controller_t */ - public VREvent_Controller_t controller; - /** C type : VREvent_Mouse_t */ - public VREvent_Mouse_t mouse; - /** C type : VREvent_Scroll_t */ - public VREvent_Scroll_t scroll; - /** C type : VREvent_Process_t */ - public VREvent_Process_t process; - /** C type : VREvent_Notification_t */ - public VREvent_Notification_t notification; - /** C type : VREvent_Overlay_t */ - public VREvent_Overlay_t overlay; - /** C type : VREvent_Status_t */ - public VREvent_Status_t status; - /** C type : VREvent_Keyboard_t */ - public VREvent_Keyboard_t keyboard; - /** C type : VREvent_Ipd_t */ - public VREvent_Ipd_t ipd; - /** C type : VREvent_Chaperone_t */ - public VREvent_Chaperone_t chaperone; - /** C type : VREvent_PerformanceTest_t */ - public VREvent_PerformanceTest_t performanceTest; - /** C type : VREvent_TouchPadMove_t */ - public VREvent_TouchPadMove_t touchPadMove; - /** C type : VREvent_SeatedZeroPoseReset_t */ - public VREvent_SeatedZeroPoseReset_t seatedZeroPoseReset; - public VREvent_Data_t() { - super(); - } - /** @param reserved C type : VREvent_Reserved_t */ - public VREvent_Data_t(VREvent_Reserved_t reserved) { - super(); - this.reserved = reserved; - setType(VREvent_Reserved_t.class); - } - /** @param controller C type : VREvent_Controller_t */ - public VREvent_Data_t(VREvent_Controller_t controller) { - super(); - this.controller = controller; - setType(VREvent_Controller_t.class); - } - /** @param mouse C type : VREvent_Mouse_t */ - public VREvent_Data_t(VREvent_Mouse_t mouse) { - super(); - this.mouse = mouse; - setType(VREvent_Mouse_t.class); - } - /** @param scroll C type : VREvent_Scroll_t */ - public VREvent_Data_t(VREvent_Scroll_t scroll) { - super(); - this.scroll = scroll; - setType(VREvent_Scroll_t.class); - } - /** @param process C type : VREvent_Process_t */ - public VREvent_Data_t(VREvent_Process_t process) { - super(); - this.process = process; - setType(VREvent_Process_t.class); - } - /** @param notification C type : VREvent_Notification_t */ - public VREvent_Data_t(VREvent_Notification_t notification) { - super(); - this.notification = notification; - setType(VREvent_Notification_t.class); - } - /** @param overlay C type : VREvent_Overlay_t */ - public VREvent_Data_t(VREvent_Overlay_t overlay) { - super(); - this.overlay = overlay; - setType(VREvent_Overlay_t.class); - } - /** @param status C type : VREvent_Status_t */ - public VREvent_Data_t(VREvent_Status_t status) { - super(); - this.status = status; - setType(VREvent_Status_t.class); - } - /** @param keyboard C type : VREvent_Keyboard_t */ - public VREvent_Data_t(VREvent_Keyboard_t keyboard) { - super(); - this.keyboard = keyboard; - setType(VREvent_Keyboard_t.class); - } - /** @param ipd C type : VREvent_Ipd_t */ - public VREvent_Data_t(VREvent_Ipd_t ipd) { - super(); - this.ipd = ipd; - setType(VREvent_Ipd_t.class); - } - /** @param chaperone C type : VREvent_Chaperone_t */ - public VREvent_Data_t(VREvent_Chaperone_t chaperone) { - super(); - this.chaperone = chaperone; - setType(VREvent_Chaperone_t.class); - } - /** @param performanceTest C type : VREvent_PerformanceTest_t */ - public VREvent_Data_t(VREvent_PerformanceTest_t performanceTest) { - super(); - this.performanceTest = performanceTest; - setType(VREvent_PerformanceTest_t.class); - } - /** @param touchPadMove C type : VREvent_TouchPadMove_t */ - public VREvent_Data_t(VREvent_TouchPadMove_t touchPadMove) { - super(); - this.touchPadMove = touchPadMove; - setType(VREvent_TouchPadMove_t.class); - } - /** @param seatedZeroPoseReset C type : VREvent_SeatedZeroPoseReset_t */ - public VREvent_Data_t(VREvent_SeatedZeroPoseReset_t seatedZeroPoseReset) { - super(); - this.seatedZeroPoseReset = seatedZeroPoseReset; - setType(VREvent_SeatedZeroPoseReset_t.class); - } - public VREvent_Data_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_Data_t implements com.sun.jna.Structure.ByReference { - - }; - public static class ByValue extends VREvent_Data_t implements com.sun.jna.Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_EditingCameraSurface_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_EditingCameraSurface_t.java deleted file mode 100644 index 562fb69ee5..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_EditingCameraSurface_t.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1103
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_EditingCameraSurface_t extends Structure { - public long overlayHandle; - public int nVisualMode; - public VREvent_EditingCameraSurface_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("overlayHandle", "nVisualMode"); - } - public VREvent_EditingCameraSurface_t(long overlayHandle, int nVisualMode) { - super(); - this.overlayHandle = overlayHandle; - this.nVisualMode = nVisualMode; - } - public VREvent_EditingCameraSurface_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_EditingCameraSurface_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_EditingCameraSurface_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Ipd_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Ipd_t.java deleted file mode 100644 index f1c56ba3f7..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Ipd_t.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1074
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_Ipd_t extends Structure { - public float ipdMeters; - public VREvent_Ipd_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("ipdMeters"); - } - public VREvent_Ipd_t(float ipdMeters) { - super(); - this.ipdMeters = ipdMeters; - } - public VREvent_Ipd_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_Ipd_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_Ipd_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Keyboard_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Keyboard_t.java deleted file mode 100644 index 3847d634c3..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Keyboard_t.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1071
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_Keyboard_t extends Structure { - /** - * char[8]
    - * C type : char*[8] - */ - public Pointer[] cNewInput = new Pointer[8]; - public long uUserValue; - public VREvent_Keyboard_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("cNewInput", "uUserValue"); - } - /** - * @param cNewInput char[8]
    - * C type : char*[8] - */ - public VREvent_Keyboard_t(Pointer cNewInput[], long uUserValue) { - super(); - if ((cNewInput.length != this.cNewInput.length)) - throw new IllegalArgumentException("Wrong array size !"); - this.cNewInput = cNewInput; - this.uUserValue = uUserValue; - } - public VREvent_Keyboard_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_Keyboard_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_Keyboard_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_MessageOverlay_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_MessageOverlay_t.java deleted file mode 100644 index d10f3cb989..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_MessageOverlay_t.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1106
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_MessageOverlay_t extends Structure { - public int unVRMessageOverlayResponse; - public VREvent_MessageOverlay_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("unVRMessageOverlayResponse"); - } - public VREvent_MessageOverlay_t(int unVRMessageOverlayResponse) { - super(); - this.unVRMessageOverlayResponse = unVRMessageOverlayResponse; - } - public VREvent_MessageOverlay_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_MessageOverlay_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_MessageOverlay_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Mouse_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Mouse_t.java deleted file mode 100644 index bd2886747d..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Mouse_t.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1038
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_Mouse_t extends Structure { - public float x; - public float y; - public int button; - public VREvent_Mouse_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("x", "y", "button"); - } - public VREvent_Mouse_t(float x, float y, int button) { - super(); - this.x = x; - this.y = y; - this.button = button; - } - public VREvent_Mouse_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_Mouse_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_Mouse_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Notification_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Notification_t.java deleted file mode 100644 index 9f4942e268..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Notification_t.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1055
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_Notification_t extends Structure { - public long ulUserValue; - public int notificationId; - public VREvent_Notification_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("ulUserValue", "notificationId"); - } - public VREvent_Notification_t(long ulUserValue, int notificationId) { - super(); - this.ulUserValue = ulUserValue; - this.notificationId = notificationId; - } - public VREvent_Notification_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_Notification_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_Notification_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Overlay_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Overlay_t.java deleted file mode 100644 index 5ee0360822..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Overlay_t.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1063
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_Overlay_t extends Structure { - public long overlayHandle; - public VREvent_Overlay_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("overlayHandle"); - } - public VREvent_Overlay_t(long overlayHandle) { - super(); - this.overlayHandle = overlayHandle; - } - public VREvent_Overlay_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_Overlay_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_Overlay_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_PerformanceTest_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_PerformanceTest_t.java deleted file mode 100644 index dcb49de815..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_PerformanceTest_t.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1085
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_PerformanceTest_t extends Structure { - public int m_nFidelityLevel; - public VREvent_PerformanceTest_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("m_nFidelityLevel"); - } - public VREvent_PerformanceTest_t(int m_nFidelityLevel) { - super(); - this.m_nFidelityLevel = m_nFidelityLevel; - } - public VREvent_PerformanceTest_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_PerformanceTest_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_PerformanceTest_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Process_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Process_t.java deleted file mode 100644 index e0f957426a..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Process_t.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1060
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_Process_t extends Structure { - public int pid; - public int oldPid; - public byte bForced; - public VREvent_Process_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("pid", "oldPid", "bForced"); - } - public VREvent_Process_t(int pid, int oldPid, byte bForced) { - super(); - this.pid = pid; - this.oldPid = oldPid; - this.bForced = bForced; - } - public VREvent_Process_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_Process_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_Process_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Property_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Property_t.java deleted file mode 100644 index 0b96647781..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Property_t.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1112
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_Property_t extends Structure { - /** C type : PropertyContainerHandle_t */ - public long container; - /** - * @see ETrackedDeviceProperty
    - * C type : ETrackedDeviceProperty - */ - public int prop; - public VREvent_Property_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("container", "prop"); - } - /** - * @param container C type : PropertyContainerHandle_t
    - * @param prop @see ETrackedDeviceProperty
    - * C type : ETrackedDeviceProperty - */ - public VREvent_Property_t(long container, int prop) { - super(); - this.container = container; - this.prop = prop; - } - public VREvent_Property_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_Property_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_Property_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Reserved_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Reserved_t.java deleted file mode 100644 index 18e63c3ee2..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Reserved_t.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1082
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_Reserved_t extends Structure { - public long reserved0; - public long reserved1; - public VREvent_Reserved_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("reserved0", "reserved1"); - } - public VREvent_Reserved_t(long reserved0, long reserved1) { - super(); - this.reserved0 = reserved0; - this.reserved1 = reserved1; - } - public VREvent_Reserved_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_Reserved_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_Reserved_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_ScreenshotProgress_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_ScreenshotProgress_t.java deleted file mode 100644 index 3f822c2832..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_ScreenshotProgress_t.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1095
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_ScreenshotProgress_t extends Structure { - public float progress; - public VREvent_ScreenshotProgress_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("progress"); - } - public VREvent_ScreenshotProgress_t(float progress) { - super(); - this.progress = progress; - } - public VREvent_ScreenshotProgress_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_ScreenshotProgress_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_ScreenshotProgress_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Screenshot_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Screenshot_t.java deleted file mode 100644 index 5a5f5ea916..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Screenshot_t.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1092
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_Screenshot_t extends Structure { - public int handle; - public int type; - public VREvent_Screenshot_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("handle", "type"); - } - public VREvent_Screenshot_t(int handle, int type) { - super(); - this.handle = handle; - this.type = type; - } - public VREvent_Screenshot_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_Screenshot_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_Screenshot_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Scroll_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Scroll_t.java deleted file mode 100644 index 7c4090b1fb..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Scroll_t.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1043
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_Scroll_t extends Structure { - public float xdelta; - public float ydelta; - public int repeatCount; - public VREvent_Scroll_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("xdelta", "ydelta", "repeatCount"); - } - public VREvent_Scroll_t(float xdelta, float ydelta, int repeatCount) { - super(); - this.xdelta = xdelta; - this.ydelta = ydelta; - this.repeatCount = repeatCount; - } - public VREvent_Scroll_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_Scroll_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_Scroll_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_SeatedZeroPoseReset_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_SeatedZeroPoseReset_t.java deleted file mode 100644 index d051ec5e4c..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_SeatedZeroPoseReset_t.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1088
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_SeatedZeroPoseReset_t extends Structure { - public byte bResetBySystemMenu; - public VREvent_SeatedZeroPoseReset_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("bResetBySystemMenu"); - } - public VREvent_SeatedZeroPoseReset_t(byte bResetBySystemMenu) { - super(); - this.bResetBySystemMenu = bResetBySystemMenu; - } - public VREvent_SeatedZeroPoseReset_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_SeatedZeroPoseReset_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_SeatedZeroPoseReset_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Status_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Status_t.java deleted file mode 100644 index f69fcd9bf8..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Status_t.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1066
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_Status_t extends Structure { - public int statusState; - public VREvent_Status_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("statusState"); - } - public VREvent_Status_t(int statusState) { - super(); - this.statusState = statusState; - } - public VREvent_Status_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_Status_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_Status_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_TouchPadMove_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_TouchPadMove_t.java deleted file mode 100644 index dd963ae705..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_TouchPadMove_t.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1051
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_TouchPadMove_t extends Structure { - public byte bFingerDown; - public float flSecondsFingerDown; - public float fValueXFirst; - public float fValueYFirst; - public float fValueXRaw; - public float fValueYRaw; - public VREvent_TouchPadMove_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("bFingerDown", "flSecondsFingerDown", "fValueXFirst", "fValueYFirst", "fValueXRaw", "fValueYRaw"); - } - public VREvent_TouchPadMove_t(byte bFingerDown, float flSecondsFingerDown, float fValueXFirst, float fValueYFirst, float fValueXRaw, float fValueYRaw) { - super(); - this.bFingerDown = bFingerDown; - this.flSecondsFingerDown = flSecondsFingerDown; - this.fValueXFirst = fValueXFirst; - this.fValueYFirst = fValueYFirst; - this.fValueXRaw = fValueXRaw; - this.fValueYRaw = fValueYRaw; - } - public VREvent_TouchPadMove_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_TouchPadMove_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_TouchPadMove_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_t.java deleted file mode 100644 index 24be43e22e..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_t.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * An event posted by the server to all running applications
    - * native declaration : headers\openvr_capi.h:1315
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_t extends Structure { - /** EVREventType enum */ - public int eventType; - /** C type : TrackedDeviceIndex_t */ - public int trackedDeviceIndex; - public float eventAgeSeconds; - /** C type : VREvent_Data_t */ - public VREvent_Data_t data; - public VREvent_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("eventType", "trackedDeviceIndex", "eventAgeSeconds", "data"); - } - /** - * @param eventType EVREventType enum
    - * @param trackedDeviceIndex C type : TrackedDeviceIndex_t
    - * @param data C type : VREvent_Data_t - */ - public VREvent_t(int eventType, int trackedDeviceIndex, float eventAgeSeconds, VREvent_Data_t data) { - super(); - this.eventType = eventType; - this.trackedDeviceIndex = trackedDeviceIndex; - this.eventAgeSeconds = eventAgeSeconds; - this.data = data; - } - public VREvent_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VROverlayIntersectionMaskPrimitive_Data_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VROverlayIntersectionMaskPrimitive_Data_t.java deleted file mode 100644 index 4ac797b97a..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VROverlayIntersectionMaskPrimitive_Data_t.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Union; -/** - * native declaration : headers\openvr_capi.h:1319
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VROverlayIntersectionMaskPrimitive_Data_t extends Union { - /** C type : IntersectionMaskRectangle_t */ - public IntersectionMaskRectangle_t m_Rectangle; - /** C type : IntersectionMaskCircle_t */ - public IntersectionMaskCircle_t m_Circle; - public VROverlayIntersectionMaskPrimitive_Data_t() { - super(); - } - /** @param m_Rectangle C type : IntersectionMaskRectangle_t */ - public VROverlayIntersectionMaskPrimitive_Data_t(IntersectionMaskRectangle_t m_Rectangle) { - super(); - this.m_Rectangle = m_Rectangle; - setType(IntersectionMaskRectangle_t.class); - } - /** @param m_Circle C type : IntersectionMaskCircle_t */ - public VROverlayIntersectionMaskPrimitive_Data_t(IntersectionMaskCircle_t m_Circle) { - super(); - this.m_Circle = m_Circle; - setType(IntersectionMaskCircle_t.class); - } - public VROverlayIntersectionMaskPrimitive_Data_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VROverlayIntersectionMaskPrimitive_Data_t implements com.sun.jna.Structure.ByReference { - - }; - public static class ByValue extends VROverlayIntersectionMaskPrimitive_Data_t implements com.sun.jna.Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VROverlayIntersectionMaskPrimitive_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VROverlayIntersectionMaskPrimitive_t.java deleted file mode 100644 index 962fbe3404..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VROverlayIntersectionMaskPrimitive_t.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1323
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VROverlayIntersectionMaskPrimitive_t extends Structure { - /** - * @see EVROverlayIntersectionMaskPrimitiveType
    - * C type : EVROverlayIntersectionMaskPrimitiveType - */ - public int m_nPrimitiveType; - /** C type : VROverlayIntersectionMaskPrimitive_Data_t */ - public VROverlayIntersectionMaskPrimitive_Data_t m_Primitive; - public VROverlayIntersectionMaskPrimitive_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("m_nPrimitiveType", "m_Primitive"); - } - /** - * @param m_nPrimitiveType @see EVROverlayIntersectionMaskPrimitiveType
    - * C type : EVROverlayIntersectionMaskPrimitiveType
    - * @param m_Primitive C type : VROverlayIntersectionMaskPrimitive_Data_t - */ - public VROverlayIntersectionMaskPrimitive_t(int m_nPrimitiveType, VROverlayIntersectionMaskPrimitive_Data_t m_Primitive) { - super(); - this.m_nPrimitiveType = m_nPrimitiveType; - this.m_Primitive = m_Primitive; - } - public VROverlayIntersectionMaskPrimitive_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VROverlayIntersectionMaskPrimitive_t implements Structure.ByReference { - - }; - public static class ByValue extends VROverlayIntersectionMaskPrimitive_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VROverlayIntersectionParams_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VROverlayIntersectionParams_t.java deleted file mode 100644 index ce72360f70..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VROverlayIntersectionParams_t.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1210
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VROverlayIntersectionParams_t extends Structure { - /** C type : HmdVector3_t */ - public HmdVector3_t vSource; - /** C type : HmdVector3_t */ - public HmdVector3_t vDirection; - /** - * @see ETrackingUniverseOrigin
    - * C type : ETrackingUniverseOrigin - */ - public int eOrigin; - public VROverlayIntersectionParams_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("vSource", "vDirection", "eOrigin"); - } - /** - * @param vSource C type : HmdVector3_t
    - * @param vDirection C type : HmdVector3_t
    - * @param eOrigin @see ETrackingUniverseOrigin
    - * C type : ETrackingUniverseOrigin - */ - public VROverlayIntersectionParams_t(HmdVector3_t vSource, HmdVector3_t vDirection, int eOrigin) { - super(); - this.vSource = vSource; - this.vDirection = vDirection; - this.eOrigin = eOrigin; - } - public VROverlayIntersectionParams_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VROverlayIntersectionParams_t implements Structure.ByReference { - - }; - public static class ByValue extends VROverlayIntersectionParams_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VROverlayIntersectionResults_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VROverlayIntersectionResults_t.java deleted file mode 100644 index be0df71651..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VROverlayIntersectionResults_t.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1216
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VROverlayIntersectionResults_t extends Structure { - /** C type : HmdVector3_t */ - public HmdVector3_t vPoint; - /** C type : HmdVector3_t */ - public HmdVector3_t vNormal; - /** C type : HmdVector2_t */ - public HmdVector2_t vUVs; - public float fDistance; - public VROverlayIntersectionResults_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("vPoint", "vNormal", "vUVs", "fDistance"); - } - /** - * @param vPoint C type : HmdVector3_t
    - * @param vNormal C type : HmdVector3_t
    - * @param vUVs C type : HmdVector2_t - */ - public VROverlayIntersectionResults_t(HmdVector3_t vPoint, HmdVector3_t vNormal, HmdVector2_t vUVs, float fDistance) { - super(); - this.vPoint = vPoint; - this.vNormal = vNormal; - this.vUVs = vUVs; - this.fDistance = fDistance; - } - public VROverlayIntersectionResults_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VROverlayIntersectionResults_t implements Structure.ByReference { - - }; - public static class ByValue extends VROverlayIntersectionResults_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRTextureBounds_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRTextureBounds_t.java deleted file mode 100644 index 9bb56e46d2..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRTextureBounds_t.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1007
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VRTextureBounds_t extends Structure { - public float uMin; - public float vMin; - public float uMax; - public float vMax; - public VRTextureBounds_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("uMin", "vMin", "uMax", "vMax"); - } - public VRTextureBounds_t(float uMin, float vMin, float uMax, float vMax) { - super(); - this.uMin = uMin; - this.vMin = vMin; - this.uMax = uMax; - this.vMax = vMax; - } - public VRTextureBounds_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VRTextureBounds_t implements Structure.ByReference { - - }; - public static class ByValue extends VRTextureBounds_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRVulkanTextureData_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRVulkanTextureData_t.java deleted file mode 100644 index 08ef57c49f..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRVulkanTextureData_t.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.jme3.system.jopenvr; -import com.jme3.system.jopenvr.JOpenVRLibrary.VkDevice_T; -import com.jme3.system.jopenvr.JOpenVRLibrary.VkInstance_T; -import com.jme3.system.jopenvr.JOpenVRLibrary.VkPhysicalDevice_T; -import com.jme3.system.jopenvr.JOpenVRLibrary.VkQueue_T; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1023
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VRVulkanTextureData_t extends Structure { - public long m_nImage; - /** - * struct VkDevice_T *
    - * C type : VkDevice_T* - */ - public VkDevice_T m_pDevice; - /** - * struct VkPhysicalDevice_T *
    - * C type : VkPhysicalDevice_T* - */ - public VkPhysicalDevice_T m_pPhysicalDevice; - /** - * struct VkInstance_T *
    - * C type : VkInstance_T* - */ - public VkInstance_T m_pInstance; - /** - * struct VkQueue_T *
    - * C type : VkQueue_T* - */ - public VkQueue_T m_pQueue; - public int m_nQueueFamilyIndex; - public int m_nWidth; - public int m_nHeight; - public int m_nFormat; - public int m_nSampleCount; - public VRVulkanTextureData_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("m_nImage", "m_pDevice", "m_pPhysicalDevice", "m_pInstance", "m_pQueue", "m_nQueueFamilyIndex", "m_nWidth", "m_nHeight", "m_nFormat", "m_nSampleCount"); - } - public VRVulkanTextureData_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VRVulkanTextureData_t implements Structure.ByReference { - - }; - public static class ByValue extends VRVulkanTextureData_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRApplications_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRApplications_FnTable.java deleted file mode 100644 index 8102beac3d..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRApplications_FnTable.java +++ /dev/null @@ -1,216 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Callback; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.ptr.IntByReference; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1514
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VR_IVRApplications_FnTable extends Structure { - /** C type : AddApplicationManifest_callback* */ - public VR_IVRApplications_FnTable.AddApplicationManifest_callback AddApplicationManifest; - /** C type : RemoveApplicationManifest_callback* */ - public VR_IVRApplications_FnTable.RemoveApplicationManifest_callback RemoveApplicationManifest; - /** C type : IsApplicationInstalled_callback* */ - public VR_IVRApplications_FnTable.IsApplicationInstalled_callback IsApplicationInstalled; - /** C type : GetApplicationCount_callback* */ - public VR_IVRApplications_FnTable.GetApplicationCount_callback GetApplicationCount; - /** C type : GetApplicationKeyByIndex_callback* */ - public VR_IVRApplications_FnTable.GetApplicationKeyByIndex_callback GetApplicationKeyByIndex; - /** C type : GetApplicationKeyByProcessId_callback* */ - public VR_IVRApplications_FnTable.GetApplicationKeyByProcessId_callback GetApplicationKeyByProcessId; - /** C type : LaunchApplication_callback* */ - public VR_IVRApplications_FnTable.LaunchApplication_callback LaunchApplication; - /** C type : LaunchTemplateApplication_callback* */ - public VR_IVRApplications_FnTable.LaunchTemplateApplication_callback LaunchTemplateApplication; - /** C type : LaunchApplicationFromMimeType_callback* */ - public VR_IVRApplications_FnTable.LaunchApplicationFromMimeType_callback LaunchApplicationFromMimeType; - /** C type : LaunchDashboardOverlay_callback* */ - public VR_IVRApplications_FnTable.LaunchDashboardOverlay_callback LaunchDashboardOverlay; - /** C type : CancelApplicationLaunch_callback* */ - public VR_IVRApplications_FnTable.CancelApplicationLaunch_callback CancelApplicationLaunch; - /** C type : IdentifyApplication_callback* */ - public VR_IVRApplications_FnTable.IdentifyApplication_callback IdentifyApplication; - /** C type : GetApplicationProcessId_callback* */ - public VR_IVRApplications_FnTable.GetApplicationProcessId_callback GetApplicationProcessId; - /** C type : GetApplicationsErrorNameFromEnum_callback* */ - public VR_IVRApplications_FnTable.GetApplicationsErrorNameFromEnum_callback GetApplicationsErrorNameFromEnum; - /** C type : GetApplicationPropertyString_callback* */ - public VR_IVRApplications_FnTable.GetApplicationPropertyString_callback GetApplicationPropertyString; - /** C type : GetApplicationPropertyBool_callback* */ - public VR_IVRApplications_FnTable.GetApplicationPropertyBool_callback GetApplicationPropertyBool; - /** C type : GetApplicationPropertyUint64_callback* */ - public VR_IVRApplications_FnTable.GetApplicationPropertyUint64_callback GetApplicationPropertyUint64; - /** C type : SetApplicationAutoLaunch_callback* */ - public VR_IVRApplications_FnTable.SetApplicationAutoLaunch_callback SetApplicationAutoLaunch; - /** C type : GetApplicationAutoLaunch_callback* */ - public VR_IVRApplications_FnTable.GetApplicationAutoLaunch_callback GetApplicationAutoLaunch; - /** C type : SetDefaultApplicationForMimeType_callback* */ - public VR_IVRApplications_FnTable.SetDefaultApplicationForMimeType_callback SetDefaultApplicationForMimeType; - /** C type : GetDefaultApplicationForMimeType_callback* */ - public VR_IVRApplications_FnTable.GetDefaultApplicationForMimeType_callback GetDefaultApplicationForMimeType; - /** C type : GetApplicationSupportedMimeTypes_callback* */ - public VR_IVRApplications_FnTable.GetApplicationSupportedMimeTypes_callback GetApplicationSupportedMimeTypes; - /** C type : GetApplicationsThatSupportMimeType_callback* */ - public VR_IVRApplications_FnTable.GetApplicationsThatSupportMimeType_callback GetApplicationsThatSupportMimeType; - /** C type : GetApplicationLaunchArguments_callback* */ - public VR_IVRApplications_FnTable.GetApplicationLaunchArguments_callback GetApplicationLaunchArguments; - /** C type : GetStartingApplication_callback* */ - public VR_IVRApplications_FnTable.GetStartingApplication_callback GetStartingApplication; - /** C type : GetTransitionState_callback* */ - public VR_IVRApplications_FnTable.GetTransitionState_callback GetTransitionState; - /** C type : PerformApplicationPrelaunchCheck_callback* */ - public VR_IVRApplications_FnTable.PerformApplicationPrelaunchCheck_callback PerformApplicationPrelaunchCheck; - /** C type : GetApplicationsTransitionStateNameFromEnum_callback* */ - public VR_IVRApplications_FnTable.GetApplicationsTransitionStateNameFromEnum_callback GetApplicationsTransitionStateNameFromEnum; - /** C type : IsQuitUserPromptRequested_callback* */ - public VR_IVRApplications_FnTable.IsQuitUserPromptRequested_callback IsQuitUserPromptRequested; - /** C type : LaunchInternalProcess_callback* */ - public VR_IVRApplications_FnTable.LaunchInternalProcess_callback LaunchInternalProcess; - /** C type : GetCurrentSceneProcessId_callback* */ - public VR_IVRApplications_FnTable.GetCurrentSceneProcessId_callback GetCurrentSceneProcessId; - /** native declaration : headers\openvr_capi.h:1483 */ - public interface AddApplicationManifest_callback extends Callback { - int apply(Pointer pchApplicationManifestFullPath, byte bTemporary); - }; - /** native declaration : headers\openvr_capi.h:1484 */ - public interface RemoveApplicationManifest_callback extends Callback { - int apply(Pointer pchApplicationManifestFullPath); - }; - /** native declaration : headers\openvr_capi.h:1485 */ - public interface IsApplicationInstalled_callback extends Callback { - byte apply(Pointer pchAppKey); - }; - /** native declaration : headers\openvr_capi.h:1486 */ - public interface GetApplicationCount_callback extends Callback { - int apply(); - }; - /** native declaration : headers\openvr_capi.h:1487 */ - public interface GetApplicationKeyByIndex_callback extends Callback { - int apply(int unApplicationIndex, Pointer pchAppKeyBuffer, int unAppKeyBufferLen); - }; - /** native declaration : headers\openvr_capi.h:1488 */ - public interface GetApplicationKeyByProcessId_callback extends Callback { - int apply(int unProcessId, Pointer pchAppKeyBuffer, int unAppKeyBufferLen); - }; - /** native declaration : headers\openvr_capi.h:1489 */ - public interface LaunchApplication_callback extends Callback { - int apply(Pointer pchAppKey); - }; - /** native declaration : headers\openvr_capi.h:1490 */ - public interface LaunchTemplateApplication_callback extends Callback { - int apply(Pointer pchTemplateAppKey, Pointer pchNewAppKey, AppOverrideKeys_t pKeys, int unKeys); - }; - /** native declaration : headers\openvr_capi.h:1491 */ - public interface LaunchApplicationFromMimeType_callback extends Callback { - int apply(Pointer pchMimeType, Pointer pchArgs); - }; - /** native declaration : headers\openvr_capi.h:1492 */ - public interface LaunchDashboardOverlay_callback extends Callback { - int apply(Pointer pchAppKey); - }; - /** native declaration : headers\openvr_capi.h:1493 */ - public interface CancelApplicationLaunch_callback extends Callback { - byte apply(Pointer pchAppKey); - }; - /** native declaration : headers\openvr_capi.h:1494 */ - public interface IdentifyApplication_callback extends Callback { - int apply(int unProcessId, Pointer pchAppKey); - }; - /** native declaration : headers\openvr_capi.h:1495 */ - public interface GetApplicationProcessId_callback extends Callback { - int apply(Pointer pchAppKey); - }; - /** native declaration : headers\openvr_capi.h:1496 */ - public interface GetApplicationsErrorNameFromEnum_callback extends Callback { - Pointer apply(int error); - }; - /** native declaration : headers\openvr_capi.h:1497 */ - public interface GetApplicationPropertyString_callback extends Callback { - int apply(Pointer pchAppKey, int eProperty, Pointer pchPropertyValueBuffer, int unPropertyValueBufferLen, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:1498 */ - public interface GetApplicationPropertyBool_callback extends Callback { - byte apply(Pointer pchAppKey, int eProperty, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:1499 */ - public interface GetApplicationPropertyUint64_callback extends Callback { - long apply(Pointer pchAppKey, int eProperty, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:1500 */ - public interface SetApplicationAutoLaunch_callback extends Callback { - int apply(Pointer pchAppKey, byte bAutoLaunch); - }; - /** native declaration : headers\openvr_capi.h:1501 */ - public interface GetApplicationAutoLaunch_callback extends Callback { - byte apply(Pointer pchAppKey); - }; - /** native declaration : headers\openvr_capi.h:1502 */ - public interface SetDefaultApplicationForMimeType_callback extends Callback { - int apply(Pointer pchAppKey, Pointer pchMimeType); - }; - /** native declaration : headers\openvr_capi.h:1503 */ - public interface GetDefaultApplicationForMimeType_callback extends Callback { - byte apply(Pointer pchMimeType, Pointer pchAppKeyBuffer, int unAppKeyBufferLen); - }; - /** native declaration : headers\openvr_capi.h:1504 */ - public interface GetApplicationSupportedMimeTypes_callback extends Callback { - byte apply(Pointer pchAppKey, Pointer pchMimeTypesBuffer, int unMimeTypesBuffer); - }; - /** native declaration : headers\openvr_capi.h:1505 */ - public interface GetApplicationsThatSupportMimeType_callback extends Callback { - int apply(Pointer pchMimeType, Pointer pchAppKeysThatSupportBuffer, int unAppKeysThatSupportBuffer); - }; - /** native declaration : headers\openvr_capi.h:1506 */ - public interface GetApplicationLaunchArguments_callback extends Callback { - int apply(int unHandle, Pointer pchArgs, int unArgs); - }; - /** native declaration : headers\openvr_capi.h:1507 */ - public interface GetStartingApplication_callback extends Callback { - int apply(Pointer pchAppKeyBuffer, int unAppKeyBufferLen); - }; - /** native declaration : headers\openvr_capi.h:1508 */ - public interface GetTransitionState_callback extends Callback { - int apply(); - }; - /** native declaration : headers\openvr_capi.h:1509 */ - public interface PerformApplicationPrelaunchCheck_callback extends Callback { - int apply(Pointer pchAppKey); - }; - /** native declaration : headers\openvr_capi.h:1510 */ - public interface GetApplicationsTransitionStateNameFromEnum_callback extends Callback { - Pointer apply(int state); - }; - /** native declaration : headers\openvr_capi.h:1511 */ - public interface IsQuitUserPromptRequested_callback extends Callback { - byte apply(); - }; - /** native declaration : headers\openvr_capi.h:1512 */ - public interface LaunchInternalProcess_callback extends Callback { - int apply(Pointer pchBinaryPath, Pointer pchArguments, Pointer pchWorkingDirectory); - }; - /** native declaration : headers\openvr_capi.h:1513 */ - public interface GetCurrentSceneProcessId_callback extends Callback { - int apply(); - }; - public VR_IVRApplications_FnTable() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("AddApplicationManifest", "RemoveApplicationManifest", "IsApplicationInstalled", "GetApplicationCount", "GetApplicationKeyByIndex", "GetApplicationKeyByProcessId", "LaunchApplication", "LaunchTemplateApplication", "LaunchApplicationFromMimeType", "LaunchDashboardOverlay", "CancelApplicationLaunch", "IdentifyApplication", "GetApplicationProcessId", "GetApplicationsErrorNameFromEnum", "GetApplicationPropertyString", "GetApplicationPropertyBool", "GetApplicationPropertyUint64", "SetApplicationAutoLaunch", "GetApplicationAutoLaunch", "SetDefaultApplicationForMimeType", "GetDefaultApplicationForMimeType", "GetApplicationSupportedMimeTypes", "GetApplicationsThatSupportMimeType", "GetApplicationLaunchArguments", "GetStartingApplication", "GetTransitionState", "PerformApplicationPrelaunchCheck", "GetApplicationsTransitionStateNameFromEnum", "IsQuitUserPromptRequested", "LaunchInternalProcess", "GetCurrentSceneProcessId"); - } - public VR_IVRApplications_FnTable(Pointer peer) { - super(peer); - } - public static class ByReference extends VR_IVRApplications_FnTable implements Structure.ByReference { - - }; - public static class ByValue extends VR_IVRApplications_FnTable implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRChaperoneSetup_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRChaperoneSetup_FnTable.java deleted file mode 100644 index 32708848f7..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRChaperoneSetup_FnTable.java +++ /dev/null @@ -1,151 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Callback; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.ptr.FloatByReference; -import com.sun.jna.ptr.IntByReference; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1574
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VR_IVRChaperoneSetup_FnTable extends Structure { - /** C type : CommitWorkingCopy_callback* */ - public VR_IVRChaperoneSetup_FnTable.CommitWorkingCopy_callback CommitWorkingCopy; - /** C type : RevertWorkingCopy_callback* */ - public VR_IVRChaperoneSetup_FnTable.RevertWorkingCopy_callback RevertWorkingCopy; - /** C type : GetWorkingPlayAreaSize_callback* */ - public VR_IVRChaperoneSetup_FnTable.GetWorkingPlayAreaSize_callback GetWorkingPlayAreaSize; - /** C type : GetWorkingPlayAreaRect_callback* */ - public VR_IVRChaperoneSetup_FnTable.GetWorkingPlayAreaRect_callback GetWorkingPlayAreaRect; - /** C type : GetWorkingCollisionBoundsInfo_callback* */ - public VR_IVRChaperoneSetup_FnTable.GetWorkingCollisionBoundsInfo_callback GetWorkingCollisionBoundsInfo; - /** C type : GetLiveCollisionBoundsInfo_callback* */ - public VR_IVRChaperoneSetup_FnTable.GetLiveCollisionBoundsInfo_callback GetLiveCollisionBoundsInfo; - /** C type : GetWorkingSeatedZeroPoseToRawTrackingPose_callback* */ - public VR_IVRChaperoneSetup_FnTable.GetWorkingSeatedZeroPoseToRawTrackingPose_callback GetWorkingSeatedZeroPoseToRawTrackingPose; - /** C type : GetWorkingStandingZeroPoseToRawTrackingPose_callback* */ - public VR_IVRChaperoneSetup_FnTable.GetWorkingStandingZeroPoseToRawTrackingPose_callback GetWorkingStandingZeroPoseToRawTrackingPose; - /** C type : SetWorkingPlayAreaSize_callback* */ - public VR_IVRChaperoneSetup_FnTable.SetWorkingPlayAreaSize_callback SetWorkingPlayAreaSize; - /** C type : SetWorkingCollisionBoundsInfo_callback* */ - public VR_IVRChaperoneSetup_FnTable.SetWorkingCollisionBoundsInfo_callback SetWorkingCollisionBoundsInfo; - /** C type : SetWorkingSeatedZeroPoseToRawTrackingPose_callback* */ - public VR_IVRChaperoneSetup_FnTable.SetWorkingSeatedZeroPoseToRawTrackingPose_callback SetWorkingSeatedZeroPoseToRawTrackingPose; - /** C type : SetWorkingStandingZeroPoseToRawTrackingPose_callback* */ - public VR_IVRChaperoneSetup_FnTable.SetWorkingStandingZeroPoseToRawTrackingPose_callback SetWorkingStandingZeroPoseToRawTrackingPose; - /** C type : ReloadFromDisk_callback* */ - public VR_IVRChaperoneSetup_FnTable.ReloadFromDisk_callback ReloadFromDisk; - /** C type : GetLiveSeatedZeroPoseToRawTrackingPose_callback* */ - public VR_IVRChaperoneSetup_FnTable.GetLiveSeatedZeroPoseToRawTrackingPose_callback GetLiveSeatedZeroPoseToRawTrackingPose; - /** C type : SetWorkingCollisionBoundsTagsInfo_callback* */ - public VR_IVRChaperoneSetup_FnTable.SetWorkingCollisionBoundsTagsInfo_callback SetWorkingCollisionBoundsTagsInfo; - /** C type : GetLiveCollisionBoundsTagsInfo_callback* */ - public VR_IVRChaperoneSetup_FnTable.GetLiveCollisionBoundsTagsInfo_callback GetLiveCollisionBoundsTagsInfo; - /** C type : SetWorkingPhysicalBoundsInfo_callback* */ - public VR_IVRChaperoneSetup_FnTable.SetWorkingPhysicalBoundsInfo_callback SetWorkingPhysicalBoundsInfo; - /** C type : GetLivePhysicalBoundsInfo_callback* */ - public VR_IVRChaperoneSetup_FnTable.GetLivePhysicalBoundsInfo_callback GetLivePhysicalBoundsInfo; - /** C type : ExportLiveToBuffer_callback* */ - public VR_IVRChaperoneSetup_FnTable.ExportLiveToBuffer_callback ExportLiveToBuffer; - /** C type : ImportFromBufferToWorking_callback* */ - public VR_IVRChaperoneSetup_FnTable.ImportFromBufferToWorking_callback ImportFromBufferToWorking; - /** native declaration : headers\openvr_capi.h:1554 */ - public interface CommitWorkingCopy_callback extends Callback { - byte apply(int configFile); - }; - /** native declaration : headers\openvr_capi.h:1555 */ - public interface RevertWorkingCopy_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:1556 */ - public interface GetWorkingPlayAreaSize_callback extends Callback { - byte apply(FloatByReference pSizeX, FloatByReference pSizeZ); - }; - /** native declaration : headers\openvr_capi.h:1557 */ - public interface GetWorkingPlayAreaRect_callback extends Callback { - byte apply(HmdQuad_t rect); - }; - /** native declaration : headers\openvr_capi.h:1558 */ - public interface GetWorkingCollisionBoundsInfo_callback extends Callback { - byte apply(HmdQuad_t pQuadsBuffer, IntByReference punQuadsCount); - }; - /** native declaration : headers\openvr_capi.h:1559 */ - public interface GetLiveCollisionBoundsInfo_callback extends Callback { - byte apply(HmdQuad_t pQuadsBuffer, IntByReference punQuadsCount); - }; - /** native declaration : headers\openvr_capi.h:1560 */ - public interface GetWorkingSeatedZeroPoseToRawTrackingPose_callback extends Callback { - byte apply(HmdMatrix34_t pmatSeatedZeroPoseToRawTrackingPose); - }; - /** native declaration : headers\openvr_capi.h:1561 */ - public interface GetWorkingStandingZeroPoseToRawTrackingPose_callback extends Callback { - byte apply(HmdMatrix34_t pmatStandingZeroPoseToRawTrackingPose); - }; - /** native declaration : headers\openvr_capi.h:1562 */ - public interface SetWorkingPlayAreaSize_callback extends Callback { - void apply(float sizeX, float sizeZ); - }; - /** native declaration : headers\openvr_capi.h:1563 */ - public interface SetWorkingCollisionBoundsInfo_callback extends Callback { - void apply(HmdQuad_t pQuadsBuffer, int unQuadsCount); - }; - /** native declaration : headers\openvr_capi.h:1564 */ - public interface SetWorkingSeatedZeroPoseToRawTrackingPose_callback extends Callback { - void apply(HmdMatrix34_t pMatSeatedZeroPoseToRawTrackingPose); - }; - /** native declaration : headers\openvr_capi.h:1565 */ - public interface SetWorkingStandingZeroPoseToRawTrackingPose_callback extends Callback { - void apply(HmdMatrix34_t pMatStandingZeroPoseToRawTrackingPose); - }; - /** native declaration : headers\openvr_capi.h:1566 */ - public interface ReloadFromDisk_callback extends Callback { - void apply(int configFile); - }; - /** native declaration : headers\openvr_capi.h:1567 */ - public interface GetLiveSeatedZeroPoseToRawTrackingPose_callback extends Callback { - byte apply(HmdMatrix34_t pmatSeatedZeroPoseToRawTrackingPose); - }; - /** native declaration : headers\openvr_capi.h:1568 */ - public interface SetWorkingCollisionBoundsTagsInfo_callback extends Callback { - void apply(Pointer pTagsBuffer, int unTagCount); - }; - /** native declaration : headers\openvr_capi.h:1569 */ - public interface GetLiveCollisionBoundsTagsInfo_callback extends Callback { - byte apply(Pointer pTagsBuffer, IntByReference punTagCount); - }; - /** native declaration : headers\openvr_capi.h:1570 */ - public interface SetWorkingPhysicalBoundsInfo_callback extends Callback { - byte apply(HmdQuad_t pQuadsBuffer, int unQuadsCount); - }; - /** native declaration : headers\openvr_capi.h:1571 */ - public interface GetLivePhysicalBoundsInfo_callback extends Callback { - byte apply(HmdQuad_t pQuadsBuffer, IntByReference punQuadsCount); - }; - /** native declaration : headers\openvr_capi.h:1572 */ - public interface ExportLiveToBuffer_callback extends Callback { - byte apply(Pointer pBuffer, IntByReference pnBufferLength); - }; - /** native declaration : headers\openvr_capi.h:1573 */ - public interface ImportFromBufferToWorking_callback extends Callback { - byte apply(Pointer pBuffer, int nImportFlags); - }; - public VR_IVRChaperoneSetup_FnTable() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("CommitWorkingCopy", "RevertWorkingCopy", "GetWorkingPlayAreaSize", "GetWorkingPlayAreaRect", "GetWorkingCollisionBoundsInfo", "GetLiveCollisionBoundsInfo", "GetWorkingSeatedZeroPoseToRawTrackingPose", "GetWorkingStandingZeroPoseToRawTrackingPose", "SetWorkingPlayAreaSize", "SetWorkingCollisionBoundsInfo", "SetWorkingSeatedZeroPoseToRawTrackingPose", "SetWorkingStandingZeroPoseToRawTrackingPose", "ReloadFromDisk", "GetLiveSeatedZeroPoseToRawTrackingPose", "SetWorkingCollisionBoundsTagsInfo", "GetLiveCollisionBoundsTagsInfo", "SetWorkingPhysicalBoundsInfo", "GetLivePhysicalBoundsInfo", "ExportLiveToBuffer", "ImportFromBufferToWorking"); - } - public VR_IVRChaperoneSetup_FnTable(Pointer peer) { - super(peer); - } - public static class ByReference extends VR_IVRChaperoneSetup_FnTable implements Structure.ByReference { - - }; - public static class ByValue extends VR_IVRChaperoneSetup_FnTable implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRChaperone_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRChaperone_FnTable.java deleted file mode 100644 index 4d34575267..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRChaperone_FnTable.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Callback; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.ptr.FloatByReference; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1532
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VR_IVRChaperone_FnTable extends Structure { - /** C type : GetCalibrationState_callback* */ - public VR_IVRChaperone_FnTable.GetCalibrationState_callback GetCalibrationState; - /** C type : GetPlayAreaSize_callback* */ - public VR_IVRChaperone_FnTable.GetPlayAreaSize_callback GetPlayAreaSize; - /** C type : GetPlayAreaRect_callback* */ - public VR_IVRChaperone_FnTable.GetPlayAreaRect_callback GetPlayAreaRect; - /** C type : ReloadInfo_callback* */ - public VR_IVRChaperone_FnTable.ReloadInfo_callback ReloadInfo; - /** C type : SetSceneColor_callback* */ - public VR_IVRChaperone_FnTable.SetSceneColor_callback SetSceneColor; - /** C type : GetBoundsColor_callback* */ - public VR_IVRChaperone_FnTable.GetBoundsColor_callback GetBoundsColor; - /** C type : AreBoundsVisible_callback* */ - public VR_IVRChaperone_FnTable.AreBoundsVisible_callback AreBoundsVisible; - /** C type : ForceBoundsVisible_callback* */ - public VR_IVRChaperone_FnTable.ForceBoundsVisible_callback ForceBoundsVisible; - /** native declaration : headers\openvr_capi.h:1524 */ - public interface GetCalibrationState_callback extends Callback { - int apply(); - }; - /** native declaration : headers\openvr_capi.h:1525 */ - public interface GetPlayAreaSize_callback extends Callback { - byte apply(FloatByReference pSizeX, FloatByReference pSizeZ); - }; - /** native declaration : headers\openvr_capi.h:1526 */ - public interface GetPlayAreaRect_callback extends Callback { - byte apply(HmdQuad_t rect); - }; - /** native declaration : headers\openvr_capi.h:1527 */ - public interface ReloadInfo_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:1528 */ - public interface SetSceneColor_callback extends Callback { - void apply(HmdColor_t.ByValue color); - }; - /** native declaration : headers\openvr_capi.h:1529 */ - public interface GetBoundsColor_callback extends Callback { - void apply(HmdColor_t pOutputColorArray, int nNumOutputColors, float flCollisionBoundsFadeDistance, HmdColor_t pOutputCameraColor); - }; - /** native declaration : headers\openvr_capi.h:1530 */ - public interface AreBoundsVisible_callback extends Callback { - byte apply(); - }; - /** native declaration : headers\openvr_capi.h:1531 */ - public interface ForceBoundsVisible_callback extends Callback { - void apply(byte bForce); - }; - public VR_IVRChaperone_FnTable() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("GetCalibrationState", "GetPlayAreaSize", "GetPlayAreaRect", "ReloadInfo", "SetSceneColor", "GetBoundsColor", "AreBoundsVisible", "ForceBoundsVisible"); - } - /** - * @param GetCalibrationState C type : GetCalibrationState_callback*
    - * @param GetPlayAreaSize C type : GetPlayAreaSize_callback*
    - * @param GetPlayAreaRect C type : GetPlayAreaRect_callback*
    - * @param ReloadInfo C type : ReloadInfo_callback*
    - * @param SetSceneColor C type : SetSceneColor_callback*
    - * @param GetBoundsColor C type : GetBoundsColor_callback*
    - * @param AreBoundsVisible C type : AreBoundsVisible_callback*
    - * @param ForceBoundsVisible C type : ForceBoundsVisible_callback* - */ - public VR_IVRChaperone_FnTable(VR_IVRChaperone_FnTable.GetCalibrationState_callback GetCalibrationState, VR_IVRChaperone_FnTable.GetPlayAreaSize_callback GetPlayAreaSize, VR_IVRChaperone_FnTable.GetPlayAreaRect_callback GetPlayAreaRect, VR_IVRChaperone_FnTable.ReloadInfo_callback ReloadInfo, VR_IVRChaperone_FnTable.SetSceneColor_callback SetSceneColor, VR_IVRChaperone_FnTable.GetBoundsColor_callback GetBoundsColor, VR_IVRChaperone_FnTable.AreBoundsVisible_callback AreBoundsVisible, VR_IVRChaperone_FnTable.ForceBoundsVisible_callback ForceBoundsVisible) { - super(); - this.GetCalibrationState = GetCalibrationState; - this.GetPlayAreaSize = GetPlayAreaSize; - this.GetPlayAreaRect = GetPlayAreaRect; - this.ReloadInfo = ReloadInfo; - this.SetSceneColor = SetSceneColor; - this.GetBoundsColor = GetBoundsColor; - this.AreBoundsVisible = AreBoundsVisible; - this.ForceBoundsVisible = ForceBoundsVisible; - } - public VR_IVRChaperone_FnTable(Pointer peer) { - super(peer); - } - public static class ByReference extends VR_IVRChaperone_FnTable implements Structure.ByReference { - - }; - public static class ByValue extends VR_IVRChaperone_FnTable implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRCompositor_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRCompositor_FnTable.java deleted file mode 100644 index d9f34b6187..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRCompositor_FnTable.java +++ /dev/null @@ -1,278 +0,0 @@ -package com.jme3.system.jopenvr; -import com.jme3.system.jopenvr.JOpenVRLibrary.VkPhysicalDevice_T; -import com.sun.jna.Callback; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.ptr.IntByReference; -import com.sun.jna.ptr.PointerByReference; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1658
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VR_IVRCompositor_FnTable extends Structure { - /** C type : SetTrackingSpace_callback* */ - public VR_IVRCompositor_FnTable.SetTrackingSpace_callback SetTrackingSpace; - /** C type : GetTrackingSpace_callback* */ - public VR_IVRCompositor_FnTable.GetTrackingSpace_callback GetTrackingSpace; - /** C type : WaitGetPoses_callback* */ - public VR_IVRCompositor_FnTable.WaitGetPoses_callback WaitGetPoses; - /** C type : GetLastPoses_callback* */ - public VR_IVRCompositor_FnTable.GetLastPoses_callback GetLastPoses; - /** C type : GetLastPoseForTrackedDeviceIndex_callback* */ - public VR_IVRCompositor_FnTable.GetLastPoseForTrackedDeviceIndex_callback GetLastPoseForTrackedDeviceIndex; - /** C type : Submit_callback* */ - public VR_IVRCompositor_FnTable.Submit_callback Submit; - /** C type : ClearLastSubmittedFrame_callback* */ - public VR_IVRCompositor_FnTable.ClearLastSubmittedFrame_callback ClearLastSubmittedFrame; - /** C type : PostPresentHandoff_callback* */ - public VR_IVRCompositor_FnTable.PostPresentHandoff_callback PostPresentHandoff; - /** C type : GetFrameTiming_callback* */ - public VR_IVRCompositor_FnTable.GetFrameTiming_callback GetFrameTiming; - /** C type : GetFrameTimings_callback* */ - public VR_IVRCompositor_FnTable.GetFrameTimings_callback GetFrameTimings; - /** C type : GetFrameTimeRemaining_callback* */ - public VR_IVRCompositor_FnTable.GetFrameTimeRemaining_callback GetFrameTimeRemaining; - /** C type : GetCumulativeStats_callback* */ - public VR_IVRCompositor_FnTable.GetCumulativeStats_callback GetCumulativeStats; - /** C type : FadeToColor_callback* */ - public VR_IVRCompositor_FnTable.FadeToColor_callback FadeToColor; - /** C type : GetCurrentFadeColor_callback* */ - public VR_IVRCompositor_FnTable.GetCurrentFadeColor_callback GetCurrentFadeColor; - /** C type : FadeGrid_callback* */ - public VR_IVRCompositor_FnTable.FadeGrid_callback FadeGrid; - /** C type : GetCurrentGridAlpha_callback* */ - public VR_IVRCompositor_FnTable.GetCurrentGridAlpha_callback GetCurrentGridAlpha; - /** C type : SetSkyboxOverride_callback* */ - public VR_IVRCompositor_FnTable.SetSkyboxOverride_callback SetSkyboxOverride; - /** C type : ClearSkyboxOverride_callback* */ - public VR_IVRCompositor_FnTable.ClearSkyboxOverride_callback ClearSkyboxOverride; - /** C type : CompositorBringToFront_callback* */ - public VR_IVRCompositor_FnTable.CompositorBringToFront_callback CompositorBringToFront; - /** C type : CompositorGoToBack_callback* */ - public VR_IVRCompositor_FnTable.CompositorGoToBack_callback CompositorGoToBack; - /** C type : CompositorQuit_callback* */ - public VR_IVRCompositor_FnTable.CompositorQuit_callback CompositorQuit; - /** C type : IsFullscreen_callback* */ - public VR_IVRCompositor_FnTable.IsFullscreen_callback IsFullscreen; - /** C type : GetCurrentSceneFocusProcess_callback* */ - public VR_IVRCompositor_FnTable.GetCurrentSceneFocusProcess_callback GetCurrentSceneFocusProcess; - /** C type : GetLastFrameRenderer_callback* */ - public VR_IVRCompositor_FnTable.GetLastFrameRenderer_callback GetLastFrameRenderer; - /** C type : CanRenderScene_callback* */ - public VR_IVRCompositor_FnTable.CanRenderScene_callback CanRenderScene; - /** C type : ShowMirrorWindow_callback* */ - public VR_IVRCompositor_FnTable.ShowMirrorWindow_callback ShowMirrorWindow; - /** C type : HideMirrorWindow_callback* */ - public VR_IVRCompositor_FnTable.HideMirrorWindow_callback HideMirrorWindow; - /** C type : IsMirrorWindowVisible_callback* */ - public VR_IVRCompositor_FnTable.IsMirrorWindowVisible_callback IsMirrorWindowVisible; - /** C type : CompositorDumpImages_callback* */ - public VR_IVRCompositor_FnTable.CompositorDumpImages_callback CompositorDumpImages; - /** C type : ShouldAppRenderWithLowResources_callback* */ - public VR_IVRCompositor_FnTable.ShouldAppRenderWithLowResources_callback ShouldAppRenderWithLowResources; - /** C type : ForceInterleavedReprojectionOn_callback* */ - public VR_IVRCompositor_FnTable.ForceInterleavedReprojectionOn_callback ForceInterleavedReprojectionOn; - /** C type : ForceReconnectProcess_callback* */ - public VR_IVRCompositor_FnTable.ForceReconnectProcess_callback ForceReconnectProcess; - /** C type : SuspendRendering_callback* */ - public VR_IVRCompositor_FnTable.SuspendRendering_callback SuspendRendering; - /** C type : GetMirrorTextureD3D11_callback* */ - public VR_IVRCompositor_FnTable.GetMirrorTextureD3D11_callback GetMirrorTextureD3D11; - /** C type : ReleaseMirrorTextureD3D11_callback* */ - public VR_IVRCompositor_FnTable.ReleaseMirrorTextureD3D11_callback ReleaseMirrorTextureD3D11; - /** C type : GetMirrorTextureGL_callback* */ - public VR_IVRCompositor_FnTable.GetMirrorTextureGL_callback GetMirrorTextureGL; - /** C type : ReleaseSharedGLTexture_callback* */ - public VR_IVRCompositor_FnTable.ReleaseSharedGLTexture_callback ReleaseSharedGLTexture; - /** C type : LockGLSharedTextureForAccess_callback* */ - public VR_IVRCompositor_FnTable.LockGLSharedTextureForAccess_callback LockGLSharedTextureForAccess; - /** C type : UnlockGLSharedTextureForAccess_callback* */ - public VR_IVRCompositor_FnTable.UnlockGLSharedTextureForAccess_callback UnlockGLSharedTextureForAccess; - /** C type : GetVulkanInstanceExtensionsRequired_callback* */ - public VR_IVRCompositor_FnTable.GetVulkanInstanceExtensionsRequired_callback GetVulkanInstanceExtensionsRequired; - /** C type : GetVulkanDeviceExtensionsRequired_callback* */ - public VR_IVRCompositor_FnTable.GetVulkanDeviceExtensionsRequired_callback GetVulkanDeviceExtensionsRequired; - /** native declaration : headers\openvr_capi.h:1617 */ - public interface SetTrackingSpace_callback extends Callback { - void apply(int eOrigin); - }; - /** native declaration : headers\openvr_capi.h:1618 */ - public interface GetTrackingSpace_callback extends Callback { - int apply(); - }; - /** native declaration : headers\openvr_capi.h:1619 */ - public interface WaitGetPoses_callback extends Callback { - int apply(TrackedDevicePose_t pRenderPoseArray, int unRenderPoseArrayCount, TrackedDevicePose_t pGamePoseArray, int unGamePoseArrayCount); - }; - /** native declaration : headers\openvr_capi.h:1620 */ - public interface GetLastPoses_callback extends Callback { - int apply(TrackedDevicePose_t pRenderPoseArray, int unRenderPoseArrayCount, TrackedDevicePose_t pGamePoseArray, int unGamePoseArrayCount); - }; - /** native declaration : headers\openvr_capi.h:1621 */ - public interface GetLastPoseForTrackedDeviceIndex_callback extends Callback { - int apply(int unDeviceIndex, TrackedDevicePose_t pOutputPose, TrackedDevicePose_t pOutputGamePose); - }; - /** native declaration : headers\openvr_capi.h:1622 */ - public interface Submit_callback extends Callback { - int apply(int eEye, Texture_t pTexture, VRTextureBounds_t pBounds, int nSubmitFlags); - }; - /** native declaration : headers\openvr_capi.h:1623 */ - public interface ClearLastSubmittedFrame_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:1624 */ - public interface PostPresentHandoff_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:1625 */ - public interface GetFrameTiming_callback extends Callback { - byte apply(Compositor_FrameTiming pTiming, int unFramesAgo); - }; - /** native declaration : headers\openvr_capi.h:1626 */ - public interface GetFrameTimings_callback extends Callback { - int apply(Compositor_FrameTiming pTiming, int nFrames); - }; - /** native declaration : headers\openvr_capi.h:1627 */ - public interface GetFrameTimeRemaining_callback extends Callback { - float apply(); - }; - /** native declaration : headers\openvr_capi.h:1628 */ - public interface GetCumulativeStats_callback extends Callback { - void apply(Compositor_CumulativeStats pStats, int nStatsSizeInBytes); - }; - /** native declaration : headers\openvr_capi.h:1629 */ - public interface FadeToColor_callback extends Callback { - void apply(float fSeconds, float fRed, float fGreen, float fBlue, float fAlpha, byte bBackground); - }; - /** native declaration : headers\openvr_capi.h:1630 */ - public interface GetCurrentFadeColor_callback extends Callback { - com.jme3.system.jopenvr.HmdColor_t.ByValue apply(byte bBackground); - }; - /** native declaration : headers\openvr_capi.h:1631 */ - public interface FadeGrid_callback extends Callback { - void apply(float fSeconds, byte bFadeIn); - }; - /** native declaration : headers\openvr_capi.h:1632 */ - public interface GetCurrentGridAlpha_callback extends Callback { - float apply(); - }; - /** native declaration : headers\openvr_capi.h:1633 */ - public interface SetSkyboxOverride_callback extends Callback { - int apply(Texture_t pTextures, int unTextureCount); - }; - /** native declaration : headers\openvr_capi.h:1634 */ - public interface ClearSkyboxOverride_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:1635 */ - public interface CompositorBringToFront_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:1636 */ - public interface CompositorGoToBack_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:1637 */ - public interface CompositorQuit_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:1638 */ - public interface IsFullscreen_callback extends Callback { - byte apply(); - }; - /** native declaration : headers\openvr_capi.h:1639 */ - public interface GetCurrentSceneFocusProcess_callback extends Callback { - int apply(); - }; - /** native declaration : headers\openvr_capi.h:1640 */ - public interface GetLastFrameRenderer_callback extends Callback { - int apply(); - }; - /** native declaration : headers\openvr_capi.h:1641 */ - public interface CanRenderScene_callback extends Callback { - byte apply(); - }; - /** native declaration : headers\openvr_capi.h:1642 */ - public interface ShowMirrorWindow_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:1643 */ - public interface HideMirrorWindow_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:1644 */ - public interface IsMirrorWindowVisible_callback extends Callback { - byte apply(); - }; - /** native declaration : headers\openvr_capi.h:1645 */ - public interface CompositorDumpImages_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:1646 */ - public interface ShouldAppRenderWithLowResources_callback extends Callback { - byte apply(); - }; - /** native declaration : headers\openvr_capi.h:1647 */ - public interface ForceInterleavedReprojectionOn_callback extends Callback { - void apply(byte bOverride); - }; - /** native declaration : headers\openvr_capi.h:1648 */ - public interface ForceReconnectProcess_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:1649 */ - public interface SuspendRendering_callback extends Callback { - void apply(byte bSuspend); - }; - /** native declaration : headers\openvr_capi.h:1650 */ - public interface GetMirrorTextureD3D11_callback extends Callback { - int apply(int eEye, Pointer pD3D11DeviceOrResource, PointerByReference ppD3D11ShaderResourceView); - }; - /** native declaration : headers\openvr_capi.h:1651 */ - public interface ReleaseMirrorTextureD3D11_callback extends Callback { - void apply(Pointer pD3D11ShaderResourceView); - }; - /** native declaration : headers\openvr_capi.h:1652 */ - public interface GetMirrorTextureGL_callback extends Callback { - int apply(int eEye, IntByReference pglTextureId, PointerByReference pglSharedTextureHandle); - }; - /** native declaration : headers\openvr_capi.h:1653 */ - public interface ReleaseSharedGLTexture_callback extends Callback { - byte apply(int glTextureId, Pointer glSharedTextureHandle); - }; - /** native declaration : headers\openvr_capi.h:1654 */ - public interface LockGLSharedTextureForAccess_callback extends Callback { - void apply(Pointer glSharedTextureHandle); - }; - /** native declaration : headers\openvr_capi.h:1655 */ - public interface UnlockGLSharedTextureForAccess_callback extends Callback { - void apply(Pointer glSharedTextureHandle); - }; - /** native declaration : headers\openvr_capi.h:1656 */ - public interface GetVulkanInstanceExtensionsRequired_callback extends Callback { - int apply(Pointer pchValue, int unBufferSize); - }; - /** native declaration : headers\openvr_capi.h:1657 */ - public interface GetVulkanDeviceExtensionsRequired_callback extends Callback { - int apply(VkPhysicalDevice_T pPhysicalDevice, Pointer pchValue, int unBufferSize); - }; - public VR_IVRCompositor_FnTable() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("SetTrackingSpace", "GetTrackingSpace", "WaitGetPoses", "GetLastPoses", "GetLastPoseForTrackedDeviceIndex", "Submit", "ClearLastSubmittedFrame", "PostPresentHandoff", "GetFrameTiming", "GetFrameTimings", "GetFrameTimeRemaining", "GetCumulativeStats", "FadeToColor", "GetCurrentFadeColor", "FadeGrid", "GetCurrentGridAlpha", "SetSkyboxOverride", "ClearSkyboxOverride", "CompositorBringToFront", "CompositorGoToBack", "CompositorQuit", "IsFullscreen", "GetCurrentSceneFocusProcess", "GetLastFrameRenderer", "CanRenderScene", "ShowMirrorWindow", "HideMirrorWindow", "IsMirrorWindowVisible", "CompositorDumpImages", "ShouldAppRenderWithLowResources", "ForceInterleavedReprojectionOn", "ForceReconnectProcess", "SuspendRendering", "GetMirrorTextureD3D11", "ReleaseMirrorTextureD3D11", "GetMirrorTextureGL", "ReleaseSharedGLTexture", "LockGLSharedTextureForAccess", "UnlockGLSharedTextureForAccess", "GetVulkanInstanceExtensionsRequired", "GetVulkanDeviceExtensionsRequired"); - } - public VR_IVRCompositor_FnTable(Pointer peer) { - super(peer); - } - public static class ByReference extends VR_IVRCompositor_FnTable implements Structure.ByReference { - - }; - public static class ByValue extends VR_IVRCompositor_FnTable implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRDriverManager_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRDriverManager_FnTable.java deleted file mode 100644 index 4bd9188599..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRDriverManager_FnTable.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Callback; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1918
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VR_IVRDriverManager_FnTable extends Structure { - /** C type : GetDriverCount_callback* */ - public VR_IVRDriverManager_FnTable.GetDriverCount_callback GetDriverCount; - /** C type : GetDriverName_callback* */ - public VR_IVRDriverManager_FnTable.GetDriverName_callback GetDriverName; - /** native declaration : headers\openvr_capi.h:1916 */ - public interface GetDriverCount_callback extends Callback { - int apply(); - }; - /** native declaration : headers\openvr_capi.h:1917 */ - public interface GetDriverName_callback extends Callback { - int apply(int nDriver, Pointer pchValue, int unBufferSize); - }; - public VR_IVRDriverManager_FnTable() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("GetDriverCount", "GetDriverName"); - } - /** - * @param GetDriverCount C type : GetDriverCount_callback*
    - * @param GetDriverName C type : GetDriverName_callback* - */ - public VR_IVRDriverManager_FnTable(VR_IVRDriverManager_FnTable.GetDriverCount_callback GetDriverCount, VR_IVRDriverManager_FnTable.GetDriverName_callback GetDriverName) { - super(); - this.GetDriverCount = GetDriverCount; - this.GetDriverName = GetDriverName; - } - public VR_IVRDriverManager_FnTable(Pointer peer) { - super(peer); - } - public static class ByReference extends VR_IVRDriverManager_FnTable implements Structure.ByReference { - - }; - public static class ByValue extends VR_IVRDriverManager_FnTable implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRExtendedDisplay_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRExtendedDisplay_FnTable.java deleted file mode 100644 index ded79eec3e..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRExtendedDisplay_FnTable.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Callback; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.ptr.IntByReference; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1424
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VR_IVRExtendedDisplay_FnTable extends Structure { - /** C type : GetWindowBounds_callback* */ - public VR_IVRExtendedDisplay_FnTable.GetWindowBounds_callback GetWindowBounds; - /** C type : GetEyeOutputViewport_callback* */ - public VR_IVRExtendedDisplay_FnTable.GetEyeOutputViewport_callback GetEyeOutputViewport; - /** C type : GetDXGIOutputInfo_callback* */ - public VR_IVRExtendedDisplay_FnTable.GetDXGIOutputInfo_callback GetDXGIOutputInfo; - /** native declaration : headers\openvr_capi.h:1421 */ - public interface GetWindowBounds_callback extends Callback { - void apply(IntByReference pnX, IntByReference pnY, IntByReference pnWidth, IntByReference pnHeight); - }; - /** native declaration : headers\openvr_capi.h:1422 */ - public interface GetEyeOutputViewport_callback extends Callback { - void apply(int eEye, IntByReference pnX, IntByReference pnY, IntByReference pnWidth, IntByReference pnHeight); - }; - /** native declaration : headers\openvr_capi.h:1423 */ - public interface GetDXGIOutputInfo_callback extends Callback { - void apply(IntByReference pnAdapterIndex, IntByReference pnAdapterOutputIndex); - }; - public VR_IVRExtendedDisplay_FnTable() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("GetWindowBounds", "GetEyeOutputViewport", "GetDXGIOutputInfo"); - } - /** - * @param GetWindowBounds C type : GetWindowBounds_callback*
    - * @param GetEyeOutputViewport C type : GetEyeOutputViewport_callback*
    - * @param GetDXGIOutputInfo C type : GetDXGIOutputInfo_callback* - */ - public VR_IVRExtendedDisplay_FnTable(VR_IVRExtendedDisplay_FnTable.GetWindowBounds_callback GetWindowBounds, VR_IVRExtendedDisplay_FnTable.GetEyeOutputViewport_callback GetEyeOutputViewport, VR_IVRExtendedDisplay_FnTable.GetDXGIOutputInfo_callback GetDXGIOutputInfo) { - super(); - this.GetWindowBounds = GetWindowBounds; - this.GetEyeOutputViewport = GetEyeOutputViewport; - this.GetDXGIOutputInfo = GetDXGIOutputInfo; - } - public VR_IVRExtendedDisplay_FnTable(Pointer peer) { - super(peer); - } - public static class ByReference extends VR_IVRExtendedDisplay_FnTable implements Structure.ByReference { - - }; - public static class ByValue extends VR_IVRExtendedDisplay_FnTable implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRNotifications_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRNotifications_FnTable.java deleted file mode 100644 index f7e701982a..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRNotifications_FnTable.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Callback; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.ptr.IntByReference; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1864
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VR_IVRNotifications_FnTable extends Structure { - /** C type : CreateNotification_callback* */ - public VR_IVRNotifications_FnTable.CreateNotification_callback CreateNotification; - /** C type : RemoveNotification_callback* */ - public VR_IVRNotifications_FnTable.RemoveNotification_callback RemoveNotification; - /** native declaration : headers\openvr_capi.h:1862 */ - public interface CreateNotification_callback extends Callback { - int apply(long ulOverlayHandle, long ulUserValue, int type, Pointer pchText, int style, NotificationBitmap_t pImage, IntByReference pNotificationId); - }; - /** native declaration : headers\openvr_capi.h:1863 */ - public interface RemoveNotification_callback extends Callback { - int apply(int notificationId); - }; - public VR_IVRNotifications_FnTable() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("CreateNotification", "RemoveNotification"); - } - /** - * @param CreateNotification C type : CreateNotification_callback*
    - * @param RemoveNotification C type : RemoveNotification_callback* - */ - public VR_IVRNotifications_FnTable(VR_IVRNotifications_FnTable.CreateNotification_callback CreateNotification, VR_IVRNotifications_FnTable.RemoveNotification_callback RemoveNotification) { - super(); - this.CreateNotification = CreateNotification; - this.RemoveNotification = RemoveNotification; - } - public VR_IVRNotifications_FnTable(Pointer peer) { - super(peer); - } - public static class ByReference extends VR_IVRNotifications_FnTable implements Structure.ByReference { - - }; - public static class ByValue extends VR_IVRNotifications_FnTable implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVROverlay_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVROverlay_FnTable.java deleted file mode 100644 index 6ad29adca5..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVROverlay_FnTable.java +++ /dev/null @@ -1,513 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Callback; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.ptr.FloatByReference; -import com.sun.jna.ptr.IntByReference; -import com.sun.jna.ptr.LongByReference; -import com.sun.jna.ptr.PointerByReference; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1820
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VR_IVROverlay_FnTable extends Structure { - /** C type : FindOverlay_callback* */ - public VR_IVROverlay_FnTable.FindOverlay_callback FindOverlay; - /** C type : CreateOverlay_callback* */ - public VR_IVROverlay_FnTable.CreateOverlay_callback CreateOverlay; - /** C type : DestroyOverlay_callback* */ - public VR_IVROverlay_FnTable.DestroyOverlay_callback DestroyOverlay; - /** C type : SetHighQualityOverlay_callback* */ - public VR_IVROverlay_FnTable.SetHighQualityOverlay_callback SetHighQualityOverlay; - /** C type : GetHighQualityOverlay_callback* */ - public VR_IVROverlay_FnTable.GetHighQualityOverlay_callback GetHighQualityOverlay; - /** C type : GetOverlayKey_callback* */ - public VR_IVROverlay_FnTable.GetOverlayKey_callback GetOverlayKey; - /** C type : GetOverlayName_callback* */ - public VR_IVROverlay_FnTable.GetOverlayName_callback GetOverlayName; - /** C type : SetOverlayName_callback* */ - public VR_IVROverlay_FnTable.SetOverlayName_callback SetOverlayName; - /** C type : GetOverlayImageData_callback* */ - public VR_IVROverlay_FnTable.GetOverlayImageData_callback GetOverlayImageData; - /** C type : GetOverlayErrorNameFromEnum_callback* */ - public VR_IVROverlay_FnTable.GetOverlayErrorNameFromEnum_callback GetOverlayErrorNameFromEnum; - /** C type : SetOverlayRenderingPid_callback* */ - public VR_IVROverlay_FnTable.SetOverlayRenderingPid_callback SetOverlayRenderingPid; - /** C type : GetOverlayRenderingPid_callback* */ - public VR_IVROverlay_FnTable.GetOverlayRenderingPid_callback GetOverlayRenderingPid; - /** C type : SetOverlayFlag_callback* */ - public VR_IVROverlay_FnTable.SetOverlayFlag_callback SetOverlayFlag; - /** C type : GetOverlayFlag_callback* */ - public VR_IVROverlay_FnTable.GetOverlayFlag_callback GetOverlayFlag; - /** C type : SetOverlayColor_callback* */ - public VR_IVROverlay_FnTable.SetOverlayColor_callback SetOverlayColor; - /** C type : GetOverlayColor_callback* */ - public VR_IVROverlay_FnTable.GetOverlayColor_callback GetOverlayColor; - /** C type : SetOverlayAlpha_callback* */ - public VR_IVROverlay_FnTable.SetOverlayAlpha_callback SetOverlayAlpha; - /** C type : GetOverlayAlpha_callback* */ - public VR_IVROverlay_FnTable.GetOverlayAlpha_callback GetOverlayAlpha; - /** C type : SetOverlayTexelAspect_callback* */ - public VR_IVROverlay_FnTable.SetOverlayTexelAspect_callback SetOverlayTexelAspect; - /** C type : GetOverlayTexelAspect_callback* */ - public VR_IVROverlay_FnTable.GetOverlayTexelAspect_callback GetOverlayTexelAspect; - /** C type : SetOverlaySortOrder_callback* */ - public VR_IVROverlay_FnTable.SetOverlaySortOrder_callback SetOverlaySortOrder; - /** C type : GetOverlaySortOrder_callback* */ - public VR_IVROverlay_FnTable.GetOverlaySortOrder_callback GetOverlaySortOrder; - /** C type : SetOverlayWidthInMeters_callback* */ - public VR_IVROverlay_FnTable.SetOverlayWidthInMeters_callback SetOverlayWidthInMeters; - /** C type : GetOverlayWidthInMeters_callback* */ - public VR_IVROverlay_FnTable.GetOverlayWidthInMeters_callback GetOverlayWidthInMeters; - /** C type : SetOverlayAutoCurveDistanceRangeInMeters_callback* */ - public VR_IVROverlay_FnTable.SetOverlayAutoCurveDistanceRangeInMeters_callback SetOverlayAutoCurveDistanceRangeInMeters; - /** C type : GetOverlayAutoCurveDistanceRangeInMeters_callback* */ - public VR_IVROverlay_FnTable.GetOverlayAutoCurveDistanceRangeInMeters_callback GetOverlayAutoCurveDistanceRangeInMeters; - /** C type : SetOverlayTextureColorSpace_callback* */ - public VR_IVROverlay_FnTable.SetOverlayTextureColorSpace_callback SetOverlayTextureColorSpace; - /** C type : GetOverlayTextureColorSpace_callback* */ - public VR_IVROverlay_FnTable.GetOverlayTextureColorSpace_callback GetOverlayTextureColorSpace; - /** C type : SetOverlayTextureBounds_callback* */ - public VR_IVROverlay_FnTable.SetOverlayTextureBounds_callback SetOverlayTextureBounds; - /** C type : GetOverlayTextureBounds_callback* */ - public VR_IVROverlay_FnTable.GetOverlayTextureBounds_callback GetOverlayTextureBounds; - /** C type : GetOverlayRenderModel_callback* */ - public VR_IVROverlay_FnTable.GetOverlayRenderModel_callback GetOverlayRenderModel; - /** C type : SetOverlayRenderModel_callback* */ - public VR_IVROverlay_FnTable.SetOverlayRenderModel_callback SetOverlayRenderModel; - /** C type : GetOverlayTransformType_callback* */ - public VR_IVROverlay_FnTable.GetOverlayTransformType_callback GetOverlayTransformType; - /** C type : SetOverlayTransformAbsolute_callback* */ - public VR_IVROverlay_FnTable.SetOverlayTransformAbsolute_callback SetOverlayTransformAbsolute; - /** C type : GetOverlayTransformAbsolute_callback* */ - public VR_IVROverlay_FnTable.GetOverlayTransformAbsolute_callback GetOverlayTransformAbsolute; - /** C type : SetOverlayTransformTrackedDeviceRelative_callback* */ - public VR_IVROverlay_FnTable.SetOverlayTransformTrackedDeviceRelative_callback SetOverlayTransformTrackedDeviceRelative; - /** C type : GetOverlayTransformTrackedDeviceRelative_callback* */ - public VR_IVROverlay_FnTable.GetOverlayTransformTrackedDeviceRelative_callback GetOverlayTransformTrackedDeviceRelative; - /** C type : SetOverlayTransformTrackedDeviceComponent_callback* */ - public VR_IVROverlay_FnTable.SetOverlayTransformTrackedDeviceComponent_callback SetOverlayTransformTrackedDeviceComponent; - /** C type : GetOverlayTransformTrackedDeviceComponent_callback* */ - public VR_IVROverlay_FnTable.GetOverlayTransformTrackedDeviceComponent_callback GetOverlayTransformTrackedDeviceComponent; - /** C type : GetOverlayTransformOverlayRelative_callback* */ - public VR_IVROverlay_FnTable.GetOverlayTransformOverlayRelative_callback GetOverlayTransformOverlayRelative; - /** C type : SetOverlayTransformOverlayRelative_callback* */ - public VR_IVROverlay_FnTable.SetOverlayTransformOverlayRelative_callback SetOverlayTransformOverlayRelative; - /** C type : ShowOverlay_callback* */ - public VR_IVROverlay_FnTable.ShowOverlay_callback ShowOverlay; - /** C type : HideOverlay_callback* */ - public VR_IVROverlay_FnTable.HideOverlay_callback HideOverlay; - /** C type : IsOverlayVisible_callback* */ - public VR_IVROverlay_FnTable.IsOverlayVisible_callback IsOverlayVisible; - /** C type : GetTransformForOverlayCoordinates_callback* */ - public VR_IVROverlay_FnTable.GetTransformForOverlayCoordinates_callback GetTransformForOverlayCoordinates; - /** C type : PollNextOverlayEvent_callback* */ - public VR_IVROverlay_FnTable.PollNextOverlayEvent_callback PollNextOverlayEvent; - /** C type : GetOverlayInputMethod_callback* */ - public VR_IVROverlay_FnTable.GetOverlayInputMethod_callback GetOverlayInputMethod; - /** C type : SetOverlayInputMethod_callback* */ - public VR_IVROverlay_FnTable.SetOverlayInputMethod_callback SetOverlayInputMethod; - /** C type : GetOverlayMouseScale_callback* */ - public VR_IVROverlay_FnTable.GetOverlayMouseScale_callback GetOverlayMouseScale; - /** C type : SetOverlayMouseScale_callback* */ - public VR_IVROverlay_FnTable.SetOverlayMouseScale_callback SetOverlayMouseScale; - /** C type : ComputeOverlayIntersection_callback* */ - public VR_IVROverlay_FnTable.ComputeOverlayIntersection_callback ComputeOverlayIntersection; - /** C type : HandleControllerOverlayInteractionAsMouse_callback* */ - public VR_IVROverlay_FnTable.HandleControllerOverlayInteractionAsMouse_callback HandleControllerOverlayInteractionAsMouse; - /** C type : IsHoverTargetOverlay_callback* */ - public VR_IVROverlay_FnTable.IsHoverTargetOverlay_callback IsHoverTargetOverlay; - /** C type : GetGamepadFocusOverlay_callback* */ - public VR_IVROverlay_FnTable.GetGamepadFocusOverlay_callback GetGamepadFocusOverlay; - /** C type : SetGamepadFocusOverlay_callback* */ - public VR_IVROverlay_FnTable.SetGamepadFocusOverlay_callback SetGamepadFocusOverlay; - /** C type : SetOverlayNeighbor_callback* */ - public VR_IVROverlay_FnTable.SetOverlayNeighbor_callback SetOverlayNeighbor; - /** C type : MoveGamepadFocusToNeighbor_callback* */ - public VR_IVROverlay_FnTable.MoveGamepadFocusToNeighbor_callback MoveGamepadFocusToNeighbor; - /** C type : SetOverlayTexture_callback* */ - public VR_IVROverlay_FnTable.SetOverlayTexture_callback SetOverlayTexture; - /** C type : ClearOverlayTexture_callback* */ - public VR_IVROverlay_FnTable.ClearOverlayTexture_callback ClearOverlayTexture; - /** C type : SetOverlayRaw_callback* */ - public VR_IVROverlay_FnTable.SetOverlayRaw_callback SetOverlayRaw; - /** C type : SetOverlayFromFile_callback* */ - public VR_IVROverlay_FnTable.SetOverlayFromFile_callback SetOverlayFromFile; - /** C type : GetOverlayTexture_callback* */ - public VR_IVROverlay_FnTable.GetOverlayTexture_callback GetOverlayTexture; - /** C type : ReleaseNativeOverlayHandle_callback* */ - public VR_IVROverlay_FnTable.ReleaseNativeOverlayHandle_callback ReleaseNativeOverlayHandle; - /** C type : GetOverlayTextureSize_callback* */ - public VR_IVROverlay_FnTable.GetOverlayTextureSize_callback GetOverlayTextureSize; - /** C type : CreateDashboardOverlay_callback* */ - public VR_IVROverlay_FnTable.CreateDashboardOverlay_callback CreateDashboardOverlay; - /** C type : IsDashboardVisible_callback* */ - public VR_IVROverlay_FnTable.IsDashboardVisible_callback IsDashboardVisible; - /** C type : IsActiveDashboardOverlay_callback* */ - public VR_IVROverlay_FnTable.IsActiveDashboardOverlay_callback IsActiveDashboardOverlay; - /** C type : SetDashboardOverlaySceneProcess_callback* */ - public VR_IVROverlay_FnTable.SetDashboardOverlaySceneProcess_callback SetDashboardOverlaySceneProcess; - /** C type : GetDashboardOverlaySceneProcess_callback* */ - public VR_IVROverlay_FnTable.GetDashboardOverlaySceneProcess_callback GetDashboardOverlaySceneProcess; - /** C type : ShowDashboard_callback* */ - public VR_IVROverlay_FnTable.ShowDashboard_callback ShowDashboard; - /** C type : GetPrimaryDashboardDevice_callback* */ - public VR_IVROverlay_FnTable.GetPrimaryDashboardDevice_callback GetPrimaryDashboardDevice; - /** C type : ShowKeyboard_callback* */ - public VR_IVROverlay_FnTable.ShowKeyboard_callback ShowKeyboard; - /** C type : ShowKeyboardForOverlay_callback* */ - public VR_IVROverlay_FnTable.ShowKeyboardForOverlay_callback ShowKeyboardForOverlay; - /** C type : GetKeyboardText_callback* */ - public VR_IVROverlay_FnTable.GetKeyboardText_callback GetKeyboardText; - /** C type : HideKeyboard_callback* */ - public VR_IVROverlay_FnTable.HideKeyboard_callback HideKeyboard; - /** C type : SetKeyboardTransformAbsolute_callback* */ - public VR_IVROverlay_FnTable.SetKeyboardTransformAbsolute_callback SetKeyboardTransformAbsolute; - /** C type : SetKeyboardPositionForOverlay_callback* */ - public VR_IVROverlay_FnTable.SetKeyboardPositionForOverlay_callback SetKeyboardPositionForOverlay; - /** C type : SetOverlayIntersectionMask_callback* */ - public VR_IVROverlay_FnTable.SetOverlayIntersectionMask_callback SetOverlayIntersectionMask; - /** C type : GetOverlayFlags_callback* */ - public VR_IVROverlay_FnTable.GetOverlayFlags_callback GetOverlayFlags; - /** C type : ShowMessageOverlay_callback* */ - public VR_IVROverlay_FnTable.ShowMessageOverlay_callback ShowMessageOverlay; - /** native declaration : headers\openvr_capi.h:1740 */ - public interface FindOverlay_callback extends Callback { - int apply(Pointer pchOverlayKey, LongByReference pOverlayHandle); - }; - /** native declaration : headers\openvr_capi.h:1741 */ - public interface CreateOverlay_callback extends Callback { - int apply(Pointer pchOverlayKey, Pointer pchOverlayName, LongByReference pOverlayHandle); - }; - /** native declaration : headers\openvr_capi.h:1742 */ - public interface DestroyOverlay_callback extends Callback { - int apply(long ulOverlayHandle); - }; - /** native declaration : headers\openvr_capi.h:1743 */ - public interface SetHighQualityOverlay_callback extends Callback { - int apply(long ulOverlayHandle); - }; - /** native declaration : headers\openvr_capi.h:1744 */ - public interface GetHighQualityOverlay_callback extends Callback { - long apply(); - }; - /** native declaration : headers\openvr_capi.h:1745 */ - public interface GetOverlayKey_callback extends Callback { - int apply(long ulOverlayHandle, Pointer pchValue, int unBufferSize, IntByReference pError); - }; - /** native declaration : headers\openvr_capi.h:1746 */ - public interface GetOverlayName_callback extends Callback { - int apply(long ulOverlayHandle, Pointer pchValue, int unBufferSize, IntByReference pError); - }; - /** native declaration : headers\openvr_capi.h:1747 */ - public interface SetOverlayName_callback extends Callback { - int apply(long ulOverlayHandle, Pointer pchName); - }; - /** native declaration : headers\openvr_capi.h:1748 */ - public interface GetOverlayImageData_callback extends Callback { - int apply(long ulOverlayHandle, Pointer pvBuffer, int unBufferSize, IntByReference punWidth, IntByReference punHeight); - }; - /** native declaration : headers\openvr_capi.h:1749 */ - public interface GetOverlayErrorNameFromEnum_callback extends Callback { - Pointer apply(int error); - }; - /** native declaration : headers\openvr_capi.h:1750 */ - public interface SetOverlayRenderingPid_callback extends Callback { - int apply(long ulOverlayHandle, int unPID); - }; - /** native declaration : headers\openvr_capi.h:1751 */ - public interface GetOverlayRenderingPid_callback extends Callback { - int apply(long ulOverlayHandle); - }; - /** native declaration : headers\openvr_capi.h:1752 */ - public interface SetOverlayFlag_callback extends Callback { - int apply(long ulOverlayHandle, int eOverlayFlag, byte bEnabled); - }; - /** native declaration : headers\openvr_capi.h:1753 */ - public interface GetOverlayFlag_callback extends Callback { - int apply(long ulOverlayHandle, int eOverlayFlag, Pointer pbEnabled); - }; - /** native declaration : headers\openvr_capi.h:1754 */ - public interface SetOverlayColor_callback extends Callback { - int apply(long ulOverlayHandle, float fRed, float fGreen, float fBlue); - }; - /** native declaration : headers\openvr_capi.h:1755 */ - public interface GetOverlayColor_callback extends Callback { - int apply(long ulOverlayHandle, FloatByReference pfRed, FloatByReference pfGreen, FloatByReference pfBlue); - }; - /** native declaration : headers\openvr_capi.h:1756 */ - public interface SetOverlayAlpha_callback extends Callback { - int apply(long ulOverlayHandle, float fAlpha); - }; - /** native declaration : headers\openvr_capi.h:1757 */ - public interface GetOverlayAlpha_callback extends Callback { - int apply(long ulOverlayHandle, FloatByReference pfAlpha); - }; - /** native declaration : headers\openvr_capi.h:1758 */ - public interface SetOverlayTexelAspect_callback extends Callback { - int apply(long ulOverlayHandle, float fTexelAspect); - }; - /** native declaration : headers\openvr_capi.h:1759 */ - public interface GetOverlayTexelAspect_callback extends Callback { - int apply(long ulOverlayHandle, FloatByReference pfTexelAspect); - }; - /** native declaration : headers\openvr_capi.h:1760 */ - public interface SetOverlaySortOrder_callback extends Callback { - int apply(long ulOverlayHandle, int unSortOrder); - }; - /** native declaration : headers\openvr_capi.h:1761 */ - public interface GetOverlaySortOrder_callback extends Callback { - int apply(long ulOverlayHandle, IntByReference punSortOrder); - }; - /** native declaration : headers\openvr_capi.h:1762 */ - public interface SetOverlayWidthInMeters_callback extends Callback { - int apply(long ulOverlayHandle, float fWidthInMeters); - }; - /** native declaration : headers\openvr_capi.h:1763 */ - public interface GetOverlayWidthInMeters_callback extends Callback { - int apply(long ulOverlayHandle, FloatByReference pfWidthInMeters); - }; - /** native declaration : headers\openvr_capi.h:1764 */ - public interface SetOverlayAutoCurveDistanceRangeInMeters_callback extends Callback { - int apply(long ulOverlayHandle, float fMinDistanceInMeters, float fMaxDistanceInMeters); - }; - /** native declaration : headers\openvr_capi.h:1765 */ - public interface GetOverlayAutoCurveDistanceRangeInMeters_callback extends Callback { - int apply(long ulOverlayHandle, FloatByReference pfMinDistanceInMeters, FloatByReference pfMaxDistanceInMeters); - }; - /** native declaration : headers\openvr_capi.h:1766 */ - public interface SetOverlayTextureColorSpace_callback extends Callback { - int apply(long ulOverlayHandle, int eTextureColorSpace); - }; - /** native declaration : headers\openvr_capi.h:1767 */ - public interface GetOverlayTextureColorSpace_callback extends Callback { - int apply(long ulOverlayHandle, IntByReference peTextureColorSpace); - }; - /** native declaration : headers\openvr_capi.h:1768 */ - public interface SetOverlayTextureBounds_callback extends Callback { - int apply(long ulOverlayHandle, VRTextureBounds_t pOverlayTextureBounds); - }; - /** native declaration : headers\openvr_capi.h:1769 */ - public interface GetOverlayTextureBounds_callback extends Callback { - int apply(long ulOverlayHandle, VRTextureBounds_t pOverlayTextureBounds); - }; - /** native declaration : headers\openvr_capi.h:1770 */ - public interface GetOverlayRenderModel_callback extends Callback { - int apply(long ulOverlayHandle, Pointer pchValue, int unBufferSize, HmdColor_t pColor, IntByReference pError); - }; - /** native declaration : headers\openvr_capi.h:1771 */ - public interface SetOverlayRenderModel_callback extends Callback { - int apply(long ulOverlayHandle, Pointer pchRenderModel, HmdColor_t pColor); - }; - /** native declaration : headers\openvr_capi.h:1772 */ - public interface GetOverlayTransformType_callback extends Callback { - int apply(long ulOverlayHandle, IntByReference peTransformType); - }; - /** native declaration : headers\openvr_capi.h:1773 */ - public interface SetOverlayTransformAbsolute_callback extends Callback { - int apply(long ulOverlayHandle, int eTrackingOrigin, HmdMatrix34_t pmatTrackingOriginToOverlayTransform); - }; - /** native declaration : headers\openvr_capi.h:1774 */ - public interface GetOverlayTransformAbsolute_callback extends Callback { - int apply(long ulOverlayHandle, IntByReference peTrackingOrigin, HmdMatrix34_t pmatTrackingOriginToOverlayTransform); - }; - /** native declaration : headers\openvr_capi.h:1775 */ - public interface SetOverlayTransformTrackedDeviceRelative_callback extends Callback { - int apply(long ulOverlayHandle, int unTrackedDevice, HmdMatrix34_t pmatTrackedDeviceToOverlayTransform); - }; - /** native declaration : headers\openvr_capi.h:1776 */ - public interface GetOverlayTransformTrackedDeviceRelative_callback extends Callback { - int apply(long ulOverlayHandle, IntByReference punTrackedDevice, HmdMatrix34_t pmatTrackedDeviceToOverlayTransform); - }; - /** native declaration : headers\openvr_capi.h:1777 */ - public interface SetOverlayTransformTrackedDeviceComponent_callback extends Callback { - int apply(long ulOverlayHandle, int unDeviceIndex, Pointer pchComponentName); - }; - /** native declaration : headers\openvr_capi.h:1778 */ - public interface GetOverlayTransformTrackedDeviceComponent_callback extends Callback { - int apply(long ulOverlayHandle, IntByReference punDeviceIndex, Pointer pchComponentName, int unComponentNameSize); - }; - /** native declaration : headers\openvr_capi.h:1779 */ - public interface GetOverlayTransformOverlayRelative_callback extends Callback { - int apply(long ulOverlayHandle, LongByReference ulOverlayHandleParent, HmdMatrix34_t pmatParentOverlayToOverlayTransform); - }; - /** native declaration : headers\openvr_capi.h:1780 */ - public interface SetOverlayTransformOverlayRelative_callback extends Callback { - int apply(long ulOverlayHandle, long ulOverlayHandleParent, HmdMatrix34_t pmatParentOverlayToOverlayTransform); - }; - /** native declaration : headers\openvr_capi.h:1781 */ - public interface ShowOverlay_callback extends Callback { - int apply(long ulOverlayHandle); - }; - /** native declaration : headers\openvr_capi.h:1782 */ - public interface HideOverlay_callback extends Callback { - int apply(long ulOverlayHandle); - }; - /** native declaration : headers\openvr_capi.h:1783 */ - public interface IsOverlayVisible_callback extends Callback { - byte apply(long ulOverlayHandle); - }; - /** native declaration : headers\openvr_capi.h:1784 */ - public interface GetTransformForOverlayCoordinates_callback extends Callback { - int apply(long ulOverlayHandle, int eTrackingOrigin, HmdVector2_t.ByValue coordinatesInOverlay, HmdMatrix34_t pmatTransform); - }; - /** native declaration : headers\openvr_capi.h:1785 */ - public interface PollNextOverlayEvent_callback extends Callback { - byte apply(long ulOverlayHandle, VREvent_t pEvent, int uncbVREvent); - }; - /** native declaration : headers\openvr_capi.h:1786 */ - public interface GetOverlayInputMethod_callback extends Callback { - int apply(long ulOverlayHandle, IntByReference peInputMethod); - }; - /** native declaration : headers\openvr_capi.h:1787 */ - public interface SetOverlayInputMethod_callback extends Callback { - int apply(long ulOverlayHandle, int eInputMethod); - }; - /** native declaration : headers\openvr_capi.h:1788 */ - public interface GetOverlayMouseScale_callback extends Callback { - int apply(long ulOverlayHandle, HmdVector2_t pvecMouseScale); - }; - /** native declaration : headers\openvr_capi.h:1789 */ - public interface SetOverlayMouseScale_callback extends Callback { - int apply(long ulOverlayHandle, HmdVector2_t pvecMouseScale); - }; - /** native declaration : headers\openvr_capi.h:1790 */ - public interface ComputeOverlayIntersection_callback extends Callback { - byte apply(long ulOverlayHandle, VROverlayIntersectionParams_t pParams, VROverlayIntersectionResults_t pResults); - }; - /** native declaration : headers\openvr_capi.h:1791 */ - public interface HandleControllerOverlayInteractionAsMouse_callback extends Callback { - byte apply(long ulOverlayHandle, int unControllerDeviceIndex); - }; - /** native declaration : headers\openvr_capi.h:1792 */ - public interface IsHoverTargetOverlay_callback extends Callback { - byte apply(long ulOverlayHandle); - }; - /** native declaration : headers\openvr_capi.h:1793 */ - public interface GetGamepadFocusOverlay_callback extends Callback { - long apply(); - }; - /** native declaration : headers\openvr_capi.h:1794 */ - public interface SetGamepadFocusOverlay_callback extends Callback { - int apply(long ulNewFocusOverlay); - }; - /** native declaration : headers\openvr_capi.h:1795 */ - public interface SetOverlayNeighbor_callback extends Callback { - int apply(int eDirection, long ulFrom, long ulTo); - }; - /** native declaration : headers\openvr_capi.h:1796 */ - public interface MoveGamepadFocusToNeighbor_callback extends Callback { - int apply(int eDirection, long ulFrom); - }; - /** native declaration : headers\openvr_capi.h:1797 */ - public interface SetOverlayTexture_callback extends Callback { - int apply(long ulOverlayHandle, Texture_t pTexture); - }; - /** native declaration : headers\openvr_capi.h:1798 */ - public interface ClearOverlayTexture_callback extends Callback { - int apply(long ulOverlayHandle); - }; - /** native declaration : headers\openvr_capi.h:1799 */ - public interface SetOverlayRaw_callback extends Callback { - int apply(long ulOverlayHandle, Pointer pvBuffer, int unWidth, int unHeight, int unDepth); - }; - /** native declaration : headers\openvr_capi.h:1800 */ - public interface SetOverlayFromFile_callback extends Callback { - int apply(long ulOverlayHandle, Pointer pchFilePath); - }; - /** native declaration : headers\openvr_capi.h:1801 */ - public interface GetOverlayTexture_callback extends Callback { - int apply(long ulOverlayHandle, PointerByReference pNativeTextureHandle, Pointer pNativeTextureRef, IntByReference pWidth, IntByReference pHeight, IntByReference pNativeFormat, IntByReference pAPIType, IntByReference pColorSpace, VRTextureBounds_t pTextureBounds); - }; - /** native declaration : headers\openvr_capi.h:1802 */ - public interface ReleaseNativeOverlayHandle_callback extends Callback { - int apply(long ulOverlayHandle, Pointer pNativeTextureHandle); - }; - /** native declaration : headers\openvr_capi.h:1803 */ - public interface GetOverlayTextureSize_callback extends Callback { - int apply(long ulOverlayHandle, IntByReference pWidth, IntByReference pHeight); - }; - /** native declaration : headers\openvr_capi.h:1804 */ - public interface CreateDashboardOverlay_callback extends Callback { - int apply(Pointer pchOverlayKey, Pointer pchOverlayFriendlyName, LongByReference pMainHandle, LongByReference pThumbnailHandle); - }; - /** native declaration : headers\openvr_capi.h:1805 */ - public interface IsDashboardVisible_callback extends Callback { - byte apply(); - }; - /** native declaration : headers\openvr_capi.h:1806 */ - public interface IsActiveDashboardOverlay_callback extends Callback { - byte apply(long ulOverlayHandle); - }; - /** native declaration : headers\openvr_capi.h:1807 */ - public interface SetDashboardOverlaySceneProcess_callback extends Callback { - int apply(long ulOverlayHandle, int unProcessId); - }; - /** native declaration : headers\openvr_capi.h:1808 */ - public interface GetDashboardOverlaySceneProcess_callback extends Callback { - int apply(long ulOverlayHandle, IntByReference punProcessId); - }; - /** native declaration : headers\openvr_capi.h:1809 */ - public interface ShowDashboard_callback extends Callback { - void apply(Pointer pchOverlayToShow); - }; - /** native declaration : headers\openvr_capi.h:1810 */ - public interface GetPrimaryDashboardDevice_callback extends Callback { - int apply(); - }; - /** native declaration : headers\openvr_capi.h:1811 */ - public interface ShowKeyboard_callback extends Callback { - int apply(int eInputMode, int eLineInputMode, Pointer pchDescription, int unCharMax, Pointer pchExistingText, byte bUseMinimalMode, long uUserValue); - }; - /** native declaration : headers\openvr_capi.h:1812 */ - public interface ShowKeyboardForOverlay_callback extends Callback { - int apply(long ulOverlayHandle, int eInputMode, int eLineInputMode, Pointer pchDescription, int unCharMax, Pointer pchExistingText, byte bUseMinimalMode, long uUserValue); - }; - /** native declaration : headers\openvr_capi.h:1813 */ - public interface GetKeyboardText_callback extends Callback { - int apply(Pointer pchText, int cchText); - }; - /** native declaration : headers\openvr_capi.h:1814 */ - public interface HideKeyboard_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:1815 */ - public interface SetKeyboardTransformAbsolute_callback extends Callback { - void apply(int eTrackingOrigin, HmdMatrix34_t pmatTrackingOriginToKeyboardTransform); - }; - /** native declaration : headers\openvr_capi.h:1816 */ - public interface SetKeyboardPositionForOverlay_callback extends Callback { - void apply(long ulOverlayHandle, com.jme3.system.jopenvr.HmdRect2_t.ByValue avoidRect); - }; - /** native declaration : headers\openvr_capi.h:1817 */ - public interface SetOverlayIntersectionMask_callback extends Callback { - int apply(long ulOverlayHandle, VROverlayIntersectionMaskPrimitive_t pMaskPrimitives, int unNumMaskPrimitives, int unPrimitiveSize); - }; - /** native declaration : headers\openvr_capi.h:1818 */ - public interface GetOverlayFlags_callback extends Callback { - int apply(long ulOverlayHandle, IntByReference pFlags); - }; - /** native declaration : headers\openvr_capi.h:1819 */ - public interface ShowMessageOverlay_callback extends Callback { - int apply(Pointer pchText, Pointer pchCaption, Pointer pchButton0Text, Pointer pchButton1Text, Pointer pchButton2Text, Pointer pchButton3Text); - }; - public VR_IVROverlay_FnTable() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("FindOverlay", "CreateOverlay", "DestroyOverlay", "SetHighQualityOverlay", "GetHighQualityOverlay", "GetOverlayKey", "GetOverlayName", "SetOverlayName", "GetOverlayImageData", "GetOverlayErrorNameFromEnum", "SetOverlayRenderingPid", "GetOverlayRenderingPid", "SetOverlayFlag", "GetOverlayFlag", "SetOverlayColor", "GetOverlayColor", "SetOverlayAlpha", "GetOverlayAlpha", "SetOverlayTexelAspect", "GetOverlayTexelAspect", "SetOverlaySortOrder", "GetOverlaySortOrder", "SetOverlayWidthInMeters", "GetOverlayWidthInMeters", "SetOverlayAutoCurveDistanceRangeInMeters", "GetOverlayAutoCurveDistanceRangeInMeters", "SetOverlayTextureColorSpace", "GetOverlayTextureColorSpace", "SetOverlayTextureBounds", "GetOverlayTextureBounds", "GetOverlayRenderModel", "SetOverlayRenderModel", "GetOverlayTransformType", "SetOverlayTransformAbsolute", "GetOverlayTransformAbsolute", "SetOverlayTransformTrackedDeviceRelative", "GetOverlayTransformTrackedDeviceRelative", "SetOverlayTransformTrackedDeviceComponent", "GetOverlayTransformTrackedDeviceComponent", "GetOverlayTransformOverlayRelative", "SetOverlayTransformOverlayRelative", "ShowOverlay", "HideOverlay", "IsOverlayVisible", "GetTransformForOverlayCoordinates", "PollNextOverlayEvent", "GetOverlayInputMethod", "SetOverlayInputMethod", "GetOverlayMouseScale", "SetOverlayMouseScale", "ComputeOverlayIntersection", "HandleControllerOverlayInteractionAsMouse", "IsHoverTargetOverlay", "GetGamepadFocusOverlay", "SetGamepadFocusOverlay", "SetOverlayNeighbor", "MoveGamepadFocusToNeighbor", "SetOverlayTexture", "ClearOverlayTexture", "SetOverlayRaw", "SetOverlayFromFile", "GetOverlayTexture", "ReleaseNativeOverlayHandle", "GetOverlayTextureSize", "CreateDashboardOverlay", "IsDashboardVisible", "IsActiveDashboardOverlay", "SetDashboardOverlaySceneProcess", "GetDashboardOverlaySceneProcess", "ShowDashboard", "GetPrimaryDashboardDevice", "ShowKeyboard", "ShowKeyboardForOverlay", "GetKeyboardText", "HideKeyboard", "SetKeyboardTransformAbsolute", "SetKeyboardPositionForOverlay", "SetOverlayIntersectionMask", "GetOverlayFlags", "ShowMessageOverlay"); - } - public VR_IVROverlay_FnTable(Pointer peer) { - super(peer); - } - public static class ByReference extends VR_IVROverlay_FnTable implements Structure.ByReference { - - }; - public static class ByValue extends VR_IVROverlay_FnTable implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRRenderModels_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRRenderModels_FnTable.java deleted file mode 100644 index 548b2c1ed0..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRRenderModels_FnTable.java +++ /dev/null @@ -1,139 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Callback; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.ptr.IntByReference; -import com.sun.jna.ptr.PointerByReference; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1858
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VR_IVRRenderModels_FnTable extends Structure { - /** C type : LoadRenderModel_Async_callback* */ - public VR_IVRRenderModels_FnTable.LoadRenderModel_Async_callback LoadRenderModel_Async; - /** C type : FreeRenderModel_callback* */ - public VR_IVRRenderModels_FnTable.FreeRenderModel_callback FreeRenderModel; - /** C type : LoadTexture_Async_callback* */ - public VR_IVRRenderModels_FnTable.LoadTexture_Async_callback LoadTexture_Async; - /** C type : FreeTexture_callback* */ - public VR_IVRRenderModels_FnTable.FreeTexture_callback FreeTexture; - /** C type : LoadTextureD3D11_Async_callback* */ - public VR_IVRRenderModels_FnTable.LoadTextureD3D11_Async_callback LoadTextureD3D11_Async; - /** C type : LoadIntoTextureD3D11_Async_callback* */ - public VR_IVRRenderModels_FnTable.LoadIntoTextureD3D11_Async_callback LoadIntoTextureD3D11_Async; - /** C type : FreeTextureD3D11_callback* */ - public VR_IVRRenderModels_FnTable.FreeTextureD3D11_callback FreeTextureD3D11; - /** C type : GetRenderModelName_callback* */ - public VR_IVRRenderModels_FnTable.GetRenderModelName_callback GetRenderModelName; - /** C type : GetRenderModelCount_callback* */ - public VR_IVRRenderModels_FnTable.GetRenderModelCount_callback GetRenderModelCount; - /** C type : GetComponentCount_callback* */ - public VR_IVRRenderModels_FnTable.GetComponentCount_callback GetComponentCount; - /** C type : GetComponentName_callback* */ - public VR_IVRRenderModels_FnTable.GetComponentName_callback GetComponentName; - /** C type : GetComponentButtonMask_callback* */ - public VR_IVRRenderModels_FnTable.GetComponentButtonMask_callback GetComponentButtonMask; - /** C type : GetComponentRenderModelName_callback* */ - public VR_IVRRenderModels_FnTable.GetComponentRenderModelName_callback GetComponentRenderModelName; - /** C type : GetComponentState_callback* */ - public VR_IVRRenderModels_FnTable.GetComponentState_callback GetComponentState; - /** C type : RenderModelHasComponent_callback* */ - public VR_IVRRenderModels_FnTable.RenderModelHasComponent_callback RenderModelHasComponent; - /** C type : GetRenderModelThumbnailURL_callback* */ - public VR_IVRRenderModels_FnTable.GetRenderModelThumbnailURL_callback GetRenderModelThumbnailURL; - /** C type : GetRenderModelOriginalPath_callback* */ - public VR_IVRRenderModels_FnTable.GetRenderModelOriginalPath_callback GetRenderModelOriginalPath; - /** C type : GetRenderModelErrorNameFromEnum_callback* */ - public VR_IVRRenderModels_FnTable.GetRenderModelErrorNameFromEnum_callback GetRenderModelErrorNameFromEnum; - /** native declaration : headers\openvr_capi.h:1840 */ - public interface LoadRenderModel_Async_callback extends Callback { - int apply(Pointer pchRenderModelName, PointerByReference ppRenderModel); - }; - /** native declaration : headers\openvr_capi.h:1841 */ - public interface FreeRenderModel_callback extends Callback { - void apply(RenderModel_t pRenderModel); - }; - /** native declaration : headers\openvr_capi.h:1842 */ - public interface LoadTexture_Async_callback extends Callback { - int apply(int textureId, PointerByReference ppTexture); - }; - /** native declaration : headers\openvr_capi.h:1843 */ - public interface FreeTexture_callback extends Callback { - void apply(RenderModel_TextureMap_t pTexture); - }; - /** native declaration : headers\openvr_capi.h:1844 */ - public interface LoadTextureD3D11_Async_callback extends Callback { - int apply(int textureId, Pointer pD3D11Device, PointerByReference ppD3D11Texture2D); - }; - /** native declaration : headers\openvr_capi.h:1845 */ - public interface LoadIntoTextureD3D11_Async_callback extends Callback { - int apply(int textureId, Pointer pDstTexture); - }; - /** native declaration : headers\openvr_capi.h:1846 */ - public interface FreeTextureD3D11_callback extends Callback { - void apply(Pointer pD3D11Texture2D); - }; - /** native declaration : headers\openvr_capi.h:1847 */ - public interface GetRenderModelName_callback extends Callback { - int apply(int unRenderModelIndex, Pointer pchRenderModelName, int unRenderModelNameLen); - }; - /** native declaration : headers\openvr_capi.h:1848 */ - public interface GetRenderModelCount_callback extends Callback { - int apply(); - }; - /** native declaration : headers\openvr_capi.h:1849 */ - public interface GetComponentCount_callback extends Callback { - int apply(Pointer pchRenderModelName); - }; - /** native declaration : headers\openvr_capi.h:1850 */ - public interface GetComponentName_callback extends Callback { - int apply(Pointer pchRenderModelName, int unComponentIndex, Pointer pchComponentName, int unComponentNameLen); - }; - /** native declaration : headers\openvr_capi.h:1851 */ - public interface GetComponentButtonMask_callback extends Callback { - long apply(Pointer pchRenderModelName, Pointer pchComponentName); - }; - /** native declaration : headers\openvr_capi.h:1852 */ - public interface GetComponentRenderModelName_callback extends Callback { - int apply(Pointer pchRenderModelName, Pointer pchComponentName, Pointer pchComponentRenderModelName, int unComponentRenderModelNameLen); - }; - /** native declaration : headers\openvr_capi.h:1853 */ - public interface GetComponentState_callback extends Callback { - byte apply(Pointer pchRenderModelName, Pointer pchComponentName, VRControllerState_t pControllerState, RenderModel_ControllerMode_State_t pState, RenderModel_ComponentState_t pComponentState); - }; - /** native declaration : headers\openvr_capi.h:1854 */ - public interface RenderModelHasComponent_callback extends Callback { - byte apply(Pointer pchRenderModelName, Pointer pchComponentName); - }; - /** native declaration : headers\openvr_capi.h:1855 */ - public interface GetRenderModelThumbnailURL_callback extends Callback { - int apply(Pointer pchRenderModelName, Pointer pchThumbnailURL, int unThumbnailURLLen, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:1856 */ - public interface GetRenderModelOriginalPath_callback extends Callback { - int apply(Pointer pchRenderModelName, Pointer pchOriginalPath, int unOriginalPathLen, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:1857 */ - public interface GetRenderModelErrorNameFromEnum_callback extends Callback { - Pointer apply(int error); - }; - public VR_IVRRenderModels_FnTable() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("LoadRenderModel_Async", "FreeRenderModel", "LoadTexture_Async", "FreeTexture", "LoadTextureD3D11_Async", "LoadIntoTextureD3D11_Async", "FreeTextureD3D11", "GetRenderModelName", "GetRenderModelCount", "GetComponentCount", "GetComponentName", "GetComponentButtonMask", "GetComponentRenderModelName", "GetComponentState", "RenderModelHasComponent", "GetRenderModelThumbnailURL", "GetRenderModelOriginalPath", "GetRenderModelErrorNameFromEnum"); - } - public VR_IVRRenderModels_FnTable(Pointer peer) { - super(peer); - } - public static class ByReference extends VR_IVRRenderModels_FnTable implements Structure.ByReference { - - }; - public static class ByValue extends VR_IVRRenderModels_FnTable implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRResources_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRResources_FnTable.java deleted file mode 100644 index b0c098a3ef..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRResources_FnTable.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Callback; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1912
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VR_IVRResources_FnTable extends Structure { - /** C type : LoadSharedResource_callback* */ - public VR_IVRResources_FnTable.LoadSharedResource_callback LoadSharedResource; - /** C type : GetResourceFullPath_callback* */ - public VR_IVRResources_FnTable.GetResourceFullPath_callback GetResourceFullPath; - /** native declaration : headers\openvr_capi.h:1910 */ - public interface LoadSharedResource_callback extends Callback { - int apply(Pointer pchResourceName, Pointer pchBuffer, int unBufferLen); - }; - /** native declaration : headers\openvr_capi.h:1911 */ - public interface GetResourceFullPath_callback extends Callback { - int apply(Pointer pchResourceName, Pointer pchResourceTypeDirectory, Pointer pchPathBuffer, int unBufferLen); - }; - public VR_IVRResources_FnTable() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("LoadSharedResource", "GetResourceFullPath"); - } - /** - * @param LoadSharedResource C type : LoadSharedResource_callback*
    - * @param GetResourceFullPath C type : GetResourceFullPath_callback* - */ - public VR_IVRResources_FnTable(VR_IVRResources_FnTable.LoadSharedResource_callback LoadSharedResource, VR_IVRResources_FnTable.GetResourceFullPath_callback GetResourceFullPath) { - super(); - this.LoadSharedResource = LoadSharedResource; - this.GetResourceFullPath = GetResourceFullPath; - } - public VR_IVRResources_FnTable(Pointer peer) { - super(peer); - } - public static class ByReference extends VR_IVRResources_FnTable implements Structure.ByReference { - - }; - public static class ByValue extends VR_IVRResources_FnTable implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRScreenshots_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRScreenshots_FnTable.java deleted file mode 100644 index d6328b8e8d..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRScreenshots_FnTable.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Callback; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.ptr.IntByReference; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1906
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VR_IVRScreenshots_FnTable extends Structure { - /** C type : RequestScreenshot_callback* */ - public VR_IVRScreenshots_FnTable.RequestScreenshot_callback RequestScreenshot; - /** C type : HookScreenshot_callback* */ - public VR_IVRScreenshots_FnTable.HookScreenshot_callback HookScreenshot; - /** C type : GetScreenshotPropertyType_callback* */ - public VR_IVRScreenshots_FnTable.GetScreenshotPropertyType_callback GetScreenshotPropertyType; - /** C type : GetScreenshotPropertyFilename_callback* */ - public VR_IVRScreenshots_FnTable.GetScreenshotPropertyFilename_callback GetScreenshotPropertyFilename; - /** C type : UpdateScreenshotProgress_callback* */ - public VR_IVRScreenshots_FnTable.UpdateScreenshotProgress_callback UpdateScreenshotProgress; - /** C type : TakeStereoScreenshot_callback* */ - public VR_IVRScreenshots_FnTable.TakeStereoScreenshot_callback TakeStereoScreenshot; - /** C type : SubmitScreenshot_callback* */ - public VR_IVRScreenshots_FnTable.SubmitScreenshot_callback SubmitScreenshot; - /** native declaration : headers\openvr_capi.h:1899 */ - public interface RequestScreenshot_callback extends Callback { - int apply(IntByReference pOutScreenshotHandle, int type, Pointer pchPreviewFilename, Pointer pchVRFilename); - }; - /** native declaration : headers\openvr_capi.h:1900 */ - public interface HookScreenshot_callback extends Callback { - int apply(IntByReference pSupportedTypes, int numTypes); - }; - /** native declaration : headers\openvr_capi.h:1901 */ - public interface GetScreenshotPropertyType_callback extends Callback { - int apply(int screenshotHandle, IntByReference pError); - }; - /** native declaration : headers\openvr_capi.h:1902 */ - public interface GetScreenshotPropertyFilename_callback extends Callback { - int apply(int screenshotHandle, int filenameType, Pointer pchFilename, int cchFilename, IntByReference pError); - }; - /** native declaration : headers\openvr_capi.h:1903 */ - public interface UpdateScreenshotProgress_callback extends Callback { - int apply(int screenshotHandle, float flProgress); - }; - /** native declaration : headers\openvr_capi.h:1904 */ - public interface TakeStereoScreenshot_callback extends Callback { - int apply(IntByReference pOutScreenshotHandle, Pointer pchPreviewFilename, Pointer pchVRFilename); - }; - /** native declaration : headers\openvr_capi.h:1905 */ - public interface SubmitScreenshot_callback extends Callback { - int apply(int screenshotHandle, int type, Pointer pchSourcePreviewFilename, Pointer pchSourceVRFilename); - }; - public VR_IVRScreenshots_FnTable() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("RequestScreenshot", "HookScreenshot", "GetScreenshotPropertyType", "GetScreenshotPropertyFilename", "UpdateScreenshotProgress", "TakeStereoScreenshot", "SubmitScreenshot"); - } - /** - * @param RequestScreenshot C type : RequestScreenshot_callback*
    - * @param HookScreenshot C type : HookScreenshot_callback*
    - * @param GetScreenshotPropertyType C type : GetScreenshotPropertyType_callback*
    - * @param GetScreenshotPropertyFilename C type : GetScreenshotPropertyFilename_callback*
    - * @param UpdateScreenshotProgress C type : UpdateScreenshotProgress_callback*
    - * @param TakeStereoScreenshot C type : TakeStereoScreenshot_callback*
    - * @param SubmitScreenshot C type : SubmitScreenshot_callback* - */ - public VR_IVRScreenshots_FnTable(VR_IVRScreenshots_FnTable.RequestScreenshot_callback RequestScreenshot, VR_IVRScreenshots_FnTable.HookScreenshot_callback HookScreenshot, VR_IVRScreenshots_FnTable.GetScreenshotPropertyType_callback GetScreenshotPropertyType, VR_IVRScreenshots_FnTable.GetScreenshotPropertyFilename_callback GetScreenshotPropertyFilename, VR_IVRScreenshots_FnTable.UpdateScreenshotProgress_callback UpdateScreenshotProgress, VR_IVRScreenshots_FnTable.TakeStereoScreenshot_callback TakeStereoScreenshot, VR_IVRScreenshots_FnTable.SubmitScreenshot_callback SubmitScreenshot) { - super(); - this.RequestScreenshot = RequestScreenshot; - this.HookScreenshot = HookScreenshot; - this.GetScreenshotPropertyType = GetScreenshotPropertyType; - this.GetScreenshotPropertyFilename = GetScreenshotPropertyFilename; - this.UpdateScreenshotProgress = UpdateScreenshotProgress; - this.TakeStereoScreenshot = TakeStereoScreenshot; - this.SubmitScreenshot = SubmitScreenshot; - } - public VR_IVRScreenshots_FnTable(Pointer peer) { - super(peer); - } - public static class ByReference extends VR_IVRScreenshots_FnTable implements Structure.ByReference { - - }; - public static class ByValue extends VR_IVRScreenshots_FnTable implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRSettings_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRSettings_FnTable.java deleted file mode 100644 index 3ea08aa08f..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRSettings_FnTable.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Callback; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.ptr.IntByReference; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1890
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VR_IVRSettings_FnTable extends Structure { - /** C type : GetSettingsErrorNameFromEnum_callback* */ - public VR_IVRSettings_FnTable.GetSettingsErrorNameFromEnum_callback GetSettingsErrorNameFromEnum; - /** C type : Sync_callback* */ - public VR_IVRSettings_FnTable.Sync_callback Sync; - /** C type : SetBool_callback* */ - public VR_IVRSettings_FnTable.SetBool_callback SetBool; - /** C type : SetInt32_callback* */ - public VR_IVRSettings_FnTable.SetInt32_callback SetInt32; - /** C type : SetFloat_callback* */ - public VR_IVRSettings_FnTable.SetFloat_callback SetFloat; - /** C type : SetString_callback* */ - public VR_IVRSettings_FnTable.SetString_callback SetString; - /** C type : GetBool_callback* */ - public VR_IVRSettings_FnTable.GetBool_callback GetBool; - /** C type : GetInt32_callback* */ - public VR_IVRSettings_FnTable.GetInt32_callback GetInt32; - /** C type : GetFloat_callback* */ - public VR_IVRSettings_FnTable.GetFloat_callback GetFloat; - /** C type : GetString_callback* */ - public VR_IVRSettings_FnTable.GetString_callback GetString; - /** C type : RemoveSection_callback* */ - public VR_IVRSettings_FnTable.RemoveSection_callback RemoveSection; - /** C type : RemoveKeyInSection_callback* */ - public VR_IVRSettings_FnTable.RemoveKeyInSection_callback RemoveKeyInSection; - /** native declaration : headers\openvr_capi.h:1878 */ - public interface GetSettingsErrorNameFromEnum_callback extends Callback { - Pointer apply(int eError); - }; - /** native declaration : headers\openvr_capi.h:1879 */ - public interface Sync_callback extends Callback { - byte apply(byte bForce, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:1880 */ - public interface SetBool_callback extends Callback { - void apply(Pointer pchSection, Pointer pchSettingsKey, byte bValue, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:1881 */ - public interface SetInt32_callback extends Callback { - void apply(Pointer pchSection, Pointer pchSettingsKey, int nValue, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:1882 */ - public interface SetFloat_callback extends Callback { - void apply(Pointer pchSection, Pointer pchSettingsKey, float flValue, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:1883 */ - public interface SetString_callback extends Callback { - void apply(Pointer pchSection, Pointer pchSettingsKey, Pointer pchValue, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:1884 */ - public interface GetBool_callback extends Callback { - byte apply(Pointer pchSection, Pointer pchSettingsKey, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:1885 */ - public interface GetInt32_callback extends Callback { - int apply(Pointer pchSection, Pointer pchSettingsKey, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:1886 */ - public interface GetFloat_callback extends Callback { - float apply(Pointer pchSection, Pointer pchSettingsKey, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:1887 */ - public interface GetString_callback extends Callback { - void apply(Pointer pchSection, Pointer pchSettingsKey, Pointer pchValue, int unValueLen, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:1888 */ - public interface RemoveSection_callback extends Callback { - void apply(Pointer pchSection, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:1889 */ - public interface RemoveKeyInSection_callback extends Callback { - void apply(Pointer pchSection, Pointer pchSettingsKey, IntByReference peError); - }; - public VR_IVRSettings_FnTable() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("GetSettingsErrorNameFromEnum", "Sync", "SetBool", "SetInt32", "SetFloat", "SetString", "GetBool", "GetInt32", "GetFloat", "GetString", "RemoveSection", "RemoveKeyInSection"); - } - public VR_IVRSettings_FnTable(Pointer peer) { - super(peer); - } - public static class ByReference extends VR_IVRSettings_FnTable implements Structure.ByReference { - - }; - public static class ByValue extends VR_IVRSettings_FnTable implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRSystem_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRSystem_FnTable.java deleted file mode 100644 index 7b372d014f..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRSystem_FnTable.java +++ /dev/null @@ -1,352 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Callback; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.ptr.FloatByReference; -import com.sun.jna.ptr.IntByReference; -import com.sun.jna.ptr.LongByReference; - -import java.util.Arrays; -import java.util.List; -/** - * OpenVR Function Pointer Tables
    - * native declaration : headers\openvr_capi.h:1416
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VR_IVRSystem_FnTable extends Structure { - - /** C type : GetRecommendedRenderTargetSize_callback* */ - public VR_IVRSystem_FnTable.GetRecommendedRenderTargetSize_callback GetRecommendedRenderTargetSize; - /** C type : GetProjectionMatrix_callback* */ - public VR_IVRSystem_FnTable.GetProjectionMatrix_callback GetProjectionMatrix; - /** C type : GetProjectionRaw_callback* */ - public VR_IVRSystem_FnTable.GetProjectionRaw_callback GetProjectionRaw; - /** C type : ComputeDistortion_callback* */ - public VR_IVRSystem_FnTable.ComputeDistortion_callback ComputeDistortion; - /** C type : GetEyeToHeadTransform_callback* */ - public VR_IVRSystem_FnTable.GetEyeToHeadTransform_callback GetEyeToHeadTransform; - /** C type : GetTimeSinceLastVsync_callback* */ - public VR_IVRSystem_FnTable.GetTimeSinceLastVsync_callback GetTimeSinceLastVsync; - /** C type : GetD3D9AdapterIndex_callback* */ - public VR_IVRSystem_FnTable.GetD3D9AdapterIndex_callback GetD3D9AdapterIndex; - /** C type : GetDXGIOutputInfo_callback* */ - public com.jme3.system.jopenvr.VR_IVRExtendedDisplay_FnTable.GetDXGIOutputInfo_callback GetDXGIOutputInfo; - /** C type : GetOutputDevice_callback* */ - public VR_IVRSystem_FnTable.GetOutputDevice_callback GetOutputDevice; - /** C type : IsDisplayOnDesktop_callback* */ - public VR_IVRSystem_FnTable.IsDisplayOnDesktop_callback IsDisplayOnDesktop; - /** C type : SetDisplayVisibility_callback* */ - public VR_IVRSystem_FnTable.SetDisplayVisibility_callback SetDisplayVisibility; - /** C type : GetDeviceToAbsoluteTrackingPose_callback* */ - public VR_IVRSystem_FnTable.GetDeviceToAbsoluteTrackingPose_callback GetDeviceToAbsoluteTrackingPose; - /** C type : ResetSeatedZeroPose_callback* */ - public VR_IVRSystem_FnTable.ResetSeatedZeroPose_callback ResetSeatedZeroPose; - /** C type : GetSeatedZeroPoseToStandingAbsoluteTrackingPose_callback* */ - public VR_IVRSystem_FnTable.GetSeatedZeroPoseToStandingAbsoluteTrackingPose_callback GetSeatedZeroPoseToStandingAbsoluteTrackingPose; - /** C type : GetRawZeroPoseToStandingAbsoluteTrackingPose_callback* */ - public VR_IVRSystem_FnTable.GetRawZeroPoseToStandingAbsoluteTrackingPose_callback GetRawZeroPoseToStandingAbsoluteTrackingPose; - /** C type : GetSortedTrackedDeviceIndicesOfClass_callback* */ - public VR_IVRSystem_FnTable.GetSortedTrackedDeviceIndicesOfClass_callback GetSortedTrackedDeviceIndicesOfClass; - /** C type : GetTrackedDeviceActivityLevel_callback* */ - public VR_IVRSystem_FnTable.GetTrackedDeviceActivityLevel_callback GetTrackedDeviceActivityLevel; - /** C type : ApplyTransform_callback* */ - public VR_IVRSystem_FnTable.ApplyTransform_callback ApplyTransform; - /** C type : GetTrackedDeviceIndexForControllerRole_callback* */ - public VR_IVRSystem_FnTable.GetTrackedDeviceIndexForControllerRole_callback GetTrackedDeviceIndexForControllerRole; - /** C type : GetControllerRoleForTrackedDeviceIndex_callback* */ - public VR_IVRSystem_FnTable.GetControllerRoleForTrackedDeviceIndex_callback GetControllerRoleForTrackedDeviceIndex; - /** C type : GetTrackedDeviceClass_callback* */ - public VR_IVRSystem_FnTable.GetTrackedDeviceClass_callback GetTrackedDeviceClass; - /** C type : IsTrackedDeviceConnected_callback* */ - public VR_IVRSystem_FnTable.IsTrackedDeviceConnected_callback IsTrackedDeviceConnected; - /** C type : GetBoolTrackedDeviceProperty_callback* */ - public VR_IVRSystem_FnTable.GetBoolTrackedDeviceProperty_callback GetBoolTrackedDeviceProperty; - /** C type : GetFloatTrackedDeviceProperty_callback* */ - public VR_IVRSystem_FnTable.GetFloatTrackedDeviceProperty_callback GetFloatTrackedDeviceProperty; - /** C type : GetInt32TrackedDeviceProperty_callback* */ - public VR_IVRSystem_FnTable.GetInt32TrackedDeviceProperty_callback GetInt32TrackedDeviceProperty; - /** C type : GetUint64TrackedDeviceProperty_callback* */ - public VR_IVRSystem_FnTable.GetUint64TrackedDeviceProperty_callback GetUint64TrackedDeviceProperty; - /** C type : GetMatrix34TrackedDeviceProperty_callback* */ - public VR_IVRSystem_FnTable.GetMatrix34TrackedDeviceProperty_callback GetMatrix34TrackedDeviceProperty; - /** C type : GetStringTrackedDeviceProperty_callback* */ - public VR_IVRSystem_FnTable.GetStringTrackedDeviceProperty_callback GetStringTrackedDeviceProperty; - /** C type : GetPropErrorNameFromEnum_callback* */ - public VR_IVRSystem_FnTable.GetPropErrorNameFromEnum_callback GetPropErrorNameFromEnum; - /** C type : PollNextEvent_callback* */ - public VR_IVRSystem_FnTable.PollNextEvent_callback PollNextEvent; - /** C type : PollNextEventWithPose_callback* */ - public VR_IVRSystem_FnTable.PollNextEventWithPose_callback PollNextEventWithPose; - /** C type : GetEventTypeNameFromEnum_callback* */ - public VR_IVRSystem_FnTable.GetEventTypeNameFromEnum_callback GetEventTypeNameFromEnum; - /** C type : GetHiddenAreaMesh_callback* */ - public VR_IVRSystem_FnTable.GetHiddenAreaMesh_callback GetHiddenAreaMesh; - /** C type : GetControllerState_callback* */ - public VR_IVRSystem_FnTable.GetControllerState_callback GetControllerState; - /** C type : GetControllerStateWithPose_callback* */ - public VR_IVRSystem_FnTable.GetControllerStateWithPose_callback GetControllerStateWithPose; - /** C type : TriggerHapticPulse_callback* */ - public VR_IVRSystem_FnTable.TriggerHapticPulse_callback TriggerHapticPulse; - /** C type : GetButtonIdNameFromEnum_callback* */ - public VR_IVRSystem_FnTable.GetButtonIdNameFromEnum_callback GetButtonIdNameFromEnum; - /** C type : GetControllerAxisTypeNameFromEnum_callback* */ - public VR_IVRSystem_FnTable.GetControllerAxisTypeNameFromEnum_callback GetControllerAxisTypeNameFromEnum; - /** C type : CaptureInputFocus_callback* */ - public VR_IVRSystem_FnTable.CaptureInputFocus_callback CaptureInputFocus; - /** C type : ReleaseInputFocus_callback* */ - public VR_IVRSystem_FnTable.ReleaseInputFocus_callback ReleaseInputFocus; - /** C type : IsInputFocusCapturedByAnotherProcess_callback* */ - public VR_IVRSystem_FnTable.IsInputFocusCapturedByAnotherProcess_callback IsInputFocusCapturedByAnotherProcess; - /** C type : DriverDebugRequest_callback* */ - public VR_IVRSystem_FnTable.DriverDebugRequest_callback DriverDebugRequest; - /** C type : PerformFirmwareUpdate_callback* */ - public VR_IVRSystem_FnTable.PerformFirmwareUpdate_callback PerformFirmwareUpdate; - /** C type : AcknowledgeQuit_Exiting_callback* */ - public VR_IVRSystem_FnTable.AcknowledgeQuit_Exiting_callback AcknowledgeQuit_Exiting; - /** C type : AcknowledgeQuit_UserPrompt_callback* */ - public VR_IVRSystem_FnTable.AcknowledgeQuit_UserPrompt_callback AcknowledgeQuit_UserPrompt; - /** native declaration : headers\openvr_capi.h:1371 */ - public interface GetRecommendedRenderTargetSize_callback extends Callback { - void apply(IntByReference pnWidth, IntByReference pnHeight); - }; - /** native declaration : headers\openvr_capi.h:1372 */ - public interface GetProjectionMatrix_callback extends Callback { - com.jme3.system.jopenvr.HmdMatrix44_t.ByValue apply(int eEye, float fNearZ, float fFarZ); - }; - /** native declaration : headers\openvr_capi.h:1373 */ - public interface GetProjectionRaw_callback extends Callback { - void apply(int eEye, FloatByReference pfLeft, FloatByReference pfRight, FloatByReference pfTop, FloatByReference pfBottom); - }; - /** native declaration : headers\openvr_capi.h:1374 */ - public interface ComputeDistortion_callback extends Callback { - byte apply(int eEye, float fU, float fV, DistortionCoordinates_t pDistortionCoordinates); - }; - - /** native declaration : headers\openvr_capi.h:1375 */ - public interface GetEyeToHeadTransform_callback extends Callback { - HmdMatrix34_t.ByValue apply(int eEye); - }; - /** native declaration : headers\openvr_capi.h:1376 */ - public interface GetTimeSinceLastVsync_callback extends Callback { - byte apply(FloatByReference pfSecondsSinceLastVsync, LongByReference pulFrameCounter); - }; - /** native declaration : headers\openvr_capi.h:1377 */ - public interface GetD3D9AdapterIndex_callback extends Callback { - int apply(); - }; - /** native declaration : headers\openvr_capi.h:1378 */ - public interface GetDXGIOutputInfo_callback extends Callback { - void apply(IntByReference pnAdapterIndex); - }; - /** native declaration : headers\openvr_capi.h:1379 */ - public interface GetOutputDevice_callback extends Callback { - void apply(LongByReference pnDevice, int textureType); - }; - /** native declaration : headers\openvr_capi.h:1380 */ - public interface IsDisplayOnDesktop_callback extends Callback { - byte apply(); - }; - /** native declaration : headers\openvr_capi.h:1381 */ - public interface SetDisplayVisibility_callback extends Callback { - byte apply(byte bIsVisibleOnDesktop); - }; - /** native declaration : headers\openvr_capi.h:1382 */ - public interface GetDeviceToAbsoluteTrackingPose_callback extends Callback { - void apply(int eOrigin, float fPredictedSecondsToPhotonsFromNow, TrackedDevicePose_t pTrackedDevicePoseArray, int unTrackedDevicePoseArrayCount); - }; - /** native declaration : headers\openvr_capi.h:1383 */ - public interface ResetSeatedZeroPose_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:1384 */ - public interface GetSeatedZeroPoseToStandingAbsoluteTrackingPose_callback extends Callback { - HmdMatrix34_t.ByValue apply(); - }; - /** native declaration : headers\openvr_capi.h:1385 */ - public interface GetRawZeroPoseToStandingAbsoluteTrackingPose_callback extends Callback { - HmdMatrix34_t.ByValue apply(); - }; - /** native declaration : headers\openvr_capi.h:1386 */ - public interface GetSortedTrackedDeviceIndicesOfClass_callback extends Callback { - int apply(int eTrackedDeviceClass, IntByReference punTrackedDeviceIndexArray, int unTrackedDeviceIndexArrayCount, int unRelativeToTrackedDeviceIndex); - }; - /** native declaration : headers\openvr_capi.h:1387 */ - public interface GetTrackedDeviceActivityLevel_callback extends Callback { - int apply(int unDeviceId); - }; - /** native declaration : headers\openvr_capi.h:1388 */ - public interface ApplyTransform_callback extends Callback { - void apply(TrackedDevicePose_t pOutputPose, TrackedDevicePose_t pTrackedDevicePose, HmdMatrix34_t pTransform); - }; - /** native declaration : headers\openvr_capi.h:1389 */ - public interface GetTrackedDeviceIndexForControllerRole_callback extends Callback { - int apply(int unDeviceType); - }; - /** native declaration : headers\openvr_capi.h:1390 */ - public interface GetControllerRoleForTrackedDeviceIndex_callback extends Callback { - int apply(int unDeviceIndex); - }; - /** native declaration : headers\openvr_capi.h:1391 */ - public interface GetTrackedDeviceClass_callback extends Callback { - int apply(int unDeviceIndex); - }; - /** native declaration : headers\openvr_capi.h:1392 */ - public interface IsTrackedDeviceConnected_callback extends Callback { - byte apply(int unDeviceIndex); - }; - /** native declaration : headers\openvr_capi.h:1393 */ - public interface GetBoolTrackedDeviceProperty_callback extends Callback { - byte apply(int unDeviceIndex, int prop, IntByReference pError); - }; - /** native declaration : headers\openvr_capi.h:1394 */ - public interface GetFloatTrackedDeviceProperty_callback extends Callback { - float apply(int unDeviceIndex, int prop, IntByReference pError); - }; - /** native declaration : headers\openvr_capi.h:1395 */ - public interface GetInt32TrackedDeviceProperty_callback extends Callback { - int apply(int unDeviceIndex, int prop, IntByReference pError); - }; - /** native declaration : headers\openvr_capi.h:1396 */ - public interface GetUint64TrackedDeviceProperty_callback extends Callback { - long apply(int unDeviceIndex, int prop, IntByReference pError); - }; - /** native declaration : headers\openvr_capi.h:1397 */ - public interface GetMatrix34TrackedDeviceProperty_callback extends Callback { - HmdMatrix34_t.ByValue apply(int unDeviceIndex, int prop, IntByReference pError); - }; - /** native declaration : headers\openvr_capi.h:1398 */ - public interface GetStringTrackedDeviceProperty_callback extends Callback { - int apply(int unDeviceIndex, int prop, Pointer pchValue, int unBufferSize, IntByReference pError); - }; - /** native declaration : headers\openvr_capi.h:1399 */ - public interface GetPropErrorNameFromEnum_callback extends Callback { - Pointer apply(int error); - }; - /** native declaration : headers\openvr_capi.h:1400 */ - public interface PollNextEvent_callback extends Callback { - byte apply(VREvent_t pEvent, int uncbVREvent); - }; - /** native declaration : headers\openvr_capi.h:1401 */ - public interface PollNextEventWithPose_callback extends Callback { - byte apply(int eOrigin, VREvent_t pEvent, int uncbVREvent, TrackedDevicePose_t pTrackedDevicePose); - }; - /** native declaration : headers\openvr_capi.h:1402 */ - public interface GetEventTypeNameFromEnum_callback extends Callback { - Pointer apply(int eType); - }; - /** native declaration : headers\openvr_capi.h:1403 */ - public interface GetHiddenAreaMesh_callback extends Callback { - com.jme3.system.jopenvr.HiddenAreaMesh_t.ByValue apply(int eEye, int type); - }; - /** native declaration : headers\openvr_capi.h:1404 */ - public interface GetControllerState_callback extends Callback { - byte apply(int unControllerDeviceIndex, VRControllerState_t pControllerState, int unControllerStateSize); - }; - /** native declaration : headers\openvr_capi.h:1405 */ - public interface GetControllerStateWithPose_callback extends Callback { - byte apply(int eOrigin, int unControllerDeviceIndex, VRControllerState_t pControllerState, int unControllerStateSize, TrackedDevicePose_t pTrackedDevicePose); - }; - /** native declaration : headers\openvr_capi.h:1406 */ - public interface TriggerHapticPulse_callback extends Callback { - void apply(int unControllerDeviceIndex, int unAxisId, short usDurationMicroSec); - }; - /** native declaration : headers\openvr_capi.h:1407 */ - public interface GetButtonIdNameFromEnum_callback extends Callback { - Pointer apply(int eButtonId); - }; - /** native declaration : headers\openvr_capi.h:1408 */ - public interface GetControllerAxisTypeNameFromEnum_callback extends Callback { - Pointer apply(int eAxisType); - }; - /** native declaration : headers\openvr_capi.h:1409 */ - public interface CaptureInputFocus_callback extends Callback { - byte apply(); - }; - /** native declaration : headers\openvr_capi.h:1410 */ - public interface ReleaseInputFocus_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:1411 */ - public interface IsInputFocusCapturedByAnotherProcess_callback extends Callback { - byte apply(); - }; - /** native declaration : headers\openvr_capi.h:1412 */ - public interface DriverDebugRequest_callback extends Callback { - int apply(int unDeviceIndex, Pointer pchRequest, Pointer pchResponseBuffer, int unResponseBufferSize); - }; - /** native declaration : headers\openvr_capi.h:1413 */ - public interface PerformFirmwareUpdate_callback extends Callback { - int apply(int unDeviceIndex); - }; - /** native declaration : headers\openvr_capi.h:1414 */ - public interface AcknowledgeQuit_Exiting_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:1415 */ - public interface AcknowledgeQuit_UserPrompt_callback extends Callback { - void apply(); - }; - public VR_IVRSystem_FnTable() { - super(); - } - protected List getFieldOrder() { - //return Arrays.asList("GetRecommendedRenderTargetSize", "GetProjectionMatrix", "GetProjectionRaw", "ComputeDistortion", "GetEyeToHeadTransform", "GetTimeSinceLastVsync", "GetD3D9AdapterIndex", "GetDXGIOutputInfo", "GetOutputDevice", "IsDisplayOnDesktop", "SetDisplayVisibility", "GetDeviceToAbsoluteTrackingPose", "ResetSeatedZeroPose", "GetSeatedZeroPoseToStandingAbsoluteTrackingPose", "GetRawZeroPoseToStandingAbsoluteTrackingPose", "GetSortedTrackedDeviceIndicesOfClass", "GetTrackedDeviceActivityLevel", "ApplyTransform", "GetTrackedDeviceIndexForControllerRole", "GetControllerRoleForTrackedDeviceIndex", "GetTrackedDeviceClass", "IsTrackedDeviceConnected", "GetBoolTrackedDeviceProperty", "GetFloatTrackedDeviceProperty", "GetInt32TrackedDeviceProperty", "GetUint64TrackedDeviceProperty", "GetMatrix34TrackedDeviceProperty", "GetStringTrackedDeviceProperty", "GetPropErrorNameFromEnum", "PollNextEvent", "PollNextEventWithPose", "GetEventTypeNameFromEnum", "GetHiddenAreaMesh", "GetControllerState", "GetControllerStateWithPose", "TriggerHapticPulse", "GetButtonIdNameFromEnum", "GetControllerAxisTypeNameFromEnum", "CaptureInputFocus", "ReleaseInputFocus", "IsInputFocusCapturedByAnotherProcess", "DriverDebugRequest", "PerformFirmwareUpdate", "AcknowledgeQuit_Exiting", "AcknowledgeQuit_UserPrompt"); - - return Arrays.asList("GetRecommendedRenderTargetSize", - "GetProjectionMatrix", - "GetProjectionRaw", - "ComputeDistortion", - "GetEyeToHeadTransform", - "GetTimeSinceLastVsync", - "GetD3D9AdapterIndex", - "GetDXGIOutputInfo", - "GetOutputDevice", - "IsDisplayOnDesktop", - "SetDisplayVisibility", - "GetDeviceToAbsoluteTrackingPose", - "ResetSeatedZeroPose", - "GetSeatedZeroPoseToStandingAbsoluteTrackingPose", - "GetRawZeroPoseToStandingAbsoluteTrackingPose", - "GetSortedTrackedDeviceIndicesOfClass", - "GetTrackedDeviceActivityLevel", - "ApplyTransform", - "GetTrackedDeviceIndexForControllerRole", - "GetControllerRoleForTrackedDeviceIndex", - "GetTrackedDeviceClass", - "IsTrackedDeviceConnected", - "GetBoolTrackedDeviceProperty", - "GetFloatTrackedDeviceProperty", - "GetInt32TrackedDeviceProperty", - "GetUint64TrackedDeviceProperty", - "GetMatrix34TrackedDeviceProperty", - "GetStringTrackedDeviceProperty", - "GetPropErrorNameFromEnum", - "PollNextEvent", - "PollNextEventWithPose", - "GetEventTypeNameFromEnum", - "GetHiddenAreaMesh", - "GetControllerState", - "GetControllerStateWithPose", - "TriggerHapticPulse", - "GetButtonIdNameFromEnum", - "GetControllerAxisTypeNameFromEnum", - "CaptureInputFocus", - "ReleaseInputFocus", - "IsInputFocusCapturedByAnotherProcess", - "DriverDebugRequest", - "PerformFirmwareUpdate", - "AcknowledgeQuit_Exiting", - "AcknowledgeQuit_UserPrompt"); - } - public VR_IVRSystem_FnTable(Pointer peer) { - super(peer); - } - public static class ByReference extends VR_IVRSystem_FnTable implements Structure.ByReference { - - }; - public static class ByValue extends VR_IVRSystem_FnTable implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRTrackedCamera_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRTrackedCamera_FnTable.java deleted file mode 100644 index 8b7cd78b23..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRTrackedCamera_FnTable.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.jme3.system.jopenvr; -import com.sun.jna.Callback; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.ptr.IntByReference; -import com.sun.jna.ptr.LongByReference; -import com.sun.jna.ptr.PointerByReference; -import java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:1450
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VR_IVRTrackedCamera_FnTable extends Structure { - /** C type : GetCameraErrorNameFromEnum_callback* */ - public VR_IVRTrackedCamera_FnTable.GetCameraErrorNameFromEnum_callback GetCameraErrorNameFromEnum; - /** C type : HasCamera_callback* */ - public VR_IVRTrackedCamera_FnTable.HasCamera_callback HasCamera; - /** C type : GetCameraFrameSize_callback* */ - public VR_IVRTrackedCamera_FnTable.GetCameraFrameSize_callback GetCameraFrameSize; - /** C type : GetCameraIntrinsics_callback* */ - public VR_IVRTrackedCamera_FnTable.GetCameraIntrinsics_callback GetCameraIntrinsics; - /** C type : GetCameraProjection_callback* */ - public VR_IVRTrackedCamera_FnTable.GetCameraProjection_callback GetCameraProjection; - /** C type : AcquireVideoStreamingService_callback* */ - public VR_IVRTrackedCamera_FnTable.AcquireVideoStreamingService_callback AcquireVideoStreamingService; - /** C type : ReleaseVideoStreamingService_callback* */ - public VR_IVRTrackedCamera_FnTable.ReleaseVideoStreamingService_callback ReleaseVideoStreamingService; - /** C type : GetVideoStreamFrameBuffer_callback* */ - public VR_IVRTrackedCamera_FnTable.GetVideoStreamFrameBuffer_callback GetVideoStreamFrameBuffer; - /** C type : GetVideoStreamTextureSize_callback* */ - public VR_IVRTrackedCamera_FnTable.GetVideoStreamTextureSize_callback GetVideoStreamTextureSize; - /** C type : GetVideoStreamTextureD3D11_callback* */ - public VR_IVRTrackedCamera_FnTable.GetVideoStreamTextureD3D11_callback GetVideoStreamTextureD3D11; - /** C type : GetVideoStreamTextureGL_callback* */ - public VR_IVRTrackedCamera_FnTable.GetVideoStreamTextureGL_callback GetVideoStreamTextureGL; - /** C type : ReleaseVideoStreamTextureGL_callback* */ - public VR_IVRTrackedCamera_FnTable.ReleaseVideoStreamTextureGL_callback ReleaseVideoStreamTextureGL; - /** native declaration : headers\openvr_capi.h:1438 */ - public interface GetCameraErrorNameFromEnum_callback extends Callback { - Pointer apply(int eCameraError); - }; - /** native declaration : headers\openvr_capi.h:1439 */ - public interface HasCamera_callback extends Callback { - int apply(int nDeviceIndex, Pointer pHasCamera); - }; - /** native declaration : headers\openvr_capi.h:1440 */ - public interface GetCameraFrameSize_callback extends Callback { - int apply(int nDeviceIndex, int eFrameType, IntByReference pnWidth, IntByReference pnHeight, IntByReference pnFrameBufferSize); - }; - /** native declaration : headers\openvr_capi.h:1441 */ - public interface GetCameraIntrinsics_callback extends Callback { - int apply(int nDeviceIndex, int eFrameType, HmdVector2_t pFocalLength, HmdVector2_t pCenter); - }; - /** native declaration : headers\openvr_capi.h:1442 */ - public interface GetCameraProjection_callback extends Callback { - int apply(int nDeviceIndex, int eFrameType, float flZNear, float flZFar, HmdMatrix44_t pProjection); - }; - /** native declaration : headers\openvr_capi.h:1443 */ - public interface AcquireVideoStreamingService_callback extends Callback { - int apply(int nDeviceIndex, LongByReference pHandle); - }; - /** native declaration : headers\openvr_capi.h:1444 */ - public interface ReleaseVideoStreamingService_callback extends Callback { - int apply(long hTrackedCamera); - }; - /** native declaration : headers\openvr_capi.h:1445 */ - public interface GetVideoStreamFrameBuffer_callback extends Callback { - int apply(long hTrackedCamera, int eFrameType, Pointer pFrameBuffer, int nFrameBufferSize, CameraVideoStreamFrameHeader_t pFrameHeader, int nFrameHeaderSize); - }; - /** native declaration : headers\openvr_capi.h:1446 */ - public interface GetVideoStreamTextureSize_callback extends Callback { - int apply(int nDeviceIndex, int eFrameType, VRTextureBounds_t pTextureBounds, IntByReference pnWidth, IntByReference pnHeight); - }; - /** native declaration : headers\openvr_capi.h:1447 */ - public interface GetVideoStreamTextureD3D11_callback extends Callback { - int apply(long hTrackedCamera, int eFrameType, Pointer pD3D11DeviceOrResource, PointerByReference ppD3D11ShaderResourceView, CameraVideoStreamFrameHeader_t pFrameHeader, int nFrameHeaderSize); - }; - /** native declaration : headers\openvr_capi.h:1448 */ - public interface GetVideoStreamTextureGL_callback extends Callback { - int apply(long hTrackedCamera, int eFrameType, IntByReference pglTextureId, CameraVideoStreamFrameHeader_t pFrameHeader, int nFrameHeaderSize); - }; - /** native declaration : headers\openvr_capi.h:1449 */ - public interface ReleaseVideoStreamTextureGL_callback extends Callback { - int apply(long hTrackedCamera, int glTextureId); - }; - public VR_IVRTrackedCamera_FnTable() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("GetCameraErrorNameFromEnum", "HasCamera", "GetCameraFrameSize", "GetCameraIntrinsics", "GetCameraProjection", "AcquireVideoStreamingService", "ReleaseVideoStreamingService", "GetVideoStreamFrameBuffer", "GetVideoStreamTextureSize", "GetVideoStreamTextureD3D11", "GetVideoStreamTextureGL", "ReleaseVideoStreamTextureGL"); - } - public VR_IVRTrackedCamera_FnTable(Pointer peer) { - super(peer); - } - public static class ByReference extends VR_IVRTrackedCamera_FnTable implements Structure.ByReference { - - }; - public static class ByValue extends VR_IVRTrackedCamera_FnTable implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientkit/OsvrClientKitLibrary.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientkit/OsvrClientKitLibrary.java deleted file mode 100644 index 6c5b32e031..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientkit/OsvrClientKitLibrary.java +++ /dev/null @@ -1,328 +0,0 @@ -package com.jme3.system.osvr.osvrclientkit; -import com.sun.jna.Callback; -import com.sun.jna.Library; -import com.sun.jna.Native; -import com.sun.jna.NativeLibrary; -import com.sun.jna.Pointer; -import com.sun.jna.PointerType; -import com.sun.jna.ptr.PointerByReference; -/** - * JNA Wrapper for library osvrClientKit
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OsvrClientKitLibrary implements Library { - public static final String JNA_LIBRARY_NAME = "osvrClientKit"; - public static final NativeLibrary JNA_NATIVE_LIB = NativeLibrary.getInstance(OsvrClientKitLibrary.JNA_LIBRARY_NAME); - static { - Native.register(OsvrClientKitLibrary.class, OsvrClientKitLibrary.JNA_NATIVE_LIB); - } - /** - * @brief Initialize the library.
    - * @param applicationIdentifier A null terminated string identifying your
    - * application. Reverse DNS format strongly suggested.
    - * @param flags initialization options (reserved) - pass 0 for now.
    - * @returns Client context - will be needed for subsequent calls
    - * Original signature : OSVR_ClientContext osvrClientInit(const char[], uint32_t)
    - * @deprecated use the safer methods {@link #osvrClientInit(byte[], int)} and {@link #osvrClientInit(com.sun.jna.Pointer, int)} instead - */ - @Deprecated - public static native OsvrClientKitLibrary.OSVR_ClientContext osvrClientInit(Pointer applicationIdentifier, int flags); - /** - * @brief Initialize the library.
    - * @param applicationIdentifier A null terminated string identifying your
    - * application. Reverse DNS format strongly suggested.
    - * @param flags initialization options (reserved) - pass 0 for now.
    - * @returns Client context - will be needed for subsequent calls
    - * Original signature : OSVR_ClientContext osvrClientInit(const char[], uint32_t) - */ - public static native OsvrClientKitLibrary.OSVR_ClientContext osvrClientInit(byte applicationIdentifier[], int flags); - /** - * @brief Updates the state of the context - call regularly in your mainloop.
    - * @param ctx Client context
    - * Original signature : OSVR_ReturnCode osvrClientUpdate(OSVR_ClientContext)
    - * @deprecated use the safer methods {@link #osvrClientUpdate(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientContext)} and {@link #osvrClientUpdate(com.sun.jna.Pointer)} instead - */ - @Deprecated - public static native byte osvrClientUpdate(Pointer ctx); - /** - * @brief Updates the state of the context - call regularly in your mainloop.
    - * @param ctx Client context
    - * Original signature : OSVR_ReturnCode osvrClientUpdate(OSVR_ClientContext) - */ - public static native byte osvrClientUpdate(OsvrClientKitLibrary.OSVR_ClientContext ctx); - /** - * @brief Checks to see if the client context is fully started up and connected
    - * properly to a server.
    - * If this reports that the client context is not OK, there may not be a server
    - * running, or you may just have to call osvrClientUpdate() a few times to
    - * permit startup to finish. The return value of this call will not change from
    - * failure to success without calling osvrClientUpdate().
    - * @param ctx Client context
    - * @return OSVR_RETURN_FAILURE if not yet fully connected/initialized, or if
    - * some other error (null context) occurs.
    - * Original signature : OSVR_ReturnCode osvrClientCheckStatus(OSVR_ClientContext)
    - * @deprecated use the safer methods {@link #osvrClientCheckStatus(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientContext)} and {@link #osvrClientCheckStatus(com.sun.jna.Pointer)} instead - */ - @Deprecated - public static native byte osvrClientCheckStatus(Pointer ctx); - /** - * @brief Checks to see if the client context is fully started up and connected
    - * properly to a server.
    - * If this reports that the client context is not OK, there may not be a server
    - * running, or you may just have to call osvrClientUpdate() a few times to
    - * permit startup to finish. The return value of this call will not change from
    - * failure to success without calling osvrClientUpdate().
    - * @param ctx Client context
    - * @return OSVR_RETURN_FAILURE if not yet fully connected/initialized, or if
    - * some other error (null context) occurs.
    - * Original signature : OSVR_ReturnCode osvrClientCheckStatus(OSVR_ClientContext) - */ - public static native byte osvrClientCheckStatus(OsvrClientKitLibrary.OSVR_ClientContext ctx); - /** - * @brief Shutdown the library.
    - * @param ctx Client context
    - * Original signature : OSVR_ReturnCode osvrClientShutdown(OSVR_ClientContext)
    - * @deprecated use the safer methods {@link #osvrClientShutdown(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientContext)} and {@link #osvrClientShutdown(com.sun.jna.Pointer)} instead - */ - @Deprecated - public static native byte osvrClientShutdown(Pointer ctx); - /** - * @brief Shutdown the library.
    - * @param ctx Client context
    - * Original signature : OSVR_ReturnCode osvrClientShutdown(OSVR_ClientContext) - */ - public static native byte osvrClientShutdown(OsvrClientKitLibrary.OSVR_ClientContext ctx); - /** - * @brief Log a message from the client.
    - * Original signature : void osvrClientLog(OSVR_ClientContext, OSVR_LogLevel, const char*)
    - * @deprecated use the safer methods {@link #osvrClientLog(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientContext, int, java.lang.String)} and {@link #osvrClientLog(com.sun.jna.Pointer, int, com.sun.jna.Pointer)} instead - */ - @Deprecated - public static native void osvrClientLog(Pointer ctx, int severity, Pointer message); - /** - * @brief Log a message from the client.
    - * Original signature : void osvrClientLog(OSVR_ClientContext, OSVR_LogLevel, const char*) - */ - public static native void osvrClientLog(OsvrClientKitLibrary.OSVR_ClientContext ctx, int severity, String message); - /** - * @brief Get the interface associated with the given path.
    - * @param ctx Client context
    - * @param path A resource path (null-terminated string)
    - * @param[out] iface The interface object. May be freed when no longer needed,
    - * otherwise it will be freed when the context is closed.
    - * Original signature : OSVR_ReturnCode osvrClientGetInterface(OSVR_ClientContext, const char[], OSVR_ClientInterface*)
    - * @deprecated use the safer methods {@link #osvrClientGetInterface(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientContext, byte[], com.sun.jna.ptr.PointerByReference)} and {@link #osvrClientGetInterface(com.sun.jna.Pointer, com.sun.jna.Pointer, com.sun.jna.ptr.PointerByReference)} instead - */ - @Deprecated - public static native byte osvrClientGetInterface(Pointer ctx, Pointer path, Pointer iface); - /** - * @brief Get the interface associated with the given path.
    - * @param ctx Client context
    - * @param path A resource path (null-terminated string)
    - * @param[out] iface The interface object. May be freed when no longer needed,
    - * otherwise it will be freed when the context is closed.
    - * Original signature : OSVR_ReturnCode osvrClientGetInterface(OSVR_ClientContext, const char[], OSVR_ClientInterface*) - */ - public static native byte osvrClientGetInterface(OsvrClientKitLibrary.OSVR_ClientContext ctx, byte path[], PointerByReference iface); - /** - * @brief Get the interface associated with the given path.
    - * @param ctx Client context
    - * @param path A resource path (null-terminated string)
    - * @param[out] iface The interface object. May be freed when no longer needed,
    - * otherwise it will be freed when the context is closed.
    - * Original signature : OSVR_ReturnCode osvrClientGetInterface(OSVR_ClientContext, const char[], OSVR_ClientInterface*) - */ - public static native byte osvrClientGetInterface(Pointer ctx, Pointer path, PointerByReference iface); - /** - * @brief Free an interface object before context closure.
    - * @param ctx Client context
    - * @param iface The interface object
    - * @returns OSVR_RETURN_SUCCESS unless a null context or interface was passed
    - * or the given interface was not found in the context (i.e. had already been
    - * freed)
    - * Original signature : OSVR_ReturnCode osvrClientFreeInterface(OSVR_ClientContext, OSVR_ClientInterface)
    - * @deprecated use the safer methods {@link #osvrClientFreeInterface(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientContext, osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface)} and {@link #osvrClientFreeInterface(com.sun.jna.Pointer, com.sun.jna.Pointer)} instead - */ - @Deprecated - public static native byte osvrClientFreeInterface(Pointer ctx, Pointer iface); - /** - * @brief Free an interface object before context closure.
    - * @param ctx Client context
    - * @param iface The interface object
    - * @returns OSVR_RETURN_SUCCESS unless a null context or interface was passed
    - * or the given interface was not found in the context (i.e. had already been
    - * freed)
    - * Original signature : OSVR_ReturnCode osvrClientFreeInterface(OSVR_ClientContext, OSVR_ClientInterface) - */ - public static native byte osvrClientFreeInterface(OsvrClientKitLibrary.OSVR_ClientContext ctx, OsvrClientKitLibrary.OSVR_ClientInterface iface); - /** - * Original signature : OSVR_ReturnCode osvrRegisterPoseCallback(OSVR_ClientInterface, OSVR_PoseCallback, void*)
    - * @deprecated use the safer methods {@link #osvrRegisterPoseCallback(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface, com.sun.jna.Pointer, com.sun.jna.Pointer)} and {@link #osvrRegisterPoseCallback(com.sun.jna.Pointer, com.sun.jna.Pointer, com.sun.jna.Pointer)} instead - */ - @Deprecated - public static native byte osvrRegisterPoseCallback(Pointer iface, Pointer cb, Pointer userdata); - /** Original signature : OSVR_ReturnCode osvrRegisterPoseCallback(OSVR_ClientInterface, OSVR_PoseCallback, void*) */ - public static native byte osvrRegisterPoseCallback(OsvrClientKitLibrary.OSVR_ClientInterface iface, Pointer cb, Pointer userdata); - /** - * Original signature : OSVR_ReturnCode osvrRegisterPositionCallback(OSVR_ClientInterface, OSVR_PositionCallback, void*)
    - * @deprecated use the safer methods {@link #osvrRegisterPositionCallback(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface, com.sun.jna.Pointer, com.sun.jna.Pointer)} and {@link #osvrRegisterPositionCallback(com.sun.jna.Pointer, com.sun.jna.Pointer, com.sun.jna.Pointer)} instead - */ - @Deprecated - public static native byte osvrRegisterPositionCallback(Pointer iface, Pointer cb, Pointer userdata); - /** Original signature : OSVR_ReturnCode osvrRegisterPositionCallback(OSVR_ClientInterface, OSVR_PositionCallback, void*) */ - public static native byte osvrRegisterPositionCallback(OsvrClientKitLibrary.OSVR_ClientInterface iface, Pointer cb, Pointer userdata); - /** - * Original signature : OSVR_ReturnCode osvrRegisterOrientationCallback(OSVR_ClientInterface, OSVR_OrientationCallback, void*)
    - * @deprecated use the safer methods {@link #osvrRegisterOrientationCallback(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface, com.sun.jna.Pointer, com.sun.jna.Pointer)} and {@link #osvrRegisterOrientationCallback(com.sun.jna.Pointer, com.sun.jna.Pointer, com.sun.jna.Pointer)} instead - */ - @Deprecated - public static native byte osvrRegisterOrientationCallback(Pointer iface, Pointer cb, Pointer userdata); - /** Original signature : OSVR_ReturnCode osvrRegisterOrientationCallback(OSVR_ClientInterface, OSVR_OrientationCallback, void*) */ - public static native byte osvrRegisterOrientationCallback(OsvrClientKitLibrary.OSVR_ClientInterface iface, Pointer cb, Pointer userdata); - /** - * Original signature : OSVR_ReturnCode osvrRegisterVelocityCallback(OSVR_ClientInterface, OSVR_VelocityCallback, void*)
    - * @deprecated use the safer methods {@link #osvrRegisterVelocityCallback(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface, com.sun.jna.Pointer, com.sun.jna.Pointer)} and {@link #osvrRegisterVelocityCallback(com.sun.jna.Pointer, com.sun.jna.Pointer, com.sun.jna.Pointer)} instead - */ - @Deprecated - public static native byte osvrRegisterVelocityCallback(Pointer iface, Pointer cb, Pointer userdata); - /** Original signature : OSVR_ReturnCode osvrRegisterVelocityCallback(OSVR_ClientInterface, OSVR_VelocityCallback, void*) */ - public static native byte osvrRegisterVelocityCallback(OsvrClientKitLibrary.OSVR_ClientInterface iface, Pointer cb, Pointer userdata); - /** - * Original signature : OSVR_ReturnCode osvrRegisterLinearVelocityCallback(OSVR_ClientInterface, OSVR_LinearVelocityCallback, void*)
    - * @deprecated use the safer methods {@link #osvrRegisterLinearVelocityCallback(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface, com.sun.jna.Pointer, com.sun.jna.Pointer)} and {@link #osvrRegisterLinearVelocityCallback(com.sun.jna.Pointer, com.sun.jna.Pointer, com.sun.jna.Pointer)} instead - */ - @Deprecated - public static native byte osvrRegisterLinearVelocityCallback(Pointer iface, Pointer cb, Pointer userdata); - /** Original signature : OSVR_ReturnCode osvrRegisterLinearVelocityCallback(OSVR_ClientInterface, OSVR_LinearVelocityCallback, void*) */ - public static native byte osvrRegisterLinearVelocityCallback(OsvrClientKitLibrary.OSVR_ClientInterface iface, Pointer cb, Pointer userdata); - /** - * Original signature : OSVR_ReturnCode osvrRegisterAngularVelocityCallback(OSVR_ClientInterface, OSVR_AngularVelocityCallback, void*)
    - * @deprecated use the safer methods {@link #osvrRegisterAngularVelocityCallback(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface, com.sun.jna.Pointer, com.sun.jna.Pointer)} and {@link #osvrRegisterAngularVelocityCallback(com.sun.jna.Pointer, com.sun.jna.Pointer, com.sun.jna.Pointer)} instead - */ - @Deprecated - public static native byte osvrRegisterAngularVelocityCallback(Pointer iface, Pointer cb, Pointer userdata); - /** Original signature : OSVR_ReturnCode osvrRegisterAngularVelocityCallback(OSVR_ClientInterface, OSVR_AngularVelocityCallback, void*) */ - public static native byte osvrRegisterAngularVelocityCallback(OsvrClientKitLibrary.OSVR_ClientInterface iface, Pointer cb, Pointer userdata); - /** - * Original signature : OSVR_ReturnCode osvrRegisterAccelerationCallback(OSVR_ClientInterface, OSVR_AccelerationCallback, void*)
    - * @deprecated use the safer methods {@link #osvrRegisterAccelerationCallback(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface, com.sun.jna.Pointer, com.sun.jna.Pointer)} and {@link #osvrRegisterAccelerationCallback(com.sun.jna.Pointer, com.sun.jna.Pointer, com.sun.jna.Pointer)} instead - */ - @Deprecated - public static native byte osvrRegisterAccelerationCallback(Pointer iface, Pointer cb, Pointer userdata); - /** Original signature : OSVR_ReturnCode osvrRegisterAccelerationCallback(OSVR_ClientInterface, OSVR_AccelerationCallback, void*) */ - public static native byte osvrRegisterAccelerationCallback(OsvrClientKitLibrary.OSVR_ClientInterface iface, Pointer cb, Pointer userdata); - /** - * Original signature : OSVR_ReturnCode osvrRegisterLinearAccelerationCallback(OSVR_ClientInterface, OSVR_LinearAccelerationCallback, void*)
    - * @deprecated use the safer methods {@link #osvrRegisterLinearAccelerationCallback(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface, com.sun.jna.Pointer, com.sun.jna.Pointer)} and {@link #osvrRegisterLinearAccelerationCallback(com.sun.jna.Pointer, com.sun.jna.Pointer, com.sun.jna.Pointer)} instead - */ - @Deprecated - public static native byte osvrRegisterLinearAccelerationCallback(Pointer iface, Pointer cb, Pointer userdata); - /** Original signature : OSVR_ReturnCode osvrRegisterLinearAccelerationCallback(OSVR_ClientInterface, OSVR_LinearAccelerationCallback, void*) */ - public static native byte osvrRegisterLinearAccelerationCallback(OsvrClientKitLibrary.OSVR_ClientInterface iface, Pointer cb, Pointer userdata); - /** - * Original signature : OSVR_ReturnCode osvrRegisterAngularAccelerationCallback(OSVR_ClientInterface, OSVR_AngularAccelerationCallback, void*)
    - * @deprecated use the safer methods {@link #osvrRegisterAngularAccelerationCallback(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface, com.sun.jna.Pointer, com.sun.jna.Pointer)} and {@link #osvrRegisterAngularAccelerationCallback(com.sun.jna.Pointer, com.sun.jna.Pointer, com.sun.jna.Pointer)} instead - */ - @Deprecated - public static native byte osvrRegisterAngularAccelerationCallback(Pointer iface, Pointer cb, Pointer userdata); - /** Original signature : OSVR_ReturnCode osvrRegisterAngularAccelerationCallback(OSVR_ClientInterface, OSVR_AngularAccelerationCallback, void*) */ - public static native byte osvrRegisterAngularAccelerationCallback(OsvrClientKitLibrary.OSVR_ClientInterface iface, Pointer cb, Pointer userdata); - /** - * Original signature : OSVR_ReturnCode osvrRegisterButtonCallback(OSVR_ClientInterface, OSVR_ButtonCallback, void*)
    - * @deprecated use the safer methods {@link #osvrRegisterButtonCallback(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface, com.sun.jna.Pointer, com.sun.jna.Pointer)} and {@link #osvrRegisterButtonCallback(com.sun.jna.Pointer, com.sun.jna.Pointer, com.sun.jna.Pointer)} instead - */ - @Deprecated - public static native byte osvrRegisterButtonCallback(Pointer iface, Pointer cb, Pointer userdata); - /** Original signature : OSVR_ReturnCode osvrRegisterButtonCallback(OSVR_ClientInterface, OSVR_ButtonCallback, void*) */ - public static native byte osvrRegisterButtonCallback(OsvrClientKitLibrary.OSVR_ClientInterface iface, Callback cb, Pointer userdata); - /** - * Original signature : OSVR_ReturnCode osvrRegisterAnalogCallback(OSVR_ClientInterface, OSVR_AnalogCallback, void*)
    - * @deprecated use the safer methods {@link #osvrRegisterAnalogCallback(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface, com.sun.jna.Pointer, com.sun.jna.Pointer)} and {@link #osvrRegisterAnalogCallback(com.sun.jna.Pointer, com.sun.jna.Pointer, com.sun.jna.Pointer)} instead - */ - @Deprecated - public static native byte osvrRegisterAnalogCallback(Pointer iface, Pointer cb, Pointer userdata); - /** Original signature : OSVR_ReturnCode osvrRegisterAnalogCallback(OSVR_ClientInterface, OSVR_AnalogCallback, void*) */ - public static native byte osvrRegisterAnalogCallback(OsvrClientKitLibrary.OSVR_ClientInterface iface, Callback cb, Pointer userdata); - /** - * Original signature : OSVR_ReturnCode osvrRegisterImagingCallback(OSVR_ClientInterface, OSVR_ImagingCallback, void*)
    - * @deprecated use the safer methods {@link #osvrRegisterImagingCallback(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface, com.sun.jna.Pointer, com.sun.jna.Pointer)} and {@link #osvrRegisterImagingCallback(com.sun.jna.Pointer, com.sun.jna.Pointer, com.sun.jna.Pointer)} instead - */ - @Deprecated - public static native byte osvrRegisterImagingCallback(Pointer iface, Pointer cb, Pointer userdata); - /** Original signature : OSVR_ReturnCode osvrRegisterImagingCallback(OSVR_ClientInterface, OSVR_ImagingCallback, void*) */ - public static native byte osvrRegisterImagingCallback(OsvrClientKitLibrary.OSVR_ClientInterface iface, Pointer cb, Pointer userdata); - /** - * Original signature : OSVR_ReturnCode osvrRegisterLocation2DCallback(OSVR_ClientInterface, OSVR_Location2DCallback, void*)
    - * @deprecated use the safer methods {@link #osvrRegisterLocation2DCallback(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface, com.sun.jna.Pointer, com.sun.jna.Pointer)} and {@link #osvrRegisterLocation2DCallback(com.sun.jna.Pointer, com.sun.jna.Pointer, com.sun.jna.Pointer)} instead - */ - @Deprecated - public static native byte osvrRegisterLocation2DCallback(Pointer iface, Pointer cb, Pointer userdata); - /** Original signature : OSVR_ReturnCode osvrRegisterLocation2DCallback(OSVR_ClientInterface, OSVR_Location2DCallback, void*) */ - public static native byte osvrRegisterLocation2DCallback(OsvrClientKitLibrary.OSVR_ClientInterface iface, Pointer cb, Pointer userdata); - /** - * Original signature : OSVR_ReturnCode osvrRegisterDirectionCallback(OSVR_ClientInterface, OSVR_DirectionCallback, void*)
    - * @deprecated use the safer methods {@link #osvrRegisterDirectionCallback(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface, com.sun.jna.Pointer, com.sun.jna.Pointer)} and {@link #osvrRegisterDirectionCallback(com.sun.jna.Pointer, com.sun.jna.Pointer, com.sun.jna.Pointer)} instead - */ - @Deprecated - public static native byte osvrRegisterDirectionCallback(Pointer iface, Pointer cb, Pointer userdata); - /** Original signature : OSVR_ReturnCode osvrRegisterDirectionCallback(OSVR_ClientInterface, OSVR_DirectionCallback, void*) */ - public static native byte osvrRegisterDirectionCallback(OsvrClientKitLibrary.OSVR_ClientInterface iface, Pointer cb, Pointer userdata); - /** - * Original signature : OSVR_ReturnCode osvrRegisterEyeTracker2DCallback(OSVR_ClientInterface, OSVR_EyeTracker2DCallback, void*)
    - * @deprecated use the safer methods {@link #osvrRegisterEyeTracker2DCallback(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface, com.sun.jna.Pointer, com.sun.jna.Pointer)} and {@link #osvrRegisterEyeTracker2DCallback(com.sun.jna.Pointer, com.sun.jna.Pointer, com.sun.jna.Pointer)} instead - */ - @Deprecated - public static native byte osvrRegisterEyeTracker2DCallback(Pointer iface, Pointer cb, Pointer userdata); - /** Original signature : OSVR_ReturnCode osvrRegisterEyeTracker2DCallback(OSVR_ClientInterface, OSVR_EyeTracker2DCallback, void*) */ - public static native byte osvrRegisterEyeTracker2DCallback(OsvrClientKitLibrary.OSVR_ClientInterface iface, Pointer cb, Pointer userdata); - /** - * Original signature : OSVR_ReturnCode osvrRegisterEyeTracker3DCallback(OSVR_ClientInterface, OSVR_EyeTracker3DCallback, void*)
    - * @deprecated use the safer methods {@link #osvrRegisterEyeTracker3DCallback(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface, com.sun.jna.Pointer, com.sun.jna.Pointer)} and {@link #osvrRegisterEyeTracker3DCallback(com.sun.jna.Pointer, com.sun.jna.Pointer, com.sun.jna.Pointer)} instead - */ - @Deprecated - public static native byte osvrRegisterEyeTracker3DCallback(Pointer iface, Pointer cb, Pointer userdata); - /** Original signature : OSVR_ReturnCode osvrRegisterEyeTracker3DCallback(OSVR_ClientInterface, OSVR_EyeTracker3DCallback, void*) */ - public static native byte osvrRegisterEyeTracker3DCallback(OsvrClientKitLibrary.OSVR_ClientInterface iface, Pointer cb, Pointer userdata); - /** - * Original signature : OSVR_ReturnCode osvrRegisterEyeTrackerBlinkCallback(OSVR_ClientInterface, OSVR_EyeTrackerBlinkCallback, void*)
    - * @deprecated use the safer methods {@link #osvrRegisterEyeTrackerBlinkCallback(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface, com.sun.jna.Pointer, com.sun.jna.Pointer)} and {@link #osvrRegisterEyeTrackerBlinkCallback(com.sun.jna.Pointer, com.sun.jna.Pointer, com.sun.jna.Pointer)} instead - */ - @Deprecated - public static native byte osvrRegisterEyeTrackerBlinkCallback(Pointer iface, Pointer cb, Pointer userdata); - /** Original signature : OSVR_ReturnCode osvrRegisterEyeTrackerBlinkCallback(OSVR_ClientInterface, OSVR_EyeTrackerBlinkCallback, void*) */ - public static native byte osvrRegisterEyeTrackerBlinkCallback(OsvrClientKitLibrary.OSVR_ClientInterface iface, Pointer cb, Pointer userdata); - /** - * Original signature : OSVR_ReturnCode osvrRegisterNaviVelocityCallback(OSVR_ClientInterface, OSVR_NaviVelocityCallback, void*)
    - * @deprecated use the safer methods {@link #osvrRegisterNaviVelocityCallback(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface, com.sun.jna.Pointer, com.sun.jna.Pointer)} and {@link #osvrRegisterNaviVelocityCallback(com.sun.jna.Pointer, com.sun.jna.Pointer, com.sun.jna.Pointer)} instead - */ - @Deprecated - public static native byte osvrRegisterNaviVelocityCallback(Pointer iface, Pointer cb, Pointer userdata); - /** Original signature : OSVR_ReturnCode osvrRegisterNaviVelocityCallback(OSVR_ClientInterface, OSVR_NaviVelocityCallback, void*) */ - public static native byte osvrRegisterNaviVelocityCallback(OsvrClientKitLibrary.OSVR_ClientInterface iface, Pointer cb, Pointer userdata); - /** - * Original signature : OSVR_ReturnCode osvrRegisterNaviPositionCallback(OSVR_ClientInterface, OSVR_NaviPositionCallback, void*)
    - * @deprecated use the safer methods {@link #osvrRegisterNaviPositionCallback(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface, com.sun.jna.Pointer, com.sun.jna.Pointer)} and {@link #osvrRegisterNaviPositionCallback(com.sun.jna.Pointer, com.sun.jna.Pointer, com.sun.jna.Pointer)} instead - */ - @Deprecated - public static native byte osvrRegisterNaviPositionCallback(Pointer iface, Pointer cb, Pointer userdata); - /** Original signature : OSVR_ReturnCode osvrRegisterNaviPositionCallback(OSVR_ClientInterface, OSVR_NaviPositionCallback, void*) */ - public static native byte osvrRegisterNaviPositionCallback(OsvrClientKitLibrary.OSVR_ClientInterface iface, Pointer cb, Pointer userdata); - public static class OSVR_ClientContext extends PointerType { - public OSVR_ClientContext(Pointer address) { - super(address); - } - public OSVR_ClientContext() { - super(); - } - }; - public static class OSVR_ClientInterface extends PointerType { - public OSVR_ClientInterface(Pointer address) { - super(address); - } - public OSVR_ClientInterface() { - super(); - } - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_AccelerationReport.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_AccelerationReport.java deleted file mode 100644 index 61592a5b3e..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_AccelerationReport.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.jme3.system.osvr.osvrclientreporttypes; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_AccelerationReport extends Structure { - public int sensor; - /** C type : OSVR_AccelerationState */ - public OSVR_AccelerationState state; - public OSVR_AccelerationReport() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("sensor", "state"); - } - /** @param state C type : OSVR_AccelerationState */ - public OSVR_AccelerationReport(int sensor, OSVR_AccelerationState state) { - super(); - this.sensor = sensor; - this.state = state; - } - public OSVR_AccelerationReport(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_AccelerationReport implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_AccelerationReport implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_AccelerationState.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_AccelerationState.java deleted file mode 100644 index ccf4837ced..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_AccelerationState.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.jme3.system.osvr.osvrclientreporttypes; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_AccelerationState extends Structure { - /** C type : OSVR_LinearAccelerationState */ - public OSVR_Vec3 linearAcceleration; - /** C type : OSVR_CBool */ - public byte linearAccelerationValid; - /** C type : OSVR_AngularAccelerationState */ - public OSVR_IncrementalQuaternion angularAcceleration; - /** C type : OSVR_CBool */ - public byte angularAccelerationValid; - public OSVR_AccelerationState() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("linearAcceleration", "linearAccelerationValid", "angularAcceleration", "angularAccelerationValid"); - } - /** - * @param linearAcceleration C type : OSVR_LinearAccelerationState
    - * @param linearAccelerationValid C type : OSVR_CBool
    - * @param angularAcceleration C type : OSVR_AngularAccelerationState
    - * @param angularAccelerationValid C type : OSVR_CBool - */ - public OSVR_AccelerationState(OSVR_Vec3 linearAcceleration, byte linearAccelerationValid, OSVR_IncrementalQuaternion angularAcceleration, byte angularAccelerationValid) { - super(); - this.linearAcceleration = linearAcceleration; - this.linearAccelerationValid = linearAccelerationValid; - this.angularAcceleration = angularAcceleration; - this.angularAccelerationValid = angularAccelerationValid; - } - public OSVR_AccelerationState(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_AccelerationState implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_AccelerationState implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_AnalogReport.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_AnalogReport.java deleted file mode 100644 index 0f84cdfeac..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_AnalogReport.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.jme3.system.osvr.osvrclientreporttypes; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_AnalogReport extends Structure { - public int sensor; - /** C type : OSVR_AnalogState */ - public double state; - public OSVR_AnalogReport() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("sensor", "state"); - } - /** @param state C type : OSVR_AnalogState */ - public OSVR_AnalogReport(int sensor, double state) { - super(); - this.sensor = sensor; - this.state = state; - } - public OSVR_AnalogReport(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_AnalogReport implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_AnalogReport implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_AngularAccelerationReport.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_AngularAccelerationReport.java deleted file mode 100644 index 1afbe795b9..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_AngularAccelerationReport.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.jme3.system.osvr.osvrclientreporttypes; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_AngularAccelerationReport extends Structure { - public int sensor; - /** C type : OSVR_AngularAccelerationState */ - public OSVR_IncrementalQuaternion state; - public OSVR_AngularAccelerationReport() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("sensor", "state"); - } - /** @param state C type : OSVR_AngularAccelerationState */ - public OSVR_AngularAccelerationReport(int sensor, OSVR_IncrementalQuaternion state) { - super(); - this.sensor = sensor; - this.state = state; - } - public OSVR_AngularAccelerationReport(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_AngularAccelerationReport implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_AngularAccelerationReport implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_AngularVelocityReport.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_AngularVelocityReport.java deleted file mode 100644 index 5926ec7456..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_AngularVelocityReport.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.jme3.system.osvr.osvrclientreporttypes; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_AngularVelocityReport extends Structure { - public int sensor; - /** C type : OSVR_AngularVelocityState */ - public OSVR_IncrementalQuaternion state; - public OSVR_AngularVelocityReport() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("sensor", "state"); - } - /** @param state C type : OSVR_AngularVelocityState */ - public OSVR_AngularVelocityReport(int sensor, OSVR_IncrementalQuaternion state) { - super(); - this.sensor = sensor; - this.state = state; - } - public OSVR_AngularVelocityReport(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_AngularVelocityReport implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_AngularVelocityReport implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_ButtonReport.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_ButtonReport.java deleted file mode 100644 index ad3ab53be6..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_ButtonReport.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.jme3.system.osvr.osvrclientreporttypes; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_ButtonReport extends Structure { - public int sensor; - /** C type : OSVR_ButtonState */ - public byte state; - public OSVR_ButtonReport() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("sensor", "state"); - } - /** @param state C type : OSVR_ButtonState */ - public OSVR_ButtonReport(int sensor, byte state) { - super(); - this.sensor = sensor; - this.state = state; - } - public OSVR_ButtonReport(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_ButtonReport implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_ButtonReport implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_DirectionReport.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_DirectionReport.java deleted file mode 100644 index 78ca84a396..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_DirectionReport.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.jme3.system.osvr.osvrclientreporttypes; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_DirectionReport extends Structure { - /** C type : OSVR_ChannelCount */ - public int sensor; - /** C type : OSVR_DirectionState */ - public OSVR_Vec3 direction; - public OSVR_DirectionReport() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("sensor", "direction"); - } - /** - * @param sensor C type : OSVR_ChannelCount
    - * @param direction C type : OSVR_DirectionState - */ - public OSVR_DirectionReport(int sensor, OSVR_Vec3 direction) { - super(); - this.sensor = sensor; - this.direction = direction; - } - public OSVR_DirectionReport(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_DirectionReport implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_DirectionReport implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_EyeTracker2DReport.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_EyeTracker2DReport.java deleted file mode 100644 index fab1548e2b..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_EyeTracker2DReport.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.jme3.system.osvr.osvrclientreporttypes; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_EyeTracker2DReport extends Structure { - /** C type : OSVR_ChannelCount */ - public int sensor; - /** C type : OSVR_EyeTracker2DState */ - public OSVR_Vec2 state; - public OSVR_EyeTracker2DReport() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("sensor", "state"); - } - /** - * @param sensor C type : OSVR_ChannelCount
    - * @param state C type : OSVR_EyeTracker2DState - */ - public OSVR_EyeTracker2DReport(int sensor, OSVR_Vec2 state) { - super(); - this.sensor = sensor; - this.state = state; - } - public OSVR_EyeTracker2DReport(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_EyeTracker2DReport implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_EyeTracker2DReport implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_EyeTracker3DReport.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_EyeTracker3DReport.java deleted file mode 100644 index a42192be8b..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_EyeTracker3DReport.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.jme3.system.osvr.osvrclientreporttypes; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_EyeTracker3DReport extends Structure { - /** C type : OSVR_ChannelCount */ - public int sensor; - /** C type : OSVR_EyeTracker3DState */ - public OSVR_EyeTracker3DState state; - public OSVR_EyeTracker3DReport() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("sensor", "state"); - } - /** - * @param sensor C type : OSVR_ChannelCount
    - * @param state C type : OSVR_EyeTracker3DState - */ - public OSVR_EyeTracker3DReport(int sensor, OSVR_EyeTracker3DState state) { - super(); - this.sensor = sensor; - this.state = state; - } - public OSVR_EyeTracker3DReport(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_EyeTracker3DReport implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_EyeTracker3DReport implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_EyeTracker3DState.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_EyeTracker3DState.java deleted file mode 100644 index 07eb1d8806..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_EyeTracker3DState.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.jme3.system.osvr.osvrclientreporttypes; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_EyeTracker3DState extends Structure { - /** C type : OSVR_CBool */ - public byte directionValid; - /** C type : OSVR_DirectionState */ - public OSVR_Vec3 direction; - /** C type : OSVR_CBool */ - public byte basePointValid; - /** C type : OSVR_PositionState */ - public OSVR_Vec3 basePoint; - public OSVR_EyeTracker3DState() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("directionValid", "direction", "basePointValid", "basePoint"); - } - /** - * @param directionValid C type : OSVR_CBool
    - * @param direction C type : OSVR_DirectionState
    - * @param basePointValid C type : OSVR_CBool
    - * @param basePoint C type : OSVR_PositionState - */ - public OSVR_EyeTracker3DState(byte directionValid, OSVR_Vec3 direction, byte basePointValid, OSVR_Vec3 basePoint) { - super(); - this.directionValid = directionValid; - this.direction = direction; - this.basePointValid = basePointValid; - this.basePoint = basePoint; - } - public OSVR_EyeTracker3DState(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_EyeTracker3DState implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_EyeTracker3DState implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_EyeTrackerBlinkReport.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_EyeTrackerBlinkReport.java deleted file mode 100644 index 4d051bbd23..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_EyeTrackerBlinkReport.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.jme3.system.osvr.osvrclientreporttypes; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_EyeTrackerBlinkReport extends Structure { - /** C type : OSVR_ChannelCount */ - public int sensor; - /** C type : OSVR_EyeTrackerBlinkState */ - public byte state; - public OSVR_EyeTrackerBlinkReport() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("sensor", "state"); - } - /** - * @param sensor C type : OSVR_ChannelCount
    - * @param state C type : OSVR_EyeTrackerBlinkState - */ - public OSVR_EyeTrackerBlinkReport(int sensor, byte state) { - super(); - this.sensor = sensor; - this.state = state; - } - public OSVR_EyeTrackerBlinkReport(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_EyeTrackerBlinkReport implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_EyeTrackerBlinkReport implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_IncrementalQuaternion.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_IncrementalQuaternion.java deleted file mode 100644 index 66f04ba4e4..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_IncrementalQuaternion.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.jme3.system.osvr.osvrclientreporttypes; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_IncrementalQuaternion extends Structure { - /** C type : OSVR_Quaternion */ - public OSVR_Quaternion incrementalRotation; - public double dt; - public OSVR_IncrementalQuaternion() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("incrementalRotation", "dt"); - } - /** @param incrementalRotation C type : OSVR_Quaternion */ - public OSVR_IncrementalQuaternion(OSVR_Quaternion incrementalRotation, double dt) { - super(); - this.incrementalRotation = incrementalRotation; - this.dt = dt; - } - public OSVR_IncrementalQuaternion(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_IncrementalQuaternion implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_IncrementalQuaternion implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_LinearAccelerationReport.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_LinearAccelerationReport.java deleted file mode 100644 index e93333f59d..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_LinearAccelerationReport.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.jme3.system.osvr.osvrclientreporttypes; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_LinearAccelerationReport extends Structure { - public int sensor; - /** C type : OSVR_LinearAccelerationState */ - public OSVR_Vec3 state; - public OSVR_LinearAccelerationReport() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("sensor", "state"); - } - /** @param state C type : OSVR_LinearAccelerationState */ - public OSVR_LinearAccelerationReport(int sensor, OSVR_Vec3 state) { - super(); - this.sensor = sensor; - this.state = state; - } - public OSVR_LinearAccelerationReport(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_LinearAccelerationReport implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_LinearAccelerationReport implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_LinearVelocityReport.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_LinearVelocityReport.java deleted file mode 100644 index daca276bc4..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_LinearVelocityReport.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.jme3.system.osvr.osvrclientreporttypes; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_LinearVelocityReport extends Structure { - public int sensor; - /** C type : OSVR_LinearVelocityState */ - public OSVR_Vec3 state; - public OSVR_LinearVelocityReport() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("sensor", "state"); - } - /** @param state C type : OSVR_LinearVelocityState */ - public OSVR_LinearVelocityReport(int sensor, OSVR_Vec3 state) { - super(); - this.sensor = sensor; - this.state = state; - } - public OSVR_LinearVelocityReport(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_LinearVelocityReport implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_LinearVelocityReport implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_Location2DReport.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_Location2DReport.java deleted file mode 100644 index 75e9ea1e36..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_Location2DReport.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.jme3.system.osvr.osvrclientreporttypes; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_Location2DReport extends Structure { - /** C type : OSVR_ChannelCount */ - public int sensor; - /** C type : OSVR_Location2DState */ - public OSVR_Vec2 location; - public OSVR_Location2DReport() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("sensor", "location"); - } - /** - * @param sensor C type : OSVR_ChannelCount
    - * @param location C type : OSVR_Location2DState - */ - public OSVR_Location2DReport(int sensor, OSVR_Vec2 location) { - super(); - this.sensor = sensor; - this.location = location; - } - public OSVR_Location2DReport(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_Location2DReport implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_Location2DReport implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_NaviPositionReport.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_NaviPositionReport.java deleted file mode 100644 index 641018a972..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_NaviPositionReport.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.jme3.system.osvr.osvrclientreporttypes; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_NaviPositionReport extends Structure { - /** C type : OSVR_ChannelCount */ - public int sensor; - /** C type : OSVR_NaviPositionState */ - public OSVR_Vec2 state; - public OSVR_NaviPositionReport() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("sensor", "state"); - } - /** - * @param sensor C type : OSVR_ChannelCount
    - * @param state C type : OSVR_NaviPositionState - */ - public OSVR_NaviPositionReport(int sensor, OSVR_Vec2 state) { - super(); - this.sensor = sensor; - this.state = state; - } - public OSVR_NaviPositionReport(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_NaviPositionReport implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_NaviPositionReport implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_NaviVelocityReport.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_NaviVelocityReport.java deleted file mode 100644 index 89dcef2508..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_NaviVelocityReport.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.jme3.system.osvr.osvrclientreporttypes; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_NaviVelocityReport extends Structure { - /** C type : OSVR_ChannelCount */ - public int sensor; - /** C type : OSVR_NaviVelocityState */ - public OSVR_Vec2 state; - public OSVR_NaviVelocityReport() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("sensor", "state"); - } - /** - * @param sensor C type : OSVR_ChannelCount
    - * @param state C type : OSVR_NaviVelocityState - */ - public OSVR_NaviVelocityReport(int sensor, OSVR_Vec2 state) { - super(); - this.sensor = sensor; - this.state = state; - } - public OSVR_NaviVelocityReport(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_NaviVelocityReport implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_NaviVelocityReport implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_OrientationReport.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_OrientationReport.java deleted file mode 100644 index 2699487f15..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_OrientationReport.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.jme3.system.osvr.osvrclientreporttypes; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_OrientationReport extends Structure { - public int sensor; - /** C type : OSVR_OrientationState */ - public OSVR_Quaternion rotation; - public OSVR_OrientationReport() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("sensor", "rotation"); - } - /** @param rotation C type : OSVR_OrientationState */ - public OSVR_OrientationReport(int sensor, OSVR_Quaternion rotation) { - super(); - this.sensor = sensor; - this.rotation = rotation; - } - public OSVR_OrientationReport(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_OrientationReport implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_OrientationReport implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_Pose3.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_Pose3.java deleted file mode 100644 index a9ce1c2021..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_Pose3.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.jme3.system.osvr.osvrclientreporttypes; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_Pose3 extends Structure { - /** C type : OSVR_Vec3 */ - public OSVR_Vec3 translation; - /** C type : OSVR_Quaternion */ - public OSVR_Quaternion rotation; - public OSVR_Pose3() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("translation", "rotation"); - } - /** - * @param translation C type : OSVR_Vec3
    - * @param rotation C type : OSVR_Quaternion - */ - public OSVR_Pose3(OSVR_Vec3 translation, OSVR_Quaternion rotation) { - super(); - this.translation = translation; - this.rotation = rotation; - } - public OSVR_Pose3(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_Pose3 implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_Pose3 implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_PoseReport.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_PoseReport.java deleted file mode 100644 index f80bfd06b1..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_PoseReport.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.jme3.system.osvr.osvrclientreporttypes; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_PoseReport extends Structure { - public int sensor; - /** C type : OSVR_PoseState */ - public OSVR_Pose3 pose; - public OSVR_PoseReport() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("sensor", "pose"); - } - /** @param pose C type : OSVR_PoseState */ - public OSVR_PoseReport(int sensor, OSVR_Pose3 pose) { - super(); - this.sensor = sensor; - this.pose = pose; - } - public OSVR_PoseReport(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_PoseReport implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_PoseReport implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_PositionReport.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_PositionReport.java deleted file mode 100644 index 7186828354..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_PositionReport.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.jme3.system.osvr.osvrclientreporttypes; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_PositionReport extends Structure { - public int sensor; - /** C type : OSVR_PositionState */ - public OSVR_Vec3 xyz; - public OSVR_PositionReport() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("sensor", "xyz"); - } - /** @param xyz C type : OSVR_PositionState */ - public OSVR_PositionReport(int sensor, OSVR_Vec3 xyz) { - super(); - this.sensor = sensor; - this.xyz = xyz; - } - public OSVR_PositionReport(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_PositionReport implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_PositionReport implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_Quaternion.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_Quaternion.java deleted file mode 100644 index 48f83f6077..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_Quaternion.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.jme3.system.osvr.osvrclientreporttypes; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_Quaternion extends Structure { - /** C type : double[4] */ - public double[] data = new double[4]; - public OSVR_Quaternion() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("data"); - } - /** @param data C type : double[4] */ - public OSVR_Quaternion(double data[]) { - super(); - if ((data.length != this.data.length)) - throw new IllegalArgumentException("Wrong array size !"); - this.data = data; - } - public OSVR_Quaternion(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_Quaternion implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_Quaternion implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_Vec2.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_Vec2.java deleted file mode 100644 index 28a5453a23..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_Vec2.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.jme3.system.osvr.osvrclientreporttypes; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_Vec2 extends Structure { - /** C type : double[2] */ - public double[] data = new double[2]; - public OSVR_Vec2() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("data"); - } - /** @param data C type : double[2] */ - public OSVR_Vec2(double data[]) { - super(); - if ((data.length != this.data.length)) - throw new IllegalArgumentException("Wrong array size !"); - this.data = data; - } - public OSVR_Vec2(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_Vec2 implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_Vec2 implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_Vec3.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_Vec3.java deleted file mode 100644 index 96c81a65c4..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_Vec3.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.jme3.system.osvr.osvrclientreporttypes; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_Vec3 extends Structure { - /** C type : double[3] */ - public double[] data = new double[3]; - public OSVR_Vec3() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("data"); - } - /** @param data C type : double[3] */ - public OSVR_Vec3(double data[]) { - super(); - if ((data.length != this.data.length)) - throw new IllegalArgumentException("Wrong array size !"); - this.data = data; - } - public OSVR_Vec3(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_Vec3 implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_Vec3 implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_VelocityReport.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_VelocityReport.java deleted file mode 100644 index 103f351d81..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_VelocityReport.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.jme3.system.osvr.osvrclientreporttypes; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_VelocityReport extends Structure { - public int sensor; - /** C type : OSVR_VelocityState */ - public OSVR_VelocityState state; - public OSVR_VelocityReport() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("sensor", "state"); - } - /** @param state C type : OSVR_VelocityState */ - public OSVR_VelocityReport(int sensor, OSVR_VelocityState state) { - super(); - this.sensor = sensor; - this.state = state; - } - public OSVR_VelocityReport(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_VelocityReport implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_VelocityReport implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_VelocityState.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_VelocityState.java deleted file mode 100644 index de34de0cd2..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_VelocityState.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.jme3.system.osvr.osvrclientreporttypes; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_VelocityState extends Structure { - /** C type : OSVR_LinearVelocityState */ - public OSVR_Vec3 linearVelocity; - /** C type : OSVR_CBool */ - public byte linearVelocityValid; - /** C type : OSVR_AngularVelocityState */ - public OSVR_IncrementalQuaternion angularVelocity; - /** C type : OSVR_CBool */ - public byte angularVelocityValid; - public OSVR_VelocityState() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("linearVelocity", "linearVelocityValid", "angularVelocity", "angularVelocityValid"); - } - /** - * @param linearVelocity C type : OSVR_LinearVelocityState
    - * @param linearVelocityValid C type : OSVR_CBool
    - * @param angularVelocity C type : OSVR_AngularVelocityState
    - * @param angularVelocityValid C type : OSVR_CBool - */ - public OSVR_VelocityState(OSVR_Vec3 linearVelocity, byte linearVelocityValid, OSVR_IncrementalQuaternion angularVelocity, byte angularVelocityValid) { - super(); - this.linearVelocity = linearVelocity; - this.linearVelocityValid = linearVelocityValid; - this.angularVelocity = angularVelocity; - this.angularVelocityValid = angularVelocityValid; - } - public OSVR_VelocityState(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_VelocityState implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_VelocityState implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OsvrClientReportTypesLibrary.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OsvrClientReportTypesLibrary.java deleted file mode 100644 index 7933cdefee..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OsvrClientReportTypesLibrary.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.jme3.system.osvr.osvrclientreporttypes; -import com.sun.jna.Library; -import com.sun.jna.Native; -import com.sun.jna.NativeLibrary; -/** - * JNA Wrapper for library osvrClientReportTypes
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OsvrClientReportTypesLibrary implements Library { - public static final String JNA_LIBRARY_NAME = "osvrClientKit"; - public static final NativeLibrary JNA_NATIVE_LIB = NativeLibrary.getInstance(OsvrClientReportTypesLibrary.JNA_LIBRARY_NAME); - static { - Native.register(OsvrClientReportTypesLibrary.class, OsvrClientReportTypesLibrary.JNA_NATIVE_LIB); - } - public static final int OSVR_TRUE = (int)(1); - public static final int OSVR_FALSE = (int)(0); - public static final int OSVR_BUTTON_PRESSED = (int)(1); - public static final int OSVR_BUTTON_NOT_PRESSED = (int)(0); - public static final int OSVR_EYE_BLINK = (int)(1); - public static final int OSVR_EYE_NO_BLINK = (int)(0); - /** Original signature : double osvrVec3GetX(const OSVR_Vec3*) */ - public static native double osvrVec3GetX(OSVR_Vec3 v); - /** Original signature : void osvrVec3SetX(OSVR_Vec3*, double) */ - public static native void osvrVec3SetX(OSVR_Vec3 v, double val); - /** Original signature : double osvrVec3GetY(const OSVR_Vec3*) */ - public static native double osvrVec3GetY(OSVR_Vec3 v); - /** Original signature : void osvrVec3SetY(OSVR_Vec3*, double) */ - public static native void osvrVec3SetY(OSVR_Vec3 v, double val); - /** Original signature : double osvrVec3GetZ(const OSVR_Vec3*) */ - public static native double osvrVec3GetZ(OSVR_Vec3 v); - /** Original signature : void osvrVec3SetZ(OSVR_Vec3*, double) */ - public static native void osvrVec3SetZ(OSVR_Vec3 v, double val); - /** - * @brief Set a Vec3 to the zero vector
    - * Original signature : void osvrVec3Zero(OSVR_Vec3*) - */ - public static native void osvrVec3Zero(OSVR_Vec3 v); - /** Original signature : double osvrQuatGetW(const OSVR_Quaternion*) */ - public static native double osvrQuatGetW(OSVR_Quaternion q); - /** Original signature : void osvrQuatSetW(OSVR_Quaternion*, double) */ - public static native void osvrQuatSetW(OSVR_Quaternion q, double val); - /** Original signature : double osvrQuatGetX(const OSVR_Quaternion*) */ - public static native double osvrQuatGetX(OSVR_Quaternion q); - /** Original signature : void osvrQuatSetX(OSVR_Quaternion*, double) */ - public static native void osvrQuatSetX(OSVR_Quaternion q, double val); - /** Original signature : double osvrQuatGetY(const OSVR_Quaternion*) */ - public static native double osvrQuatGetY(OSVR_Quaternion q); - /** Original signature : void osvrQuatSetY(OSVR_Quaternion*, double) */ - public static native void osvrQuatSetY(OSVR_Quaternion q, double val); - /** Original signature : double osvrQuatGetZ(const OSVR_Quaternion*) */ - public static native double osvrQuatGetZ(OSVR_Quaternion q); - /** Original signature : void osvrQuatSetZ(OSVR_Quaternion*, double) */ - public static native void osvrQuatSetZ(OSVR_Quaternion q, double val); - /** - * @brief Set a quaternion to the identity rotation
    - * Original signature : void osvrQuatSetIdentity(OSVR_Quaternion*) - */ - public static native void osvrQuatSetIdentity(OSVR_Quaternion q); - /** - * @brief Set a pose to identity
    - * Original signature : void osvrPose3SetIdentity(OSVR_Pose3*) - */ - public static native void osvrPose3SetIdentity(OSVR_Pose3 pose); - /** Original signature : double osvrVec2GetX(const OSVR_Vec2*) */ - public static native double osvrVec2GetX(OSVR_Vec2 v); - /** Original signature : void osvrVec2SetX(OSVR_Vec2*, double) */ - public static native void osvrVec2SetX(OSVR_Vec2 v, double val); - /** Original signature : double osvrVec2GetY(const OSVR_Vec2*) */ - public static native double osvrVec2GetY(OSVR_Vec2 v); - /** Original signature : void osvrVec2SetY(OSVR_Vec2*, double) */ - public static native void osvrVec2SetY(OSVR_Vec2 v, double val); - /** - * @brief Set a Vec2 to the zero vector
    - * Original signature : void osvrVec2Zero(OSVR_Vec2*) - */ - public static native void osvrVec2Zero(OSVR_Vec2 v); -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrdisplay/OsvrDisplayLibrary.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrdisplay/OsvrDisplayLibrary.java deleted file mode 100644 index 38489ecdfc..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrdisplay/OsvrDisplayLibrary.java +++ /dev/null @@ -1,821 +0,0 @@ -package com.jme3.system.osvr.osvrdisplay; -import com.jme3.system.osvr.osvrclientkit.OsvrClientKitLibrary; -import com.sun.jna.Library; -import com.sun.jna.Native; -import com.sun.jna.NativeLibrary; -import com.sun.jna.Pointer; -import com.sun.jna.PointerType; -import com.sun.jna.ptr.DoubleByReference; -import com.sun.jna.ptr.FloatByReference; -import com.sun.jna.ptr.IntByReference; -import com.sun.jna.ptr.PointerByReference; -import java.nio.ByteBuffer; -import java.nio.DoubleBuffer; -import java.nio.FloatBuffer; -import java.nio.IntBuffer; - -/** - * JNA Wrapper for library osvrDisplay
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OsvrDisplayLibrary implements Library { - public static final String JNA_LIBRARY_NAME = "osvrClientKit"; - public static final NativeLibrary JNA_NATIVE_LIB = NativeLibrary.getInstance(OsvrDisplayLibrary.JNA_LIBRARY_NAME); - static { - Native.register(OsvrDisplayLibrary.class, OsvrDisplayLibrary.JNA_NATIVE_LIB); - } - /** - * @brief Allocates a display configuration object populated with data from the
    - * OSVR system.
    - * Before this call will succeed, your application will need to be correctly
    - * and fully connected to an OSVR server. You may consider putting this call in
    - * a loop alternating with osvrClientUpdate() until this call succeeds.
    - * Data provided by a display configuration object:
    - * - The logical display topology (number and relationship of viewers, eyes,
    - * and surfaces), which remains constant throughout the life of the
    - * configuration object. (A method of notification of change here is TBD).
    - * - Pose data for viewers (not required for rendering) and pose/view data for
    - * eyes (used for rendering) which is based on tracker data: if used, these
    - * should be queried every frame.
    - * - Projection matrix data for surfaces, which while in current practice may
    - * be relatively unchanging, we are not guaranteeing them to be constant:
    - * these should be queried every frame.
    - * - Video-input-relative viewport size/location for a surface: would like this
    - * to be variable, but probably not feasible. If you have input, please
    - * comment on the dev mailing list.
    - * - Per-surface distortion strategy priorities/availabilities: constant. Note
    - * the following, though...
    - * - Per-surface distortion strategy parameters: variable, request each frame.
    - * (Could make constant with a notification if needed?)
    - * Important note: While most of this data is immediately available if you are
    - * successful in getting a display config object, the pose-based data (viewer
    - * pose, eye pose, eye view matrix) needs tracker state, so at least one (and in
    - * practice, typically more) osvrClientUpdate() must be performed before a new
    - * tracker report is available to populate that state. See
    - * osvrClientCheckDisplayStartup() to query if all startup data is available.
    - * @todo Decide if relative viewport should be constant in a display config,
    - * and update docs accordingly.
    - * @todo Decide if distortion params should be constant in a display config,
    - * and update docs accordingly.
    - * @return OSVR_RETURN_FAILURE if invalid parameters were passed or some other
    - * error occurred, in which case the output argument is unmodified.
    - * Original signature : OSVR_ReturnCode osvrClientGetDisplay(OSVR_ClientContext, OSVR_DisplayConfig*)
    - * @deprecated use the safer methods {@link #osvrClientGetDisplay(osvrdisplay.OsvrDisplayLibrary.OSVR_ClientContext, com.sun.jna.ptr.PointerByReference)} and {@link #osvrClientGetDisplay(com.sun.jna.Pointer, com.sun.jna.ptr.PointerByReference)} instead - */ - @Deprecated - public static native byte osvrClientGetDisplay(Pointer ctx, Pointer disp); - /** - * @brief Allocates a display configuration object populated with data from the
    - * OSVR system.
    - * Before this call will succeed, your application will need to be correctly
    - * and fully connected to an OSVR server. You may consider putting this call in
    - * a loop alternating with osvrClientUpdate() until this call succeeds.
    - * Data provided by a display configuration object:
    - * - The logical display topology (number and relationship of viewers, eyes,
    - * and surfaces), which remains constant throughout the life of the
    - * configuration object. (A method of notification of change here is TBD).
    - * - Pose data for viewers (not required for rendering) and pose/view data for
    - * eyes (used for rendering) which is based on tracker data: if used, these
    - * should be queried every frame.
    - * - Projection matrix data for surfaces, which while in current practice may
    - * be relatively unchanging, we are not guaranteeing them to be constant:
    - * these should be queried every frame.
    - * - Video-input-relative viewport size/location for a surface: would like this
    - * to be variable, but probably not feasible. If you have input, please
    - * comment on the dev mailing list.
    - * - Per-surface distortion strategy priorities/availabilities: constant. Note
    - * the following, though...
    - * - Per-surface distortion strategy parameters: variable, request each frame.
    - * (Could make constant with a notification if needed?)
    - * Important note: While most of this data is immediately available if you are
    - * successful in getting a display config object, the pose-based data (viewer
    - * pose, eye pose, eye view matrix) needs tracker state, so at least one (and in
    - * practice, typically more) osvrClientUpdate() must be performed before a new
    - * tracker report is available to populate that state. See
    - * osvrClientCheckDisplayStartup() to query if all startup data is available.
    - * @todo Decide if relative viewport should be constant in a display config,
    - * and update docs accordingly.
    - * @todo Decide if distortion params should be constant in a display config,
    - * and update docs accordingly.
    - * @return OSVR_RETURN_FAILURE if invalid parameters were passed or some other
    - * error occurred, in which case the output argument is unmodified.
    - * Original signature : OSVR_ReturnCode osvrClientGetDisplay(OSVR_ClientContext, OSVR_DisplayConfig*) - */ - public static native byte osvrClientGetDisplay(OsvrClientKitLibrary.OSVR_ClientContext ctx, PointerByReference disp); - /** - * @brief Allocates a display configuration object populated with data from the
    - * OSVR system.
    - * Before this call will succeed, your application will need to be correctly
    - * and fully connected to an OSVR server. You may consider putting this call in
    - * a loop alternating with osvrClientUpdate() until this call succeeds.
    - * Data provided by a display configuration object:
    - * - The logical display topology (number and relationship of viewers, eyes,
    - * and surfaces), which remains constant throughout the life of the
    - * configuration object. (A method of notification of change here is TBD).
    - * - Pose data for viewers (not required for rendering) and pose/view data for
    - * eyes (used for rendering) which is based on tracker data: if used, these
    - * should be queried every frame.
    - * - Projection matrix data for surfaces, which while in current practice may
    - * be relatively unchanging, we are not guaranteeing them to be constant:
    - * these should be queried every frame.
    - * - Video-input-relative viewport size/location for a surface: would like this
    - * to be variable, but probably not feasible. If you have input, please
    - * comment on the dev mailing list.
    - * - Per-surface distortion strategy priorities/availabilities: constant. Note
    - * the following, though...
    - * - Per-surface distortion strategy parameters: variable, request each frame.
    - * (Could make constant with a notification if needed?)
    - * Important note: While most of this data is immediately available if you are
    - * successful in getting a display config object, the pose-based data (viewer
    - * pose, eye pose, eye view matrix) needs tracker state, so at least one (and in
    - * practice, typically more) osvrClientUpdate() must be performed before a new
    - * tracker report is available to populate that state. See
    - * osvrClientCheckDisplayStartup() to query if all startup data is available.
    - * @todo Decide if relative viewport should be constant in a display config,
    - * and update docs accordingly.
    - * @todo Decide if distortion params should be constant in a display config,
    - * and update docs accordingly.
    - * @return OSVR_RETURN_FAILURE if invalid parameters were passed or some other
    - * error occurred, in which case the output argument is unmodified.
    - * Original signature : OSVR_ReturnCode osvrClientGetDisplay(OSVR_ClientContext, OSVR_DisplayConfig*) - */ - public static native byte osvrClientGetDisplay(Pointer ctx, PointerByReference disp); - /** - * @brief Frees a display configuration object. The corresponding context must
    - * still be open.
    - * If you fail to call this, it will be automatically called as part of
    - * clean-up when the corresponding context is closed.
    - * @return OSVR_RETURN_FAILURE if a null config was passed, or if the given
    - * display object was already freed.
    - * Original signature : OSVR_ReturnCode osvrClientFreeDisplay(OSVR_DisplayConfig)
    - * @deprecated use the safer methods {@link #osvrClientFreeDisplay(osvrdisplay.OsvrDisplayLibrary.OSVR_DisplayConfig)} and {@link #osvrClientFreeDisplay(com.sun.jna.Pointer)} instead - */ - @Deprecated - public static native byte osvrClientFreeDisplay(Pointer disp); - /** - * @brief Frees a display configuration object. The corresponding context must
    - * still be open.
    - * If you fail to call this, it will be automatically called as part of
    - * clean-up when the corresponding context is closed.
    - * @return OSVR_RETURN_FAILURE if a null config was passed, or if the given
    - * display object was already freed.
    - * Original signature : OSVR_ReturnCode osvrClientFreeDisplay(OSVR_DisplayConfig) - */ - public static native byte osvrClientFreeDisplay(OsvrDisplayLibrary.OSVR_DisplayConfig disp); - /** - * @brief Checks to see if a display is fully configured and ready, including
    - * having received its first pose update.
    - * Once this first succeeds, it will continue to succeed for the lifetime of
    - * the display config object, so it is not necessary to keep calling once you
    - * get a successful result.
    - * @return OSVR_RETURN_FAILURE if a null config was passed, or if the given
    - * display config object was otherwise not ready for full use.
    - * Original signature : OSVR_ReturnCode osvrClientCheckDisplayStartup(OSVR_DisplayConfig)
    - * @deprecated use the safer methods {@link #osvrClientCheckDisplayStartup(osvrdisplay.OsvrDisplayLibrary.OSVR_DisplayConfig)} and {@link #osvrClientCheckDisplayStartup(com.sun.jna.Pointer)} instead - */ - @Deprecated - public static native byte osvrClientCheckDisplayStartup(Pointer disp); - /** - * @brief Checks to see if a display is fully configured and ready, including
    - * having received its first pose update.
    - * Once this first succeeds, it will continue to succeed for the lifetime of
    - * the display config object, so it is not necessary to keep calling once you
    - * get a successful result.
    - * @return OSVR_RETURN_FAILURE if a null config was passed, or if the given
    - * display config object was otherwise not ready for full use.
    - * Original signature : OSVR_ReturnCode osvrClientCheckDisplayStartup(OSVR_DisplayConfig) - */ - public static native byte osvrClientCheckDisplayStartup(OsvrDisplayLibrary.OSVR_DisplayConfig disp); - /** - * @brief A display config can have one or more display inputs to pass pixels
    - * over (HDMI/DVI connections, etc): retrieve the number of display inputs in
    - * the current configuration.
    - * @param disp Display config object.
    - * @param[out] numDisplayInputs Number of display inputs in the logical display
    - * topology, **constant** throughout the active, valid lifetime of a display
    - * config object.
    - * @sa OSVR_DisplayInputCount
    - * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in
    - * which case the output argument is unmodified.
    - * Original signature : OSVR_ReturnCode osvrClientGetNumDisplayInputs(OSVR_DisplayConfig, OSVR_DisplayInputCount*)
    - * @deprecated use the safer methods {@link #osvrClientGetNumDisplayInputs(osvrdisplay.OsvrDisplayLibrary.OSVR_DisplayConfig, java.nio.ByteBuffer)} and {@link #osvrClientGetNumDisplayInputs(com.sun.jna.Pointer, com.sun.jna.Pointer)} instead - */ - @Deprecated - public static native byte osvrClientGetNumDisplayInputs(Pointer disp, Pointer numDisplayInputs); - /** - * @brief A display config can have one or more display inputs to pass pixels
    - * over (HDMI/DVI connections, etc): retrieve the number of display inputs in
    - * the current configuration.
    - * @param disp Display config object.
    - * @param[out] numDisplayInputs Number of display inputs in the logical display
    - * topology, **constant** throughout the active, valid lifetime of a display
    - * config object.
    - * @sa OSVR_DisplayInputCount
    - * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in
    - * which case the output argument is unmodified.
    - * Original signature : OSVR_ReturnCode osvrClientGetNumDisplayInputs(OSVR_DisplayConfig, OSVR_DisplayInputCount*) - */ - public static native byte osvrClientGetNumDisplayInputs(OsvrDisplayLibrary.OSVR_DisplayConfig disp, ByteBuffer numDisplayInputs); - /** - * @brief Retrieve the pixel dimensions of a given display input for a display
    - * config
    - * @param disp Display config object.
    - * @param displayInputIndex The zero-based index of the display input.
    - * @param[out] width Width (in pixels) of the display input.
    - * @param[out] height Height (in pixels) of the display input.
    - * The out parameters are **constant** throughout the active, valid lifetime of
    - * a display config object.
    - * @sa OSVR_DisplayDimension
    - * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in
    - * which case the output arguments are unmodified.
    - * Original signature : OSVR_ReturnCode osvrClientGetDisplayDimensions(OSVR_DisplayConfig, OSVR_DisplayInputCount, OSVR_DisplayDimension*, OSVR_DisplayDimension*)
    - * @deprecated use the safer methods {@link #osvrClientGetDisplayDimensions(osvrdisplay.OsvrDisplayLibrary.OSVR_DisplayConfig, byte, java.nio.IntBuffer, java.nio.IntBuffer)} and {@link #osvrClientGetDisplayDimensions(com.sun.jna.Pointer, byte, com.sun.jna.ptr.IntByReference, com.sun.jna.ptr.IntByReference)} instead - */ - @Deprecated - public static native byte osvrClientGetDisplayDimensions(Pointer disp, byte displayInputIndex, IntByReference width, IntByReference height); - /** - * @brief Retrieve the pixel dimensions of a given display input for a display
    - * config
    - * @param disp Display config object.
    - * @param displayInputIndex The zero-based index of the display input.
    - * @param[out] width Width (in pixels) of the display input.
    - * @param[out] height Height (in pixels) of the display input.
    - * The out parameters are **constant** throughout the active, valid lifetime of
    - * a display config object.
    - * @sa OSVR_DisplayDimension
    - * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in
    - * which case the output arguments are unmodified.
    - * Original signature : OSVR_ReturnCode osvrClientGetDisplayDimensions(OSVR_DisplayConfig, OSVR_DisplayInputCount, OSVR_DisplayDimension*, OSVR_DisplayDimension*) - */ - public static native byte osvrClientGetDisplayDimensions(OsvrDisplayLibrary.OSVR_DisplayConfig disp, byte displayInputIndex, IntBuffer width, IntBuffer height); - /** - * @brief A display config can have one (or theoretically more) viewers:
    - * retrieve the viewer count.
    - * @param disp Display config object.
    - * @param[out] viewers Number of viewers in the logical display topology,
    - * *constant** throughout the active, valid lifetime of a display config
    - * object.
    - * @sa OSVR_ViewerCount
    - * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in which case
    - * the output argument is unmodified.
    - * Original signature : OSVR_ReturnCode osvrClientGetNumViewers(OSVR_DisplayConfig, OSVR_ViewerCount*)
    - * @deprecated use the safer methods {@link #osvrClientGetNumViewers(osvrdisplay.OsvrDisplayLibrary.OSVR_DisplayConfig, java.nio.IntBuffer)} and {@link #osvrClientGetNumViewers(com.sun.jna.Pointer, com.sun.jna.ptr.IntByReference)} instead - */ - @Deprecated - public static native byte osvrClientGetNumViewers(Pointer disp, IntByReference viewers); - /** - * @brief A display config can have one (or theoretically more) viewers:
    - * retrieve the viewer count.
    - * @param disp Display config object.
    - * @param[out] viewers Number of viewers in the logical display topology,
    - * *constant** throughout the active, valid lifetime of a display config
    - * object.
    - * @sa OSVR_ViewerCount
    - * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in which case
    - * the output argument is unmodified.
    - * Original signature : OSVR_ReturnCode osvrClientGetNumViewers(OSVR_DisplayConfig, OSVR_ViewerCount*) - */ - public static native byte osvrClientGetNumViewers(OsvrDisplayLibrary.OSVR_DisplayConfig disp, IntBuffer viewers); - /** - * @brief Get the pose of a viewer in a display config.
    - * Note that there may not necessarily be any surfaces rendered from this pose
    - * (it's the unused "center" eye in a stereo configuration, for instance) so
    - * only use this if it makes integration into your engine or existing
    - * applications (not originally designed for stereo) easier.
    - * Will only succeed if osvrClientCheckDisplayStartup() succeeds.
    - * @return OSVR_RETURN_FAILURE if invalid parameters were passed or no pose was
    - * yet available, in which case the pose argument is unmodified.
    - * Original signature : OSVR_ReturnCode osvrClientGetViewerPose(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_Pose3*)
    - * @deprecated use the safer methods {@link #osvrClientGetViewerPose(osvrdisplay.OsvrDisplayLibrary.OSVR_DisplayConfig, int, com.sun.jna.Pointer)} and {@link #osvrClientGetViewerPose(com.sun.jna.Pointer, int, com.sun.jna.Pointer)} instead - */ - @Deprecated - public static native byte osvrClientGetViewerPose(Pointer disp, int viewer, Pointer pose); - /** - * @brief Get the pose of a viewer in a display config.
    - * Note that there may not necessarily be any surfaces rendered from this pose
    - * (it's the unused "center" eye in a stereo configuration, for instance) so
    - * only use this if it makes integration into your engine or existing
    - * applications (not originally designed for stereo) easier.
    - * Will only succeed if osvrClientCheckDisplayStartup() succeeds.
    - * @return OSVR_RETURN_FAILURE if invalid parameters were passed or no pose was
    - * yet available, in which case the pose argument is unmodified.
    - * Original signature : OSVR_ReturnCode osvrClientGetViewerPose(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_Pose3*) - */ - public static native byte osvrClientGetViewerPose(OsvrDisplayLibrary.OSVR_DisplayConfig disp, int viewer, Pointer pose); - /** - * @brief Each viewer in a display config can have one or more "eyes" which
    - * have a substantially similar pose: get the count.
    - * @param disp Display config object.
    - * @param viewer Viewer ID
    - * @param[out] eyes Number of eyes for this viewer in the logical display
    - * topology, **constant** throughout the active, valid lifetime of a display
    - * config object
    - * @sa OSVR_EyeCount
    - * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in which case
    - * the output argument is unmodified.
    - * Original signature : OSVR_ReturnCode osvrClientGetNumEyesForViewer(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount*)
    - * @deprecated use the safer methods {@link #osvrClientGetNumEyesForViewer(osvrdisplay.OsvrDisplayLibrary.OSVR_DisplayConfig, int, java.nio.ByteBuffer)} and {@link #osvrClientGetNumEyesForViewer(com.sun.jna.Pointer, int, com.sun.jna.Pointer)} instead - */ - @Deprecated - public static native byte osvrClientGetNumEyesForViewer(Pointer disp, int viewer, Pointer eyes); - /** - * @brief Each viewer in a display config can have one or more "eyes" which
    - * have a substantially similar pose: get the count.
    - * @param disp Display config object.
    - * @param viewer Viewer ID
    - * @param[out] eyes Number of eyes for this viewer in the logical display
    - * topology, **constant** throughout the active, valid lifetime of a display
    - * config object
    - * @sa OSVR_EyeCount
    - * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in which case
    - * the output argument is unmodified.
    - * Original signature : OSVR_ReturnCode osvrClientGetNumEyesForViewer(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount*) - */ - public static native byte osvrClientGetNumEyesForViewer(OsvrDisplayLibrary.OSVR_DisplayConfig disp, int viewer, ByteBuffer eyes); - /** - * @brief Get the "viewpoint" for the given eye of a viewer in a display
    - * config.
    - * Will only succeed if osvrClientCheckDisplayStartup() succeeds.
    - * @param disp Display config object
    - * @param viewer Viewer ID
    - * @param eye Eye ID
    - * @param[out] pose Room-space pose (not relative to pose of the viewer)
    - * @return OSVR_RETURN_FAILURE if invalid parameters were passed or no pose was
    - * yet available, in which case the pose argument is unmodified.
    - * Original signature : OSVR_ReturnCode osvrClientGetViewerEyePose(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_Pose3*)
    - * @deprecated use the safer methods {@link #osvrClientGetViewerEyePose(osvrdisplay.OsvrDisplayLibrary.OSVR_DisplayConfig, int, byte, com.sun.jna.Pointer)} and {@link #osvrClientGetViewerEyePose(com.sun.jna.Pointer, int, byte, com.sun.jna.Pointer)} instead - */ - @Deprecated - public static native byte osvrClientGetViewerEyePose(Pointer disp, int viewer, byte eye, Pointer pose); - /** - * @brief Get the "viewpoint" for the given eye of a viewer in a display
    - * config.
    - * Will only succeed if osvrClientCheckDisplayStartup() succeeds.
    - * @param disp Display config object
    - * @param viewer Viewer ID
    - * @param eye Eye ID
    - * @param[out] pose Room-space pose (not relative to pose of the viewer)
    - * @return OSVR_RETURN_FAILURE if invalid parameters were passed or no pose was
    - * yet available, in which case the pose argument is unmodified.
    - * Original signature : OSVR_ReturnCode osvrClientGetViewerEyePose(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_Pose3*) - */ - public static native byte osvrClientGetViewerEyePose(OsvrDisplayLibrary.OSVR_DisplayConfig disp, int viewer, byte eye, Pointer pose); - /** - * @brief Get the view matrix (inverse of pose) for the given eye of a
    - * viewer in a display config - matrix of **doubles**.
    - * Will only succeed if osvrClientCheckDisplayStartup() succeeds.
    - * @param disp Display config object
    - * @param viewer Viewer ID
    - * @param eye Eye ID
    - * @param flags Bitwise OR of matrix convention flags (see @ref MatrixFlags)
    - * @param[out] mat Pass a double[::OSVR_MATRIX_SIZE] to get the transformation
    - * matrix from room space to eye space (not relative to pose of the viewer)
    - * @return OSVR_RETURN_FAILURE if invalid parameters were passed or no pose was
    - * yet available, in which case the output argument is unmodified.
    - * Original signature : OSVR_ReturnCode osvrClientGetViewerEyeViewMatrixd(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_MatrixConventions, double*)
    - * @deprecated use the safer methods {@link #osvrClientGetViewerEyeViewMatrixd(osvrdisplay.OsvrDisplayLibrary.OSVR_DisplayConfig, int, byte, short, java.nio.DoubleBuffer)} and {@link #osvrClientGetViewerEyeViewMatrixd(com.sun.jna.Pointer, int, byte, short, com.sun.jna.ptr.DoubleByReference)} instead - */ - @Deprecated - public static native byte osvrClientGetViewerEyeViewMatrixd(Pointer disp, int viewer, byte eye, short flags, DoubleByReference mat); - /** - * @brief Get the view matrix (inverse of pose) for the given eye of a
    - * viewer in a display config - matrix of **doubles**.
    - * Will only succeed if osvrClientCheckDisplayStartup() succeeds.
    - * @param disp Display config object
    - * @param viewer Viewer ID
    - * @param eye Eye ID
    - * @param flags Bitwise OR of matrix convention flags (see @ref MatrixFlags)
    - * @param[out] mat Pass a double[::OSVR_MATRIX_SIZE] to get the transformation
    - * matrix from room space to eye space (not relative to pose of the viewer)
    - * @return OSVR_RETURN_FAILURE if invalid parameters were passed or no pose was
    - * yet available, in which case the output argument is unmodified.
    - * Original signature : OSVR_ReturnCode osvrClientGetViewerEyeViewMatrixd(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_MatrixConventions, double*) - */ - public static native byte osvrClientGetViewerEyeViewMatrixd(OsvrDisplayLibrary.OSVR_DisplayConfig disp, int viewer, byte eye, short flags, DoubleBuffer mat); - /** - * @brief Get the view matrix (inverse of pose) for the given eye of a
    - * viewer in a display config - matrix of **floats**.
    - * Will only succeed if osvrClientCheckDisplayStartup() succeeds.
    - * @param disp Display config object
    - * @param viewer Viewer ID
    - * @param eye Eye ID
    - * @param flags Bitwise OR of matrix convention flags (see @ref MatrixFlags)
    - * @param[out] mat Pass a float[::OSVR_MATRIX_SIZE] to get the transformation
    - * matrix from room space to eye space (not relative to pose of the viewer)
    - * @return OSVR_RETURN_FAILURE if invalid parameters were passed or no pose was
    - * yet available, in which case the output argument is unmodified.
    - * Original signature : OSVR_ReturnCode osvrClientGetViewerEyeViewMatrixf(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_MatrixConventions, float*)
    - * @deprecated use the safer methods {@link #osvrClientGetViewerEyeViewMatrixf(osvrdisplay.OsvrDisplayLibrary.OSVR_DisplayConfig, int, byte, short, java.nio.FloatBuffer)} and {@link #osvrClientGetViewerEyeViewMatrixf(com.sun.jna.Pointer, int, byte, short, com.sun.jna.ptr.FloatByReference)} instead - */ - @Deprecated - public static native byte osvrClientGetViewerEyeViewMatrixf(Pointer disp, int viewer, byte eye, short flags, FloatByReference mat); - /** - * @brief Get the view matrix (inverse of pose) for the given eye of a
    - * viewer in a display config - matrix of **floats**.
    - * Will only succeed if osvrClientCheckDisplayStartup() succeeds.
    - * @param disp Display config object
    - * @param viewer Viewer ID
    - * @param eye Eye ID
    - * @param flags Bitwise OR of matrix convention flags (see @ref MatrixFlags)
    - * @param[out] mat Pass a float[::OSVR_MATRIX_SIZE] to get the transformation
    - * matrix from room space to eye space (not relative to pose of the viewer)
    - * @return OSVR_RETURN_FAILURE if invalid parameters were passed or no pose was
    - * yet available, in which case the output argument is unmodified.
    - * Original signature : OSVR_ReturnCode osvrClientGetViewerEyeViewMatrixf(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_MatrixConventions, float*) - */ - public static native byte osvrClientGetViewerEyeViewMatrixf(OsvrDisplayLibrary.OSVR_DisplayConfig disp, int viewer, byte eye, short flags, FloatBuffer mat); - /** - * @brief Each eye of each viewer in a display config has one or more surfaces
    - * (aka "screens") on which content should be rendered.
    - * @param disp Display config object
    - * @param viewer Viewer ID
    - * @param eye Eye ID
    - * @param[out] surfaces Number of surfaces (numbered [0, surfaces - 1]) for the
    - * given viewer and eye. **Constant** throughout the active, valid lifetime of
    - * a display config object.
    - * @sa OSVR_SurfaceCount
    - * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in which case
    - * the output argument is unmodified.
    - * Original signature : OSVR_ReturnCode osvrClientGetNumSurfacesForViewerEye(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_SurfaceCount*)
    - * @deprecated use the safer methods {@link #osvrClientGetNumSurfacesForViewerEye(osvrdisplay.OsvrDisplayLibrary.OSVR_DisplayConfig, int, byte, java.nio.IntBuffer)} and {@link #osvrClientGetNumSurfacesForViewerEye(com.sun.jna.Pointer, int, byte, com.sun.jna.ptr.IntByReference)} instead - */ - @Deprecated - public static native byte osvrClientGetNumSurfacesForViewerEye(Pointer disp, int viewer, byte eye, IntByReference surfaces); - /** - * @brief Each eye of each viewer in a display config has one or more surfaces
    - * (aka "screens") on which content should be rendered.
    - * @param disp Display config object
    - * @param viewer Viewer ID
    - * @param eye Eye ID
    - * @param[out] surfaces Number of surfaces (numbered [0, surfaces - 1]) for the
    - * given viewer and eye. **Constant** throughout the active, valid lifetime of
    - * a display config object.
    - * @sa OSVR_SurfaceCount
    - * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in which case
    - * the output argument is unmodified.
    - * Original signature : OSVR_ReturnCode osvrClientGetNumSurfacesForViewerEye(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_SurfaceCount*) - */ - public static native byte osvrClientGetNumSurfacesForViewerEye(OsvrDisplayLibrary.OSVR_DisplayConfig disp, int viewer, byte eye, IntBuffer surfaces); - /** - * @brief Get the dimensions/location of the viewport **within the display
    - * input** for a surface seen by an eye of a viewer in a display config. (This
    - * does not include other video inputs that may be on a single virtual desktop,
    - * etc. or explicitly account for display configurations that use multiple
    - * video inputs. It does not necessarily indicate that a viewport in the sense
    - * of glViewport must be created with these parameters, though the parameter
    - * order matches for convenience.)
    - * @param disp Display config object
    - * @param viewer Viewer ID
    - * @param eye Eye ID
    - * @param surface Surface ID
    - * @param[out] left Output: Distance in pixels from the left of the video input
    - * to the left of the viewport.
    - * @param[out] bottom Output: Distance in pixels from the bottom of the video
    - * input to the bottom of the viewport.
    - * @param[out] width Output: Width of viewport in pixels.
    - * @param[out] height Output: Height of viewport in pixels.
    - * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in which case
    - * the output arguments are unmodified.
    - * Original signature : OSVR_ReturnCode osvrClientGetRelativeViewportForViewerEyeSurface(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_SurfaceCount, OSVR_ViewportDimension*, OSVR_ViewportDimension*, OSVR_ViewportDimension*, OSVR_ViewportDimension*)
    - * @deprecated use the safer methods {@link #osvrClientGetRelativeViewportForViewerEyeSurface(osvrdisplay.OsvrDisplayLibrary.OSVR_DisplayConfig, int, byte, int, java.nio.IntBuffer, java.nio.IntBuffer, java.nio.IntBuffer, java.nio.IntBuffer)} and {@link #osvrClientGetRelativeViewportForViewerEyeSurface(com.sun.jna.Pointer, int, byte, int, com.sun.jna.ptr.IntByReference, com.sun.jna.ptr.IntByReference, com.sun.jna.ptr.IntByReference, com.sun.jna.ptr.IntByReference)} instead - */ - @Deprecated - public static native byte osvrClientGetRelativeViewportForViewerEyeSurface(Pointer disp, int viewer, byte eye, int surface, IntByReference left, IntByReference bottom, IntByReference width, IntByReference height); - /** - * @brief Get the dimensions/location of the viewport **within the display
    - * input** for a surface seen by an eye of a viewer in a display config. (This
    - * does not include other video inputs that may be on a single virtual desktop,
    - * etc. or explicitly account for display configurations that use multiple
    - * video inputs. It does not necessarily indicate that a viewport in the sense
    - * of glViewport must be created with these parameters, though the parameter
    - * order matches for convenience.)
    - * @param disp Display config object
    - * @param viewer Viewer ID
    - * @param eye Eye ID
    - * @param surface Surface ID
    - * @param[out] left Output: Distance in pixels from the left of the video input
    - * to the left of the viewport.
    - * @param[out] bottom Output: Distance in pixels from the bottom of the video
    - * input to the bottom of the viewport.
    - * @param[out] width Output: Width of viewport in pixels.
    - * @param[out] height Output: Height of viewport in pixels.
    - * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in which case
    - * the output arguments are unmodified.
    - * Original signature : OSVR_ReturnCode osvrClientGetRelativeViewportForViewerEyeSurface(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_SurfaceCount, OSVR_ViewportDimension*, OSVR_ViewportDimension*, OSVR_ViewportDimension*, OSVR_ViewportDimension*) - */ - public static native byte osvrClientGetRelativeViewportForViewerEyeSurface(OsvrDisplayLibrary.OSVR_DisplayConfig disp, int viewer, byte eye, int surface, IntBuffer left, IntBuffer bottom, IntBuffer width, IntBuffer height); - /** - * @brief Get the index of the display input for a surface seen by an eye of a
    - * viewer in a display config.
    - * This is the OSVR-assigned display input: it may not (and in practice,
    - * usually will not) match any platform-specific display indices. This function
    - * exists to associate surfaces with video inputs as enumerated by
    - * osvrClientGetNumDisplayInputs().
    - * @param disp Display config object
    - * @param viewer Viewer ID
    - * @param eye Eye ID
    - * @param surface Surface ID
    - * @param[out] displayInput Zero-based index of the display input pixels for
    - * this surface are tranmitted over.
    - * This association is **constant** throughout the active, valid lifetime of a
    - * display config object.
    - * @sa osvrClientGetNumDisplayInputs(),
    - * osvrClientGetRelativeViewportForViewerEyeSurface()
    - * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in which
    - * case the output argument is unmodified.
    - * Original signature : OSVR_ReturnCode osvrClientGetViewerEyeSurfaceDisplayInputIndex(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_SurfaceCount, OSVR_DisplayInputCount*)
    - * @deprecated use the safer methods {@link #osvrClientGetViewerEyeSurfaceDisplayInputIndex(osvrdisplay.OsvrDisplayLibrary.OSVR_DisplayConfig, int, byte, int, java.nio.ByteBuffer)} and {@link #osvrClientGetViewerEyeSurfaceDisplayInputIndex(com.sun.jna.Pointer, int, byte, int, com.sun.jna.Pointer)} instead - */ - @Deprecated - public static native byte osvrClientGetViewerEyeSurfaceDisplayInputIndex(Pointer disp, int viewer, byte eye, int surface, Pointer displayInput); - /** - * @brief Get the index of the display input for a surface seen by an eye of a
    - * viewer in a display config.
    - * This is the OSVR-assigned display input: it may not (and in practice,
    - * usually will not) match any platform-specific display indices. This function
    - * exists to associate surfaces with video inputs as enumerated by
    - * osvrClientGetNumDisplayInputs().
    - * @param disp Display config object
    - * @param viewer Viewer ID
    - * @param eye Eye ID
    - * @param surface Surface ID
    - * @param[out] displayInput Zero-based index of the display input pixels for
    - * this surface are tranmitted over.
    - * This association is **constant** throughout the active, valid lifetime of a
    - * display config object.
    - * @sa osvrClientGetNumDisplayInputs(),
    - * osvrClientGetRelativeViewportForViewerEyeSurface()
    - * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in which
    - * case the output argument is unmodified.
    - * Original signature : OSVR_ReturnCode osvrClientGetViewerEyeSurfaceDisplayInputIndex(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_SurfaceCount, OSVR_DisplayInputCount*) - */ - public static native byte osvrClientGetViewerEyeSurfaceDisplayInputIndex(OsvrDisplayLibrary.OSVR_DisplayConfig disp, int viewer, byte eye, int surface, ByteBuffer displayInput); - /** - * @brief Get the projection matrix for a surface seen by an eye of a viewer
    - * in a display config. (double version)
    - * @param disp Display config object
    - * @param viewer Viewer ID
    - * @param eye Eye ID
    - * @param surface Surface ID
    - * @param near Distance from viewpoint to near clipping plane - must be
    - * positive.
    - * @param far Distance from viewpoint to far clipping plane - must be positive
    - * and not equal to near, typically greater than near.
    - * @param flags Bitwise OR of matrix convention flags (see @ref MatrixFlags)
    - * @param[out] matrix Output projection matrix: supply an array of 16
    - * (::OSVR_MATRIX_SIZE) doubles.
    - * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in which case
    - * the output argument is unmodified.
    - * Original signature : OSVR_ReturnCode osvrClientGetViewerEyeSurfaceProjectionMatrixd(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_SurfaceCount, double, double, OSVR_MatrixConventions, double*)
    - * @deprecated use the safer methods {@link #osvrClientGetViewerEyeSurfaceProjectionMatrixd(osvrdisplay.OsvrDisplayLibrary.OSVR_DisplayConfig, int, byte, int, double, double, short, java.nio.DoubleBuffer)} and {@link #osvrClientGetViewerEyeSurfaceProjectionMatrixd(com.sun.jna.Pointer, int, byte, int, double, double, short, com.sun.jna.ptr.DoubleByReference)} instead - */ - @Deprecated - public static native byte osvrClientGetViewerEyeSurfaceProjectionMatrixd(Pointer disp, int viewer, byte eye, int surface, double near, double far, short flags, DoubleByReference matrix); - /** - * @brief Get the projection matrix for a surface seen by an eye of a viewer
    - * in a display config. (double version)
    - * @param disp Display config object
    - * @param viewer Viewer ID
    - * @param eye Eye ID
    - * @param surface Surface ID
    - * @param near Distance from viewpoint to near clipping plane - must be
    - * positive.
    - * @param far Distance from viewpoint to far clipping plane - must be positive
    - * and not equal to near, typically greater than near.
    - * @param flags Bitwise OR of matrix convention flags (see @ref MatrixFlags)
    - * @param[out] matrix Output projection matrix: supply an array of 16
    - * (::OSVR_MATRIX_SIZE) doubles.
    - * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in which case
    - * the output argument is unmodified.
    - * Original signature : OSVR_ReturnCode osvrClientGetViewerEyeSurfaceProjectionMatrixd(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_SurfaceCount, double, double, OSVR_MatrixConventions, double*) - */ - public static native byte osvrClientGetViewerEyeSurfaceProjectionMatrixd(OsvrDisplayLibrary.OSVR_DisplayConfig disp, int viewer, byte eye, int surface, double near, double far, short flags, DoubleBuffer matrix); - /** - * @brief Get the projection matrix for a surface seen by an eye of a viewer
    - * in a display config. (float version)
    - * @param disp Display config object
    - * @param viewer Viewer ID
    - * @param eye Eye ID
    - * @param surface Surface ID
    - * @param near Distance to near clipping plane - must be nonzero, typically
    - * positive.
    - * @param far Distance to far clipping plane - must be nonzero, typically
    - * positive and greater than near.
    - * @param flags Bitwise OR of matrix convention flags (see @ref MatrixFlags)
    - * @param[out] matrix Output projection matrix: supply an array of 16
    - * (::OSVR_MATRIX_SIZE) floats.
    - * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in which case
    - * the output argument is unmodified.
    - * Original signature : OSVR_ReturnCode osvrClientGetViewerEyeSurfaceProjectionMatrixf(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_SurfaceCount, float, float, OSVR_MatrixConventions, float*)
    - * @deprecated use the safer methods {@link #osvrClientGetViewerEyeSurfaceProjectionMatrixf(osvrdisplay.OsvrDisplayLibrary.OSVR_DisplayConfig, int, byte, int, float, float, short, java.nio.FloatBuffer)} and {@link #osvrClientGetViewerEyeSurfaceProjectionMatrixf(com.sun.jna.Pointer, int, byte, int, float, float, short, com.sun.jna.ptr.FloatByReference)} instead - */ - @Deprecated - public static native byte osvrClientGetViewerEyeSurfaceProjectionMatrixf(Pointer disp, int viewer, byte eye, int surface, float near, float far, short flags, FloatByReference matrix); - /** - * @brief Get the projection matrix for a surface seen by an eye of a viewer
    - * in a display config. (float version)
    - * @param disp Display config object
    - * @param viewer Viewer ID
    - * @param eye Eye ID
    - * @param surface Surface ID
    - * @param near Distance to near clipping plane - must be nonzero, typically
    - * positive.
    - * @param far Distance to far clipping plane - must be nonzero, typically
    - * positive and greater than near.
    - * @param flags Bitwise OR of matrix convention flags (see @ref MatrixFlags)
    - * @param[out] matrix Output projection matrix: supply an array of 16
    - * (::OSVR_MATRIX_SIZE) floats.
    - * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in which case
    - * the output argument is unmodified.
    - * Original signature : OSVR_ReturnCode osvrClientGetViewerEyeSurfaceProjectionMatrixf(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_SurfaceCount, float, float, OSVR_MatrixConventions, float*) - */ - public static native byte osvrClientGetViewerEyeSurfaceProjectionMatrixf(OsvrDisplayLibrary.OSVR_DisplayConfig disp, int viewer, byte eye, int surface, float near, float far, short flags, FloatBuffer matrix); - /** - * @brief Get the clipping planes (positions at unit distance) for a surface
    - * seen by an eye of a viewer
    - * in a display config.
    - * This is only for use in integrations that cannot accept a fully-formulated
    - * projection matrix as returned by
    - * osvrClientGetViewerEyeSurfaceProjectionMatrixf() or
    - * osvrClientGetViewerEyeSurfaceProjectionMatrixd(), and may not necessarily
    - * provide the same optimizations.
    - * As all the planes are given at unit (1) distance, before passing these
    - * planes to a consuming function in your application/engine, you will typically
    - * divide them by your near clipping plane distance.
    - * @param disp Display config object
    - * @param viewer Viewer ID
    - * @param eye Eye ID
    - * @param surface Surface ID
    - * @param[out] left Distance to left clipping plane
    - * @param[out] right Distance to right clipping plane
    - * @param[out] bottom Distance to bottom clipping plane
    - * @param[out] top Distance to top clipping plane
    - * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in which case
    - * the output arguments are unmodified.
    - * Original signature : OSVR_ReturnCode osvrClientGetViewerEyeSurfaceProjectionClippingPlanes(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_SurfaceCount, double*, double*, double*, double*)
    - * @deprecated use the safer methods {@link #osvrClientGetViewerEyeSurfaceProjectionClippingPlanes(osvrdisplay.OsvrDisplayLibrary.OSVR_DisplayConfig, int, byte, int, java.nio.DoubleBuffer, java.nio.DoubleBuffer, java.nio.DoubleBuffer, java.nio.DoubleBuffer)} and {@link #osvrClientGetViewerEyeSurfaceProjectionClippingPlanes(com.sun.jna.Pointer, int, byte, int, com.sun.jna.ptr.DoubleByReference, com.sun.jna.ptr.DoubleByReference, com.sun.jna.ptr.DoubleByReference, com.sun.jna.ptr.DoubleByReference)} instead - */ - @Deprecated - public static native byte osvrClientGetViewerEyeSurfaceProjectionClippingPlanes(Pointer disp, int viewer, byte eye, int surface, DoubleByReference left, DoubleByReference right, DoubleByReference bottom, DoubleByReference top); - /** - * @brief Get the clipping planes (positions at unit distance) for a surface
    - * seen by an eye of a viewer
    - * in a display config.
    - * This is only for use in integrations that cannot accept a fully-formulated
    - * projection matrix as returned by
    - * osvrClientGetViewerEyeSurfaceProjectionMatrixf() or
    - * osvrClientGetViewerEyeSurfaceProjectionMatrixd(), and may not necessarily
    - * provide the same optimizations.
    - * As all the planes are given at unit (1) distance, before passing these
    - * planes to a consuming function in your application/engine, you will typically
    - * divide them by your near clipping plane distance.
    - * @param disp Display config object
    - * @param viewer Viewer ID
    - * @param eye Eye ID
    - * @param surface Surface ID
    - * @param[out] left Distance to left clipping plane
    - * @param[out] right Distance to right clipping plane
    - * @param[out] bottom Distance to bottom clipping plane
    - * @param[out] top Distance to top clipping plane
    - * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in which case
    - * the output arguments are unmodified.
    - * Original signature : OSVR_ReturnCode osvrClientGetViewerEyeSurfaceProjectionClippingPlanes(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_SurfaceCount, double*, double*, double*, double*) - */ - public static native byte osvrClientGetViewerEyeSurfaceProjectionClippingPlanes(OsvrDisplayLibrary.OSVR_DisplayConfig disp, int viewer, byte eye, int surface, DoubleBuffer left, DoubleBuffer right, DoubleBuffer bottom, DoubleBuffer top); - /** - * @brief Determines if a surface seen by an eye of a viewer in a display
    - * config requests some distortion to be performed.
    - * This simply reports true or false, and does not specify which kind of
    - * distortion implementations have been parameterized for this display. For
    - * each distortion implementation your application supports, you'll want to
    - * call the corresponding priority function to find out if it is available.
    - * @param disp Display config object
    - * @param viewer Viewer ID
    - * @param eye Eye ID
    - * @param surface Surface ID
    - * @param[out] distortionRequested Output parameter: whether distortion is
    - * requested. **Constant** throughout the active, valid lifetime of a display
    - * config object.
    - * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in which case
    - * the output argument is unmodified.
    - * Original signature : OSVR_ReturnCode osvrClientDoesViewerEyeSurfaceWantDistortion(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_SurfaceCount, OSVR_CBool*)
    - * @deprecated use the safer methods {@link #osvrClientDoesViewerEyeSurfaceWantDistortion(osvrdisplay.OsvrDisplayLibrary.OSVR_DisplayConfig, int, byte, int, java.nio.ByteBuffer)} and {@link #osvrClientDoesViewerEyeSurfaceWantDistortion(com.sun.jna.Pointer, int, byte, int, com.sun.jna.Pointer)} instead - */ - @Deprecated - public static native byte osvrClientDoesViewerEyeSurfaceWantDistortion(Pointer disp, int viewer, byte eye, int surface, Pointer distortionRequested); - /** - * @brief Determines if a surface seen by an eye of a viewer in a display
    - * config requests some distortion to be performed.
    - * This simply reports true or false, and does not specify which kind of
    - * distortion implementations have been parameterized for this display. For
    - * each distortion implementation your application supports, you'll want to
    - * call the corresponding priority function to find out if it is available.
    - * @param disp Display config object
    - * @param viewer Viewer ID
    - * @param eye Eye ID
    - * @param surface Surface ID
    - * @param[out] distortionRequested Output parameter: whether distortion is
    - * requested. **Constant** throughout the active, valid lifetime of a display
    - * config object.
    - * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in which case
    - * the output argument is unmodified.
    - * Original signature : OSVR_ReturnCode osvrClientDoesViewerEyeSurfaceWantDistortion(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_SurfaceCount, OSVR_CBool*) - */ - public static native byte osvrClientDoesViewerEyeSurfaceWantDistortion(OsvrDisplayLibrary.OSVR_DisplayConfig disp, int viewer, byte eye, int surface, ByteBuffer distortionRequested); - /** - * @brief Returns the priority/availability of radial distortion parameters for
    - * a surface seen by an eye of a viewer in a display config.
    - * If osvrClientDoesViewerEyeSurfaceWantDistortion() reports false, then the
    - * display does not request distortion of any sort, and thus neither this nor
    - * any other distortion strategy priority function will report an "available"
    - * priority.
    - * @param disp Display config object
    - * @param viewer Viewer ID
    - * @param eye Eye ID
    - * @param surface Surface ID
    - * @param[out] priority Output: the priority level. Negative values
    - * (canonically OSVR_DISTORTION_PRIORITY_UNAVAILABLE) indicate this technique
    - * not available, higher values indicate higher preference for the given
    - * technique based on the device's description. **Constant** throughout the
    - * active, valid lifetime of a display config object.
    - * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in which case
    - * the output argument is unmodified.
    - * Original signature : OSVR_ReturnCode osvrClientGetViewerEyeSurfaceRadialDistortionPriority(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_SurfaceCount, OSVR_DistortionPriority*)
    - * @deprecated use the safer methods {@link #osvrClientGetViewerEyeSurfaceRadialDistortionPriority(osvrdisplay.OsvrDisplayLibrary.OSVR_DisplayConfig, int, byte, int, java.nio.IntBuffer)} and {@link #osvrClientGetViewerEyeSurfaceRadialDistortionPriority(com.sun.jna.Pointer, int, byte, int, com.sun.jna.ptr.IntByReference)} instead - */ - @Deprecated - public static native byte osvrClientGetViewerEyeSurfaceRadialDistortionPriority(Pointer disp, int viewer, byte eye, int surface, IntByReference priority); - /** - * @brief Returns the priority/availability of radial distortion parameters for
    - * a surface seen by an eye of a viewer in a display config.
    - * If osvrClientDoesViewerEyeSurfaceWantDistortion() reports false, then the
    - * display does not request distortion of any sort, and thus neither this nor
    - * any other distortion strategy priority function will report an "available"
    - * priority.
    - * @param disp Display config object
    - * @param viewer Viewer ID
    - * @param eye Eye ID
    - * @param surface Surface ID
    - * @param[out] priority Output: the priority level. Negative values
    - * (canonically OSVR_DISTORTION_PRIORITY_UNAVAILABLE) indicate this technique
    - * not available, higher values indicate higher preference for the given
    - * technique based on the device's description. **Constant** throughout the
    - * active, valid lifetime of a display config object.
    - * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in which case
    - * the output argument is unmodified.
    - * Original signature : OSVR_ReturnCode osvrClientGetViewerEyeSurfaceRadialDistortionPriority(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_SurfaceCount, OSVR_DistortionPriority*) - */ - public static native byte osvrClientGetViewerEyeSurfaceRadialDistortionPriority(OsvrDisplayLibrary.OSVR_DisplayConfig disp, int viewer, byte eye, int surface, IntBuffer priority); - /** - * @brief Returns the radial distortion parameters, if known/requested, for a
    - * surface seen by an eye of a viewer in a display config.
    - * Will only succeed if osvrClientGetViewerEyeSurfaceRadialDistortionPriority()
    - * reports a non-negative priority.
    - * @param disp Display config object
    - * @param viewer Viewer ID
    - * @param eye Eye ID
    - * @param surface Surface ID
    - * @param[out] params Output: the parameters for radial distortion
    - * @return OSVR_RETURN_FAILURE if this surface does not have these parameters
    - * described, or if invalid parameters were passed, in which case the output
    - * argument is unmodified.
    - * Original signature : OSVR_ReturnCode osvrClientGetViewerEyeSurfaceRadialDistortion(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_SurfaceCount, OSVR_RadialDistortionParameters*)
    - * @deprecated use the safer methods {@link #osvrClientGetViewerEyeSurfaceRadialDistortion(osvrdisplay.OsvrDisplayLibrary.OSVR_DisplayConfig, int, byte, int, com.sun.jna.Pointer)} and {@link #osvrClientGetViewerEyeSurfaceRadialDistortion(com.sun.jna.Pointer, int, byte, int, com.sun.jna.Pointer)} instead - */ - @Deprecated - public static native byte osvrClientGetViewerEyeSurfaceRadialDistortion(Pointer disp, int viewer, byte eye, int surface, Pointer params); - /** - * @brief Returns the radial distortion parameters, if known/requested, for a
    - * surface seen by an eye of a viewer in a display config.
    - * Will only succeed if osvrClientGetViewerEyeSurfaceRadialDistortionPriority()
    - * reports a non-negative priority.
    - * @param disp Display config object
    - * @param viewer Viewer ID
    - * @param eye Eye ID
    - * @param surface Surface ID
    - * @param[out] params Output: the parameters for radial distortion
    - * @return OSVR_RETURN_FAILURE if this surface does not have these parameters
    - * described, or if invalid parameters were passed, in which case the output
    - * argument is unmodified.
    - * Original signature : OSVR_ReturnCode osvrClientGetViewerEyeSurfaceRadialDistortion(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_SurfaceCount, OSVR_RadialDistortionParameters*) - */ - public static native byte osvrClientGetViewerEyeSurfaceRadialDistortion(OsvrDisplayLibrary.OSVR_DisplayConfig disp, int viewer, byte eye, int surface, Pointer params); - public static class OSVR_ClientContext extends PointerType { - public OSVR_ClientContext(Pointer address) { - super(address); - } - public OSVR_ClientContext() { - super(); - } - }; - public static class OSVR_DisplayConfig extends PointerType { - public OSVR_DisplayConfig(Pointer address) { - super(address); - } - public OSVR_DisplayConfig() { - super(); - } - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrinterface/OsvrInterfaceLibrary.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrinterface/OsvrInterfaceLibrary.java deleted file mode 100644 index 2a1c69476f..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrinterface/OsvrInterfaceLibrary.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.jme3.system.osvr.osvrinterface; -import com.jme3.system.osvr.osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface; -import com.jme3.system.osvr.osvrclientreporttypes.OSVR_Pose3; -import com.jme3.system.osvr.osvrtimevalue.OSVR_TimeValue; -import com.sun.jna.Library; -import com.sun.jna.Native; -import com.sun.jna.NativeLibrary; -/** - * JNA Wrapper for library osvrInterface
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OsvrInterfaceLibrary implements Library { - public static final String JNA_LIBRARY_NAME = "osvrClientKit"; - public static final NativeLibrary JNA_NATIVE_LIB = NativeLibrary.getInstance(OsvrInterfaceLibrary.JNA_LIBRARY_NAME); - static { - Native.register(OsvrInterfaceLibrary.class, OsvrInterfaceLibrary.JNA_NATIVE_LIB); - } - - /** Manually added */ - public static native byte osvrGetPoseState(OSVR_ClientInterface iface, OSVR_TimeValue timestamp, OSVR_Pose3 state); - -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrmatrixconventions/OSVR_Pose3.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrmatrixconventions/OSVR_Pose3.java deleted file mode 100644 index 8925e2c6e2..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrmatrixconventions/OSVR_Pose3.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.jme3.system.osvr.osvrmatrixconventions; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_Pose3 extends Structure { - /** C type : OSVR_Vec3 */ - public OSVR_Vec3 translation; - /** C type : OSVR_Quaternion */ - public OSVR_Quaternion rotation; - public OSVR_Pose3() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("translation", "rotation"); - } - /** - * @param translation C type : OSVR_Vec3
    - * @param rotation C type : OSVR_Quaternion - */ - public OSVR_Pose3(OSVR_Vec3 translation, OSVR_Quaternion rotation) { - super(); - this.translation = translation; - this.rotation = rotation; - } - public OSVR_Pose3(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_Pose3 implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_Pose3 implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrmatrixconventions/OSVR_Quaternion.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrmatrixconventions/OSVR_Quaternion.java deleted file mode 100644 index 04c9145941..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrmatrixconventions/OSVR_Quaternion.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.jme3.system.osvr.osvrmatrixconventions; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_Quaternion extends Structure { - /** C type : double[4] */ - public double[] data = new double[4]; - public OSVR_Quaternion() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("data"); - } - /** @param data C type : double[4] */ - public OSVR_Quaternion(double data[]) { - super(); - if ((data.length != this.data.length)) - throw new IllegalArgumentException("Wrong array size !"); - this.data = data; - } - public OSVR_Quaternion(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_Quaternion implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_Quaternion implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrmatrixconventions/OSVR_Vec3.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrmatrixconventions/OSVR_Vec3.java deleted file mode 100644 index 31db1607ae..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrmatrixconventions/OSVR_Vec3.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.jme3.system.osvr.osvrmatrixconventions; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_Vec3 extends Structure { - /** C type : double[3] */ - public double[] data = new double[3]; - public OSVR_Vec3() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("data"); - } - /** @param data C type : double[3] */ - public OSVR_Vec3(double data[]) { - super(); - if ((data.length != this.data.length)) - throw new IllegalArgumentException("Wrong array size !"); - this.data = data; - } - public OSVR_Vec3(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_Vec3 implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_Vec3 implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrmatrixconventions/OsvrMatrixConventionsLibrary.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrmatrixconventions/OsvrMatrixConventionsLibrary.java deleted file mode 100644 index e32f3813a0..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrmatrixconventions/OsvrMatrixConventionsLibrary.java +++ /dev/null @@ -1,182 +0,0 @@ -package com.jme3.system.osvr.osvrmatrixconventions; -import com.sun.jna.Library; -import com.sun.jna.Native; -import com.sun.jna.NativeLibrary; -import com.sun.jna.Pointer; -import com.sun.jna.PointerType; -import com.sun.jna.ptr.DoubleByReference; -import com.sun.jna.ptr.FloatByReference; -import java.nio.DoubleBuffer; -import java.nio.FloatBuffer; -/** - * JNA Wrapper for library osvrMatrixConventions
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OsvrMatrixConventionsLibrary implements Library { - public static final String JNA_LIBRARY_NAME = "osvrUtil"; - public static final NativeLibrary JNA_NATIVE_LIB = NativeLibrary.getInstance(OsvrMatrixConventionsLibrary.JNA_LIBRARY_NAME); - static { - Native.register(OsvrMatrixConventionsLibrary.class, OsvrMatrixConventionsLibrary.JNA_NATIVE_LIB); - } - /** enum values */ - public static interface OSVR_MatrixMasks { - public static final int OSVR_MATRIX_MASK_ROWMAJOR = 0x1; - public static final int OSVR_MATRIX_MASK_ROWVECTORS = 0x2; - public static final int OSVR_MATRIX_MASK_LHINPUT = 0x4; - public static final int OSVR_MATRIX_MASK_UNSIGNEDZ = 0x8; - }; - /** enum values */ - public static interface OSVR_MatrixOrderingFlags { - public static final int OSVR_MATRIX_COLMAJOR = 0x0; - public static final int OSVR_MATRIX_ROWMAJOR = (int)OsvrMatrixConventionsLibrary.OSVR_MatrixMasks.OSVR_MATRIX_MASK_ROWMAJOR; - }; - /** enum values */ - public static interface OSVR_MatrixVectorFlags { - public static final int OSVR_MATRIX_COLVECTORS = 0x0; - public static final int OSVR_MATRIX_ROWVECTORS = (int)OsvrMatrixConventionsLibrary.OSVR_MatrixMasks.OSVR_MATRIX_MASK_ROWVECTORS; - }; - /** enum values */ - public static interface OSVR_ProjectionMatrixInputFlags { - public static final int OSVR_MATRIX_RHINPUT = 0x0; - public static final int OSVR_MATRIX_LHINPUT = (int)OsvrMatrixConventionsLibrary.OSVR_MatrixMasks.OSVR_MATRIX_MASK_LHINPUT; - }; - /** enum values */ - public static interface OSVR_ProjectionMatrixZFlags { - public static final int OSVR_MATRIX_SIGNEDZ = 0x0; - public static final int OSVR_MATRIX_UNSIGNEDZ = (int)OsvrMatrixConventionsLibrary.OSVR_MatrixMasks.OSVR_MATRIX_MASK_UNSIGNEDZ; - }; - public static final int OSVR_MATRIX_SIZE = 16; - public static final int OSVR_RETURN_SUCCESS = (int)(0); - public static final int OSVR_RETURN_FAILURE = (int)(1); - /** Original signature : double osvrVec3GetX(const OSVR_Vec3*) */ - public static native double osvrVec3GetX(OSVR_Vec3 v); - /** Original signature : void osvrVec3SetX(OSVR_Vec3*, double) */ - public static native void osvrVec3SetX(OSVR_Vec3 v, double val); - /** Original signature : double osvrVec3GetY(const OSVR_Vec3*) */ - public static native double osvrVec3GetY(OSVR_Vec3 v); - /** Original signature : void osvrVec3SetY(OSVR_Vec3*, double) */ - public static native void osvrVec3SetY(OSVR_Vec3 v, double val); - /** Original signature : double osvrVec3GetZ(const OSVR_Vec3*) */ - public static native double osvrVec3GetZ(OSVR_Vec3 v); - /** Original signature : void osvrVec3SetZ(OSVR_Vec3*, double) */ - public static native void osvrVec3SetZ(OSVR_Vec3 v, double val); - /** - * @brief Set a Vec3 to the zero vector
    - * Original signature : void osvrVec3Zero(OSVR_Vec3*) - */ - public static native void osvrVec3Zero(OSVR_Vec3 v); - /** Original signature : double osvrQuatGetW(const OSVR_Quaternion*) */ - public static native double osvrQuatGetW(OSVR_Quaternion q); - /** Original signature : void osvrQuatSetW(OSVR_Quaternion*, double) */ - public static native void osvrQuatSetW(OSVR_Quaternion q, double val); - /** Original signature : double osvrQuatGetX(const OSVR_Quaternion*) */ - public static native double osvrQuatGetX(OSVR_Quaternion q); - /** Original signature : void osvrQuatSetX(OSVR_Quaternion*, double) */ - public static native void osvrQuatSetX(OSVR_Quaternion q, double val); - /** Original signature : double osvrQuatGetY(const OSVR_Quaternion*) */ - public static native double osvrQuatGetY(OSVR_Quaternion q); - /** Original signature : void osvrQuatSetY(OSVR_Quaternion*, double) */ - public static native void osvrQuatSetY(OSVR_Quaternion q, double val); - /** Original signature : double osvrQuatGetZ(const OSVR_Quaternion*) */ - public static native double osvrQuatGetZ(OSVR_Quaternion q); - /** Original signature : void osvrQuatSetZ(OSVR_Quaternion*, double) */ - public static native void osvrQuatSetZ(OSVR_Quaternion q, double val); - /** - * @brief Set a quaternion to the identity rotation
    - * Original signature : void osvrQuatSetIdentity(OSVR_Quaternion*) - */ - public static native void osvrQuatSetIdentity(OSVR_Quaternion q); - /** - * @brief Set a pose to identity
    - * Original signature : void osvrPose3SetIdentity(OSVR_Pose3*) - */ - public static native void osvrPose3SetIdentity(OSVR_Pose3 pose); - /** - * @brief Set a matrix of doubles based on a Pose3.
    - * @param pose The Pose3 to convert
    - * @param flags Memory ordering flag - see @ref MatrixFlags
    - * @param[out] mat an array of 16 doubles
    - * Original signature : OSVR_ReturnCode osvrPose3ToMatrixd(const OSVR_Pose3*, OSVR_MatrixConventions, double*)
    - * @deprecated use the safer methods {@link #osvrPose3ToMatrixd(osvrmatrixconventions.OSVR_Pose3, short, java.nio.DoubleBuffer)} and {@link #osvrPose3ToMatrixd(osvrmatrixconventions.OSVR_Pose3, short, com.sun.jna.ptr.DoubleByReference)} instead - */ - @Deprecated - public static native byte osvrPose3ToMatrixd(OSVR_Pose3 pose, short flags, DoubleByReference mat); - /** - * @brief Set a matrix of doubles based on a Pose3.
    - * @param pose The Pose3 to convert
    - * @param flags Memory ordering flag - see @ref MatrixFlags
    - * @param[out] mat an array of 16 doubles
    - * Original signature : OSVR_ReturnCode osvrPose3ToMatrixd(const OSVR_Pose3*, OSVR_MatrixConventions, double*) - */ - public static native byte osvrPose3ToMatrixd(OSVR_Pose3 pose, short flags, DoubleBuffer mat); - /** - * @brief Set a matrix of floats based on a Pose3.
    - * @param pose The Pose3 to convert
    - * @param flags Memory ordering flag - see @ref MatrixFlags
    - * @param[out] mat an array of 16 floats
    - * Original signature : OSVR_ReturnCode osvrPose3ToMatrixf(const OSVR_Pose3*, OSVR_MatrixConventions, float*)
    - * @deprecated use the safer methods {@link #osvrPose3ToMatrixf(osvrmatrixconventions.OSVR_Pose3, short, java.nio.FloatBuffer)} and {@link #osvrPose3ToMatrixf(osvrmatrixconventions.OSVR_Pose3, short, com.sun.jna.ptr.FloatByReference)} instead - */ - @Deprecated - public static native byte osvrPose3ToMatrixf(OSVR_Pose3 pose, short flags, FloatByReference mat); - /** - * @brief Set a matrix of floats based on a Pose3.
    - * @param pose The Pose3 to convert
    - * @param flags Memory ordering flag - see @ref MatrixFlags
    - * @param[out] mat an array of 16 floats
    - * Original signature : OSVR_ReturnCode osvrPose3ToMatrixf(const OSVR_Pose3*, OSVR_MatrixConventions, float*) - */ - public static native byte osvrPose3ToMatrixf(OSVR_Pose3 pose, short flags, FloatBuffer mat); - /** - * @brief Set a matrix based on a Pose3. (C++-only overload - detecting scalar
    - * type)
    - * Original signature : OSVR_ReturnCode osvrPose3ToMatrix(const OSVR_Pose3*, OSVR_MatrixConventions, double*)
    - * @deprecated use the safer methods {@link #osvrPose3ToMatrix(osvrmatrixconventions.OSVR_Pose3, short, java.nio.DoubleBuffer)} and {@link #osvrPose3ToMatrix(osvrmatrixconventions.OSVR_Pose3, short, com.sun.jna.ptr.DoubleByReference)} instead - */ - @Deprecated - public static native byte osvrPose3ToMatrix(OSVR_Pose3 pose, short flags, DoubleByReference mat); - /** - * @brief Set a matrix based on a Pose3. (C++-only overload - detecting scalar
    - * type)
    - * Original signature : OSVR_ReturnCode osvrPose3ToMatrix(const OSVR_Pose3*, OSVR_MatrixConventions, double*) - */ - public static native byte osvrPose3ToMatrix(OSVR_Pose3 pose, short flags, DoubleBuffer mat); - /** - * @brief Set a matrix based on a Pose3. (C++-only overload - detecting scalar
    - * type)
    - * Original signature : OSVR_ReturnCode osvrPose3ToMatrix(const OSVR_Pose3*, OSVR_MatrixConventions, float*)
    - * @deprecated use the safer methods {@link #osvrPose3ToMatrix(osvrmatrixconventions.OSVR_Pose3, short, java.nio.FloatBuffer)} and {@link #osvrPose3ToMatrix(osvrmatrixconventions.OSVR_Pose3, short, com.sun.jna.ptr.FloatByReference)} instead - */ - @Deprecated - public static native byte osvrPose3ToMatrix(OSVR_Pose3 pose, short flags, FloatByReference mat); - /** - * @brief Set a matrix based on a Pose3. (C++-only overload - detecting scalar
    - * type)
    - * Original signature : OSVR_ReturnCode osvrPose3ToMatrix(const OSVR_Pose3*, OSVR_MatrixConventions, float*) - */ - public static native byte osvrPose3ToMatrix(OSVR_Pose3 pose, short flags, FloatBuffer mat); - /** - * @brief Set a matrix based on a Pose3. (C++-only overload - detects scalar
    - * and takes array rather than pointer)
    - * Original signature : OSVR_ReturnCode osvrPose3ToMatrix(const OSVR_Pose3*, OSVR_MatrixConventions, Scalar[OSVR_MATRIX_SIZE])
    - * @deprecated use the safer methods {@link #osvrPose3ToMatrix(osvrmatrixconventions.OSVR_Pose3, short, osvrmatrixconventions.OsvrMatrixConventionsLibrary.Scalar[])} and {@link #osvrPose3ToMatrix(osvrmatrixconventions.OSVR_Pose3, short, com.sun.jna.Pointer)} instead - */ - @Deprecated - public static native byte osvrPose3ToMatrix(OSVR_Pose3 pose, short flags, Pointer mat); - /** - * @brief Set a matrix based on a Pose3. (C++-only overload - detects scalar
    - * and takes array rather than pointer)
    - * Original signature : OSVR_ReturnCode osvrPose3ToMatrix(const OSVR_Pose3*, OSVR_MatrixConventions, Scalar[OSVR_MATRIX_SIZE]) - */ - public static native byte osvrPose3ToMatrix(OSVR_Pose3 pose, short flags, OsvrMatrixConventionsLibrary.Scalar mat[]); - public static class Scalar extends PointerType { - public Scalar(Pointer address) { - super(address); - } - public Scalar() { - super(); - } - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanager/OSVR_ProjectionMatrix.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanager/OSVR_ProjectionMatrix.java deleted file mode 100644 index 16a1dc6b41..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanager/OSVR_ProjectionMatrix.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.jme3.system.osvr.osvrrendermanager; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_ProjectionMatrix extends Structure { - public double left; - public double right; - public double top; - public double bottom; - /** < Cannot name "near" because Visual Studio keyword */ - public double nearClip; - public double farClip; - public OSVR_ProjectionMatrix() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("left", "right", "top", "bottom", "nearClip", "farClip"); - } - /** @param nearClip < Cannot name "near" because Visual Studio keyword */ - public OSVR_ProjectionMatrix(double left, double right, double top, double bottom, double nearClip, double farClip) { - super(); - this.left = left; - this.right = right; - this.top = top; - this.bottom = bottom; - this.nearClip = nearClip; - this.farClip = farClip; - } - public OSVR_ProjectionMatrix(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_ProjectionMatrix implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_ProjectionMatrix implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanager/OSVR_RGB.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanager/OSVR_RGB.java deleted file mode 100644 index 09695a57b8..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanager/OSVR_RGB.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.jme3.system.osvr.osvrrendermanager; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_RGB extends Structure { - public float r; - public float g; - public float b; - public OSVR_RGB() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("r", "g", "b"); - } - public OSVR_RGB(float r, float g, float b) { - super(); - this.r = r; - this.g = g; - this.b = b; - } - public OSVR_RGB(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_RGB implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_RGB implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanager/OSVR_RenderParams.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanager/OSVR_RenderParams.java deleted file mode 100644 index 742175010c..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanager/OSVR_RenderParams.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.jme3.system.osvr.osvrrendermanager; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_RenderParams extends Structure { - /** - * < Room space to insert
    - * C type : OSVR_PoseState* - */ - public Pointer worldFromRoomAppend; - /** - * < Overrides head space
    - * C type : OSVR_PoseState* - */ - public Pointer roomFromHeadReplace; - public double nearClipDistanceMeters; - public double farClipDistanceMeters; - public OSVR_RenderParams() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("worldFromRoomAppend", "roomFromHeadReplace", "nearClipDistanceMeters", "farClipDistanceMeters"); - } - /** - * @param worldFromRoomAppend < Room space to insert
    - * C type : OSVR_PoseState*
    - * @param roomFromHeadReplace < Overrides head space
    - * C type : OSVR_PoseState* - */ - public OSVR_RenderParams(Pointer worldFromRoomAppend, Pointer roomFromHeadReplace, double nearClipDistanceMeters, double farClipDistanceMeters) { - super(); - this.worldFromRoomAppend = worldFromRoomAppend; - this.roomFromHeadReplace = roomFromHeadReplace; - this.nearClipDistanceMeters = nearClipDistanceMeters; - this.farClipDistanceMeters = farClipDistanceMeters; - } - public OSVR_RenderParams(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_RenderParams implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_RenderParams implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanager/OSVR_ViewportDescription.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanager/OSVR_ViewportDescription.java deleted file mode 100644 index e3528fad01..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanager/OSVR_ViewportDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.jme3.system.osvr.osvrrendermanager; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_ViewportDescription extends Structure { - /** < Left side of the viewport in pixels */ - public double left; - /** < First pixel in the viewport at the bottom. */ - public double lower; - /** < Last pixel in the viewport at the top */ - public double width; - /** < Last pixel on the right of the viewport in pixels */ - public double height; - public OSVR_ViewportDescription() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("left", "lower", "width", "height"); - } - /** - * @param left < Left side of the viewport in pixels
    - * @param lower < First pixel in the viewport at the bottom.
    - * @param width < Last pixel in the viewport at the top
    - * @param height < Last pixel on the right of the viewport in pixels - */ - public OSVR_ViewportDescription(double left, double lower, double width, double height) { - super(); - this.left = left; - this.lower = lower; - this.width = width; - this.height = height; - } - public OSVR_ViewportDescription(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_ViewportDescription implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_ViewportDescription implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanager/OsvrRenderManagerLibrary.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanager/OsvrRenderManagerLibrary.java deleted file mode 100644 index 64e71afc6d..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanager/OsvrRenderManagerLibrary.java +++ /dev/null @@ -1,117 +0,0 @@ -package com.jme3.system.osvr.osvrrendermanager; -import com.ochafik.lang.jnaerator.runtime.NativeSizeByReference; -import com.sun.jna.Library; -import com.sun.jna.Native; -import com.sun.jna.NativeLibrary; -import com.sun.jna.Pointer; -import com.sun.jna.ptr.DoubleByReference; -import com.sun.jna.ptr.FloatByReference; -import com.sun.jna.ptr.PointerByReference; -import java.nio.DoubleBuffer; -import java.nio.FloatBuffer; -/** - * JNA Wrapper for library osvrRenderManager
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OsvrRenderManagerLibrary implements Library { - public static final String JNA_LIBRARY_NAME = "osvrRenderManager"; - public static final NativeLibrary JNA_NATIVE_LIB = NativeLibrary.getInstance(OsvrRenderManagerLibrary.JNA_LIBRARY_NAME); - static { - Native.register(OsvrRenderManagerLibrary.class, OsvrRenderManagerLibrary.JNA_NATIVE_LIB); - } - /** enum values */ - public static interface OSVR_OpenStatus { - public static final int OSVR_OPEN_STATUS_FAILURE = 0; - public static final int OSVR_OPEN_STATUS_PARTIAL = 1; - public static final int OSVR_OPEN_STATUS_COMPLETE = 2; - }; - /** - * @todo OSVR_RenderTimingInfo
    - * Original signature : OSVR_ReturnCode osvrDestroyRenderManager(OSVR_RenderManager) - */ - public static native byte osvrDestroyRenderManager(Pointer renderManager); - /** - * @todo Make this actually cache, for now it does not.
    - * Original signature : OSVR_ReturnCode osvrRenderManagerGetNumRenderInfo(OSVR_RenderManager, OSVR_RenderParams, OSVR_RenderInfoCount*) - */ - public static native byte osvrRenderManagerGetNumRenderInfo(Pointer renderManager, OSVR_RenderParams.ByValue renderParams, NativeSizeByReference numRenderInfoOut); - /** Original signature : OSVR_ReturnCode osvrRenderManagerGetDoingOkay(OSVR_RenderManager) */ - public static native byte osvrRenderManagerGetDoingOkay(Pointer renderManager); - /** Original signature : OSVR_ReturnCode osvrRenderManagerGetDefaultRenderParams(OSVR_RenderParams*) */ - public static native byte osvrRenderManagerGetDefaultRenderParams(OSVR_RenderParams renderParamsOut); - /** - * must be registered before they are presented.
    - * Original signature : OSVR_ReturnCode osvrRenderManagerStartPresentRenderBuffers(OSVR_RenderManagerPresentState*) - */ - public static native byte osvrRenderManagerStartPresentRenderBuffers(PointerByReference presentStateOut); - /** - * buffers for a single frame. This sequence starts with the Start function.
    - * Original signature : OSVR_ReturnCode osvrRenderManagerFinishPresentRenderBuffers(OSVR_RenderManager, OSVR_RenderManagerPresentState, OSVR_RenderParams, OSVR_CBool) - */ - public static native byte osvrRenderManagerFinishPresentRenderBuffers(Pointer renderManager, Pointer presentState, OSVR_RenderParams.ByValue renderParams, byte shouldFlipY); - /** - * must be registered before they are presented.
    - * Original signature : OSVR_ReturnCode osvrRenderManagerStartRegisterRenderBuffers(OSVR_RenderManagerRegisterBufferState*) - */ - public static native byte osvrRenderManagerStartRegisterRenderBuffers(PointerByReference registerBufferStateOut); - /** - * buffers for a single frame. This sequence starts with the Start function.
    - * Original signature : OSVR_ReturnCode osvrRenderManagerFinishRegisterRenderBuffers(OSVR_RenderManager, OSVR_RenderManagerRegisterBufferState, OSVR_CBool) - */ - public static native byte osvrRenderManagerFinishRegisterRenderBuffers(Pointer renderManager, Pointer registerBufferState, byte appWillNotOverwriteBeforeNewPresent); - /** Original signature : OSVR_ReturnCode osvrRenderManagerPresentSolidColorf(OSVR_RenderManager, OSVR_RGB_FLOAT) */ - public static native byte osvrRenderManagerPresentSolidColorf(Pointer renderManager, com.jme3.system.osvr.osvrrendermanager.OSVR_RGB.ByValue rgb); - /** - * when you're done.
    - * Original signature : OSVR_ReturnCode osvrRenderManagerGetRenderInfoCollection(OSVR_RenderManager, OSVR_RenderParams, OSVR_RenderInfoCollection*) - */ - public static native byte osvrRenderManagerGetRenderInfoCollection(Pointer renderManager, OSVR_RenderParams.ByValue renderParams, PointerByReference renderInfoCollectionOut); - /** - * Releases the OSVR_RenderInfoCollection.
    - * Original signature : OSVR_ReturnCode osvrRenderManagerReleaseRenderInfoCollection(OSVR_RenderInfoCollection) - */ - public static native byte osvrRenderManagerReleaseRenderInfoCollection(Pointer renderInfoCollection); - /** - * Get the size of the OSVR_RenderInfoCollection.
    - * Original signature : OSVR_ReturnCode osvrRenderManagerGetNumRenderInfoInCollection(OSVR_RenderInfoCollection, OSVR_RenderInfoCount*) - */ - public static native byte osvrRenderManagerGetNumRenderInfoInCollection(Pointer renderInfoCollection, NativeSizeByReference countOut); - /** - * @return True on success, false on failure (null pointer).
    - * Original signature : OSVR_ReturnCode OSVR_Projection_to_OpenGL(double*, OSVR_ProjectionMatrix)
    - * @deprecated use the safer methods {@link #OSVR_Projection_to_OpenGL(java.nio.DoubleBuffer, com.jme3.system.osvr.osvrrendermanager.OSVR_ProjectionMatrix.ByValue)} and {@link #OSVR_Projection_to_OpenGL(com.sun.jna.ptr.DoubleByReference, com.jme3.system.osvr.osvrrendermanager.OSVR_ProjectionMatrix.ByValue)} instead - */ - @Deprecated - public static native byte OSVR_Projection_to_OpenGL(DoubleByReference OpenGL_out, com.jme3.system.osvr.osvrrendermanager.OSVR_ProjectionMatrix.ByValue projection_in); - /** - * @return True on success, false on failure (null pointer).
    - * Original signature : OSVR_ReturnCode OSVR_Projection_to_OpenGL(double*, OSVR_ProjectionMatrix) - */ - public static native byte OSVR_Projection_to_OpenGL(DoubleBuffer OpenGL_out, com.jme3.system.osvr.osvrrendermanager.OSVR_ProjectionMatrix.ByValue projection_in); - /** - * @return True on success, false on failure (null pointer).
    - * Original signature : OSVR_ReturnCode OSVR_Projection_to_D3D(float[16], OSVR_ProjectionMatrix)
    - * @deprecated use the safer methods {@link #OSVR_Projection_to_D3D(java.nio.FloatBuffer, com.jme3.system.osvr.osvrrendermanager.OSVR_ProjectionMatrix.ByValue)} and {@link #OSVR_Projection_to_D3D(com.sun.jna.ptr.FloatByReference, com.jme3.system.osvr.osvrrendermanager.OSVR_ProjectionMatrix.ByValue)} instead - */ - @Deprecated - public static native byte OSVR_Projection_to_D3D(FloatByReference D3D_out, com.jme3.system.osvr.osvrrendermanager.OSVR_ProjectionMatrix.ByValue projection_in); - /** - * @return True on success, false on failure (null pointer).
    - * Original signature : OSVR_ReturnCode OSVR_Projection_to_D3D(float[16], OSVR_ProjectionMatrix) - */ - public static native byte OSVR_Projection_to_D3D(FloatBuffer D3D_out, com.jme3.system.osvr.osvrrendermanager.OSVR_ProjectionMatrix.ByValue projection_in); - /** - * @return True on success, false on failure (null pointer).
    - * Original signature : OSVR_ReturnCode OSVR_Projection_to_Unreal(float[16], OSVR_ProjectionMatrix)
    - * @deprecated use the safer methods {@link #OSVR_Projection_to_Unreal(java.nio.FloatBuffer, com.jme3.system.osvr.osvrrendermanager.OSVR_ProjectionMatrix.ByValue)} and {@link #OSVR_Projection_to_Unreal(com.sun.jna.ptr.FloatByReference, com.jme3.system.osvr.osvrrendermanager.OSVR_ProjectionMatrix.ByValue)} instead - */ - @Deprecated - public static native byte OSVR_Projection_to_Unreal(FloatByReference Unreal_out, com.jme3.system.osvr.osvrrendermanager.OSVR_ProjectionMatrix.ByValue projection_in); - /** - * @return True on success, false on failure (null pointer).
    - * Original signature : OSVR_ReturnCode OSVR_Projection_to_Unreal(float[16], OSVR_ProjectionMatrix) - */ - public static native byte OSVR_Projection_to_Unreal(FloatBuffer Unreal_out, com.jme3.system.osvr.osvrrendermanager.OSVR_ProjectionMatrix.ByValue projection_in); -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_GraphicsLibraryOpenGL.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_GraphicsLibraryOpenGL.java deleted file mode 100644 index 626609e081..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_GraphicsLibraryOpenGL.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.jme3.system.osvr.osvrrendermanageropengl; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_GraphicsLibraryOpenGL extends Structure { - /** C type : const OSVR_OpenGLToolkitFunctions* */ - public com.jme3.system.osvr.osvrrendermanageropengl.OSVR_OpenGLToolkitFunctions.ByReference toolkit; - public OSVR_GraphicsLibraryOpenGL() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("toolkit"); - } - /** @param toolkit C type : const OSVR_OpenGLToolkitFunctions* */ - public OSVR_GraphicsLibraryOpenGL(com.jme3.system.osvr.osvrrendermanageropengl.OSVR_OpenGLToolkitFunctions.ByReference toolkit) { - super(); - this.toolkit = toolkit; - } - public OSVR_GraphicsLibraryOpenGL(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_GraphicsLibraryOpenGL implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_GraphicsLibraryOpenGL implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_OpenGLContextParams.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_OpenGLContextParams.java deleted file mode 100644 index 71a67ee1a0..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_OpenGLContextParams.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.jme3.system.osvr.osvrrendermanageropengl; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_OpenGLContextParams extends Structure { - /** C type : const char* */ - public Pointer windowTitle; - /** C type : OSVR_CBool */ - public byte fullScreen; - public int width; - public int height; - public int xPos; - public int yPos; - public int bitsPerPixel; - public int numBuffers; - /** C type : OSVR_CBool */ - public byte visible; - public OSVR_OpenGLContextParams() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("windowTitle", "fullScreen", "width", "height", "xPos", "yPos", "bitsPerPixel", "numBuffers", "visible"); - } - /** - * @param windowTitle C type : const char*
    - * @param fullScreen C type : OSVR_CBool
    - * @param visible C type : OSVR_CBool - */ - public OSVR_OpenGLContextParams(Pointer windowTitle, byte fullScreen, int width, int height, int xPos, int yPos, int bitsPerPixel, int numBuffers, byte visible) { - super(); - this.windowTitle = windowTitle; - this.fullScreen = fullScreen; - this.width = width; - this.height = height; - this.xPos = xPos; - this.yPos = yPos; - this.bitsPerPixel = bitsPerPixel; - this.numBuffers = numBuffers; - this.visible = visible; - } - public OSVR_OpenGLContextParams(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_OpenGLContextParams implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_OpenGLContextParams implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_OpenGLToolkitFunctions.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_OpenGLToolkitFunctions.java deleted file mode 100644 index 0b996bcecd..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_OpenGLToolkitFunctions.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.jme3.system.osvr.osvrrendermanageropengl; -import com.ochafik.lang.jnaerator.runtime.NativeSize; -import com.sun.jna.Callback; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.ptr.IntByReference; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_OpenGLToolkitFunctions extends Structure { - public NativeSize size; - /** C type : void* */ - public Pointer data; - /** C type : create_callback* */ - public OSVR_OpenGLToolkitFunctions.create_callback create; - /** C type : destroy_callback* */ - public OSVR_OpenGLToolkitFunctions.destroy_callback destroy; - /** C type : handleEvents_callback* */ - public OSVR_OpenGLToolkitFunctions.handleEvents_callback handleEvents; - /** C type : getDisplayFrameBuffer_callback* */ - public OSVR_OpenGLToolkitFunctions.getDisplayFrameBuffer_callback getDisplayFrameBuffer; - /** C type : getDisplaySizeOverride_callback* */ - public OSVR_OpenGLToolkitFunctions.getDisplaySizeOverride_callback getDisplaySizeOverride; - public interface create_callback extends Callback { - void apply(Pointer data); - }; - public interface destroy_callback extends Callback { - void apply(Pointer data); - }; - public interface OSVR_CBool_callback extends Callback { - int apply(Pointer data, OSVR_OpenGLContextParams p); - }; - public interface OSVR_CBool_callback2 extends Callback { - int apply(Pointer data); - }; - public interface OSVR_CBool_callback3 extends Callback { - int apply(Pointer data, NativeSize display); - }; - public interface OSVR_CBool_callback4 extends Callback { - int apply(Pointer data, NativeSize display); - }; - public interface OSVR_CBool_callback5 extends Callback { - int apply(Pointer data, byte verticalSync); - }; - public interface handleEvents_callback extends Callback { - byte apply(Pointer data); - }; - public interface getDisplayFrameBuffer_callback extends Callback { - byte apply(Pointer data, NativeSize display, IntByReference frameBufferOut); - }; - public interface getDisplaySizeOverride_callback extends Callback { - byte apply(Pointer data, NativeSize display, IntByReference width, IntByReference height); - }; - public OSVR_OpenGLToolkitFunctions() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("size", "data", "create", "destroy", "handleEvents", "getDisplayFrameBuffer", "getDisplaySizeOverride"); - } - /** - * @param data C type : void*
    - * @param create C type : create_callback*
    - * @param destroy C type : destroy_callback*
    - * @param handleEvents C type : handleEvents_callback*
    - * @param getDisplayFrameBuffer C type : getDisplayFrameBuffer_callback*
    - * @param getDisplaySizeOverride C type : getDisplaySizeOverride_callback* - */ - public OSVR_OpenGLToolkitFunctions(NativeSize size, Pointer data, OSVR_OpenGLToolkitFunctions.create_callback create, OSVR_OpenGLToolkitFunctions.destroy_callback destroy, OSVR_OpenGLToolkitFunctions.handleEvents_callback handleEvents, OSVR_OpenGLToolkitFunctions.getDisplayFrameBuffer_callback getDisplayFrameBuffer, OSVR_OpenGLToolkitFunctions.getDisplaySizeOverride_callback getDisplaySizeOverride) { - super(); - this.size = size; - this.data = data; - this.create = create; - this.destroy = destroy; - this.handleEvents = handleEvents; - this.getDisplayFrameBuffer = getDisplayFrameBuffer; - this.getDisplaySizeOverride = getDisplaySizeOverride; - } - public OSVR_OpenGLToolkitFunctions(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_OpenGLToolkitFunctions implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_OpenGLToolkitFunctions implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_OpenResultsOpenGL.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_OpenResultsOpenGL.java deleted file mode 100644 index 7032d84576..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_OpenResultsOpenGL.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.jme3.system.osvr.osvrrendermanageropengl; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_OpenResultsOpenGL extends Structure { - /** - * @see OSVR_OpenStatus
    - * C type : OSVR_OpenStatus - */ - public int status; - /** C type : OSVR_GraphicsLibraryOpenGL */ - public OSVR_GraphicsLibraryOpenGL library; - /** C type : OSVR_RenderBufferOpenGL */ - public OSVR_RenderBufferOpenGL buffers; - public OSVR_OpenResultsOpenGL() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("status", "library", "buffers"); - } - /** - * @param status @see OSVR_OpenStatus
    - * C type : OSVR_OpenStatus
    - * @param library C type : OSVR_GraphicsLibraryOpenGL
    - * @param buffers C type : OSVR_RenderBufferOpenGL - */ - public OSVR_OpenResultsOpenGL(int status, OSVR_GraphicsLibraryOpenGL library, OSVR_RenderBufferOpenGL buffers) { - super(); - this.status = status; - this.library = library; - this.buffers = buffers; - } - public OSVR_OpenResultsOpenGL(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_OpenResultsOpenGL implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_OpenResultsOpenGL implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_ProjectionMatrix.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_ProjectionMatrix.java deleted file mode 100644 index 5aabd88447..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_ProjectionMatrix.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.jme3.system.osvr.osvrrendermanageropengl; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_ProjectionMatrix extends Structure { - public double left; - public double right; - public double top; - public double bottom; - /** < Cannot name "near" because Visual Studio keyword */ - public double nearClip; - public double farClip; - public OSVR_ProjectionMatrix() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("left", "right", "top", "bottom", "nearClip", "farClip"); - } - /** @param nearClip < Cannot name "near" because Visual Studio keyword */ - public OSVR_ProjectionMatrix(double left, double right, double top, double bottom, double nearClip, double farClip) { - super(); - this.left = left; - this.right = right; - this.top = top; - this.bottom = bottom; - this.nearClip = nearClip; - this.farClip = farClip; - } - public OSVR_ProjectionMatrix(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_ProjectionMatrix implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_ProjectionMatrix implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_RGB.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_RGB.java deleted file mode 100644 index fb5a925b35..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_RGB.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.jme3.system.osvr.osvrrendermanageropengl; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_RGB extends Structure { - public float r; - public float g; - public float b; - public OSVR_RGB() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("r", "g", "b"); - } - public OSVR_RGB(float r, float g, float b) { - super(); - this.r = r; - this.g = g; - this.b = b; - } - public OSVR_RGB(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_RGB implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_RGB implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_RenderBufferOpenGL.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_RenderBufferOpenGL.java deleted file mode 100644 index d2488eff9e..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_RenderBufferOpenGL.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.jme3.system.osvr.osvrrendermanageropengl; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_RenderBufferOpenGL extends Structure { - public int colorBufferName; - public int depthStencilBufferName; - public OSVR_RenderBufferOpenGL() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("colorBufferName", "depthStencilBufferName"); - } - public OSVR_RenderBufferOpenGL(int colorBufferName, int depthStencilBufferName) { - super(); - this.colorBufferName = colorBufferName; - this.depthStencilBufferName = depthStencilBufferName; - } - public OSVR_RenderBufferOpenGL(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_RenderBufferOpenGL implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_RenderBufferOpenGL implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_RenderInfoOpenGL.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_RenderInfoOpenGL.java deleted file mode 100644 index 3b0e1a79f2..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_RenderInfoOpenGL.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.jme3.system.osvr.osvrrendermanageropengl; -import com.jme3.system.osvr.osvrmatrixconventions.OSVR_Pose3; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public /*abstract*/ class OSVR_RenderInfoOpenGL extends Structure { - /** C type : OSVR_GraphicsLibraryOpenGL */ - public OSVR_GraphicsLibraryOpenGL library; - /** C type : OSVR_ViewportDescription */ - public OSVR_ViewportDescription viewport; - public OSVR_Pose3 pose; - /** C type : OSVR_ProjectionMatrix */ - public OSVR_ProjectionMatrix projection; - public OSVR_RenderInfoOpenGL() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("library", "viewport", "pose", "projection"); - } - /** - * @param library C type : OSVR_GraphicsLibraryOpenGL
    - * @param viewport C type : OSVR_ViewportDescription
    - * @param projection C type : OSVR_ProjectionMatrix - */ - public OSVR_RenderInfoOpenGL(OSVR_GraphicsLibraryOpenGL library, OSVR_ViewportDescription viewport, OSVR_Pose3 pose, OSVR_ProjectionMatrix projection) { - super(); - this.library = library; - this.viewport = viewport; - this.pose = pose; - this.projection = projection; - } - public OSVR_RenderInfoOpenGL(Pointer peer) { - super(peer); - } - public static /*abstract*/ class ByReference extends OSVR_RenderInfoOpenGL implements Structure.ByReference { - - }; - public static /*abstract*/ class ByValue extends OSVR_RenderInfoOpenGL implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_RenderParams.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_RenderParams.java deleted file mode 100644 index ef560519d0..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_RenderParams.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.jme3.system.osvr.osvrrendermanageropengl; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_RenderParams extends Structure { - /** - * < Room space to insert
    - * C type : OSVR_PoseState* - */ - public Pointer worldFromRoomAppend; - /** - * < Overrides head space
    - * C type : OSVR_PoseState* - */ - public Pointer roomFromHeadReplace; - public double nearClipDistanceMeters; - public double farClipDistanceMeters; - public OSVR_RenderParams() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("worldFromRoomAppend", "roomFromHeadReplace", "nearClipDistanceMeters", "farClipDistanceMeters"); - } - /** - * @param worldFromRoomAppend < Room space to insert
    - * C type : OSVR_PoseState*
    - * @param roomFromHeadReplace < Overrides head space
    - * C type : OSVR_PoseState* - */ - public OSVR_RenderParams(Pointer worldFromRoomAppend, Pointer roomFromHeadReplace, double nearClipDistanceMeters, double farClipDistanceMeters) { - super(); - this.worldFromRoomAppend = worldFromRoomAppend; - this.roomFromHeadReplace = roomFromHeadReplace; - this.nearClipDistanceMeters = nearClipDistanceMeters; - this.farClipDistanceMeters = farClipDistanceMeters; - } - public OSVR_RenderParams(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_RenderParams implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_RenderParams implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_ViewportDescription.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_ViewportDescription.java deleted file mode 100644 index d9ff621bef..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_ViewportDescription.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.jme3.system.osvr.osvrrendermanageropengl; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_ViewportDescription extends Structure { - /** < Left side of the viewport in pixels */ - public double left; - /** < First pixel in the viewport at the bottom. */ - public double lower; - /** < Last pixel in the viewport at the top */ - public double width; - /** < Last pixel on the right of the viewport in pixels */ - public double height; - public OSVR_ViewportDescription() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("left", "lower", "width", "height"); - } - /** - * @param left < Left side of the viewport in pixels
    - * @param lower < First pixel in the viewport at the bottom.
    - * @param width < Last pixel in the viewport at the top
    - * @param height < Last pixel on the right of the viewport in pixels - */ - public OSVR_ViewportDescription(double left, double lower, double width, double height) { - super(); - this.left = left; - this.lower = lower; - this.width = width; - this.height = height; - } - public OSVR_ViewportDescription(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_ViewportDescription implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_ViewportDescription implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OsvrRenderManagerOpenGLLibrary.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OsvrRenderManagerOpenGLLibrary.java deleted file mode 100644 index 2e706c31d8..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OsvrRenderManagerOpenGLLibrary.java +++ /dev/null @@ -1,167 +0,0 @@ -package com.jme3.system.osvr.osvrrendermanageropengl; -import com.jme3.system.osvr.osvrclientkit.OsvrClientKitLibrary; -import com.ochafik.lang.jnaerator.runtime.NativeSize; -import com.ochafik.lang.jnaerator.runtime.NativeSizeByReference; -import com.sun.jna.Library; -import com.sun.jna.Native; -import com.sun.jna.NativeLibrary; -import com.sun.jna.Pointer; -import com.sun.jna.PointerType; -import com.sun.jna.ptr.DoubleByReference; -import com.sun.jna.ptr.FloatByReference; -import com.sun.jna.ptr.IntByReference; -import com.sun.jna.ptr.PointerByReference; -import java.nio.DoubleBuffer; -import java.nio.FloatBuffer; -import java.nio.IntBuffer; -/** - * JNA Wrapper for library osvrRenderManagerOpenGL
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OsvrRenderManagerOpenGLLibrary implements Library { - public static final String JNA_LIBRARY_NAME = "osvrRenderManager"; - public static final NativeLibrary JNA_NATIVE_LIB = NativeLibrary.getInstance(OsvrRenderManagerOpenGLLibrary.JNA_LIBRARY_NAME); - static { - Native.register(OsvrRenderManagerOpenGLLibrary.class, OsvrRenderManagerOpenGLLibrary.JNA_NATIVE_LIB); - } - /** enum values */ - public static interface OSVR_OpenStatus { - public static final int OSVR_OPEN_STATUS_FAILURE = 0; - public static final int OSVR_OPEN_STATUS_PARTIAL = 1; - public static final int OSVR_OPEN_STATUS_COMPLETE = 2; - }; - /** - * @todo OSVR_RenderTimingInfo
    - * Original signature : OSVR_ReturnCode osvrDestroyRenderManager(OSVR_RenderManager) - */ - public static native byte osvrDestroyRenderManager(Pointer renderManager); - /** - * @todo Make this actually cache, for now it does not.
    - * Original signature : OSVR_ReturnCode osvrRenderManagerGetNumRenderInfo(OSVR_RenderManager, OSVR_RenderParams, OSVR_RenderInfoCount*) - */ - public static native byte osvrRenderManagerGetNumRenderInfo(Pointer renderManager, OSVR_RenderParams.ByValue renderParams, NativeSizeByReference numRenderInfoOut); - /** Original signature : OSVR_ReturnCode osvrRenderManagerGetDoingOkay(OSVR_RenderManager) */ - public static native byte osvrRenderManagerGetDoingOkay(Pointer renderManager); - /** Original signature : OSVR_ReturnCode osvrRenderManagerGetDefaultRenderParams(OSVR_RenderParams*) */ - public static native byte osvrRenderManagerGetDefaultRenderParams(OSVR_RenderParams renderParamsOut); - /** - * must be registered before they are presented.
    - * Original signature : OSVR_ReturnCode osvrRenderManagerStartPresentRenderBuffers(OSVR_RenderManagerPresentState*) - */ - public static native byte osvrRenderManagerStartPresentRenderBuffers(PointerByReference presentStateOut); - /** - * buffers for a single frame. This sequence starts with the Start function.
    - * Original signature : OSVR_ReturnCode osvrRenderManagerFinishPresentRenderBuffers(OSVR_RenderManager, OSVR_RenderManagerPresentState, OSVR_RenderParams, OSVR_CBool) - */ - public static native byte osvrRenderManagerFinishPresentRenderBuffers(Pointer renderManager, Pointer presentState, OSVR_RenderParams.ByValue renderParams, byte shouldFlipY); - /** - * must be registered before they are presented.
    - * Original signature : OSVR_ReturnCode osvrRenderManagerStartRegisterRenderBuffers(OSVR_RenderManagerRegisterBufferState*) - */ - public static native byte osvrRenderManagerStartRegisterRenderBuffers(PointerByReference registerBufferStateOut); - /** - * buffers for a single frame. This sequence starts with the Start function.
    - * Original signature : OSVR_ReturnCode osvrRenderManagerFinishRegisterRenderBuffers(OSVR_RenderManager, OSVR_RenderManagerRegisterBufferState, OSVR_CBool) - */ - public static native byte osvrRenderManagerFinishRegisterRenderBuffers(Pointer renderManager, Pointer registerBufferState, byte appWillNotOverwriteBeforeNewPresent); - /** Original signature : OSVR_ReturnCode osvrRenderManagerPresentSolidColorf(OSVR_RenderManager, OSVR_RGB_FLOAT) */ - public static native byte osvrRenderManagerPresentSolidColorf(Pointer renderManager, com.jme3.system.osvr.osvrrendermanageropengl.OSVR_RGB.ByValue rgb); - /** - * when you're done.
    - * Original signature : OSVR_ReturnCode osvrRenderManagerGetRenderInfoCollection(OSVR_RenderManager, OSVR_RenderParams, OSVR_RenderInfoCollection*) - */ - public static native byte osvrRenderManagerGetRenderInfoCollection(Pointer renderManager, OSVR_RenderParams.ByValue renderParams, PointerByReference renderInfoCollectionOut); - /** - * Releases the OSVR_RenderInfoCollection.
    - * Original signature : OSVR_ReturnCode osvrRenderManagerReleaseRenderInfoCollection(OSVR_RenderInfoCollection) - */ - public static native byte osvrRenderManagerReleaseRenderInfoCollection(Pointer renderInfoCollection); - /** - * Get the size of the OSVR_RenderInfoCollection.
    - * Original signature : OSVR_ReturnCode osvrRenderManagerGetNumRenderInfoInCollection(OSVR_RenderInfoCollection, OSVR_RenderInfoCount*) - */ - public static native byte osvrRenderManagerGetNumRenderInfoInCollection(Pointer renderInfoCollection, NativeSizeByReference countOut); - /** - * @return True on success, false on failure (null pointer).
    - * Original signature : OSVR_ReturnCode OSVR_Projection_to_OpenGL(double*, OSVR_ProjectionMatrix)
    - * @deprecated use the safer methods {@link #OSVR_Projection_to_OpenGL(java.nio.DoubleBuffer, com.jme3.system.osvr.osvrrendermanageropengl.OSVR_ProjectionMatrix.ByValue)} and {@link #OSVR_Projection_to_OpenGL(com.sun.jna.ptr.DoubleByReference, com.jme3.system.osvr.osvrrendermanageropengl.OSVR_ProjectionMatrix.ByValue)} instead - */ - @Deprecated - public static native byte OSVR_Projection_to_OpenGL(DoubleByReference OpenGL_out, com.jme3.system.osvr.osvrrendermanageropengl.OSVR_ProjectionMatrix.ByValue projection_in); - /** - * @return True on success, false on failure (null pointer).
    - * Original signature : OSVR_ReturnCode OSVR_Projection_to_OpenGL(double*, OSVR_ProjectionMatrix) - */ - public static native byte OSVR_Projection_to_OpenGL(DoubleBuffer OpenGL_out, com.jme3.system.osvr.osvrrendermanageropengl.OSVR_ProjectionMatrix.ByValue projection_in); - /** - * @return True on success, false on failure (null pointer).
    - * Original signature : OSVR_ReturnCode OSVR_Projection_to_D3D(float[16], OSVR_ProjectionMatrix)
    - * @deprecated use the safer methods {@link #OSVR_Projection_to_D3D(java.nio.FloatBuffer, com.jme3.system.osvr.osvrrendermanageropengl.OSVR_ProjectionMatrix.ByValue)} and {@link #OSVR_Projection_to_D3D(com.sun.jna.ptr.FloatByReference, com.jme3.system.osvr.osvrrendermanageropengl.OSVR_ProjectionMatrix.ByValue)} instead - */ - @Deprecated - public static native byte OSVR_Projection_to_D3D(FloatByReference D3D_out, com.jme3.system.osvr.osvrrendermanageropengl.OSVR_ProjectionMatrix.ByValue projection_in); - /** - * @return True on success, false on failure (null pointer).
    - * Original signature : OSVR_ReturnCode OSVR_Projection_to_D3D(float[16], OSVR_ProjectionMatrix) - */ - public static native byte OSVR_Projection_to_D3D(FloatBuffer D3D_out, com.jme3.system.osvr.osvrrendermanageropengl.OSVR_ProjectionMatrix.ByValue projection_in); - /** - * @return True on success, false on failure (null pointer).
    - * Original signature : OSVR_ReturnCode OSVR_Projection_to_Unreal(float[16], OSVR_ProjectionMatrix)
    - * @deprecated use the safer methods {@link #OSVR_Projection_to_Unreal(java.nio.FloatBuffer, com.jme3.system.osvr.osvrrendermanageropengl.OSVR_ProjectionMatrix.ByValue)} and {@link #OSVR_Projection_to_Unreal(com.sun.jna.ptr.FloatByReference, com.jme3.system.osvr.osvrrendermanageropengl.OSVR_ProjectionMatrix.ByValue)} instead - */ - @Deprecated - public static native byte OSVR_Projection_to_Unreal(FloatByReference Unreal_out, com.jme3.system.osvr.osvrrendermanageropengl.OSVR_ProjectionMatrix.ByValue projection_in); - /** - * @return True on success, false on failure (null pointer).
    - * Original signature : OSVR_ReturnCode OSVR_Projection_to_Unreal(float[16], OSVR_ProjectionMatrix) - */ - public static native byte OSVR_Projection_to_Unreal(FloatBuffer Unreal_out, com.jme3.system.osvr.osvrrendermanageropengl.OSVR_ProjectionMatrix.ByValue projection_in); - /** - * Original signature : OSVR_ReturnCode osvrCreateRenderManagerOpenGL(OSVR_ClientContext, const char[], OSVR_GraphicsLibraryOpenGL, OSVR_RenderManager*, OSVR_RenderManagerOpenGL*)
    - * @deprecated use the safer methods {@link #osvrCreateRenderManagerOpenGL(com.jme3.system.osvr.osvrrendermanageropengl.OsvrRenderManagerOpenGLLibrary.OSVR_ClientContext, byte[], com.jme3.system.osvr.osvrrendermanageropengl.OSVR_GraphicsLibraryOpenGL.ByValue, com.sun.jna.ptr.PointerByReference, com.sun.jna.ptr.PointerByReference)} and {@link #osvrCreateRenderManagerOpenGL(com.sun.jna.Pointer, com.sun.jna.Pointer, com.jme3.system.osvr.osvrrendermanageropengl.OSVR_GraphicsLibraryOpenGL.ByValue, com.sun.jna.ptr.PointerByReference, com.sun.jna.ptr.PointerByReference)} instead - */ - @Deprecated - public static native byte osvrCreateRenderManagerOpenGL(Pointer clientContext, Pointer graphicsLibraryName, com.jme3.system.osvr.osvrrendermanageropengl.OSVR_GraphicsLibraryOpenGL.ByValue graphicsLibrary, PointerByReference renderManagerOut, PointerByReference renderManagerOpenGLOut); - /** Original signature : OSVR_ReturnCode osvrCreateRenderManagerOpenGL(OSVR_ClientContext, const char[], OSVR_GraphicsLibraryOpenGL, OSVR_RenderManager*, OSVR_RenderManagerOpenGL*) */ - public static native byte osvrCreateRenderManagerOpenGL(OsvrClientKitLibrary.OSVR_ClientContext clientContext, byte graphicsLibraryName[], com.jme3.system.osvr.osvrrendermanageropengl.OSVR_GraphicsLibraryOpenGL.ByValue graphicsLibrary, PointerByReference renderManagerOut, PointerByReference renderManagerOpenGLOut); - /** Original signature : OSVR_ReturnCode osvrRenderManagerGetRenderInfoOpenGL(OSVR_RenderManagerOpenGL, OSVR_RenderInfoCount, OSVR_RenderParams, OSVR_RenderInfoOpenGL*) */ - public static native byte osvrRenderManagerGetRenderInfoOpenGL(Pointer renderManager, NativeSize renderInfoIndex, OSVR_RenderParams.ByValue renderParams, OSVR_RenderInfoOpenGL renderInfoOut); - /** Original signature : OSVR_ReturnCode osvrRenderManagerOpenDisplayOpenGL(OSVR_RenderManagerOpenGL, OSVR_OpenResultsOpenGL*) */ - public static native byte osvrRenderManagerOpenDisplayOpenGL(Pointer renderManager, OSVR_OpenResultsOpenGL openResultsOut); - /** Original signature : OSVR_ReturnCode osvrRenderManagerPresentRenderBufferOpenGL(OSVR_RenderManagerPresentState, OSVR_RenderBufferOpenGL, OSVR_RenderInfoOpenGL, OSVR_ViewportDescription) */ - public static native byte osvrRenderManagerPresentRenderBufferOpenGL(Pointer presentState, com.jme3.system.osvr.osvrrendermanageropengl.OSVR_RenderBufferOpenGL.ByValue buffer, OSVR_RenderInfoOpenGL.ByValue renderInfoUsed, com.jme3.system.osvr.osvrrendermanageropengl.OSVR_ViewportDescription.ByValue normalizedCroppingViewport); - /** Original signature : OSVR_ReturnCode osvrRenderManagerRegisterRenderBufferOpenGL(OSVR_RenderManagerRegisterBufferState, OSVR_RenderBufferOpenGL) */ - public static native byte osvrRenderManagerRegisterRenderBufferOpenGL(Pointer registerBufferState, com.jme3.system.osvr.osvrrendermanageropengl.OSVR_RenderBufferOpenGL.ByValue renderBuffer); - /** - * Gets a given OSVR_RenderInfoOpenGL from an OSVR_RenderInfoCollection.
    - * Original signature : OSVR_ReturnCode osvrRenderManagerGetRenderInfoFromCollectionOpenGL(OSVR_RenderInfoCollection, OSVR_RenderInfoCount, OSVR_RenderInfoOpenGL*) - */ - public static native byte osvrRenderManagerGetRenderInfoFromCollectionOpenGL(Pointer renderInfoCollection, NativeSize index, OSVR_RenderInfoOpenGL renderInfoOut); - /** - * Original signature : OSVR_ReturnCode osvrRenderManagerCreateColorBufferOpenGL(GLsizei, GLsizei, GLenum, GLuint*)
    - * @deprecated use the safer methods {@link #osvrRenderManagerCreateColorBufferOpenGL(int, int, int, java.nio.IntBuffer)} and {@link #osvrRenderManagerCreateColorBufferOpenGL(int, int, int, com.sun.jna.ptr.IntByReference)} instead - */ - @Deprecated - public static native byte osvrRenderManagerCreateColorBufferOpenGL(int width, int height, int format, IntByReference colorBufferNameOut); - /** Original signature : OSVR_ReturnCode osvrRenderManagerCreateColorBufferOpenGL(GLsizei, GLsizei, GLenum, GLuint*) */ - public static native byte osvrRenderManagerCreateColorBufferOpenGL(int width, int height, int format, IntBuffer colorBufferNameOut); - /** - * Original signature : OSVR_ReturnCode osvrRenderManagerCreateDepthBufferOpenGL(GLsizei, GLsizei, GLuint*)
    - * @deprecated use the safer methods {@link #osvrRenderManagerCreateDepthBufferOpenGL(int, int, java.nio.IntBuffer)} and {@link #osvrRenderManagerCreateDepthBufferOpenGL(int, int, com.sun.jna.ptr.IntByReference)} instead - */ - @Deprecated - public static native byte osvrRenderManagerCreateDepthBufferOpenGL(int width, int height, IntByReference depthBufferNameOut); - /** Original signature : OSVR_ReturnCode osvrRenderManagerCreateDepthBufferOpenGL(GLsizei, GLsizei, GLuint*) */ - public static native byte osvrRenderManagerCreateDepthBufferOpenGL(int width, int height, IntBuffer depthBufferNameOut); - public static class OSVR_ClientContext extends PointerType { - public OSVR_ClientContext(Pointer address) { - super(address); - } - public OSVR_ClientContext() { - super(); - } - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrtimevalue/OSVR_TimeValue.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrtimevalue/OSVR_TimeValue.java deleted file mode 100644 index db60f043d8..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrtimevalue/OSVR_TimeValue.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.jme3.system.osvr.osvrtimevalue; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import java.util.Arrays; -import java.util.List; -/** - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OSVR_TimeValue extends Structure { - /** C type : OSVR_TimeValue_Seconds */ - public long seconds; - /** C type : OSVR_TimeValue_Microseconds */ - public int microseconds; - public OSVR_TimeValue() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("seconds", "microseconds"); - } - /** - * @param seconds C type : OSVR_TimeValue_Seconds
    - * @param microseconds C type : OSVR_TimeValue_Microseconds - */ - public OSVR_TimeValue(long seconds, int microseconds) { - super(); - this.seconds = seconds; - this.microseconds = microseconds; - } - public OSVR_TimeValue(Pointer peer) { - super(peer); - } - public static class ByReference extends OSVR_TimeValue implements Structure.ByReference { - - }; - public static class ByValue extends OSVR_TimeValue implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrtimevalue/OsvrTimeValueLibrary.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrtimevalue/OsvrTimeValueLibrary.java deleted file mode 100644 index 886c16d8f6..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrtimevalue/OsvrTimeValueLibrary.java +++ /dev/null @@ -1,119 +0,0 @@ -package com.jme3.system.osvr.osvrtimevalue; -import com.sun.jna.Library; -import com.sun.jna.Native; -import com.sun.jna.NativeLibrary; -import com.sun.jna.Pointer; -import com.sun.jna.PointerType; -/** - * JNA Wrapper for library osvrTimeValue
    - * This file was autogenerated by JNAerator,
    - * a tool written by Olivier Chafik that uses a few opensource projects..
    - * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class OsvrTimeValueLibrary implements Library { - public static final String JNA_LIBRARY_NAME = "osvrClientKit"; - public static final NativeLibrary JNA_NATIVE_LIB = NativeLibrary.getInstance(OsvrTimeValueLibrary.JNA_LIBRARY_NAME); - static { - Native.register(OsvrTimeValueLibrary.class, OsvrTimeValueLibrary.JNA_NATIVE_LIB); - } - public static final int OSVR_TRUE = (int)(1); - public static final int OSVR_FALSE = (int)(0); - /** - * @brief Gets the current time in the TimeValue. Parallel to gettimeofday.
    - * Original signature : void osvrTimeValueGetNow(OSVR_TimeValue*) - */ - public static native void osvrTimeValueGetNow(OSVR_TimeValue dest); - /** - * @brief Converts from a TimeValue struct to your system's struct timeval.
    - * @param dest Pointer to an empty struct timeval for your platform.
    - * @param src A pointer to an OSVR_TimeValue you'd like to convert from.
    - * If either parameter is NULL, the function will return without doing
    - * anything.
    - * Original signature : void osvrTimeValueToStructTimeval(timeval*, const OSVR_TimeValue*) - */ - public static native void osvrTimeValueToStructTimeval(OsvrTimeValueLibrary.timeval dest, OSVR_TimeValue src); - /** - * @brief Converts from a TimeValue struct to your system's struct timeval.
    - * @param dest An OSVR_TimeValue destination pointer.
    - * @param src Pointer to a struct timeval you'd like to convert from.
    - * The result is normalized.
    - * If either parameter is NULL, the function will return without doing
    - * anything.
    - * Original signature : void osvrStructTimevalToTimeValue(OSVR_TimeValue*, timeval*) - */ - public static native void osvrStructTimevalToTimeValue(OSVR_TimeValue dest, OsvrTimeValueLibrary.timeval src); - /** - * @brief "Normalizes" a time value so that the absolute number of microseconds
    - * is less than 1,000,000, and that the sign of both components is the same.
    - * @param tv Address of a struct TimeValue to normalize in place.
    - * If the given pointer is NULL, this function returns without doing anything.
    - * Original signature : void osvrTimeValueNormalize(OSVR_TimeValue*) - */ - public static native void osvrTimeValueNormalize(OSVR_TimeValue tv); - /** - * @brief Sums two time values, replacing the first with the result.
    - * @param tvA Destination and first source.
    - * @param tvB second source
    - * If a given pointer is NULL, this function returns without doing anything.
    - * Both parameters are expected to be in normalized form.
    - * Original signature : void osvrTimeValueSum(OSVR_TimeValue*, const OSVR_TimeValue*) - */ - public static native void osvrTimeValueSum(OSVR_TimeValue tvA, OSVR_TimeValue tvB); - /** - * @brief Computes the difference between two time values, replacing the first
    - * with the result.
    - * Effectively, `*tvA = *tvA - *tvB`
    - * @param tvA Destination and first source.
    - * @param tvB second source
    - * If a given pointer is NULL, this function returns without doing anything.
    - * Both parameters are expected to be in normalized form.
    - * Original signature : void osvrTimeValueDifference(OSVR_TimeValue*, const OSVR_TimeValue*) - */ - public static native void osvrTimeValueDifference(OSVR_TimeValue tvA, OSVR_TimeValue tvB); - /** - * @brief Compares two time values (assumed to be normalized), returning
    - * the same values as strcmp
    - * @return <0 if A is earlier than B, 0 if they are the same, and >0 if A
    - * is later than B.
    - * Original signature : int osvrTimeValueCmp(const OSVR_TimeValue*, const OSVR_TimeValue*) - */ - public static native int osvrTimeValueCmp(OSVR_TimeValue tvA, OSVR_TimeValue tvB); - /** - * @brief Compute the difference between the two time values, returning the
    - * duration as a double-precision floating-point number of seconds.
    - * Effectively, `ret = *tvA - *tvB`
    - * @param tvA first source.
    - * @param tvB second source
    - * @return Duration of timespan in seconds (floating-point)
    - * Original signature : double osvrTimeValueDurationSeconds(const OSVR_TimeValue*, const OSVR_TimeValue*) - */ - public static native double osvrTimeValueDurationSeconds(OSVR_TimeValue tvA, OSVR_TimeValue tvB); - /** - * @brief True if A is later than B
    - * Original signature : OSVR_CBool osvrTimeValueGreater(const OSVR_TimeValue*, const OSVR_TimeValue*) - */ - public static native byte osvrTimeValueGreater(OSVR_TimeValue tvA, OSVR_TimeValue tvB); - /** - * Returns true if the time value is normalized. Typically used in assertions.
    - * Original signature : bool osvrTimeValueIsNormalized(const OSVR_TimeValue&) - */ - public static native byte osvrTimeValueIsNormalized(OSVR_TimeValue tv); - /** - * Operator > overload for time values
    - * Original signature : bool operator>(const OSVR_TimeValue&, const OSVR_TimeValue&) - */ - public static native byte operatorGreater(OSVR_TimeValue tvA, OSVR_TimeValue tvB); - /** - * Operator == overload for time values
    - * Original signature : bool operator==(const OSVR_TimeValue&, const OSVR_TimeValue&) - */ - public static native byte operatorIsEqual(OSVR_TimeValue tvA, OSVR_TimeValue tvB); - public static class timeval extends PointerType { - public timeval(Pointer address) { - super(address); - } - public timeval() { - super(); - } - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/util/ImageSaver.java b/jme3-vr/src/main/java/com/jme3/util/ImageSaver.java new file mode 100644 index 0000000000..6375bd7942 --- /dev/null +++ b/jme3-vr/src/main/java/com/jme3/util/ImageSaver.java @@ -0,0 +1,108 @@ +package com.jme3.util; + +import org.lwjgl.BufferUtils; + +import javax.imageio.ImageIO; +import java.awt.*; +import java.awt.image.*; +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.IntBuffer; +import java.util.HashMap; +import java.util.Map; + +import static org.lwjgl.opengl.GL11.*; +import static org.lwjgl.opengl.GL11.GL_PACK_ALIGNMENT; +import static org.lwjgl.opengl.GL11.glPixelStorei; +import static org.lwjgl.opengl.GL12.GL_TEXTURE_DEPTH; +import static org.lwjgl.opengl.GL13.GL_TEXTURE_COMPRESSED; +import static org.lwjgl.opengl.GL13.GL_TEXTURE_COMPRESSED_IMAGE_SIZE; +import static org.lwjgl.opengl.GL14.GL_TEXTURE_DEPTH_SIZE; +import static org.lwjgl.system.MemoryUtil.memAlloc; + +public class ImageSaver { + + private int floatsPerPixel = 3; + private int bytesPerFloat = 1; + private int width = 1512; + private int height = 1680; + private int size = width * height * floatsPerPixel * bytesPerFloat; + private ByteBuffer texSaveBuffer = memAlloc(size); + private IntBuffer wBuf = BufferUtils.createIntBuffer(1); + private IntBuffer hBuf = BufferUtils.createIntBuffer(1); + + public void saveTextureToFile(long textureID, String filename) { + // TODO: Can we do without the cast? + glBindTexture(GL_TEXTURE_2D, (int) textureID); + glPixelStorei(GL_PACK_ALIGNMENT, 1); + int level = 0; + + glGetTexLevelParameteriv(GL_TEXTURE_2D, level, GL_TEXTURE_WIDTH, wBuf); + glGetTexLevelParameteriv(GL_TEXTURE_2D, level, GL_TEXTURE_HEIGHT, hBuf); + + int w = wBuf.get(); + int h = hBuf.get(); + assert (w == width); + assert (h == height); + + glGetTexImage(GL_TEXTURE_2D, level, GL_RGB + , GL_UNSIGNED_BYTE, texSaveBuffer); + glPixelStorei(GL_PACK_ALIGNMENT, 4); + + DataBuffer imageData = new DataBufferByte(size); + for (int i = 0; i < size; i++) { + imageData.setElem(i, texSaveBuffer.get(i)); + } + + //3 bytes per pixel: red, green, blue + WritableRaster raster = Raster.createInterleavedRaster(imageData, width, height, 3 * width, 3, new int[] {0, 1, 2}, (Point) null); +// WritableRaster raster = Raster.createInterleavedRaster(imageData, width, height, bytesPerFloat * floatsPerPixel * width, 16, new int[]{0, 4, 8, 12}, (Point) null); + ColorModel cm = new ComponentColorModel(ColorModel.getRGBdefault().getColorSpace(), false, true, Transparency.OPAQUE, DataBuffer.TYPE_BYTE); + BufferedImage image = new BufferedImage(cm, raster, true, null); + try { + ImageIO.write(image, "png", new File(filename)); + } catch (IOException e) { + e.printStackTrace(); + throw new RuntimeException(e); + } finally { + hBuf.clear(); + wBuf.clear(); + texSaveBuffer.clear(); + } + } + + IntBuffer paramBuffer = BufferUtils.createIntBuffer(1); + public void getTextureInfo(long handle) { + glBindTexture(GL_TEXTURE_2D, (int) handle); + + HashMap h = new HashMap(); + h.put("GL_TEXTURE_ALPHA_SIZE" , GL_TEXTURE_ALPHA_SIZE); + h.put("GL_TEXTURE_BLUE_SIZE" , GL_TEXTURE_BLUE_SIZE); + h.put("GL_TEXTURE_BORDER" , GL_TEXTURE_BORDER); + h.put("GL_TEXTURE_COMPRESSED" , GL_TEXTURE_COMPRESSED); + h.put("GL_TEXTURE_COMPRESSED_IMAGE_SIZE" , GL_TEXTURE_COMPRESSED_IMAGE_SIZE); + h.put("GL_TEXTURE_DEPTH" , GL_TEXTURE_DEPTH); + h.put("GL_TEXTURE_DEPTH_SIZE" , GL_TEXTURE_DEPTH_SIZE); + h.put("GL_TEXTURE_GREEN_SIZE" , GL_TEXTURE_GREEN_SIZE); + h.put("GL_TEXTURE_HEIGHT" , GL_TEXTURE_HEIGHT); + h.put("GL_TEXTURE_INTENSITY_SIZE" , GL_TEXTURE_INTENSITY_SIZE); + h.put("GL_TEXTURE_INTERNAL_FORMAT" , GL_TEXTURE_INTERNAL_FORMAT); + h.put("GL_TEXTURE_LUMINANCE_SIZE" , GL_TEXTURE_LUMINANCE_SIZE); + h.put("GL_TEXTURE_RED_SIZE" , GL_TEXTURE_RED_SIZE); + h.put("GL_TEXTURE_WIDTH" , GL_TEXTURE_WIDTH); + + for(Map.Entry entry : h.entrySet()) { + String name = entry.getKey(); + int glAttrib = entry.getValue(); + glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, glAttrib, paramBuffer); + + System.out.println(name + ": " + paramBuffer.get()); + + paramBuffer.clear(); + } + + glBindTexture(GL_TEXTURE_2D, 0); + } +} diff --git a/jme3-vr/src/main/java/com/jme3/util/VRGuiManager.java b/jme3-vr/src/main/java/com/jme3/util/VRGuiManager.java index a5a4d89e8e..e87519c379 100644 --- a/jme3-vr/src/main/java/com/jme3/util/VRGuiManager.java +++ b/jme3-vr/src/main/java/com/jme3/util/VRGuiManager.java @@ -123,9 +123,7 @@ public void setPositioningMode(VRGUIPositioningMode mode) { * @return the GUI canvas size. This method return the size in pixels of the GUI available area within the VR view. */ public Vector2f getCanvasSize() { - if (environment != null){ - if (environment.getApplication() != null){ if( screenSize == null ) { if( environment.isInVR() && environment.getVRHardware() != null ) { @@ -144,7 +142,6 @@ public Vector2f getCanvasSize() { } else { throw new IllegalStateException("VR GUI manager is not attached to any environment."); } - } /** @@ -153,9 +150,7 @@ public Vector2f getCanvasSize() { * @see #getCanvasSize() */ public Vector2f getCanvasToWindowRatio() { - if (environment != null){ - if (environment.getApplication() != null){ if( ratio == null ) { ratio = new Vector2f(); @@ -168,7 +163,6 @@ public Vector2f getCanvasToWindowRatio() { ratio.y = Float.max(1f, canvas.y / height); } return ratio; - } else { throw new IllegalStateException("VR GUI manager underlying environment is not attached to any application."); } @@ -191,7 +185,6 @@ public void positionGui() { * @param tpf the time per frame. */ private void positionTo(Vector3f pos, Quaternion dir, float tpf) { - if (environment != null){ Vector3f guiPos = guiQuadNode.getLocalTranslation(); guiPos.set(0f, 0f, guiDistance); @@ -221,7 +214,6 @@ public void updateGuiQuadGeometricState() { * @param tpf the time per frame. */ public void positionGuiNow(float tpf) { - if (environment != null){ wantsReposition = false; if( environment.isInVR() == false ){ diff --git a/jme3-vr/src/main/java/com/jme3/util/VRUtil.java b/jme3-vr/src/main/java/com/jme3/util/VRUtil.java index 9111e340f9..aaf41a816c 100644 --- a/jme3-vr/src/main/java/com/jme3/util/VRUtil.java +++ b/jme3-vr/src/main/java/com/jme3/util/VRUtil.java @@ -7,8 +7,8 @@ import com.jme3.math.FastMath; import com.jme3.math.Matrix4f; import com.jme3.math.Quaternion; -import com.jme3.system.jopenvr.HmdMatrix34_t; -import com.jme3.system.jopenvr.HmdMatrix44_t; +import org.lwjgl.openvr.HmdMatrix34; +import org.lwjgl.openvr.HmdMatrix44; import java.util.concurrent.TimeUnit; @@ -36,20 +36,20 @@ public static void sleepNanos(long nanoDuration) { timeLeft = end - System.nanoTime(); } while (timeLeft > 0); } - - public static Matrix4f convertSteamVRMatrix3ToMatrix4f(HmdMatrix34_t hmdMatrix, Matrix4f mat){ - mat.set(hmdMatrix.m[0], hmdMatrix.m[1], hmdMatrix.m[2], hmdMatrix.m[3], - hmdMatrix.m[4], hmdMatrix.m[5], hmdMatrix.m[6], hmdMatrix.m[7], - hmdMatrix.m[8], hmdMatrix.m[9], hmdMatrix.m[10], hmdMatrix.m[11], + + public static Matrix4f convertSteamVRMatrix3ToMatrix4f(HmdMatrix34 hmdMatrix, Matrix4f mat){ + mat.set(hmdMatrix.m(0), hmdMatrix.m(1), hmdMatrix.m(2), hmdMatrix.m(3), + hmdMatrix.m(4), hmdMatrix.m(5), hmdMatrix.m(6), hmdMatrix.m(7), + hmdMatrix.m(8), hmdMatrix.m(9), hmdMatrix.m(10), hmdMatrix.m(11), 0f, 0f, 0f, 1f); return mat; } - - public static Matrix4f convertSteamVRMatrix4ToMatrix4f(HmdMatrix44_t hmdMatrix, Matrix4f mat){ - mat.set(hmdMatrix.m[0], hmdMatrix.m[1], hmdMatrix.m[2], hmdMatrix.m[3], - hmdMatrix.m[4], hmdMatrix.m[5], hmdMatrix.m[6], hmdMatrix.m[7], - hmdMatrix.m[8], hmdMatrix.m[9], hmdMatrix.m[10], hmdMatrix.m[11], - hmdMatrix.m[12], hmdMatrix.m[13], hmdMatrix.m[14], hmdMatrix.m[15]); + + public static Matrix4f convertSteamVRMatrix4ToMatrix4f(HmdMatrix44 hmdMatrix, Matrix4f mat){ + mat.set(hmdMatrix.m(0), hmdMatrix.m(1), hmdMatrix.m(2), hmdMatrix.m(3), + hmdMatrix.m(4), hmdMatrix.m(5), hmdMatrix.m(6), hmdMatrix.m(7), + hmdMatrix.m(8), hmdMatrix.m(9), hmdMatrix.m(10), hmdMatrix.m(11), + hmdMatrix.m(12), hmdMatrix.m(13), hmdMatrix.m(14), hmdMatrix.m(15)); return mat; }