diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 6b56daa8a7..5b19a4b767 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,7 +3,7 @@ [versions] checkstyle = "9.3" -lwjgl3 = "3.3.6" +lwjgl3 = "3.4.0" nifty = "1.4.3" [libraries] @@ -32,8 +32,6 @@ lwjgl3-jemalloc = { module = "org.lwjgl:lwjgl-jemalloc", version.ref = "lwjgl3" lwjgl3-openal = { module = "org.lwjgl:lwjgl-openal", version.ref = "lwjgl3" } lwjgl3-opencl = { module = "org.lwjgl:lwjgl-opencl", version.ref = "lwjgl3" } lwjgl3-opengl = { module = "org.lwjgl:lwjgl-opengl", version.ref = "lwjgl3" } -lwjgl3-openvr = { module = "org.lwjgl:lwjgl-openvr", version.ref = "lwjgl3" } -lwjgl3-ovr = { module = "org.lwjgl:lwjgl-ovr", version.ref = "lwjgl3" } mokito-core = "org.mockito:mockito-core:3.12.4" diff --git a/jme3-jbullet/src/main/java/com/jme3/bullet/debug/BulletDebugAppState.java b/jme3-jbullet/src/main/java/com/jme3/bullet/debug/BulletDebugAppState.java index b8df7695ff..9bbfb86f5c 100644 --- a/jme3-jbullet/src/main/java/com/jme3/bullet/debug/BulletDebugAppState.java +++ b/jme3-jbullet/src/main/java/com/jme3/bullet/debug/BulletDebugAppState.java @@ -32,7 +32,6 @@ package com.jme3.bullet.debug; import com.jme3.app.Application; -import com.jme3.app.VRAppState; import com.jme3.app.state.AbstractAppState; import com.jme3.app.state.AppStateManager; import com.jme3.asset.AssetManager; @@ -173,17 +172,11 @@ public void initialize(AppStateManager stateManager, Application app) { setupMaterials(app); physicsDebugRootNode.setCullHint(Spatial.CullHint.Never); - if (isVr()) { - /* This is a less good solution than the non-vr version (as the debug shapes can be obscured by the regular - * geometry), however it is the best possible as VR does not currently support multiple viewports per eye */ - VRAppState vrAppState = stateManager.getState(VRAppState.ID, VRAppState.class); - vrAppState.getLeftViewPort().attachScene(physicsDebugRootNode); - vrAppState.getRightViewPort().attachScene(physicsDebugRootNode); - } else { - viewPort = rm.createMainView("Physics Debug Overlay", app.getCamera()); - viewPort.setClearFlags(false, true, false); - viewPort.attachScene(physicsDebugRootNode); - } + + viewPort = rm.createMainView("Physics Debug Overlay", app.getCamera()); + viewPort.setClearFlags(false, true, false); + viewPort.attachScene(physicsDebugRootNode); + } /** @@ -193,15 +186,8 @@ public void initialize(AppStateManager stateManager, Application app) { * is invoked. */ @Override - public void cleanup() { - if (isVr()) { - VRAppState vrAppState = app.getStateManager().getState(VRAppState.ID, VRAppState.class); - vrAppState.getLeftViewPort().detachScene(physicsDebugRootNode); - vrAppState.getRightViewPort().detachScene(physicsDebugRootNode); - } else { - rm.removeMainView(viewPort); - } - + public void cleanup() { + rm.removeMainView(viewPort); super.cleanup(); } @@ -436,17 +422,4 @@ public static interface DebugAppStateFilter { */ public boolean displayObject(Object obj); } - - private boolean isVr() { - if (isVr == null) { - try { - VRAppState vrAppState = app.getStateManager().getState(VRAppState.ID, VRAppState.class); - isVr = vrAppState != null && !vrAppState.DISABLE_VR; - } catch (NoClassDefFoundError e) { - //Vr isn't even on the classpath - isVr = false; - } - } - return isVr; - } -} \ No newline at end of file +} diff --git a/jme3-lwjgl3/src/main/java/com/jme3/opencl/lwjgl/LwjglDevice.java b/jme3-lwjgl3/src/main/java/com/jme3/opencl/lwjgl/LwjglDevice.java index a6acd255fc..0d07be6837 100644 --- a/jme3-lwjgl3/src/main/java/com/jme3/opencl/lwjgl/LwjglDevice.java +++ b/jme3-lwjgl3/src/main/java/com/jme3/opencl/lwjgl/LwjglDevice.java @@ -61,15 +61,19 @@ public long getDevice() { public LwjglPlatform getPlatform() { return platform; } - + @Override public DeviceType getDeviceType() { - int type = Info.clGetDeviceInfoInt(device, CL10.CL_DEVICE_TYPE); - switch (type) { - case CL10.CL_DEVICE_TYPE_ACCELERATOR: return DeviceType.ACCELEARTOR; - case CL10.CL_DEVICE_TYPE_CPU: return DeviceType.CPU; - case CL10.CL_DEVICE_TYPE_GPU: return DeviceType.GPU; - default: return DeviceType.DEFAULT; + long type = Info.clGetDeviceInfoInt(device, CL10.CL_DEVICE_TYPE); + + if ((type & CL10.CL_DEVICE_TYPE_GPU) != 0) { + return DeviceType.GPU; + } else if ((type & CL10.CL_DEVICE_TYPE_CPU) != 0) { + return DeviceType.CPU; + } else if ((type & CL10.CL_DEVICE_TYPE_ACCELERATOR) != 0) { + return DeviceType.ACCELEARTOR; + } else { + return DeviceType.DEFAULT; } } diff --git a/jme3-lwjgl3/src/main/java/com/jme3/opencl/lwjgl/LwjglPlatform.java b/jme3-lwjgl3/src/main/java/com/jme3/opencl/lwjgl/LwjglPlatform.java index 6d4a8e64a7..6e9a7dd637 100644 --- a/jme3-lwjgl3/src/main/java/com/jme3/opencl/lwjgl/LwjglPlatform.java +++ b/jme3-lwjgl3/src/main/java/com/jme3/opencl/lwjgl/LwjglPlatform.java @@ -78,7 +78,7 @@ public List getDevices() { * @param deviceType the device type * @return the available devices */ - private long[] getDevices(int deviceType) { + private long[] getDevices(long deviceType) { int[] count = new int[1]; int errcode = CL10.clGetDeviceIDs(platform, deviceType, null, count); if (errcode == CL10.CL_DEVICE_NOT_FOUND) { diff --git a/jme3-vr/build.gradle b/jme3-vr/build.gradle deleted file mode 100644 index 6bcb4e766a..0000000000 --- a/jme3-vr/build.gradle +++ /dev/null @@ -1,30 +0,0 @@ -dependencies { - api project(':jme3-core') - api project(':jme3-lwjgl3') - api project(':jme3-desktop') - api project(':jme3-effects') - - // https://mvnrepository.com/artifact/net.java.dev.jna/jna - implementation libs.jna - implementation libs.jnaerator.runtime - - // Native LibOVR/Oculus support - api libs.lwjgl3.ovr - runtimeOnly(variantOf(libs.lwjgl3.ovr){ classifier('natives-windows') }) - - // Native OpenVR/LWJGL support - api libs.lwjgl3.openvr - implementation(variantOf(libs.lwjgl3.openvr){ classifier('natives-linux') }) - implementation(variantOf(libs.lwjgl3.openvr){ classifier('natives-macos') }) - runtimeOnly(variantOf(libs.lwjgl3.openvr){ classifier('natives-windows') }) - runtimeOnly(variantOf(libs.lwjgl3.openvr){ classifier('natives-linux') }) - runtimeOnly(variantOf(libs.lwjgl3.openvr){ classifier('natives-macos') }) -} - -javadoc { - // Disable doclint for JDK8+. - if (JavaVersion.current().isJava8Compatible()){ - options.addStringOption('Xdoclint:none', '-quiet') - } -} - diff --git a/jme3-vr/src/main/java/com/jme3/app/VRAppState.java b/jme3-vr/src/main/java/com/jme3/app/VRAppState.java deleted file mode 100644 index f8fe39347f..0000000000 --- a/jme3-vr/src/main/java/com/jme3/app/VRAppState.java +++ /dev/null @@ -1,637 +0,0 @@ -package com.jme3.app; - -/* - * Copyright (c) 2009-2021 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. - */ -import com.jme3.app.Application; -import com.jme3.app.state.AbstractAppState; -import com.jme3.app.state.AppStateManager; -import com.jme3.input.vr.VRAPI; -import com.jme3.input.vr.VRInputAPI; -import com.jme3.input.vr.VRMouseManager; -import com.jme3.input.vr.VRViewManager; -import com.jme3.math.ColorRGBA; -import com.jme3.math.Quaternion; -import com.jme3.math.Vector3f; -import com.jme3.post.PreNormalCaching; -import com.jme3.renderer.RenderManager; -import com.jme3.renderer.ViewPort; -import com.jme3.scene.Spatial; -import com.jme3.system.AppSettings; -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.util.Locale; -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * 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}, - * the common way to use this app state is:
- * - * Attaching an instance of this app state to an already started application may cause crashes. - * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr - * - * @deprecated The jme3-vr module is deprecated and will be removed in a future version (as it only supports OpenVR). - * For new Virtual Reality projects, use user libraries that provide OpenXR support. - * See Virtual Reality JME wiki section - * for more information. - */ -@Deprecated -public class VRAppState extends AbstractAppState { - public static final String ID = "VRAppState"; - 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. - */ - public VRAppState(VREnvironment environment) { - super(ID); - - this.environment = environment; - - this.setSettings(environment.getSettings()); - } - - /** - * Create a new VR app state with given settings. The app state relies on the given {@link VREnvironment VR environment}. - * @param settings the settings to use. - * @param environment the {@link VREnvironment VR environment} that this app state is using. - * @deprecated The jme3-vr module is deprecated and will be removed in a future version (as it only supports OpenVR). - * For new Virtual Reality projects, use user libraries that provide OpenXR support. - * See Virtual Reality JME wiki section - * for more information. - */ - @Deprecated - public VRAppState(AppSettings settings, VREnvironment environment){ - this(environment); - this.settings = settings; - processSettings(settings); - } - - /** - * Simple update of the app state, this method should contain any spatial updates. - * This method is called by the {@link #update(float) update()} method and should not be called manually. - * @param tpf the application time. - */ - 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}. - */ - public void simpleRender(RenderManager renderManager) { - PreNormalCaching.resetCache(environment.isInVR()); - } - - /** - * Set the frustum values for the application. - * @param near the frustum near value. - * @param far the frustum 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( environment.getVRViewManager() != null ){ - environment.getVRViewManager().setResolutionMultiplier(resMult); - } - } - - /** - * Move filters from the main scene into the eye's. - * This removes filters from the main scene. - */ - public void moveScreenProcessingToVR() { - environment.getVRViewManager().moveScreenProcessingToEyes(); - } - - /** - * Get the observer final rotation within the scene. - * @return the observer final rotation within the scene. - * @see #getFinalObserverPosition() - */ - public Quaternion getFinalObserverRotation() { - if( environment.getVRViewManager() == null ) { - if( environment.getObserver() == null ) { - return environment.getCamera().getRotation(); - } else { - return ((Spatial)environment.getObserver()).getWorldRotation(); - } - } - - if( environment.getObserver() == null ) { - tempq.set(environment.getDummyCamera().getRotation()); - } else { - tempq.set(((Spatial)environment.getObserver()).getWorldRotation()); - } - return tempq.multLocal(environment.getVRHardware().getOrientation()); - } - - /** - * Get the observer final position within the scene. - * @return the observer position. - * @see #getFinalObserverRotation() - */ - public Vector3f getFinalObserverPosition() { - if( environment.getVRViewManager() == null ) { - if( environment.getObserver() == null ) { - return environment.getCamera().getLocation(); - } else{ - return ((Spatial)environment.getObserver()).getWorldTranslation(); - } - } - - Vector3f pos = environment.getVRHardware().getPosition(); - if( environment.getObserver() == null ) { - environment.getDummyCamera().getRotation().mult(pos, pos); - return pos.addLocal(environment.getDummyCamera().getLocation()); - } else { - ((Spatial)environment.getObserver()).getWorldRotation().mult(pos, pos); - return pos.addLocal(((Spatial)environment.getObserver()).getWorldTranslation()); - } - } - - /** - * Get the VR headset left viewport. - * @return the VR headset left viewport. - * @see #getRightViewPort() - */ - 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. - * @see #getLeftViewPort() - */ - public ViewPort getRightViewPort() { - if( environment.getVRViewManager() == null ){ - return application.getViewPort(); - } - return environment.getVRViewManager().getRightViewPort(); - } - - /** - * Set the background color for both left and right view ports. - * @param clr the background color. - */ - 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. - * @see #getStateManager() - */ - 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. - * @see #getApplication() - */ - public AppStateManager getStateManager(){ - return stateManager; - } - - /** - * Get the scene observer. If no observer has been set, this method returns the application camera. - * @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 application camera. - * @param observer the scene observer. - */ - 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. - */ - 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. - */ - public VREnvironment getVREnvironment(){ - return environment; - } - - /** - * Get the VR underlying hardware. - * @return the VR underlying hardware. - */ - public VRAPI getVRHardware() { - return getVREnvironment().getVRHardware(); - } - - /** - * Get the VR dedicated input. - * @return the VR dedicated input. - */ - public VRInputAPI getVRinput() { - if( getVREnvironment().getVRHardware() == null ){ - return null; - } - - return getVREnvironment().getVRHardware().getVRinput(); - } - - /** - * Get the VR view manager. - * @return the VR view manager. - */ - public VRViewManager getVRViewManager() { - return getVREnvironment().getVRViewManager(); - } - - /** - * Get the GUI manager attached to this app state. - * @return the GUI manager attached to this app state. - */ - 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. - */ - 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. - * @see #setSettings(AppSettings) - */ - 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. - * @see #getSettings() - */ - public void setSettings(AppSettings settings){ - this.settings = settings; - processSettings(settings); - } - - @Override - public void update(float tpf) { - - // update VR pose & cameras - if( environment.getVRViewManager() != null ) { - environment.getVRViewManager().update(tpf); - } else if( environment.getObserver() != null ) { - environment.getCamera().setFrame(((Spatial)environment.getObserver()).getWorldTranslation(), ((Spatial)environment.getObserver()).getWorldRotation()); - } - - if( environment.isInVR() == false || environment.getVRGUIManager().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 view manager update otherwise - // TODO isn't this done by SimpleApplication? - 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 - environment.getVRMouseManager().updateAnalogAsMouse(0, null, null, null, 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(); - } - } - - @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); - - 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); - } else { - logger.config("VR mode disabled."); - //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; - } - } - - // 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); - } - settings.setSwapBuffers(true); - } else { - // use basic mirroring window, skip settings window - settings.setSamples(1); - settings.setWidth(xWin); - settings.setHeight(yWin); - settings.setBitsPerPixel(32); - settings.setFrameRate(0); - settings.setFrequency(environment.getVRHardware().getDisplayFrequency()); - settings.setFullscreen(false); - settings.setVSync(false); // stop vsyncing on primary monitor! - settings.setSwapBuffers(environment.isSwapBuffers()); - } - - // 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. - */ - protected void processSettings(AppSettings settings){ - if (settings != null){ - - if (settings.get(VRConstants.SETTING_DISABLE_VR) != null){ - DISABLE_VR = settings.getBoolean(VRConstants.SETTING_DISABLE_VR); - } - } - } -} \ 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 2b20bae63e..0000000000 --- a/jme3-vr/src/main/java/com/jme3/app/VRApplication.java +++ /dev/null @@ -1,1485 +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.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 com.jme3.util.res.Resources; - -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 extend 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 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(0, 0); - - 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 ) { - //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 frustum values for the application. - * @param near the frustum near value. - * @param far the frustum 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; - } - - /** - * Simple update of the application, this method should contain {@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 and 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. - */ - @Override - 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.handleErrorMessage(errMsg + "\n" + t.getClass().getSimpleName() + - (t.getMessage() != null ? ": " + t.getMessage() : "")); - } else { - JmeSystem.handleErrorMessage(errMsg); - } - } - - stop(); // stop the application - } - - - /** - * Force the focus gain for the application. Internal use only. - */ - @Override - 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. - */ - @Override - public void loseFocus(){ - if (lostFocusBehavior != LostFocusBehavior.Disabled){ - if (lostFocusBehavior == LostFocusBehavior.PauseOnLostFocus) { - paused = true; - } - context.setAutoFlushFrames(false); - } - } - - /** - * Reshape the display window. Internal use only. - */ - @Override - public void reshape(int w, int h){ - if (renderManager != null) { - renderManager.notifyReshape(w, h); - } - } - - /** - * Request the application to close. Internal use only. - */ - @Override - 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. - */ - @Override - 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. - */ - @Override - 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. - */ - @Override - 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. - */ - @Override - 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() - */ - @Override - 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) - */ - @Override - 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 (!JmeSystem.showSettingsDialog(settings, loadSettings)) { - logger.config("Starting application [SUCCESS]"); - return; - } - - - 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); - 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.2 renderer."); - settings.setRenderer(AppSettings.LWJGL_OPENGL32); - } 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) - */ - @Override - 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 dedicated 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 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 ) { - // Update geometric state here only if GUI is in manual mode, or not in VR. - // Otherwise it will get updated automatically in the view-manager update. - 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 = Resources.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(){ - // acquire 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 set 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.useJoysticks()){ - 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). - */ - @Override - 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 - */ - @Override - 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. - */ - @Override - public void setAppProfiler(AppProfiler prof) { - return; - } - - /** - * Returns the current AppProfiler hook, or null if none is set. - */ - @Override - public AppProfiler getAppProfiler() { - return null; - } -} diff --git a/jme3-vr/src/main/java/com/jme3/app/VRConstants.java b/jme3-vr/src/main/java/com/jme3/app/VRConstants.java deleted file mode 100644 index 0a4bf1fff5..0000000000 --- a/jme3-vr/src/main/java/com/jme3/app/VRConstants.java +++ /dev/null @@ -1,164 +0,0 @@ -package com.jme3.app; - -import java.util.HashMap; -import com.jme3.system.AppSettings; - -/** - * Some constants dedicated to the VR module. - * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr - * @since 3.1.0 - * @deprecated The jme3-vr module is deprecated and will be removed in a future version (as it only supports OpenVR). - * For new Virtual Reality projects, use user libraries that provide OpenXR support. - * See Virtual Reality JME wiki section - * for more information. - */ -@Deprecated -public class VRConstants { - /** - * An AppSettings parameter that set if the VR compositor has to be used. - *

- * Type: boolean
- * Usage: {@link AppSettings appSettings}.{@link HashMap#put(Object, Object) put}(VRConstants.SETTING_USE_COMPOSITOR, value) - */ - public static final String SETTING_USE_COMPOSITOR = "VRUseCompositor"; - - /** - * An AppSettings parameter that set if the rendering has to use two eyes, - * regardless of VR API detection (turning this setting on without a VR system should lead to errors). - *

- * Type: boolean
- * Usage: {@link AppSettings appSettings}.{@link HashMap#put(Object, Object) put}(VRConstants.SETTING_VR_FORCE, value) - */ - public static final String SETTING_VR_FORCE = "VRForce"; - - /** - * An AppSettings parameter that set to invert the eyes of the HMD. - * Type: boolean
- * Usage: {@link AppSettings appSettings}.{@link HashMap#put(Object, Object) put}(VRConstants.SETTING_FLIP_EYES, value) - */ - public static final String SETTING_FLIP_EYES = "VRFlipEyes"; - - /** - * An AppSettings parameter that set if the GUI has to be displayed even if it is behind objects. - * Type: boolean
- * Usage: {@link AppSettings appSettings}.{@link HashMap#put(Object, Object) put}(VRConstants.SETTING_GUI_OVERDRAW, value) - * - */ - public static final String SETTING_GUI_OVERDRAW = "VRGUIOverdraw"; - - /** - * An AppSettings parameter that set if the GUI surface has to be curved. - * Type: boolean
- * Usage: {@link AppSettings appSettings}.{@link HashMap#put(Object, Object) put}(VRConstants.SETTING_GUI_CURVED_SURFACE, value) - */ - public static final String SETTING_GUI_CURVED_SURFACE = "VRGUICurvedSurface"; - - /** - * An AppSettings parameter that set if a mirror rendering has to be displayed on the screen. - * Runs faster when set to false. - * Type: boolean
- * Usage: {@link AppSettings appSettings}.{@link HashMap#put(Object, Object) put}(VRConstants.SETTING_ENABLE_MIRROR_WINDOW, value) - */ - public static final String SETTING_ENABLE_MIRROR_WINDOW = "VREnableMirrorWindow"; - - /** - * An AppSettings parameter that set if the VR rendering has to be disabled, - * regardless VR API and devices are presents. - * Type: boolean
- * Usage: {@link AppSettings appSettings}.{@link HashMap#put(Object, Object) put}(VRConstants.SETTING_DISABLE_VR, value) - */ - public static final String SETTING_DISABLE_VR = "VRDisable"; - - - /** - * An AppSettings parameter that set if the VR user is seated. - * Type: boolean
- * Usage: {@link AppSettings appSettings}.{@link HashMap#put(Object, Object) put}(VRConstants.SETTING_SEATED_EXPERIENCE, value) - */ - public static final String SETTING_SEATED_EXPERIENCE = "VRSeatedExperience"; - - /** - * An AppSettings parameter that set if the GUI has to be ignored. - * Type: boolean
- * Usage: {@link AppSettings appSettings}.{@link HashMap#put(Object, Object) put}(VRConstants.SETTING_NO_GUI, value) - */ - public static final String SETTING_NO_GUI = "VRNoGUI"; - - /** - * An AppSettings parameter that set if instance rendering has to be used. - * This setting requires some vertex shader changes (see Common/MatDefs/VR/Unshaded.j3md). - * Type: boolean
- * Usage: {@link AppSettings appSettings}.{@link HashMap#put(Object, Object) put}(VRConstants.SETTING_INSTANCE_RENDERING, value) - */ - public static final String SETTING_INSTANCE_RENDERING = "VRInstanceRendering"; - - /** - * An AppSettings parameter that set if Multi Sample Anti Aliasing has to be enabled. - * Type: boolean
- * Usage: {@link AppSettings appSettings}.{@link HashMap#put(Object, Object) put}(VRConstants.SETTING_DISABLE_MSAA, value) - */ - public static final String SETTING_DISABLE_MSAA = "VRDisableMSAA"; - - /** - * An AppSettings parameter that set the default field of view (FOV) value. - * Type: float
- * Usage: {@link AppSettings appSettings}.{@link HashMap#put(Object, Object) put}(VRConstants.SETTING_DEFAULT_FOV, value) - */ - public static final String SETTING_DEFAULT_FOV = "VRDefaultFOV"; - - /** - * An AppSettings parameter that set the default aspect ratio. - * Type: float
- * Usage: {@link AppSettings appSettings}.{@link HashMap#put(Object, Object) put}(VRConstants.SETTING_DEFAULT_ASPECT_RATIO, value) - */ - public static final String SETTING_DEFAULT_ASPECT_RATIO = "VRDefaultAspectRatio"; - - /** - * An AppSettings parameter that specifies the underlying VR API. Possible values are:
- *

    - *
  • {@link VRConstants#SETTING_VRAPI_OPENVR_VALUE SETTING_VRAPI_OPENVR_VALUE}: Use OpenVR binding. - *
  • {@link VRConstants#SETTING_VRAPI_OSVR_VALUE SETTING_VRAPI_OSVR_VALUE}: Use OSVR binding. - *
  • {@link VRConstants#SETTING_VRAPI_OPENVR_LWJGL_VALUE SETTING_VRAPI_OPENVR_LWJGL_VALUE}: Use OpenVR binding from LWJGL. - *
  • {@link VRConstants#SETTING_VRAPI_OCULUSVR_VALUE SETTING_VRAPI_OCULUSVR_VALUE}: Use Oculus Rift binding binding. - *
- * Type: int
- * Usage: {@link AppSettings appSettings}.{@link HashMap#put(Object, Object) put}(VRConstants.SETTING_VRAPI, value) - */ - public static final String SETTING_VRAPI = "VRAPI"; - - /** - * The identifier of the OpenVR system. - * - * Deprecated as only the lwjgl OpenVr version has been upgraded to modern action based inputs - * - * @see #SETTING_VRAPI_OPENVR_LWJGL_VALUE - * @see #SETTING_VRAPI_OCULUSVR_VALUE - */ - @Deprecated - public static final int SETTING_VRAPI_OPENVR_VALUE = 1; - - /** - * The identifier of the OpenVR from LWJGL system. - * - * @see #SETTING_VRAPI_OPENVR_VALUE - * @see #SETTING_VRAPI_OCULUSVR_VALUE - */ - public static final int SETTING_VRAPI_OPENVR_LWJGL_VALUE = 3; - - /** - * The identifier of the Oculus Rift system. - * - * Deprecated as an OpenVr system should be used instead (and the rift itself is discontinued) - * - * @see #SETTING_VRAPI_OPENVR_VALUE - * @see #SETTING_VRAPI_OPENVR_LWJGL_VALUE - */ - @Deprecated - public static final int SETTING_VRAPI_OCULUSVR_VALUE = 4; - - /** - * A private constructor to inhibit instantiation of this class. - */ - private VRConstants() { - } -} diff --git a/jme3-vr/src/main/java/com/jme3/app/VREnvironment.java b/jme3-vr/src/main/java/com/jme3/app/VREnvironment.java deleted file mode 100644 index a44a358b1c..0000000000 --- a/jme3-vr/src/main/java/com/jme3/app/VREnvironment.java +++ /dev/null @@ -1,537 +0,0 @@ -package com.jme3.app; - -import java.util.Locale; -import java.util.logging.Level; -import java.util.logging.Logger; - -import com.jme3.app.state.AppState; -import com.jme3.input.vr.VRAPI; -import com.jme3.input.vr.VRBounds; -import com.jme3.input.vr.VRInputAPI; -import com.jme3.input.vr.VRMouseManager; -import com.jme3.input.vr.VRViewManager; -import com.jme3.input.vr.lwjgl_openvr.LWJGLOpenVR; -import com.jme3.input.vr.lwjgl_openvr.LWJGLOpenVRMouseManager; -import com.jme3.input.vr.lwjgl_openvr.LWJGLOpenVRViewManager; -import com.jme3.input.vr.oculus.OculusMouseManager; -import com.jme3.input.vr.oculus.OculusVR; -import com.jme3.input.vr.oculus.OculusViewManager; -import com.jme3.input.vr.openvr.OpenVR; -import com.jme3.input.vr.openvr.OpenVRMouseManager; -import com.jme3.input.vr.openvr.OpenVRViewManager; -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; - -/** - * - * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr - * - * @deprecated The jme3-vr module is deprecated and will be removed in a future version (as it only supports OpenVR). - * For new Virtual Reality projects, use user libraries that provide OpenXR support. - * See Virtual Reality JME wiki section - * for more information. - */ -@Deprecated -public class VREnvironment { - private static final Logger logger = Logger.getLogger(VREnvironment.class.getName()); - - private VRAPI hardware = null; - private VRGuiManager guiManager = null; - private VRMouseManager mouseManager = null; - private VRViewManager viewManager = null; - - private VRBounds bounds = null; - - /** - * The underlying system VR API. By default, set to {@link VRConstants#SETTING_VRAPI_OPENVR_VALUE}. - */ - public int vrBinding = VRConstants.SETTING_VRAPI_OPENVR_VALUE; - - private boolean seated = false; - - private Spatial observer = null; - - private boolean forceVR = false; - - private boolean vrSupportedOS = false; - - private boolean nogui = false; - - private boolean compositorOS; - - private boolean useCompositor = true; - - private boolean instanceRendering = false; - - private boolean disableSwapBuffers = true; - - private float defaultFOV = 108f; - - private float defaultAspect = 1f; - - private AppSettings settings = null; - - private Application application = null; - - private Camera dummyCam = null; - - private AppState app = null; - - private boolean initialized = false; - - public VREnvironment(AppSettings settings){ - this.settings = settings; - - bounds = null; - - processSettings(); - } - - /** - * Get the VR underlying hardware. - * @return the VR underlying hardware. - */ - public VRAPI getVRHardware() { - return hardware; - } - - /** - * Set the VR bounds. - * @see #getVRBounds() - */ - public void setVRBounds(VRBounds bounds){ - this.bounds = bounds; - } - - /** - * Get the VR bounds. - * @return the VR bounds. - * @see #setVRBounds(VRBounds) - */ - public VRBounds getVRBounds(){ - return bounds; - } - - /** - * Get the VR dedicated input. - * @return the VR dedicated input. - */ - public VRInputAPI getVRinput() { - if( hardware == null ){ - return null; - } - - return hardware.getVRinput(); - } - - /** - * Get the VR view manager. - * @return the VR view manager. - */ - public VRViewManager getVRViewManager() { - return viewManager; - } - - /** - * Get the GUI manager attached to this environment. - * @return the GUI manager attached to this environment. - */ - public VRGuiManager getVRGUIManager(){ - return guiManager; - } - - /** - * Get the VR mouse manager attached to this environment. - * @return the VR mouse manager attached to this environment. - */ - public VRMouseManager getVRMouseManager(){ - return mouseManager; - } - - /** - * 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( hardware instanceof OpenVR ) { - if( hardware.getCompositor() == null ) { - return; - } - - if( seated ) { - ((OpenVR)hardware).getCompositor().SetTrackingSpace.apply(JOpenVRLibrary.ETrackingUniverseOrigin.ETrackingUniverseOrigin_TrackingUniverseSeated); - } else { - ((OpenVR)hardware).getCompositor().SetTrackingSpace.apply(JOpenVRLibrary.ETrackingUniverseOrigin.ETrackingUniverseOrigin_TrackingUniverseStanding); - } - } else if (hardware instanceof LWJGLOpenVR) { - if( hardware.isInitialized() ) { - ((LWJGLOpenVR)hardware).setTrackingSpace(seated); - } - } - } - - /** - * 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; - } - - /** - * 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 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 ) { - if (application != null){ - return application.getCamera(); - } else { - throw new IllegalStateException("VR environment is not attached to any application."); - } - } - 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 application {@link #getCamera() camera}. - * @param observer the scene observer. - */ - public void setObserver(Spatial observer) { - this.observer = observer; - } - - /** - * Get the default Field Of View (FOV) value. - * @return the default Field Of View (FOV) value. - * @see #setDefaultFOV(float) - */ - public float getDefaultFOV() { - return defaultFOV; - } - - /** - * Set the default Field Of View (FOV) value. - * @param defaultFOV the default Field Of View (FOV) value. - * @see #getDefaultFOV() - */ - public void setDefaultFOV(float defaultFOV) { - this.defaultFOV = defaultFOV; - } - - /** - * Get the default aspect ratio. - * @return the default aspect ratio. - * @see #setDefaultAspect(float) - */ - public float getDefaultAspect() { - return defaultAspect; - } - - /** - * Set the default aspect ratio. - * @param defaultAspect the default aspect ratio. - * @see #getDefaultAspect() - */ - public void setDefaultAspect(float defaultAspect) { - this.defaultAspect = defaultAspect; - } - - /** - * Get the {@link AppSettings settings} attached to this environment. - * @return the {@link AppSettings settings} attached to this environment. - * @see #setSettings(AppSettings) - */ - public AppSettings getSettings(){ - return settings; - } - - /** - * Set the {@link AppSettings settings} attached to this environment. - * @param settings the {@link AppSettings settings} attached to this environment. - * @see #getSettings() - */ - public void setSettings(AppSettings settings){ - this.settings = settings; - processSettings(); - } - - /** - * Get if the system currently support VR. - * @return true if the system currently support VR and false otherwise. - */ - public boolean isVRSupported() { - return vrSupportedOS; - } - - /** - * Check if the VR mode is enabled. - * @return true if the VR mode is enabled and false otherwise. - */ - public boolean isInVR() { - return (forceVR || vrSupportedOS && hardware != null && hardware.isInitialized() && isInitialized()); - } - - /** - * Check if the rendering is instanced (see Geometry instancing). - * @return true if the rendering is instanced and false otherwise. - */ - public boolean isInstanceRendering() { - return instanceRendering; - } - - public boolean isSwapBuffers(){ - return disableSwapBuffers; - } - - /** - * 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; - } - - /** - * Check if the VR environment is initialized. A call to the {@link #initialize() initialize()} method should set this value to true - * @return true if the VR environment is initialized and false otherwise. - */ - public boolean isInitialized(){ - return initialized; - } - - /** - * Is the VR compositor is active. - * @return true if the VR compositor is active and false otherwise. - */ - public boolean compositorAllowed() { - return useCompositor && compositorOS; - } - - /** - * Reset headset pose if seating experience. - */ - public void resetSeatedPose(){ - if( vrSupportedOS == false || isSeatedExperience() == false ){ - return; - } - getVRHardware().reset(); - } - - public AppState getAppState(){ - return app; - } - - public Application getApplication(){ - return application; - } - - /** - * Get the {@link Camera camera} used for rendering. - * If the VR mode is {@link #isInVR() active}, this method return a dummy camera, otherwise, - * this method return the camera of the attached application. - * @return the camera attached used for rendering. - */ - public Camera getCamera() { - if( isInVR() && getVRViewManager() != null && getVRViewManager().getLeftCamera() != null ) { - return getDummyCamera(); - } - - return application.getCamera(); - } - - public Camera getDummyCamera(){ - if (dummyCam == null){ - if (application != null){ - if (application.getCamera() != null){ - dummyCam = application.getCamera().clone(); - } else { - if ((settings != null) && (settings.getWidth() != 0) && (settings.getHeight() != 0)){ - dummyCam = new Camera(settings.getWidth(), settings.getHeight()); - } else { - dummyCam = new Camera(0, 0); - } - } - } else { - throw new IllegalStateException("VR environment is not attached to any application."); - } - } - return dummyCam; - } - - /** - * Attach the VR environment to the given app state and application. - * This method should be called within the {@link AppState#stateAttached(com.jme3.app.state.AppStateManager) stateAttached(com.jme3.app.state.AppStateManager)} method - * from the app state. - * @param appState the app state to attach. - * @param application the application to attach. - */ - public void atttach(AppState appState, Application application){ - this.application = application; - this.app = appState; - - // Instantiate view manager - if (vrBinding == VRConstants.SETTING_VRAPI_OPENVR_VALUE){ - viewManager = new OpenVRViewManager(this); - } else if (vrBinding == VRConstants.SETTING_VRAPI_OCULUSVR_VALUE) { - viewManager = new OculusViewManager(this); - } else if (vrBinding == VRConstants.SETTING_VRAPI_OPENVR_LWJGL_VALUE) { - viewManager = new LWJGLOpenVRViewManager(this); - } else { - logger.severe("Cannot instantiate view manager, unknown VRAPI type: "+vrBinding); - } - } - - /** - * Initialize this VR environment. This method enable the system bindings and configure all the VR system modules. - * A call to this method has to be made before any use of VR capabilities. - * @return true if the VR environment is successfully initialized and false otherwise. - */ - public boolean initialize(){ - logger.config("Initializing VR environment."); - - 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 = System.getProperty("sun.arch.data.model").equalsIgnoreCase("64"); //64-bit only - compositorOS = OS.contains("indows") || OS.contains("nux"); - - if (OS.contains("nux") && vrBinding != VRConstants.SETTING_VRAPI_OPENVR_LWJGL_VALUE){ - logger.severe("Only LWJGL VR backend is currently (partially) supported on Linux."); - vrSupportedOS = false; - } - - if( vrSupportedOS) { - 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 Oculus Rift wrapper [SUCCESS]"); - } else if (vrBinding == VRConstants.SETTING_VRAPI_OPENVR_LWJGL_VALUE) { - guiManager = new VRGuiManager(this); - mouseManager = new LWJGLOpenVRMouseManager(this); - - hardware = new LWJGLOpenVR(this); - initialized = true; - logger.config("Creating OpenVR/LWJGL wrapper [SUCCESS]"); - } else { - logger.config("Cannot create VR binding: "+vrBinding+" [FAILED]"); - logger.log(Level.SEVERE, "Cannot initialize VR environment [FAILED]"); - } - - 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]"); - } - - return initialized; - } - - private void processSettings(){ - if (settings != null){ - if (settings.get(VRConstants.SETTING_USE_COMPOSITOR) != null){ - useCompositor = settings.getBoolean(VRConstants.SETTING_USE_COMPOSITOR); - if( useCompositor == false ){ - disableSwapBuffers = false; - } - } - - if (settings.get(VRConstants.SETTING_ENABLE_MIRROR_WINDOW) != null){ - if( useCompositor == false ) { - disableSwapBuffers = false; - } else { - disableSwapBuffers = !settings.getBoolean(VRConstants.SETTING_ENABLE_MIRROR_WINDOW); - } - } - - if (settings.get(VRConstants.SETTING_GUI_OVERDRAW) != null){ - getVRGUIManager().setGuiOverdraw(settings.getBoolean(VRConstants.SETTING_GUI_OVERDRAW)); - } - - if (settings.get(VRConstants.SETTING_GUI_CURVED_SURFACE) != null){ - getVRGUIManager().setCurvedSurface(settings.getBoolean(VRConstants.SETTING_GUI_CURVED_SURFACE)); - } - - if (settings.get(VRConstants.SETTING_NO_GUI) != null){ - nogui = settings.getBoolean(VRConstants.SETTING_NO_GUI); - } - - if (settings.get(VRConstants.SETTING_VRAPI) != null){ - vrBinding = settings.getInteger(VRConstants.SETTING_VRAPI); - }else{ - vrBinding = VRConstants.SETTING_VRAPI_OPENVR_LWJGL_VALUE; //this is the binding that is best supported so makes sense to be the default - } - - if (settings.get(VRConstants.SETTING_SEATED_EXPERIENCE) != null){ - seated = settings.getBoolean(VRConstants.SETTING_SEATED_EXPERIENCE); - } - - if (settings.get(VRConstants.SETTING_INSTANCE_RENDERING) != null){ - instanceRendering = settings.getBoolean(VRConstants.SETTING_INSTANCE_RENDERING); - } - - if (settings.get(VRConstants.SETTING_DEFAULT_FOV) != null){ - defaultFOV = settings.getFloat(VRConstants.SETTING_DEFAULT_FOV); - } - - if (settings.get(VRConstants.SETTING_DEFAULT_ASPECT_RATIO) != null){ - defaultAspect = settings.getFloat(VRConstants.SETTING_DEFAULT_ASPECT_RATIO); - } - - if (settings.get(VRConstants.SETTING_FLIP_EYES) != null){ - if( getVRHardware() != null ){ - getVRHardware().setFlipEyes(settings.getBoolean(VRConstants.SETTING_FLIP_EYES)); - } - } - } - } -} diff --git a/jme3-vr/src/main/java/com/jme3/input/lwjgl/GlfwKeyInputVR.java b/jme3-vr/src/main/java/com/jme3/input/lwjgl/GlfwKeyInputVR.java deleted file mode 100644 index 6d4f5d6691..0000000000 --- a/jme3-vr/src/main/java/com/jme3/input/lwjgl/GlfwKeyInputVR.java +++ /dev/null @@ -1,153 +0,0 @@ -package com.jme3.input.lwjgl; - -/* - * Copyright (c) 2009-2021 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. - */ - -import com.jme3.input.KeyInput; -import com.jme3.input.RawInputListener; -import com.jme3.input.event.KeyInputEvent; -import com.jme3.system.lwjgl.LwjglWindowVR; - -import org.lwjgl.glfw.GLFWKeyCallback; - -import java.util.LinkedList; -import java.util.Queue; -import java.util.logging.Logger; - -import static org.lwjgl.glfw.GLFW.*; - -/** - * A key input that wraps GLFW underlying components. - * @author reden - phr00t - https://github.com/phr00t - * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr - * - */ -public class GlfwKeyInputVR implements KeyInput { - - private static final Logger logger = Logger.getLogger(GlfwKeyInput.class.getName()); - - private LwjglWindowVR context; - private RawInputListener listener; - private boolean initialized, shift_pressed; - private GLFWKeyCallback keyCallback; - private Queue keyInputEvents = new LinkedList<>(); - - /** - * Create a new input attached to the given {@link LwjglWindowVR context}. - * @param context the context to attach to this input. - */ - public GlfwKeyInputVR(LwjglWindowVR context) { - this.context = context; - } - - @Override - public void initialize() { - if (!context.isRenderable()) { - return; - } - - glfwSetKeyCallback(context.getWindowHandle(), keyCallback = new GLFWKeyCallback() { - @Override - public void invoke(long window, int key, int scancode, int action, int mods) { - scancode = GlfwKeyMap.toJmeKeyCode(key); - if( key == GLFW_KEY_LEFT_SHIFT || key == GLFW_KEY_RIGHT_SHIFT ) { - shift_pressed = (action == GLFW_PRESS); - } else if( key >= 'A' && key <= 'Z' && !shift_pressed ) { - key += 32; // make lowercase - } else if( key >= 'a' && key <= 'z' && shift_pressed ) { - key -= 32; // make uppercase - } - final KeyInputEvent evt = new KeyInputEvent(scancode, (char) key, GLFW_PRESS == action, GLFW_REPEAT == action); - evt.setTime(getInputTimeNanos()); - keyInputEvents.add(evt); - } - }); - - glfwSetInputMode(context.getWindowHandle(), GLFW_STICKY_KEYS, 1); - - initialized = true; - logger.fine("Keyboard created."); - } - - /** - * Get the key count. - * @return the key count. - */ - public int getKeyCount() { - // This might not be correct - return GLFW_KEY_LAST - GLFW_KEY_SPACE; - } - - @Override - public void update() { - if (!context.isRenderable()) { - return; - } - - while (!keyInputEvents.isEmpty()) { - listener.onKeyEvent(keyInputEvents.poll()); - } - } - - @Override - public void destroy() { - if (!context.isRenderable()) { - return; - } - - keyCallback.free(); - - logger.fine("Keyboard destroyed."); - } - - @Override - public boolean isInitialized() { - return initialized; - } - - @Override - public void setInputListener(RawInputListener listener) { - this.listener = listener; - } - - @Override - public long getInputTimeNanos() { - return (long) (glfwGetTime() * 1000000000); - } - - @Override - public String getKeyName(int jmeKey) { - int glfwKey = GlfwKeyMap.fromJmeKeyCode(jmeKey); - return glfwGetKeyName(glfwKey, 0); - } - -} 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 deleted file mode 100644 index 8566ca3a04..0000000000 --- a/jme3-vr/src/main/java/com/jme3/input/lwjgl/GlfwMouseInputVR.java +++ /dev/null @@ -1,332 +0,0 @@ -package com.jme3.input.lwjgl; - -/* - * Copyright (c) 2009-2021 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. - */ - -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.LwjglWindowVR; -import com.jme3.util.BufferUtils; - -import org.lwjgl.glfw.GLFWCursorPosCallback; -import org.lwjgl.glfw.GLFWMouseButtonCallback; -import org.lwjgl.glfw.GLFWScrollCallback; - -import java.nio.ByteBuffer; -import java.nio.IntBuffer; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.Map; -import java.util.Queue; -import java.util.logging.Logger; - -import static org.lwjgl.glfw.GLFW.*; -import org.lwjgl.glfw.GLFWImage; -import org.lwjgl.system.MemoryUtil; - -/** - * Captures mouse input using GLFW callbacks. It then temporarily stores these in event queues which are processed in the - * {@link #update()} method. Due to some of the GLFW button IDs, there is a conversion method in this class which will - * convert the GLFW left, middle and right mouse button to JME3 left, middle and right button codes.

- * This class support modifications dedicated to VR rendering. - * @author Daniel Johansson (dannyjo) - * @author reden - phr00t - https://github.com/phr00t - * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr * @author Julien Seinturier - (c) 2016 - JOrigin project - http:/www.jorigin.org - */ -public class GlfwMouseInputVR implements MouseInput { - - private static final Logger logger = Logger.getLogger(GlfwMouseInputVR.class.getName()); - - private static final int WHEEL_SCALE = 120; - - private LwjglWindowVR context; - private RawInputListener listener; - private boolean cursorVisible = true; - private int mouseX, xDelta; - private int mouseY, yDelta; - private int mouseWheel; - private boolean initialized; - private GLFWCursorPosCallback cursorPosCallback; - private GLFWScrollCallback scrollCallback; - private GLFWMouseButtonCallback mouseButtonCallback; - private Queue mouseMotionEvents = new LinkedList<>(); - private Queue mouseButtonEvents = new LinkedList<>(); - - private Map jmeToGlfwCursorMap = new HashMap<>(); - - /** - * Create a new mouse input attached to the given {@link LwjglWindowVR context}. - * @param context the context to which to attach the input. - */ - public GlfwMouseInputVR(LwjglWindowVR context) { - this.context = context; - } - - private void onCursorPos(long window, double xpos, double ypos) { - int x = (int) Math.round(xpos); - int y = context.getSettings().getHeight() - (int) Math.round(ypos); - - if (mouseX == 0) { - mouseX = x; - } - - if (mouseY == 0) { - mouseY = y; - } - - xDelta = x - mouseX; - yDelta = y - mouseY; - mouseX = x; - mouseY = y; - - if (xDelta != 0 || yDelta != 0) { - final MouseMotionEvent mouseMotionEvent = new MouseMotionEvent(x, y, xDelta, yDelta, mouseWheel, 0); - mouseMotionEvent.setTime(getInputTimeNanos()); - mouseMotionEvents.add(mouseMotionEvent); - } - } - - private void onWheelScroll(long window, double xOffset, double yOffset) { - mouseWheel += yOffset; - - final MouseMotionEvent mouseMotionEvent = new MouseMotionEvent(mouseX, mouseY, 0, 0, mouseWheel, (int) Math.round(yOffset)); - mouseMotionEvent.setTime(getInputTimeNanos()); - mouseMotionEvents.add(mouseMotionEvent); - } - private void onMouseButton(final long window, final int button, final int action, final int mods) { - final MouseButtonEvent mouseButtonEvent = new MouseButtonEvent(convertButton(button), action == GLFW_PRESS, mouseX, mouseY); - mouseButtonEvent.setTime(getInputTimeNanos()); - mouseButtonEvents.add(mouseButtonEvent); - } - - @Override - public void initialize() { - glfwSetCursorPosCallback(context.getWindowHandle(), cursorPosCallback = new GLFWCursorPosCallback() { - @Override - public void invoke(long window, double xpos, double ypos) { - onCursorPos(window, xpos, ypos); - } - }); - - glfwSetScrollCallback(context.getWindowHandle(), scrollCallback = new GLFWScrollCallback() { - @Override - public void invoke(final long window, final double xOffset, final double yOffset) { - onWheelScroll(window, xOffset, yOffset * WHEEL_SCALE); - } - }); - - glfwSetMouseButtonCallback(context.getWindowHandle(), mouseButtonCallback = new GLFWMouseButtonCallback() { - @Override - public void invoke(final long window, final int button, final int action, final int mods) { - onMouseButton(window, button, action, mods); - } - }); - - setCursorVisible(cursorVisible); - logger.fine("Mouse created."); - initialized = true; - } - - /** - * Set the position of the cursor on the display. - * @param x the x position of the cursor (pixel). - * @param y the y position of the cursor (pixel). - */ - public void setCursorPosition(int x, int y) { - if (!context.isRenderable()) { - return; - } - - glfwSetCursorPos(context.getWindowHandle(), x, y); - } - - /** - * Hide the active cursor within the display. - */ - public void hideActiveCursor() { - if (!context.isRenderable()) { - return; - } - - if (cursorVisible) { - glfwSetInputMode(context.getWindowHandle(), GLFW_CURSOR, GLFW_CURSOR_HIDDEN); - } - } - - /** - * Get the last delta in x (pixel). - * @return the last delta in x (pixel). - * @see #getLastDeltaY() - */ - public int getLastDeltaX() { - return xDelta; - } - - /** - * Get the last delta in y (pixel). - * @return the last delta in y (pixel). - * @see #getLastDeltaX() - */ - public int getLastDeltaY() { - return yDelta; - } - - /** - * Clear the last x and y deltas. - * @see #getLastDeltaX() - * @see #getLastDeltaY() - */ - public void clearDeltas() { - xDelta = 0; - yDelta = 0; - } - - /** - * Check if the input is initialized. - * @return true if the input is initialized and false otherwise. - */ - @Override - public boolean isInitialized() { - return initialized; - } - - @Override - public int getButtonCount() { - return GLFW_MOUSE_BUTTON_LAST + 1; - } - - @Override - public void update() { - while (!mouseMotionEvents.isEmpty()) { - listener.onMouseMotionEvent(mouseMotionEvents.poll()); - } - - while (!mouseButtonEvents.isEmpty()) { - listener.onMouseButtonEvent(mouseButtonEvents.poll()); - } - } - - @Override - public void destroy() { - if (!context.isRenderable()) { - return; - } - - cursorPosCallback.free(); - scrollCallback.free(); - mouseButtonCallback.free(); - - for (long glfwCursor : jmeToGlfwCursorMap.values()) { - glfwDestroyCursor(glfwCursor); - } - - logger.fine("Mouse destroyed."); - } - - @Override - public void setCursorVisible(boolean visible) { - cursorVisible = visible; - - if (!context.isRenderable()) { - return; - } - - if (cursorVisible) { - glfwSetInputMode(context.getWindowHandle(), GLFW_CURSOR, GLFW_CURSOR_NORMAL); - } else { - glfwSetInputMode(context.getWindowHandle(), GLFW_CURSOR, GLFW_CURSOR_DISABLED); - } - } - - @Override - public void setInputListener(RawInputListener listener) { - this.listener = listener; - } - - @Override - public long getInputTimeNanos() { - return (long) (glfwGetTime() * 1000000000); - } - - private long createGlfwCursor(JmeCursor jmeCursor) { - GLFWImage glfwImage = new GLFWImage(BufferUtils.createByteBuffer(GLFWImage.SIZEOF)); - - // TODO: currently animated cursors are not supported - IntBuffer imageData = jmeCursor.getImagesData(); - ByteBuffer buf = BufferUtils.createByteBuffer(imageData.capacity() * 4); - buf.asIntBuffer().put(imageData); - - glfwImage.set(jmeCursor.getWidth(), jmeCursor.getHeight(), buf); - - return glfwCreateCursor(glfwImage, jmeCursor.getXHotSpot(), jmeCursor.getYHotSpot()); - } - - @Override - public void setNativeCursor(JmeCursor jmeCursor) { - if (jmeCursor != null) { - Long glfwCursor = jmeToGlfwCursorMap.get(jmeCursor); - - if (glfwCursor == null) { - glfwCursor = createGlfwCursor(jmeCursor); - jmeToGlfwCursorMap.put(jmeCursor, glfwCursor); - } - - glfwSetCursor(context.getWindowHandle(), glfwCursor); - } else { - glfwSetCursor(context.getWindowHandle(), MemoryUtil.NULL); - } - } - - /** - * Simply converts the GLFW button code to a JME button code. If there is no - * match it just returns the GLFW button code. Bear in mind GLFW supports 8 - * different mouse buttons. - * - * @param glfwButton the raw GLFW button index. - * @return the mapped {@link MouseInput} button id. - */ - private int convertButton(final int glfwButton) { - switch (glfwButton) { - case GLFW_MOUSE_BUTTON_LEFT: - return MouseInput.BUTTON_LEFT; - case GLFW_MOUSE_BUTTON_MIDDLE: - return MouseInput.BUTTON_MIDDLE; - case GLFW_MOUSE_BUTTON_RIGHT: - return MouseInput.BUTTON_RIGHT; - default: - return glfwButton; - } - } -} diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/AbstractVRMouseManager.java b/jme3-vr/src/main/java/com/jme3/input/vr/AbstractVRMouseManager.java deleted file mode 100644 index 6be4cae9fb..0000000000 --- a/jme3-vr/src/main/java/com/jme3/input/vr/AbstractVRMouseManager.java +++ /dev/null @@ -1,226 +0,0 @@ -package com.jme3.input.vr; - -import java.util.logging.Logger; - -import org.lwjgl.glfw.GLFW; - -import com.jme3.app.VREnvironment; -import com.jme3.input.MouseInput; -import com.jme3.input.lwjgl.GlfwMouseInputVR; -import com.jme3.material.RenderState.BlendMode; -import com.jme3.math.Vector2f; -import com.jme3.system.AppSettings; -import com.jme3.system.lwjgl.LwjglWindow; -import com.jme3.texture.Texture; -import com.jme3.texture.Texture2D; -import com.jme3.ui.Picture; - -/** - * An abstract implementation of a {@link VRMouseManager}. This class should be overridden by specific hardware implementation of VR devices. - * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr - * - */ -public abstract class AbstractVRMouseManager implements VRMouseManager { - private static final Logger logger = Logger.getLogger(AbstractVRMouseManager.class.getName()); - - private VREnvironment environment = null; - - private boolean vrMouseEnabled = true; - private boolean mouseAttached = false; - private Picture mouseImage; - private int recentCenterCount = 0; - - protected final Vector2f cursorPos = new Vector2f(); - - private float ySize, sensitivity = 8f, acceleration = 2f; - - private boolean thumbstickMode; - private float moveScale = 1f; - - /** - * Create a new AbstractVRMouseManager attached to the given {@link VREnvironment VR environment}. - * @param environment the {@link VREnvironment VR environment} that this manager is attached to. - */ - public AbstractVRMouseManager(VREnvironment environment) { - this.environment = environment; - } - - @Override - public void initialize() { - logger.config("Initializing VR mouse manager."); - - // load default mouse image - mouseImage = new Picture("mouse"); - setImage("Common/Util/mouse.png"); - // hide default cursor by making it invisible - - MouseInput mi = environment.getApplication().getContext().getMouseInput(); - if( mi instanceof GlfwMouseInputVR ){ - ((GlfwMouseInputVR)mi).hideActiveCursor(); - } - centerMouse(); - - logger.config("Initialized VR mouse manager [SUCCESS]"); - } - - @Override - public VREnvironment getVREnvironment() { - return environment; - } - - @Override - public void setVRMouseEnabled(boolean enabled) { - vrMouseEnabled = enabled; - } - - @Override - public void setThumbstickMode(boolean set) { - thumbstickMode = set; - } - - @Override - public boolean isThumbstickMode() { - return thumbstickMode; - } - - @Override - public void setSpeed(float sensitivity, float acceleration) { - this.sensitivity = sensitivity; - this.acceleration = acceleration; - } - - @Override - public float getSpeedSensitivity() { - return sensitivity; - } - - @Override - public float getSpeedAcceleration() { - return acceleration; - } - - @Override - public float getMouseMoveScale() { - return moveScale; - } - - @Override - public void setMouseMoveScale(float set) { - moveScale = set; - } - - @Override - public void setImage(String texture) { - if (environment != null){ - - if (environment.getApplication() != null){ - if( environment.isInVR() == false ){ - Texture tex = environment.getApplication().getAssetManager().loadTexture(texture); - mouseImage.setTexture(environment.getApplication().getAssetManager(), (Texture2D)tex, true); - ySize = tex.getImage().getHeight(); - mouseImage.setHeight(ySize); - mouseImage.setWidth(tex.getImage().getWidth()); - mouseImage.getMaterial().getAdditionalRenderState().setBlendMode(BlendMode.Alpha); - mouseImage.getMaterial().getAdditionalRenderState().setDepthWrite(false); - } else { - Texture tex = environment.getApplication().getAssetManager().loadTexture(texture); - mouseImage.setTexture(environment.getApplication().getAssetManager(), (Texture2D)tex, true); - ySize = tex.getImage().getHeight(); - mouseImage.setHeight(ySize); - mouseImage.setWidth(tex.getImage().getWidth()); - mouseImage.getMaterial().getAdditionalRenderState().setBlendMode(BlendMode.Alpha); - mouseImage.getMaterial().getAdditionalRenderState().setDepthWrite(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 Vector2f getCursorPosition() { - - if (environment != null){ - if (environment.getApplication() != null){ - if( environment.isInVR() ) { - return cursorPos; - } - - return environment.getApplication().getInputManager().getCursorPosition(); - } 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 centerMouse() { - if (environment != null){ - if (environment.getApplication() != null){ - // set mouse in center of the screen if newly added - Vector2f size = environment.getVRGUIManager().getCanvasSize(); - MouseInput mi = environment.getApplication().getContext().getMouseInput(); - AppSettings as = environment.getApplication().getContext().getSettings(); - if( mi instanceof GlfwMouseInputVR ) ((GlfwMouseInputVR)mi).setCursorPosition((int)(as.getWidth() / 2f), (int)(as.getHeight() / 2f)); - if( environment.isInVR() ) { - cursorPos.x = size.x / 2f; - cursorPos.y = size.y / 2f; - recentCenterCount = 2; - } - } 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 we are showing the cursor, add our picture as it - if( vrMouseEnabled && environment.getApplication().getInputManager().isCursorVisible() ) { - if(!mouseAttached) { - mouseAttached = true; - environment.getApplication().getGuiViewPort().attachScene(mouseImage); - centerMouse(); - // the "real" mouse pointer should stay hidden - if (environment.getApplication().getContext() instanceof LwjglWindow){ - GLFW.glfwSetInputMode(((LwjglWindow)environment.getApplication().getContext()).getWindowHandle(), GLFW.GLFW_CURSOR, GLFW.GLFW_CURSOR_DISABLED); - } - } - // handle mouse movements, which may be in addition to (or exclusive from) tracked movement - MouseInput mi = environment.getApplication().getContext().getMouseInput(); - if( mi instanceof GlfwMouseInputVR ) { - if( recentCenterCount <= 0 ) { - //Vector2f winratio = VRGuiManager.getCanvasToWindowRatio(); - cursorPos.x += ((GlfwMouseInputVR)mi).getLastDeltaX();// * winratio.x; - cursorPos.y += ((GlfwMouseInputVR)mi).getLastDeltaY();// * winratio.y; - if( cursorPos.x < 0f ) cursorPos.x = 0f; - if( cursorPos.y < 0f ) cursorPos.y = 0f; - if( cursorPos.x > environment.getVRGUIManager().getCanvasSize().x ) cursorPos.x = environment.getVRGUIManager().getCanvasSize().x; - if( cursorPos.y > environment.getVRGUIManager().getCanvasSize().y ) cursorPos.y = environment.getVRGUIManager().getCanvasSize().y; - } else recentCenterCount--; - ((GlfwMouseInputVR)mi).clearDeltas(); - } - // ok, update the cursor graphic position - Vector2f currentPos = getCursorPosition(); - mouseImage.setLocalTranslation(currentPos.x, currentPos.y - ySize, environment.getVRGUIManager().getGuiDistance() + 1f); - - mouseImage.updateGeometricState(); - - } else if(mouseAttached) { - mouseAttached = false; - environment.getApplication().getGuiViewPort().detachScene(mouseImage); - - // Use the setCursorVisible implementation to show the cursor again, depending on the state of cursorVisible - boolean cursorVisible = environment.getApplication().getInputManager().isCursorVisible(); - environment.getApplication().getContext().getMouseInput().setCursorVisible(cursorVisible); - } - } -} 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 deleted file mode 100644 index 03868cedf7..0000000000 --- a/jme3-vr/src/main/java/com/jme3/input/vr/AbstractVRViewManager.java +++ /dev/null @@ -1,226 +0,0 @@ -package com.jme3.input.vr; - -import com.jme3.app.VREnvironment; -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.shadow.DirectionalLightShadowFilter; -import com.jme3.shadow.VRDirectionalLightShadowRenderer; -import com.jme3.texture.Texture2D; - -/** - * A VR view manager. This class holds methods that enable to submit 3D views to the VR compositor. - * System-dependent classes should extend this one. - * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr - */ -public abstract class AbstractVRViewManager implements VRViewManager { - //private static final Logger logger = Logger.getLogger(AbstractVRViewManager.class.getName()); - - protected VREnvironment environment = null; - - protected Camera leftCamera; - protected ViewPort leftViewPort; - protected FilterPostProcessor leftPostProcessor; - protected Texture2D leftEyeTexture; - protected Texture2D leftEyeDepth; - - protected Camera rightCamera; - protected ViewPort rightViewPort; - protected FilterPostProcessor rightPostProcessor; - protected Texture2D rightEyeTexture; - protected Texture2D rightEyeDepth; - - protected ViewPort mirrorViewPort; - - private float resMult = 1f; - - private float heightAdjustment; - - @Override - public Camera getLeftCamera() { - return leftCamera; - } - - @Override - public Camera getRightCamera() { - return rightCamera; - } - - @Override - public ViewPort getLeftViewPort() { - return leftViewPort; - } - - @Override - public ViewPort getRightViewPort() { - return rightViewPort; - } - - /** - * Get the {@link ViewPort view port} attached to the mirror display. - * @return the view port attached to the mirror display. - */ - @Override - public ViewPort getMirrorViewPort() { - return mirrorViewPort; - } - - - @Override - public Texture2D getLeftTexture(){ - return leftEyeTexture; - } - - @Override - public Texture2D getRightTexture(){ - return rightEyeTexture; - } - - @Override - public Texture2D getLeftDepth(){ - return leftEyeDepth; - } - - @Override - public Texture2D getRightDepth(){ - return rightEyeDepth; - } - - @Override - public FilterPostProcessor getLeftPostProcessor(){ - return leftPostProcessor; - } - - @Override - public FilterPostProcessor getRightPostProcessor(){ - return rightPostProcessor; - } - - @Override - public float getResolutionMuliplier() { - return resMult; - } - - @Override - public void setResolutionMultiplier(float resMult) { - this.resMult = resMult; - } - - @Override - public float getHeightAdjustment() { - return heightAdjustment; - } - - @Override - public void setHeightAdjustment(float amount) { - heightAdjustment = amount; - } - - @Override - public VREnvironment getVREnvironment(){ - return environment; - } - - /** - * Handles moving filters from the main view to each eye - */ - @Override - public void moveScreenProcessingToEyes() { - if (environment != null){ - if( getRightViewPort() == null ){ - return; - } - - if (environment.getApplication() != null){ - syncScreenProcessing(environment.getApplication().getViewPort()); - environment.getApplication().getViewPort().clearProcessors(); - } 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."); - } - } - - /** - * 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 (environment != null){ - if( getRightViewPort() == null ){ - return; - } - - if (environment.getApplication() != null){ - // set up post-processing filters - if( getRightPostProcessor() == null ) { - rightPostProcessor = new FilterPostProcessor(environment.getApplication().getAssetManager()); - leftPostProcessor = new FilterPostProcessor(environment.getApplication().getAssetManager()); - } - // clear out all filters & processors, to start from scratch - getRightPostProcessor().removeAllFilters(); - getLeftPostProcessor().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(getLeftPostProcessor()); - getRightViewPort().addProcessor(getRightPostProcessor()); - // Go through all of the filters in the processors list, - // add them to the left viewport processor, and 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 { - getLeftPostProcessor().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, light scattering etc. - } - getRightPostProcessor().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 - getLeftPostProcessor().addFilter(new TranslucentBucketFilter()); - getRightPostProcessor().addFilter(new TranslucentBucketFilter()); - } 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/AnalogActionState.java b/jme3-vr/src/main/java/com/jme3/input/vr/AnalogActionState.java deleted file mode 100644 index 58b377d6a7..0000000000 --- a/jme3-vr/src/main/java/com/jme3/input/vr/AnalogActionState.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.jme3.input.vr; - -/** - * @deprecated The jme3-vr module is deprecated and will be removed in a future version (as it only supports OpenVR). - * For new Virtual Reality projects, use user libraries that provide OpenXR support. - * See Virtual Reality JME wiki section - * for more information. - */ -@Deprecated -public class AnalogActionState{ - - /** - * The X coordinate of the analog data (typically between -1 and 1 for joystick coordinates or 0 and 1 for - * trigger pulls) - */ - public final float x; - - /** - * The Y coordinate of the analog data (typically between -1 and 1) - * - * Will be zero if the analog action doesn't have at least 2 dimensions - */ - public final float y; - - /** - * The Z coordinate of the analog data (typically between -1 and 1) - * - * Will be zero if the analog action doesn't have at least 3 dimensions - */ - public final float z; - - /** - * The change in the X coordinate since the last frame - */ - public final float deltaX; - - /** - * The change in the Y coordinate since the last frame - */ - public final float deltaY; - - /** - * The change in the Z coordinate since the last frame - */ - public final float deltaZ; - - public AnalogActionState(float x, float y, float z, float deltaX, float deltaY, float deltaZ){ - this.x = x; - this.y = y; - this.z = z; - this.deltaX = deltaX; - this.deltaY = deltaY; - this.deltaZ = deltaZ; - } -} diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/DigitalActionState.java b/jme3-vr/src/main/java/com/jme3/input/vr/DigitalActionState.java deleted file mode 100644 index ffe4baebf3..0000000000 --- a/jme3-vr/src/main/java/com/jme3/input/vr/DigitalActionState.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.jme3.input.vr; - -/** - * @deprecated The jme3-vr module is deprecated and will be removed in a future version (as it only supports OpenVR). - * For new Virtual Reality projects, use user libraries that provide OpenXR support. - * See Virtual Reality JME wiki section - * for more information. - */ -@Deprecated -public class DigitalActionState{ - - /** - * The current value of this action - */ - public final boolean state; - - /** - * If since the last loop the value of this action has changed - */ - public final boolean changed; - - public DigitalActionState(boolean state, boolean changed){ - this.state = state; - this.changed = changed; - } -} diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/HmdType.java b/jme3-vr/src/main/java/com/jme3/input/vr/HmdType.java deleted file mode 100644 index 8dfe9b9365..0000000000 --- a/jme3-vr/src/main/java/com/jme3/input/vr/HmdType.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.jme3.input.vr; - -/** - * The type of VR Head Mounted Device (HMD) - * @author reden - phr00t - https://github.com/phr00t - * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr - */ -public enum HmdType { - /** - * HTC vive Head Mounted Device (HMD). - */ - HTC_VIVE, - - /** - * Valve Index Head Mounted Device (HMD). - */ - VALVE_INDEX, - - /** - * Oculus Rift Head Mounted Device (HMD). - */ - OCULUS_RIFT, - - /** - * OSVR generic Head Mounted Device (HMD). - */ - OSVR, - - /** - * FOVE Head Mounted Device (HMD). - */ - FOVE, - - /** - * STARVR Head Mounted Device (HMD). - */ - STARVR, - - /** - * GameFace Head Mounted Device (HMD). - */ - GAMEFACE, - - /** - * PlayStation VR (formerly Morpheus) Head Mounted Device (HMD). - */ - MORPHEUS, - - /** - * Samsung GearVR Head Mounted Device (HMD). - */ - GEARVR, - - /** - * a null Head Mounted Device (HMD). - */ - NULL, - - /** - * a none Head Mounted Device (HMD). - */ - NONE, - - /** - * a not referenced Head Mounted Device (HMD). - */ - OTHER -} \ No newline at end of file diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/VRAPI.java b/jme3-vr/src/main/java/com/jme3/input/vr/VRAPI.java deleted file mode 100644 index 2b0534d6a5..0000000000 --- a/jme3-vr/src/main/java/com/jme3/input/vr/VRAPI.java +++ /dev/null @@ -1,183 +0,0 @@ -package com.jme3.input.vr; - -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; - -/** - * An interface that represents a VR system. This interface has to be implemented in order to wrap underlying VR system (OpenVR, OculusVR, ...) - * @author reden - phr00t - https://github.com/phr00t - * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr - */ -public interface VRAPI { - /** - * Initialize this object from a VR system. All the native bindings to underlying VR system should be done within this method. - * @return true if the initialization is a success and false otherwise. - */ - public boolean initialize(); - - /** - * Initialize the VR compositor that will be used for rendering. - * @param allowed true if the use of VR compositor is allowed and false otherwise. - * @return true if the initialization is a success and false otherwise. - */ - public boolean initVRCompositor(boolean allowed); - - /** - * Get the object that wraps natively the VR system. - * @return the object that wraps natively the VR system. - */ - public Object getVRSystem(); - - /** - * Get the object that wraps natively the VR compositor. - * @return the object that wraps natively the VR system. - */ - public Object getCompositor(); - - /** - * Get the name of the underlying VR system. - * @return the name of the underlying VR system. - */ - public String getName(); - - /** - * Get the input provided by the underlying VR system. - * @return the input provided by the underlying VR system. - */ - public VRInputAPI getVRinput(); - - /** - * Flip the left and right eye. - * @param set true if the eyes has to be flipped and false otherwise. - */ - public void setFlipEyes(boolean set); - - /** - * Set if latency information has to be logged. - * @param set true if latency information has to be logged and false otherwise. - */ - public void printLatencyInfoToConsole(boolean set); - - /** - * Get the Head Mounted Device (HMD) display frequency. - * @return the Head Mounted Device (HMD) display frequency. - */ - public int getDisplayFrequency(); - - /** - * Close the link with underlying VR system and free all attached resources. - */ - public void destroy(); - - /** - * Check if the VR API is initialized. - * @return true if the VR API is initialized and false otherwise. - * @see #initialize() - */ - public boolean isInitialized(); - - /** - * Reset the VR system. After a call to this method, the current position of the HMD should be - * the origin (i-e the observer without any combined transformation). - */ - public void reset(); - - /** - * Get the size of a Head Mounted Device (HMD) rendering area in pixels. - * @param store the size of a Head Mounted Device (HMD) rendering area in pixels (modified). - */ - public void getRenderSize(Vector2f store); - - //public float getFOV(int dir); - - /** - * Get the Head Mounted Device (HMD) interpupilar distance in meters. - * @return the Head Mounted Device (HMD) interpupilar distance in meters. - */ - public float getInterpupillaryDistance(); - - /** - * Get the Head Mounted Device (HMD) orientation. - * @return the Head Mounted Device (HMD) orientation. - */ - public Quaternion getOrientation(); - - /** - * Get the Head Mounted Device (HMD) position. - * @return the Head Mounted Device (HMD) orientation. - */ - public Vector3f getPosition(); - - /** - * Get the Head Mounted Device (HMD) position and orientation. - * @param storePos the Head Mounted Device (HMD) position (modified). - * @param storeRot the Head Mounted Device (HMD) rotation (modified). - */ - public void getPositionAndOrientation(Vector3f storePos, Quaternion storeRot); - - /** - * Update Head Mounted Device (HMD) pose internal storage. This method should be called before other calls to HMD position/orientation access. - */ - public void updatePose(); - - /** - * Get the Head Mounted Device (HMD) left eye projection matrix. - * @param cam the camera attached to the left eye. - * @return the Head Mounted Device (HMD) left eye projection matrix. - */ - public Matrix4f getHMDMatrixProjectionLeftEye(Camera cam); - - /** - * Get the Head Mounted Device (HMD) right eye projection matrix. - * @param cam the camera attached to the right eye. - * @return the Head Mounted Device (HMD) right eye projection matrix. - */ - public Matrix4f getHMDMatrixProjectionRightEye(Camera cam); - - /** - * Get the Head Mounted Device (HMD) left eye pose (position of the eye from the head) as a {@link Vector3f vector}. - * @return the Head Mounted Device (HMD) left eye pose as a {@link Vector3f vector}. - */ - public Vector3f getHMDVectorPoseLeftEye(); - - /** - * Get the Head Mounted Device (HMD) right eye pose (position of the eye from the head) as a {@link Vector3f vector}. - * @return the Head Mounted Device (HMD) right eye pose as a {@link Vector3f vector}. - */ - public Vector3f getHMDVectorPoseRightEye(); - - /** - * Returns the transform between the view space and left eye space. - * Eye space is the per-eye flavor of view space that provides stereo disparity. - * Instead of Model * View * Projection the model is Model * View * Eye * Projection. - * Normally View and Eye will be multiplied together and treated as View. - * This matrix incorporates the user's interpupillary distance (IPD). - * @return the transform between the view space and eye space. - */ - public Matrix4f getHMDMatrixPoseLeftEye(); - - /** - * Returns the transform between the view space and right eye space. - * Eye space is the per-eye flavor of view space that provides stereo disparity. - * Instead of Model * View * Projection the model is Model * View * Eye * Projection. - * Normally View and Eye will be multiplied together and treated as View. - * This matrix incorporates the user's interpupillary distance (IPD). - * @return the transform between the view space and eye space. - */ - public Matrix4f getHMDMatrixPoseRightEye(); - - /** - * Get the Head Mounted Device (HMD) type. - * @return the Head Mounted Device (HMD) type. - */ - public HmdType getType(); - - /** - * Get the seated to absolute position. - * @return the seated to absolute position. - */ - public Vector3f getSeatedToAbsolutePosition(); -} diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/VRBounds.java b/jme3-vr/src/main/java/com/jme3/input/vr/VRBounds.java deleted file mode 100644 index 179dbb1b08..0000000000 --- a/jme3-vr/src/main/java/com/jme3/input/vr/VRBounds.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.jme3.input.vr; - -import com.jme3.math.Vector2f; - -/** - * This interface describes the VR playground bounds. - * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr - * - */ -public interface VRBounds { - - /** - * Get the size of the VR playground. - * @return the size of the VR playground. - */ - public Vector2f getPlaySize(); -} diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/VRInputAPI.java b/jme3-vr/src/main/java/com/jme3/input/vr/VRInputAPI.java deleted file mode 100644 index 113a23c1f2..0000000000 --- a/jme3-vr/src/main/java/com/jme3/input/vr/VRInputAPI.java +++ /dev/null @@ -1,390 +0,0 @@ -package com.jme3.input.vr; - -import com.jme3.math.Quaternion; -import com.jme3.math.Vector2f; -import com.jme3.math.Vector3f; - -/** - * An interface that represents a VR input (typically a VR device such as a controller). - * @author reden - phr00t - https://github.com/phr00t - * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr - */ -public interface VRInputAPI { - - /** - * Registers an action manifest. An action manifest is a file that defines "actions" a player can make. - * (An action is an abstract version of a button press). The action manifest may then also include references to - * further files that define default mappings between those actions and physical buttons on the VR controllers. - * - * Note that registering an actions manifest will deactivate legacy inputs. i.e. methods such as {@link #isButtonDown} - * will no longer work - * - * See https://github.com/ValveSoftware/openvr/wiki/Action-manifest for documentation on how to create an - * action manifest - * - * This option is only relevant to OpenVR - * - * @param actionManifestAbsolutePath - * the absolute file path to an actions manifest - * @param startingActiveActionSet - * the actions in the manifest are divided into action sets (groups) by their prefix (e.g. "/actions/main"). - * These action sets can be turned off and on per frame. This argument sets the action set that will be - * active now. The active action sets can be later be changed by calling {@link #setActiveActionSet}. - * Note that at present only a single set at a time is supported - * - */ - default void registerActionManifest( String actionManifestAbsolutePath, String startingActiveActionSet ){ - throw new UnsupportedOperationException("Action manifests are not supported for the currently used VR API"); - } - - /** - * Updates the active action set (the action group that will have their states available to be polled). - * - * Note that this update will not take effect until the next loop - * Note that at present only a single set at a time is supported - * - * @param activeActionSet - * the actions in the manifest are divided into action sets (groups) by their prefix (e.g. "/actions/main"). - * These action sets can be turned off and on per frame. This argument sets the action set that will be - * active now. - */ - default void setActiveActionSet( String activeActionSet ){ - throw new UnsupportedOperationException("Action manifests are not supported for the currently used VR API"); - } - - /** - * Gets the current state of the action (abstract version of a button press). - * - * This is called for digital style actions (a button is pressed, or not) - * - * This method is commonly called when it's not important which hand the action is bound to (e.g. if a button press - * is opening your inventory that could be bound to either left or right hand and that would not matter). - * - * If the handedness matters use {@link #getDigitalActionState(String, String)} - * - * {@link #registerActionManifest} must have been called before using this method. - * - * @param actionName The name of the action. Will be something like /actions/main/in/openInventory - * @return the DigitalActionState that has details on if the state has changed, what the state is etc. - */ - default DigitalActionState getDigitalActionState( String actionName ){ - return getDigitalActionState(actionName, null); - } - - /** - * Gets the current state of the action (abstract version of a button press). - * - * This is called for digital style actions (a button is pressed, or not) - * - * This method is commonly called when it is important which hand the action is found on. For example while - * holding a weapon a button may be bound to "eject magazine" to allow you to load a new one, but that would only - * want to take effect on the hand that is holding the weapon - * - * Note that restrictToInput only restricts, it must still be bound to the input you want to receive the input from in - * the action manifest default bindings. - * - * {@link #registerActionManifest} must have been called before using this method. - * - * @param actionName The name of the action. E.g. /actions/main/in/openInventory - * @param restrictToInput the input to restrict the action to. E.g. /user/hand/right. Or null, which means "any input" - * @return the DigitalActionState that has details on if the state has changed, what the state is etc. - */ - default DigitalActionState getDigitalActionState( String actionName, String restrictToInput ){ - throw new UnsupportedOperationException("Action manifests are not supported for the currently used VR API"); - } - - /** - * Gets the current state of the action (abstract version of a button press). - * - * This is called for analog style actions (most commonly joysticks, but button pressure can also be mapped in analog). - * - * This method is commonly called when it's not important which hand the action is bound to (e.g. if the thumb stick - * is controlling a third-person character in-game that could be bound to either left or right hand and that would - * not matter). - * - * If the handedness matters use {@link #getAnalogActionState(String, String)} - * - * {@link #registerActionManifest} must have been called before using this method. - * - * @param actionName The name of the action. E.g. /actions/main/in/openInventory - * @return the DigitalActionState that has details on if the state has changed, what the state is etc. - */ - default AnalogActionState getAnalogActionState( String actionName ){ - return getAnalogActionState(actionName, null); - } - - /** - * Gets the current state of the action (abstract version of a button press). - * - * This is called for analog style actions (most commonly joysticks, but button pressure can also be mapped in analog). - * - * This method is commonly called when it is important which hand the action is found on. For example an "in universe" - * joystick that has a hat control might (while you are holding it) bind to the on-controller hat, but only on the hand - * holding it - * - * Note that restrictToInput only restricts, it must still be bound to the input you want to receive the input from in - * the action manifest default bindings. - * - * {@link #registerActionManifest} must have been called before using this method. - * - * @param actionName The name of the action. E.g. /actions/main/in/openInventory - * @param restrictToInput the input to restrict the action to. E.g. /user/hand/right. Or null, which means "any input" - * @return the DigitalActionState that has details on if the state has changed, what the state is etc. - */ - default AnalogActionState getAnalogActionState( String actionName, String restrictToInput ){ - throw new UnsupportedOperationException("Action manifests are not supported for the currently used VR API"); - } - - /** - * Check if the given button is down (more generally if the given input type is activated). - * - * @deprecated Use the action-manifest approach instead. See {@link #registerActionManifest}. - * Note: action-manifest will only work with the OpenVR api. - * - * @param controllerIndex the index of the controller to check. - * @param checkButton the button / input to check. - * @return true if the button / input is down / activated and false otherwise. - */ - @Deprecated - public boolean isButtonDown(int controllerIndex, VRInputType checkButton); - - /** - * Check if the given button / input from the given controller has been just pressed / activated. - * - * @deprecated Use the action-manifest approach instead. See {@link #registerActionManifest}. - * Note: action-manifest will only work with the OpenVR api. - * - * @param controllerIndex the index of the controller. - * @param checkButton the button / input to check. - * @return true if the given input from the given controller has just been activated, - * false otherwise. - */ - @Deprecated - public boolean wasButtonPressedSinceLastCall(int controllerIndex, VRInputType checkButton); - - /** - * Reset the current activation of the inputs. After a call to this method, any input activation is - * considered a new activation. - * - * @see #wasButtonPressedSinceLastCall(int, VRInputType) - * - * @deprecated Use the action-manifest approach instead. See {@link #registerActionManifest}. - * Note: action-manifest will only work with the OpenVR api. - */ - @Deprecated - public void resetInputSinceLastCall(); - - /** - * Get the controller axis delta from the last value. - * - * @deprecated Use action-manifest approach instead. See {@link #registerActionManifest}. - * Note: action-manifest will only work with the OpenVR api. - * - * @param controllerIndex the index of the controller. - * @param forAxis the axis. - * @return the controller axis delta from the last call. - */ - @Deprecated - public Vector2f getAxisDeltaSinceLastCall(int controllerIndex, VRInputType forAxis); - - /** - * Get the controller velocity on all axes. - * @param controllerIndex the index of the controller. - * @return the controller velocity on all axes. - * @see #getAngularVelocity(int) - */ - public Vector3f getVelocity(int controllerIndex); - - /** - * Get the controller angular velocity on all axes. - * @param controllerIndex the index of the controller. - * @return the controller angular velocity on all axes. - * @see #getVelocity(int) - */ - public Vector3f getAngularVelocity(int controllerIndex); - - /** - * Get the axis value for the given input on the given controller. - * This value is the {@link #getAxisRaw(int, VRInputType) raw value} multiplied by the - * {@link #getAxisMultiplier() axis multiplier}. - * - * @deprecated Use action-manifest approach instead. See {@link #registerActionManifest}. - * Note: action-manifest will only work with the OpenVR api. - * - * @param controllerIndex the index of the controller. - * @param forAxis the axis. - * @return the axis value for the given input on the given controller. - * @see #getAxisRaw(int, VRInputType) - * @see #getAxisMultiplier() - */ - @Deprecated - public Vector2f getAxis(int controllerIndex, VRInputType forAxis); - - /** - * Get the axis value for the given input on the given controller. - * - * @deprecated Use the action-manifest approach. See {@link #registerActionManifest}. - * Note: action-manifest will only work with the OpenVR api. - * - * @param controllerIndex the index of the controller. - * @param forAxis the axis. - * @return the axis value for the given input on the given controller. - * @see #getAxis(int, VRInputType) - */ - @Deprecated - public Vector2f getAxisRaw(int controllerIndex, VRInputType forAxis); - - /** - * Initialize the input. - * @return true if the initialization is successful and false otherwise. - */ - public boolean init(); - - /** - * Get the number of tracked controllers (for example, hand controllers) attached to the VR system. - * @return the number of controllers attached to the VR system. - * @see #getTrackedController(int) - */ - public int getTrackedControllerCount(); - - /** - * Get a tracked controller (for example, a hand controller) that is attached to the VR system. - * @param index the index of the controller. - * @return the tracked controller (for example, a hand controller) that is attached to the VR system. - * @see #getTrackedControllerCount() - */ - public VRTrackedController getTrackedController(int index); - - /** - * Update the connected controllers. - * This method should be used just after the initialization of the input. - */ - public void updateConnectedControllers(); - - /** - * Update the controller states. - * This method should be called before accessing any controller data. - */ - public void updateControllerStates(); - - /** - * Get the native wrapping of a controller state. - * @param index the index of the controller. - * @return the native wrapping of a controller state. - */ - public Object getRawControllerState(int index); - - /** - * Swap the two hands (exchange the hands' controller 1 and 2 indices). - */ - public void swapHands(); - - /** - * Get the controller axis multiplier. - * The controller axis raw data (trackpad, trigger, ...) value is multiplied by the one given in parameter. - * @return the controller axis multiplier. - * @see #setAxisMultiplier(float) - */ - public float getAxisMultiplier(); - - /** - * Set the controller axis multiplier. - * The controller axis raw data (trackpad, trigger, ...) value is multiplied by the one given in parameter. - * @param set the controller axis multiplier. - * @see #getAxisMultiplier() - */ - public void setAxisMultiplier(float set); - - //public Matrix4f getPoseForInputDevice(int index); - - /** - * Check if the VR system has the focus and if it's not used by other process. - * @return true if the VR system has the focus and false otherwise. - */ - public boolean isInputFocused(); - - /** - * Check if the input device is actually tracked (i-e if we can obtain a pose from the input). - * @param index the index of the controller. - * @return true if the input device is actually tracked and false otherwise. - */ - public boolean isInputDeviceTracking(int index); - - /** - * Get the orientation of the input. - * @param index the index of the controller. - * @return the orientation of the input. - */ - public Quaternion getOrientation(int index); - - /** - * Get the position of the input. - * @param index the index of the controller. - * @return the position of the input. - */ - public Vector3f getPosition(int index); - - /** - * Get where is the controller pointing, after all rotations are combined. - * This position should include observer rotation from the VR application. - * @param index the index of the controller. - * @return the rotation of the input after all positional tracking is complete. - */ - public Quaternion getFinalObserverRotation(int index); - - /** - * Get the position of the input after all positional tracking is complete. - * This position should include observer position from the VR application. - * @param index the index of the controller. - * @return the position of the input after all positional tracking is complete. - */ - public Vector3f getFinalObserverPosition(int index); - - /** - * Trigger a haptic pulse on the selected controller for the duration given in parameters (in seconds). - * - * @deprecated Use triggerHapticAction instead - it has more options and doesn't use deprecated methods. - * - * @param controllerIndex the index of the controller. - * @param seconds the duration of the pulse in seconds. - */ - @Deprecated - public void triggerHapticPulse(int controllerIndex, float seconds); - - /** - * Triggers a haptic action (aka a vibration). - * - * Note: if you want a haptic action in only one hand, you can either bind the action to one hand in - * the action manifest's standard bindings or bind to both and use - * {@link #triggerHapticAction(String, float, float, float, String)} - * to control which input it gets set to at runtime. - * - * @param actionName The name of the action. Will be something like /actions/main/out/vibrate - * @param duration how long in seconds the - * @param frequency in cycles per second - * @param amplitude between 0 and 1 - */ - default void triggerHapticAction( String actionName, float duration, float frequency, float amplitude){ - triggerHapticAction( actionName, duration, frequency, amplitude, null ); - } - - /** - * Triggers a haptic action (aka a vibration) restricted to just one input (e.g. left or right hand). - * - * Note: restrictToInput only restricts which input is used at runtime. You must still bind the input - * you want to send the haptic to in the action manifest default bindings. - * - * This method is typically used by binding the haptic to both hands, and then deciding at runtime which - * hand it should be sent to. - * - * @param actionName The name of the action. Will be something like /actions/main/out/vibrate - * @param duration how long in seconds the - * @param frequency in cycles per second - * @param amplitude between 0 and 1 - * @param restrictToInput the input to restrict the action to, such as /user/hand/right or - * /user/hand/left. null means "any input". - */ - default void triggerHapticAction( String actionName, float duration, float frequency, float amplitude, String restrictToInput){ - throw new UnsupportedOperationException("Action manifests are not supported for the currently used VR API"); - } -} diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/VRInputType.java b/jme3-vr/src/main/java/com/jme3/input/vr/VRInputType.java deleted file mode 100644 index f4e145c708..0000000000 --- a/jme3-vr/src/main/java/com/jme3/input/vr/VRInputType.java +++ /dev/null @@ -1,149 +0,0 @@ -package com.jme3.input.vr; - -/** - * The type of a VR input. This enumeration enables to determine which part of the VR device is involved within input callback. - * @author reden - phr00t - https://github.com/phr00t - * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr - * - * Deprecated, use the LWJGL openVR bindings and use actions instead - * - */ -@Deprecated -public enum VRInputType { - /** - * an HTC vive trigger axis (about Vive controller). - */ - ViveTriggerAxis(0), - - /** - * an HTC vive trackpad axis (about Vive controller). - */ - ViveTrackpadAxis(1), - - /** - * an HTC vive grip button (about Vive controller). - */ - ViveGripButton(2), - - /** - * an HTC vive menu button (about Vive controller). - */ - ViveMenuButton(3), - - /** - * The thumbstick on the Oculus Touch controllers. - * - * Unlike the Vive controllers where the touchpad is commonly used - * as a virtual DPad, you should avoid using the thumbstick for purposes - * that do not require analog input. - */ - OculusThumbstickAxis(0), - - /** - * The trigger button on the Oculus Touch controllers. - * - * This is the button under the user's index finger, and should not be used to - * pick up objects. See the - * Oculus Developer documentation. - */ - OculusTriggerAxis(0), - - /** - * The 'grab' button on the Oculus Touch controllers. - * - * This button should only (unless you have a compelling reason otherwise) be used to pick up objects. - */ - OculusGripAxis(0), - - /** - * The upper buttons on the Oculus Touch controllers - B on the right controller, and Y on the left. - */ - OculusTopButton(org.lwjgl.ovr.OVR.ovrButton_B | org.lwjgl.ovr.OVR.ovrButton_Y), - - /** - * The lower (not counting menu) buttons on the Oculus Touch - * controllers - A on the right controller, and X on the left. - */ - OculusBottomButton(org.lwjgl.ovr.OVR.ovrButton_A | org.lwjgl.ovr.OVR.ovrButton_X), - - /** - * The 'click' button on the Oculus Touch thumbsticks. - */ - OculusThumbstickButton(org.lwjgl.ovr.OVR.ovrButton_LThumb | org.lwjgl.ovr.OVR.ovrButton_RThumb), - - /** - * The game-usable menu button, under and to the left of the 'X' button on the left controller. - * - * Most games use this to pause - it preferably should be used for at least that purpose, and is - * uncomfortable to rest your thumb on (in games where you suddenly have to pause/open a menu). - */ - OculusMenuButton(org.lwjgl.ovr.OVR.ovrButton_Enter), - - /** - * The capacitive touch sensors on the top buttons (Y and B) of the Oculus Touch. - */ - OculusTopTouch(org.lwjgl.ovr.OVR.ovrTouch_B | org.lwjgl.ovr.OVR.ovrTouch_Y), - - /** - * The capacitive touch sensors on the lower buttons (X and A) of the Oculus Touch. - */ - OculusBottomTouch(org.lwjgl.ovr.OVR.ovrTouch_A | org.lwjgl.ovr.OVR.ovrTouch_X), - - /** - * The capacitive touch sensors on the thumbsticks of the Oculus Touch. - */ - OculusThumbstickTouch(org.lwjgl.ovr.OVR.ovrTouch_LThumb | org.lwjgl.ovr.OVR.ovrTouch_RThumb), - - /** - * The capacitive touch sensors on the thumbrests of the Oculus Touch - this is a textured pad - * on the Oculus Touch controller next to the ABXY buttons for users to reset their thumbs on. - * - * While it probably goes without saying, only use this for gesture support and do not bind game - * elements to it. - */ - OculusThumbrestTouch(org.lwjgl.ovr.OVR.ovrTouch_LThumbRest | org.lwjgl.ovr.OVR.ovrTouch_RThumbRest), - - /** - * The state of a software calculation based on the capacitive touch sensor values that determine if - * the user has lifted their thumb off the controller, and can be used for gesture support. - * - * This should be used instead of calculating this yourself based on the touch results of all the other - * parts of the controller. - */ - OculusThumbUp(org.lwjgl.ovr.OVR.ovrTouch_LThumbUp | org.lwjgl.ovr.OVR.ovrTouch_RThumbUp), - - /** - * Is the user resting their finger on the trigger of an Oculus Touch controller? - */ - OculusIndexTouch(org.lwjgl.ovr.OVR.ovrTouch_LIndexPointing | org.lwjgl.ovr.OVR.ovrTouch_RIndexPointing), - - /** - * Is the user pointing their finger forwards, as if to press a button? - * - * This is internally calculated from proximity and filtering is applied - it should be used rather - * than !OculusIndexTouch, as it will probably lead to better results. - */ - OculusIndexPointing(org.lwjgl.ovr.OVR.ovrTouch_LIndexPointing | org.lwjgl.ovr.OVR.ovrTouch_RIndexPointing); - - /** - * The value that codes the input type. - */ - private final int value; - - /** - * Construct a new input type with the given code. - * @param value the code of the input type. - */ - private VRInputType(int value) { - this.value = value; - } - - /** - * Get the value (code) of the input type. - * @return the value (code) of the input type. - */ - public int getValue() { - return value; - } -} \ No newline at end of file diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/VRMouseManager.java b/jme3-vr/src/main/java/com/jme3/input/vr/VRMouseManager.java deleted file mode 100644 index b6923388f2..0000000000 --- a/jme3-vr/src/main/java/com/jme3/input/vr/VRMouseManager.java +++ /dev/null @@ -1,111 +0,0 @@ -package com.jme3.input.vr; - -import com.jme3.app.VREnvironment; -import com.jme3.input.controls.AnalogListener; -import com.jme3.math.Vector2f; - -/** - * A class dedicated to the handling of the mouse within VR environment. - * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr - */ -public interface VRMouseManager { - /** - * Initialize the VR mouse manager. - */ - public void initialize(); - - /** - * Get the {@link VREnvironment VR Environment} to which this manager is attached. - * @return the {@link VREnvironment VR Environment} to which this manager is attached. - */ - public VREnvironment getVREnvironment(); - - /** - * Set if the mouse cursor should be used in the VR view. - * @param enabled true if the mouse cursor should be displayed in VR and false otherwise. - */ - public void setVRMouseEnabled(boolean enabled); - - /** - * Set if the VR device controller is used within thumb stick mode. - * @param set true if the VR device controller is used within thumb stick mode and false otherwise. - */ - public void setThumbstickMode(boolean set); - - /** - * Get if the VR device controller is used within thumb stick mode. - * @return true if the VR device controller is used within thumb stick mode and false otherwise. - */ - public boolean isThumbstickMode(); - - /** - * Set the speed of the mouse. - * @param sensitivity the sensitivity of the mouse. - * @param acceleration the acceleration of the mouse. - * @see #getSpeedAcceleration() - * @see #getSpeedSensitivity() - */ - public void setSpeed(float sensitivity, float acceleration); - - /** - * Get the sensitivity of the mouse. - * @return the sensitivity of the mouse. - * @see #setSpeed(float, float) - */ - public float getSpeedSensitivity(); - - /** - * Get the acceleration of the mouse. - * @return the acceleration of the mouse. - * @see #setSpeed(float, float) - */ - public float getSpeedAcceleration(); - - /** - * Get the move scale. - * return the move scale. - * @see #setMouseMoveScale(float) - */ - public float getMouseMoveScale(); - - /** - * Set the mouse move scale. - * @param set the mouse move scale. - * @see #getMouseMoveScale() - */ - public void setMouseMoveScale(float set); - - /** - * Set the image to use as mouse cursor. The given string describe an asset that the underlying application asset manager has to load. - * @param texture the image to use as mouse cursor. - */ - public void setImage(String texture); - - /** - * Update analog controller as it was a mouse controller. - * @param inputIndex the index of the controller attached to the VR system. - * @param mouseListener the JMonkey mouse listener to trigger. - * @param mouseXName the mouseX identifier. - * @param mouseYName the mouseY identifier - * @param tpf the time per frame. - */ - public void updateAnalogAsMouse(int inputIndex, AnalogListener mouseListener, String mouseXName, String mouseYName, float tpf); - - /** - * Get the actual cursor position. - * @return the actual cursor position. - */ - public Vector2f getCursorPosition(); - - /** - * Center the mouse on the display. - */ - public void centerMouse(); - - /** - * Update the mouse manager. This method should not be called manually. - * The standard behavior for this method is to be called from the {@link VRViewManager#update(float) update method} of the attached {@link VRViewManager VR view manager}. - * @param tpf the time per frame. - */ - public void update(float tpf); -} diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/VRTrackedController.java b/jme3-vr/src/main/java/com/jme3/input/vr/VRTrackedController.java deleted file mode 100644 index e5133d2e38..0000000000 --- a/jme3-vr/src/main/java/com/jme3/input/vr/VRTrackedController.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.jme3.input.vr; - -import com.jme3.math.Matrix4f; -import com.jme3.math.Quaternion; -import com.jme3.math.Vector3f; - -/** - * TODO - * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr - */ -public interface VRTrackedController { - /** - * Get the controller name. - * @return the controller name. - */ - public String getControllerName(); - - /** - * Get the controller manufacturer. - * @return the controller manufacturer. - */ - public String getControllerManufacturer(); - - /** - * Get the position of the tracked device. This value is the translation component of the device {@link #getPose() pose}. - * @return the position of the tracked device. - * @see #getOrientation() - * @see #getPose() - */ - public Vector3f getPosition(); - - /** - * Get the orientation of the tracked device. This value is the rotation component of the device {@link #getPose() pose}. - * @return the orientation of the tracked device. - * @see #getPosition() - * @see #getPose() - */ - public Quaternion getOrientation(); - - /** - * Get the pose of the tracked device. - * The pose is a 4x4 matrix than combine the {@link #getPosition() position} and the {@link #getOrientation() orientation} of the device. - * @return the pose of the tracked device. - * @see #getPosition() - * @see #getOrientation() - */ - public Matrix4f getPose(); -} diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/VRViewManager.java b/jme3-vr/src/main/java/com/jme3/input/vr/VRViewManager.java deleted file mode 100644 index 87aaadff90..0000000000 --- a/jme3-vr/src/main/java/com/jme3/input/vr/VRViewManager.java +++ /dev/null @@ -1,172 +0,0 @@ -package com.jme3.input.vr; - -import com.jme3.app.VRAppState; -import com.jme3.app.VREnvironment; -import com.jme3.app.state.AppState; -import com.jme3.post.FilterPostProcessor; -import com.jme3.renderer.Camera; -import com.jme3.renderer.ViewPort; -import com.jme3.texture.Texture2D; - -/** - * A VR view manager. This interface describes methods that enable to submit 3D views to the VR compositor. - * @author reden - phr00t - https://github.com/phr00t - * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr - */ -public interface VRViewManager { - - /** - * The name of the left view. - */ - public final static String LEFT_VIEW_NAME = "Left View"; - - /** - * The name of the right view. - */ - public final static String RIGHT_VIEW_NAME = "Right View"; - - /** - * Get the {@link Camera camera} attached to the left eye. - * @return the {@link Camera camera} attached to the left eye. - * @see #getRightCamera() - */ - public Camera getLeftCamera(); - - /** - * Get the {@link Camera camera} attached to the right eye. - * @return the {@link Camera camera} attached to the right eye. - * @see #getLeftCamera() - */ - public Camera getRightCamera(); - - /** - * Get the {@link ViewPort viewport} attached to the left eye. - * @return the {@link ViewPort viewport} attached to the left eye. - * @see #getRightViewPort() - */ - public ViewPort getLeftViewPort(); - - - /** - * Get the {@link ViewPort viewport} attached to the right eye. - * @return the {@link ViewPort viewport} attached to the right eye. - * @see #getLeftViewPort() - */ - public ViewPort getRightViewPort(); - - /** - * Get the {@link ViewPort view port} attached to the mirror display. - * @return the view port attached to the mirror display. - * @see #getLeftViewPort() - * @see #getRightViewPort() - */ - public ViewPort getMirrorViewPort(); - - /** - * Get the texture attached to the left eye. - * @return the texture attached to the left eye. - * @see #getRightTexture() - */ - public Texture2D getLeftTexture(); - - /** - * Get the texture attached to the right eye. - * @return the texture attached to the right eye. - * @see #getLeftTexture() - */ - public Texture2D getRightTexture(); - - /** - * Get the depth texture attached to the left eye. - * @return the texture attached to the left eye. - * @see #getRightTexture() - */ - public Texture2D getLeftDepth(); - - /** - * Get the depth texture attached to the right eye. - * @return the texture attached to the right eye. - * @see #getLeftTexture() - */ - public Texture2D getRightDepth(); - - /** - * Get the {@link FilterPostProcessor filter post processor} attached to the left eye. - * @return the {@link FilterPostProcessor filter post processor} attached to the left eye. - * @see #getRightPostProcessor() - */ - public FilterPostProcessor getLeftPostProcessor(); - - /** - * Get the {@link FilterPostProcessor filter post processor} attached to the right eye. - * @return the {@link FilterPostProcessor filter post processor} attached to the right eye. - * @see #getLeftPostProcessor() - */ - public FilterPostProcessor getRightPostProcessor(); - - /** - * Get the resolution multiplier. - * @return the resolution multiplier. - * @see #setResolutionMultiplier(float) - */ - public float getResolutionMuliplier(); - - /** - * Set the resolution multiplier. - * @param resMult the resolution multiplier. - * @see #getResolutionMuliplier() - */ - public void setResolutionMultiplier(float resMult); - - /** - * Get the height adjustment to apply to the cameras before rendering. - * @return the height adjustment to apply to the cameras before rendering. - * @see #setHeightAdjustment(float) - */ - public float getHeightAdjustment(); - - /** - * Set the height adjustment to apply to the cameras before rendering. - * @param amount the height adjustment to apply to the cameras before rendering. - * @see #getHeightAdjustment() - */ - public void setHeightAdjustment(float amount); - - /** - * Get the {@link VREnvironment VR environment} to which the view manager is attached. - * @return the {@link VREnvironment VR environment} to which the view manager is attached. - */ - public VREnvironment getVREnvironment(); - - /** - * Initialize the VR view manager. This method should be called after the attachment of a {@link VREnvironment VR environment} to an application. - */ - public void initialize(); - - /** - * Update the VR view manager. - * This method is called by the attached {@link VRAppState app state} and should not be called manually. - * @param tpf the time per frame. - */ - public void update(float tpf); - - /** - * This method contains action to be done during the rendering phase. - * This method should be called for example from the {@link com.jme3.app.state.AppState#render(com.jme3.renderer.RenderManager) render} method of an {@link com.jme3.app.state.AppState app state}. - * @see #postRender() - */ - public void render(); - - /** - * Send the rendering result as textures to the two eyes. - * This method should be called after all the rendering operations - * (for example at the end of the {@link AppState#postRender() postRender()} method of the attached app state.) - * @see #render() - */ - public void postRender(); - - /** - * Handles moving filters from the main view to each eye. - */ - public void moveScreenProcessingToEyes(); -} diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/lwjgl_openvr/LWJGLOpenVR.java b/jme3-vr/src/main/java/com/jme3/input/vr/lwjgl_openvr/LWJGLOpenVR.java deleted file mode 100644 index c0574bc46d..0000000000 --- a/jme3-vr/src/main/java/com/jme3/input/vr/lwjgl_openvr/LWJGLOpenVR.java +++ /dev/null @@ -1,434 +0,0 @@ -package com.jme3.input.vr.lwjgl_openvr; - -import com.jme3.app.VREnvironment; -import com.jme3.input.vr.HmdType; -import com.jme3.input.vr.VRAPI; -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.util.VRUtil; - -import java.nio.IntBuffer; -import java.util.Locale; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.lwjgl.BufferUtils; -import org.lwjgl.openvr.*; - -/** - * A class that wraps an OpenVR system. - * @author reden - phr00t - * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr - * @author Rickard Edén - */ -public class LWJGLOpenVR implements VRAPI { - private static final Logger logger = Logger.getLogger(LWJGLOpenVR.class.getName()); - - private static boolean initSuccess = false; - private static boolean flipEyes = false; - - private IntBuffer hmdDisplayFrequency; - private TrackedDevicePose.Buffer trackedDevicePose; - protected TrackedDevicePose[] hmdTrackedDevicePoses; - - protected IntBuffer hmdErrorStore = BufferUtils.createIntBuffer(1); - - private final Quaternion rotStore = new Quaternion(); - private final Vector3f posStore = new Vector3f(); - - 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 LWJGLOpenVRInput vrInput; - - private VREnvironment environment = null; - - /** - * Convert specific OpenVR {@link org.lwjgl.openvr.HmdMatrix34 HmdMatrix34} into JME {@link Matrix4f Matrix4f} - * @param hmdMatrix the input matrix - * @param mat the converted matrix - * @return the converted matrix - */ - public static Matrix4f convertSteamVRMatrix3ToMatrix4f(org.lwjgl.openvr.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; - } - - /** - * Convert specific OpenVR {@link org.lwjgl.openvr.HmdMatrix34 HmdMatrix34_t} into JME {@link Matrix4f Matrix4f} - * @param hmdMatrix the input matrix - * @param mat the converted matrix - * @return the converted matrix - */ - public static Matrix4f convertSteamVRMatrix4ToMatrix4f(org.lwjgl.openvr.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; - } - - /** - * 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 LWJGLOpenVR(VREnvironment environment){ - this.environment = environment; - } - - @Override - public LWJGLOpenVRInput getVRinput() { - return vrInput; - } - - @Override - public Object getVRSystem() { - throw new UnsupportedOperationException("Not yet implemented!"); - } - - @Override - public Object getCompositor() { - throw new UnsupportedOperationException("Not yet implemented!"); - } - - @Override - public String getName() { - return "OpenVR/LWJGL"; - } - - @Override - public void setFlipEyes(boolean set) { - flipEyes = set; - } - - @Override - public void printLatencyInfoToConsole(boolean set) { - // not implemented - } - - @Override - public int getDisplayFrequency() { - if( hmdDisplayFrequency == null ) return 0; - return hmdDisplayFrequency.get(0); - } - - @Override - public boolean initialize() { - logger.config("Initializing OpenVR system..."); - - // Init the native linking to the OpenVR library. - - int result = VR.VR_InitInternal(hmdErrorStore, VR.EVRApplicationType_VRApplication_Scene); - - if(hmdErrorStore.get(0) != VR.EVRInitError_VRInitError_None) { - logger.severe("OpenVR Initialize Result: " + VR.VR_GetVRInitErrorAsEnglishDescription(hmdErrorStore.get(0))); - logger.severe("Initializing OpenVR system [FAILED]"); - return false; - } else { - logger.config("OpenVR initialized & VR connected."); - org.lwjgl.openvr.OpenVR.create(result); - logger.info("Model Number : " + VRSystem.VRSystem_GetStringTrackedDeviceProperty( - VR.k_unTrackedDeviceIndex_Hmd, VR.ETrackedDeviceProperty_Prop_ModelNumber_String, hmdErrorStore)); - logger.info("Serial Number: " + VRSystem.VRSystem_GetStringTrackedDeviceProperty( - VR.k_unTrackedDeviceIndex_Hmd, VR.ETrackedDeviceProperty_Prop_SerialNumber_String, hmdErrorStore)); - - hmdDisplayFrequency = BufferUtils.createIntBuffer(1); - hmdDisplayFrequency.put(VR.ETrackedDeviceProperty_Prop_DisplayFrequency_Float); - - trackedDevicePose = TrackedDevicePose.create(VR.k_unMaxTrackedDeviceCount); - hmdTrackedDevicePoses = new TrackedDevicePose[VR.k_unMaxTrackedDeviceCount]; - poseMatrices = new Matrix4f[VR.k_unMaxTrackedDeviceCount]; - for(int i=0;i 0){ - if(hmdErrorStore.get(0) == VR.EVRInitError_VRInitError_None){ - setTrackingSpace(environment.isSeatedExperience() ); - logger.config("OpenVR Compositor initialized"); - } else { - logger.severe("OpenVR Compositor error: " + hmdErrorStore.get(0)); - } - } else { - logger.log(Level.SEVERE, "Cannot get generic interface for \""+VR.IVRCompositor_Version+"\", "+VR.VR_GetVRInitErrorAsEnglishDescription(hmdErrorStore.get(0))+" ("+hmdErrorStore.get(0)+")"); - } - } - return true; - } - - /** - * Initialize the headset camera. - * @param allowed true is the use of the headset camera is allowed and false otherwise. - * @return token for camera - */ - public long initCamera(boolean allowed) { - hmdErrorStore.put(0, VR.EVRInitError_VRInitError_None); // clear the error store - if( allowed) { - long result = VR.VR_GetGenericInterface(VR.IVRTrackedCamera_Version, hmdErrorStore); - if (result > 0){ - if(hmdErrorStore.get(0) == VR.EVRInitError_VRInitError_None ){ - logger.config("OpenVR Camera initialized"); - } - return result; - } else { - logger.severe("Failed to initialize camera"); - } - } - return 0; - } - - @Override - public void destroy() { - VR.VR_ShutdownInternal(); - } - - @Override - public boolean isInitialized() { - return initSuccess; - } - - @Override - public void reset() { - VRChaperone.VRChaperone_ResetZeroPose(VR.ETrackingUniverseOrigin_TrackingUniverseSeated); - hmdSeatToStand = null; - } - - @Override - public void getRenderSize(Vector2f store) { - IntBuffer w = BufferUtils.createIntBuffer(1); - IntBuffer h = BufferUtils.createIntBuffer(1); - VRSystem.VRSystem_GetRecommendedRenderTargetSize(w, h); - logger.config("Recommended render width : " + w.get(0)); - logger.config("Recommended render height: " + h.get(0)); - store.x = w.get(0); - store.y = h.get(0); - } - - @Override - public float getInterpupillaryDistance() { - throw new UnsupportedOperationException("Not yet implemented!"); - } - - @Override - public Quaternion getOrientation() { - VRUtil.convertMatrix4toQuat(hmdPose, rotStore); - return rotStore; - } - - @Override - public Vector3f getPosition() { - // the hmdPose comes in rotated funny, fix that here - hmdPose.toTranslationVector(posStore); - posStore.x = -posStore.x; - 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(){ - int result = VRCompositor.nVRCompositor_WaitGetPoses(trackedDevicePose.address(), trackedDevicePose.remaining(), 0, 0); - // NPE when calling without a gamePoseArray. Issue filed with lwjgl #418 -// int result = VRCompositor.VRCompositor_WaitGetPoses(trackedDevicePose, null); - environment.getVRinput().updateControllerStates(); - - // read pose data from native - for (int nDevice = 0; nDevice < VR.k_unMaxTrackedDeviceCount; ++nDevice ){ - if( hmdTrackedDevicePoses[nDevice].bPoseIsValid() ){ - convertSteamVRMatrix3ToMatrix4f(hmdTrackedDevicePoses[nDevice].mDeviceToAbsoluteTracking(), poseMatrices[nDevice]); - } - } - - if ( hmdTrackedDevicePoses[VR.k_unTrackedDeviceIndex_Hmd].bPoseIsValid()){ - hmdPose.set(poseMatrices[VR.k_unTrackedDeviceIndex_Hmd]); - } else { - hmdPose.set(Matrix4f.IDENTITY); - } - } - - @Override - public Matrix4f getHMDMatrixProjectionLeftEye(Camera cam){ - if( hmdProjectionLeftEye != null ) { - return hmdProjectionLeftEye; - } else { - HmdMatrix44 mat = HmdMatrix44.create(); - mat = VRSystem.VRSystem_GetProjectionMatrix(VR.EVREye_Eye_Left, cam.getFrustumNear(), cam.getFrustumFar(), mat); - hmdProjectionLeftEye = new Matrix4f(); - convertSteamVRMatrix4ToMatrix4f(mat, hmdProjectionLeftEye); - return hmdProjectionLeftEye; - } - } - - @Override - public Matrix4f getHMDMatrixProjectionRightEye(Camera cam){ - if( hmdProjectionRightEye != null ) { - return hmdProjectionRightEye; - } else { - HmdMatrix44 mat = HmdMatrix44.create(); - mat = VRSystem.VRSystem_GetProjectionMatrix(VR.EVREye_Eye_Right, cam.getFrustumNear(), cam.getFrustumFar(), mat); - hmdProjectionRightEye = new Matrix4f(); - convertSteamVRMatrix4ToMatrix4f(mat, hmdProjectionRightEye); - return hmdProjectionRightEye; - } - } - - @Override - public Vector3f getHMDVectorPoseLeftEye() { - if( hmdPoseLeftEyeVec == null ) { - hmdPoseLeftEyeVec = getHMDMatrixPoseLeftEye().toTranslationVector(); - // set default IPD if none or broken - if( hmdPoseLeftEyeVec.x <= 0.080f * -0.5f || hmdPoseLeftEyeVec.x >= 0.040f * -0.5f ) { - 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 = getHMDMatrixPoseRightEye().toTranslationVector(); - // set default IPD if none or broken - if( hmdPoseRightEyeVec.x >= 0.080f * 0.5f || hmdPoseRightEyeVec.x <= 0.040f * 0.5f ) { - hmdPoseRightEyeVec.x = 0.065f * 0.5f; - } - if( flipEyes == false ) hmdPoseRightEyeVec.x *= -1f; // it seems these need flipping - } - return hmdPoseRightEyeVec; - } - - @Override - public Vector3f getSeatedToAbsolutePosition() { - if( environment.isSeatedExperience() == false ) return Vector3f.ZERO; - if( hmdSeatToStand == null ) { - hmdSeatToStand = new Vector3f(); - - HmdMatrix34 mat = HmdMatrix34.create(); - VRSystem.VRSystem_GetSeatedZeroPoseToStandingAbsoluteTrackingPose(mat); - Matrix4f tempMatrix = new Matrix4f(); - convertSteamVRMatrix3ToMatrix4f(mat, tempMatrix); - tempMatrix.toTranslationVector(hmdSeatToStand); - } - return hmdSeatToStand; - } - - @Override - public Matrix4f getHMDMatrixPoseLeftEye(){ - if( hmdPoseLeftEye != null ) { - return hmdPoseLeftEye; - } else { - HmdMatrix34 mat = HmdMatrix34.create(); - VRSystem.VRSystem_GetEyeToHeadTransform(VR.EVREye_Eye_Left, mat); - hmdPoseLeftEye = new Matrix4f(); - return convertSteamVRMatrix3ToMatrix4f(mat, hmdPoseLeftEye); - } - } - - @Override - public Matrix4f getHMDMatrixPoseRightEye(){ - if( hmdPoseRightEye != null ) { - return hmdPoseRightEye; - } else { - HmdMatrix34 mat = HmdMatrix34.create(); - VRSystem.VRSystem_GetEyeToHeadTransform(VR.EVREye_Eye_Right, mat); - hmdPoseRightEye = new Matrix4f(); - return convertSteamVRMatrix3ToMatrix4f(mat, hmdPoseRightEye); - } - } - - @Override - public HmdType getType() { - String completeName = ""; - String name = VRSystem.VRSystem_GetStringTrackedDeviceProperty(VR.k_unTrackedDeviceIndex_Hmd, - VR.ETrackedDeviceProperty_Prop_ManufacturerName_String, - 128, hmdErrorStore); - if( hmdErrorStore.get(0) == 0 ) completeName += name; - String number = VRSystem.VRSystem_GetStringTrackedDeviceProperty(VR.k_unTrackedDeviceIndex_Hmd, - VR.ETrackedDeviceProperty_Prop_ModelNumber_String, - 128, hmdErrorStore); - if( hmdErrorStore.get(0) == 0 ) completeName += " " + number; - 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("index") ) { - return HmdType.VALVE_INDEX; - } 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.OTHER; - } - - public void setTrackingSpace(boolean isSeated){ - if( isSeated) { - VRCompositor.VRCompositor_SetTrackingSpace(VR.ETrackingUniverseOrigin_TrackingUniverseSeated); - } else { - VRCompositor.VRCompositor_SetTrackingSpace(VR.ETrackingUniverseOrigin_TrackingUniverseStanding); - } - } - - - public Matrix4f[] getPoseMatrices() { - return poseMatrices; - } -} diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/lwjgl_openvr/LWJGLOpenVRAnalogActionData.java b/jme3-vr/src/main/java/com/jme3/input/vr/lwjgl_openvr/LWJGLOpenVRAnalogActionData.java deleted file mode 100644 index aa702fc13a..0000000000 --- a/jme3-vr/src/main/java/com/jme3/input/vr/lwjgl_openvr/LWJGLOpenVRAnalogActionData.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.jme3.input.vr.lwjgl_openvr; - -import org.lwjgl.openvr.InputAnalogActionData; - -/** - * This is a set of reusable parts that are used when accessing an analogue action - * (Analogue meaning something like a trigger pull or joystick coordinate) - */ -public class LWJGLOpenVRAnalogActionData{ - - /** - * This is the address string for the action. It will be something like /actions/main/in/openInventory - */ - String actionName; - - /** - * The handle used to request the action's state from LWJGL. - * - * It is how the action is addressed efficiently - */ - long actionHandle; - - /** - * This is a LWJGL object that will have the actions state passed into it. It is mapped to native memory so we - * don't want to keep creating new ones. - */ - InputAnalogActionData actionData; - - public LWJGLOpenVRAnalogActionData(String actionName, long actionHandle, InputAnalogActionData actionData){ - this.actionName = actionName; - this.actionHandle = actionHandle; - this.actionData = actionData; - } -} diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/lwjgl_openvr/LWJGLOpenVRBounds.java b/jme3-vr/src/main/java/com/jme3/input/vr/lwjgl_openvr/LWJGLOpenVRBounds.java deleted file mode 100644 index cce7aec17b..0000000000 --- a/jme3-vr/src/main/java/com/jme3/input/vr/lwjgl_openvr/LWJGLOpenVRBounds.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.jme3.input.vr.lwjgl_openvr; - -import com.jme3.input.vr.VRAPI; -import com.jme3.input.vr.VRBounds; -import com.jme3.math.Vector2f; -import com.jme3.util.BufferUtils; -import java.nio.FloatBuffer; - -import java.util.logging.Logger; - -/** - * A class that represents VR world bounds. - * @author reden - phr00t - https://github.com/phr00t - * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr - * @author Rickard Edén - */ -public class LWJGLOpenVRBounds implements VRBounds { - private static Logger logger = Logger.getLogger(LWJGLOpenVRBounds.class.getName()); - - private Vector2f playSize; - private boolean setup = false; - - /** - * Initialize the VR bounds. - * @return true if the initialization is a success and false otherwise. - */ - public boolean init(VRAPI api) { - logger.config("Initialize VR bounds..."); - - if( !setup ) { -// vrChaperone = new VR_IVRChaperone_FnTable(JOpenVRLibrary.VR_GetGenericInterface(JOpenVRLibrary.IVRChaperone_Version, api.hmdErrorStore).getPointer()); - FloatBuffer fbX = BufferUtils.createFloatBuffer(1); - FloatBuffer fbZ = BufferUtils.createFloatBuffer(1); - org.lwjgl.openvr.VRChaperone.VRChaperone_GetPlayAreaSize(fbX, fbZ); - - playSize = new Vector2f(fbX.get(0), fbZ.get(0)); - setup = true; - 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; - } -} \ No newline at end of file diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/lwjgl_openvr/LWJGLOpenVRDigitalActionData.java b/jme3-vr/src/main/java/com/jme3/input/vr/lwjgl_openvr/LWJGLOpenVRDigitalActionData.java deleted file mode 100644 index 75b1a100ed..0000000000 --- a/jme3-vr/src/main/java/com/jme3/input/vr/lwjgl_openvr/LWJGLOpenVRDigitalActionData.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.jme3.input.vr.lwjgl_openvr; - -import org.lwjgl.openvr.InputDigitalActionData; - -/** - * This is a set of reusable parts that are used when accessing a digital action - * (Digital meaning something like a button press, that is either on or off) - */ -public class LWJGLOpenVRDigitalActionData{ - - /** - * This is the address string for the action. It will be something like /actions/main/in/openInventory - */ - String actionName; - - /** - * The handle used to request the action's state from LWJGL. - * - * It is how the action is addressed efficiently - */ - long actionHandle; - - /** - * This is a LWJGL object that will have the actions state passed into it. It is mapped to native memory so we - * don't want to keep creating new ones. - */ - InputDigitalActionData actionData; - - public LWJGLOpenVRDigitalActionData(String actionName, long actionHandle, InputDigitalActionData actionData){ - this.actionName = actionName; - this.actionHandle = actionHandle; - this.actionData = actionData; - } -} diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/lwjgl_openvr/LWJGLOpenVRInput.java b/jme3-vr/src/main/java/com/jme3/input/vr/lwjgl_openvr/LWJGLOpenVRInput.java deleted file mode 100644 index 26ad2d4b74..0000000000 --- a/jme3-vr/src/main/java/com/jme3/input/vr/lwjgl_openvr/LWJGLOpenVRInput.java +++ /dev/null @@ -1,708 +0,0 @@ -package com.jme3.input.vr.lwjgl_openvr; - -import java.nio.LongBuffer; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.logging.Logger; - -import com.jme3.app.VREnvironment; -import com.jme3.input.vr.AnalogActionState; -import com.jme3.input.vr.DigitalActionState; -import com.jme3.input.vr.VRInputAPI; -import com.jme3.input.vr.VRInputType; -import com.jme3.input.vr.VRTrackedController; -import com.jme3.input.vr.VRViewManager; -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.util.VRUtil; -import java.nio.IntBuffer; -import org.lwjgl.BufferUtils; -import org.lwjgl.openvr.HmdVector3; -import org.lwjgl.openvr.InputAnalogActionData; -import org.lwjgl.openvr.InputDigitalActionData; -import org.lwjgl.openvr.VR; -import org.lwjgl.openvr.VRActiveActionSet; -import org.lwjgl.openvr.VRControllerState; -import org.lwjgl.openvr.VRInput; -import org.lwjgl.openvr.VRSystem; - -/* -make helper functions to pull the following easily from raw data (DONE) -trigger: -Controller#1, Axis#0 X: 0.0, Y: 0.0 -Controller#1, Axis#1 X: 1.0, Y: 0.0 -Controller#1, Axis#2 X: 0.0, Y: 0.0 -Controller#1, Axis#3 X: 0.0, Y: 0.0 -Controller#1, Axis#4 X: 0.0, Y: 0.0 -Button press: 8589934592 (when full), touch: 8589934592 -touchpad (upper left): -Controller#1, Axis#0 X: -0.6059755, Y: 0.2301706 -Controller#1, Axis#1 X: 0.0, Y: 0.0 -Controller#1, Axis#2 X: 0.0, Y: 0.0 -Controller#1, Axis#3 X: 0.0, Y: 0.0 -Controller#1, Axis#4 X: 0.0, Y: 0.0 -Button press: 4294967296 (when pressed in), touch: 4294967296 -grip: -Controller#1, Axis#0 X: 0.0, Y: 0.0 -Controller#1, Axis#1 X: 0.0, Y: 0.0 -Controller#1, Axis#2 X: 0.0, Y: 0.0 -Controller#1, Axis#3 X: 0.0, Y: 0.0 -Controller#1, Axis#4 X: 0.0, Y: 0.0 -Button press: 4, touch: 4 -thumb: -Controller#1, Axis#0 X: 0.0, Y: 0.0 -Controller#1, Axis#1 X: 0.0, Y: 0.0 -Controller#1, Axis#2 X: 0.0, Y: 0.0 -Controller#1, Axis#3 X: 0.0, Y: 0.0 -Controller#1, Axis#4 X: 0.0, Y: 0.0 -Button press: 2, touch: 2 - */ -/** - * A class that wraps an - * OpenVR - * input.
- * null values will be returned if no valid pose exists, or that - * input device isn't available user code should check for null - * values. - * - * @author reden - phr00t - * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr - * @author Rickard Edén - * @deprecated The jme3-vr module is deprecated and will be removed in a future version (as it only supports OpenVR). - * For new Virtual Reality projects, use user libraries that provide OpenXR support. - * See Virtual Reality JME wiki section - * for more information. - */ -@Deprecated -public class LWJGLOpenVRInput implements VRInputAPI { - - private static final Logger logger = Logger.getLogger(LWJGLOpenVRInput.class.getName()); - - /** - * Deprecated as used controller specific values. Should use Actions manifest instead - */ - @Deprecated - private final VRControllerState[] cStates = new VRControllerState[VR.k_unMaxTrackedDeviceCount]; - - private final Quaternion[] rotStore = new Quaternion[VR.k_unMaxTrackedDeviceCount]; - - private final Vector3f[] posStore = new Vector3f[VR.k_unMaxTrackedDeviceCount]; - - private static final int[] controllerIndex = new int[VR.k_unMaxTrackedDeviceCount]; - - private int controllerCount = 0; - - private final Vector2f tempAxis = new Vector2f(), temp2Axis = new Vector2f(); - - private final Vector2f[] lastCallAxis = new Vector2f[VR.k_unMaxTrackedDeviceCount]; - - /** - * Deprecated as used controller specific values. Should use Actions manifest instead - */ - @Deprecated - private final boolean[][] buttonDown = new boolean[VR.k_unMaxTrackedDeviceCount][16]; - - /** - * A map of the action name to the objects/data required to read states from lwjgl - */ - private final Map digitalActions = new HashMap<>(); - - /** - * A map of the action name to the objects/data required to read states from lwjgl - */ - private final Map analogActions = new HashMap<>(); - - /** - * A map of the action name to the handle of a haptic action - */ - private final Map hapticActionHandles = new HashMap<>(); - - /** - * A map of the action set name to the handle that is used to refer to it when talking to LWJGL - */ - private final Map actionSetHandles = new HashMap<>(); - - /** - * A map of input names (e.g. /user/hand/right) to the handle used to address it. - * - * Note that null is a special case that maps to VR.k_ulInvalidInputValueHandle and means "any input" - */ - private final Map inputHandles = new HashMap<>(); - - private float axisMultiplier = 1f; - - private final Vector3f tempVel = new Vector3f(); - - private final Quaternion tempq = new Quaternion(); - - private final VREnvironment environment; - - private List trackedControllers = null; - - /** - * A lwjgl object that contains handles to the active action sets (is used each frame to tell lwjgl which actions to - * fetch states back for) - */ - private VRActiveActionSet.Buffer activeActionSets; - - InputMode inputMode = InputMode.LEGACY; - - private enum InputMode{ - /** - * Simple bitfield, no way to map new controllers - */ - LEGACY, - /** - * Actions manifest based. - */ - ACTION_BASED; - } - - /** - * Create a new - * OpenVR - * input attached to the given VR environment. - * - * @param environment the VR environment to which the input is attached. - */ - public LWJGLOpenVRInput(VREnvironment environment) { - this.environment = environment; - - inputHandles.put(null, VR.k_ulInvalidInputValueHandle); - } - - @Override - public void registerActionManifest(String actionManifestAbsolutePath, String startingActiveActionSets){ - inputMode = InputMode.ACTION_BASED; - int errorCode = VRInput.VRInput_SetActionManifestPath(actionManifestAbsolutePath); - - if ( errorCode != 0 ) - { - logger.warning( "An error code of " + errorCode + " was reported while registering an action manifest" ); - } - setActiveActionSet(startingActiveActionSets); - } - - @Override - public void setActiveActionSet(String actionSet){ - assert inputMode == InputMode.ACTION_BASED : "registerActionManifest must be called before attempting to fetch action states"; - - - long actionSetHandle; - if (actionSetHandles.containsKey(actionSet)){ - actionSetHandle = actionSetHandles.get(actionSet); - }else{ - LongBuffer longBuffer = BufferUtils.createLongBuffer(1); - int errorCode = VRInput.VRInput_GetActionHandle(actionSet, longBuffer); - if ( errorCode != 0 ) - { - logger.warning( "An error code of " + errorCode + " was reported while fetching an action set handle for " + actionSet ); - } - actionSetHandle = longBuffer.get(0); - actionSetHandles.put(actionSet,actionSetHandle); - } - - //Todo: this seems to imply that you could have multiple active action sets at once (Although I was not able to get that to work), allow multiple action sets - activeActionSets = VRActiveActionSet.create(1); - activeActionSets.ulActionSet(actionSetHandle); - activeActionSets.ulRestrictedToDevice(VR.k_ulInvalidInputValueHandle); // both hands - } - - @Override - public DigitalActionState getDigitalActionState(String actionName, String restrictToInput){ - assert inputMode == InputMode.ACTION_BASED : "registerActionManifest must be called before attempting to fetch action states"; - - LWJGLOpenVRDigitalActionData actionDataObjects = digitalActions.get(actionName); - if (actionDataObjects == null){ - //this is the first time the action has been used. We must obtain a handle to it to efficiently fetch it in future - long handle = fetchActionHandle(actionName); - actionDataObjects = new LWJGLOpenVRDigitalActionData(actionName, handle, InputDigitalActionData.create()); - digitalActions.put(actionName, actionDataObjects); - } - int errorCode = VRInput.VRInput_GetDigitalActionData(actionDataObjects.actionHandle, actionDataObjects.actionData, getOrFetchInputHandle(restrictToInput)); - - if (errorCode == VR.EVRInputError_VRInputError_WrongType){ - throw new RuntimeException("Attempted to fetch a non-digital state as if it is digital"); - }else if (errorCode!=0){ - logger.warning( "An error code of " + errorCode + " was reported while fetching an action state for " + actionName ); - } - - return new DigitalActionState(actionDataObjects.actionData.bState(), actionDataObjects.actionData.bChanged()); - } - - @Override - public AnalogActionState getAnalogActionState(String actionName, String restrictToInput ){ - assert inputMode == InputMode.ACTION_BASED : "registerActionManifest must be called before attempting to fetch action states"; - - LWJGLOpenVRAnalogActionData actionDataObjects = analogActions.get(actionName); - if (actionDataObjects == null){ - //this is the first time the action has been used. We must obtain a handle to it to efficiently fetch it in future - long handle = fetchActionHandle(actionName); - actionDataObjects = new LWJGLOpenVRAnalogActionData(actionName, handle, InputAnalogActionData.create()); - analogActions.put(actionName, actionDataObjects); - } - int errorCode = VRInput.VRInput_GetAnalogActionData(actionDataObjects.actionHandle, actionDataObjects.actionData, getOrFetchInputHandle(restrictToInput)); - - if (errorCode == VR.EVRInputError_VRInputError_WrongType){ - throw new RuntimeException("Attempted to fetch a non-analog state as if it is analog"); - }else if (errorCode!=0){ - logger.warning( "An error code of " + errorCode + " was reported while fetching an action state for " + actionName ); - } - - return new AnalogActionState(actionDataObjects.actionData.x(), actionDataObjects.actionData.y(), actionDataObjects.actionData.z(), actionDataObjects.actionData.deltaX(), actionDataObjects.actionData.deltaY(), actionDataObjects.actionData.deltaZ()); - } - - @Override - public float getAxisMultiplier() { - return axisMultiplier; - } - - @Override - public void setAxisMultiplier(float set) { - axisMultiplier = set; - } - - @Override - public void swapHands() { - if (controllerCount != 2) { - return; - } - int temp = controllerIndex[0]; - controllerIndex[0] = controllerIndex[1]; - controllerIndex[1] = temp; - } - - @Override - public boolean isButtonDown(int controllerIndex, VRInputType checkButton) { - assert inputMode != InputMode.ACTION_BASED : "registerActionManifest has been called, legacy button access disabled"; - VRControllerState cs = cStates[LWJGLOpenVRInput.controllerIndex[controllerIndex]]; - switch (checkButton) { - default: - return false; - case ViveGripButton: - return (cs.ulButtonPressed() & 4) != 0; - case ViveMenuButton: - return (cs.ulButtonPressed() & 2) != 0; - case ViveTrackpadAxis: - return (cs.ulButtonPressed() & 4294967296l) != 0; - case ViveTriggerAxis: - return (cs.ulButtonPressed() & 8589934592l) != 0; - } - } - - @Override - public boolean wasButtonPressedSinceLastCall(int controllerIndex, VRInputType checkButton) { - boolean buttonDownNow = isButtonDown(controllerIndex, checkButton); - int checkButtonValue = checkButton.getValue(); - int cIndex = LWJGLOpenVRInput.controllerIndex[controllerIndex]; - boolean retval = buttonDownNow == true && buttonDown[cIndex][checkButtonValue] == false; - buttonDown[cIndex][checkButtonValue] = buttonDownNow; - return retval; - } - - @Override - public void resetInputSinceLastCall() { - for (int i = 0; i < lastCallAxis.length; i++) { - lastCallAxis[i].x = 0f; - lastCallAxis[i].y = 0f; - } - for (int i = 0; i < VR.k_unMaxTrackedDeviceCount; i++) { - for (int j = 0; j < 16; j++) { - buttonDown[i][j] = false; - } - } - } - - @Override - public Vector2f getAxisDeltaSinceLastCall(int controllerIndex, VRInputType forAxis) { - int axisIndex = forAxis.getValue(); - temp2Axis.set(lastCallAxis[axisIndex]); - lastCallAxis[axisIndex].set(getAxis(controllerIndex, forAxis)); - if ((temp2Axis.x != 0f || temp2Axis.y != 0f) && (lastCallAxis[axisIndex].x != 0f || lastCallAxis[axisIndex].y != 0f)) { - temp2Axis.subtractLocal(lastCallAxis[axisIndex]); - } else { - // move made from rest, don't count as a delta move - temp2Axis.x = 0f; - temp2Axis.y = 0f; - } - return temp2Axis; - } - - @Override - public Vector3f getVelocity(int controllerIndex) { - - if (environment != null) { - - if (environment.getVRHardware() instanceof LWJGLOpenVR) { - int index = LWJGLOpenVRInput.controllerIndex[controllerIndex]; -// if( needsNewVelocity[index] ) { - HmdVector3 tempVec = ((LWJGLOpenVR) environment.getVRHardware()).hmdTrackedDevicePoses[index].vVelocity(); -// needsNewVelocity[index] = false; -// } - tempVel.x = tempVec.v(0); - tempVel.y = tempVec.v(1); - tempVel.z = tempVec.v(2); - return tempVel; - } else { - throw new IllegalStateException("VR hardware " + environment.getVRHardware().getClass().getSimpleName() + " is not a subclass of " + LWJGLOpenVR.class.getSimpleName()); - } - } else { - throw new IllegalStateException("VR input is not attached to a VR environment."); - } - } - - @Override - public Vector3f getAngularVelocity(int controllerIndex) { - - if (environment != null) { - - if (environment.getVRHardware() instanceof LWJGLOpenVR) { - - int index = LWJGLOpenVRInput.controllerIndex[controllerIndex]; - HmdVector3 tempVec = ((LWJGLOpenVR) environment.getVRHardware()).hmdTrackedDevicePoses[index].vAngularVelocity(); -// needsNewVelocity[index] = false; -// } - tempVel.x = tempVec.v(0); - tempVel.y = tempVec.v(1); - tempVel.z = tempVec.v(2); - return tempVel; - } else { - throw new IllegalStateException("VR hardware " + environment.getVRHardware().getClass().getSimpleName() + " is not a subclass of " + LWJGLOpenVR.class.getSimpleName()); - } - } else { - throw new IllegalStateException("VR input is not attached to a VR environment."); - } - - } - - @Override - public Vector2f getAxisRaw(int controllerIndex, VRInputType forAxis) { - VRControllerState cs = cStates[LWJGLOpenVRInput.controllerIndex[controllerIndex]]; - switch (forAxis) { - default: - return null; - case ViveTriggerAxis: - tempAxis.x = cs.rAxis(1).x(); - tempAxis.y = tempAxis.x; - break; - case ViveTrackpadAxis: - tempAxis.x = cs.rAxis(0).x(); - tempAxis.y = cs.rAxis(0).y(); - break; - } - return tempAxis; - } - - @Override - public Vector2f getAxis(int controllerIndex, VRInputType forAxis) { - getAxisRaw(controllerIndex, forAxis); - tempAxis.x *= axisMultiplier; - tempAxis.y *= axisMultiplier; - return tempAxis; - } - - @Override - public boolean init() { - - logger.config("Initialize OpenVR input."); - - for (int i = 0; i < VR.k_unMaxTrackedDeviceCount; i++) { - rotStore[i] = new Quaternion(); - posStore[i] = new Vector3f(); - cStates[i] = VRControllerState.create(); - lastCallAxis[i] = new Vector2f(); - logger.config(" Input " + (i + 1) + "/" + VR.k_unMaxTrackedDeviceCount + " bound."); - } - - return true; - } - - @Override - public VRTrackedController getTrackedController(int index) { - if (trackedControllers != null) { - if ((trackedControllers.size() > 0) && (index < trackedControllers.size())) { - return trackedControllers.get(index); - } - } - - return null; - } - - @Override - public int getTrackedControllerCount() { - return controllerCount; - } - - @Override - public VRControllerState getRawControllerState(int index) { - if (isInputDeviceTracking(index) == false) { - return null; - } - return cStates[controllerIndex[index]]; - } - - @Override - public boolean isInputFocused() { - if (environment != null){ - // not a 100% match, but the closest I can find in LWJGL. Doc seems to confirm this too. - return VRSystem.VRSystem_IsInputAvailable(); - //return ((VR_IVRSystem_FnTable)environment.getVRHardware().getVRSystem()).IsInputFocusCapturedByAnotherProcess.apply() == 0; - } else { - throw new IllegalStateException("VR input is not attached to a VR environment."); - } - } - - @Override - public boolean isInputDeviceTracking(int index) { - if (index < 0 || index >= controllerCount) { - return false; - } - - if (environment != null) { - - if (environment.getVRHardware() instanceof LWJGLOpenVR) { - return ((LWJGLOpenVR) environment.getVRHardware()).hmdTrackedDevicePoses[controllerIndex[index]].bPoseIsValid(); - } else { - throw new IllegalStateException("VR hardware " + environment.getVRHardware().getClass().getSimpleName() + " is not a subclass of " + LWJGLOpenVR.class.getSimpleName()); - } - } else { - 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 LWJGLOpenVR) { - index = controllerIndex[index]; - VRUtil.convertMatrix4toQuat(((LWJGLOpenVR) environment.getVRHardware()).poseMatrices[index], rotStore[index]); - return rotStore[index]; - } else { - throw new IllegalStateException("VR hardware " + environment.getVRHardware().getClass().getSimpleName() + " is not a subclass of " + LWJGLOpenVR.class.getSimpleName()); - } - } else { - throw new IllegalStateException("VR input is not attached to a VR environment."); - } - } - - @Override - public Vector3f getPosition(int index) { - if (isInputDeviceTracking(index) == false) { - return null; - } - - if (environment != null) { - - if (environment.getVRHardware() instanceof LWJGLOpenVR) { - // the hmdPose comes in rotated funny, fix that here - index = controllerIndex[index]; - ((LWJGLOpenVR) environment.getVRHardware()).poseMatrices[index].toTranslationVector(posStore[index]); - posStore[index].x = -posStore[index].x; - posStore[index].z = -posStore[index].z; - return posStore[index]; - } else { - throw new IllegalStateException("VR hardware " + environment.getVRHardware().getClass().getSimpleName() + " is not a subclass of " + LWJGLOpenVR.class.getSimpleName()); - } - } else { - throw new IllegalStateException("VR input is not attached to a VR environment."); - } - - } - - @Override - public Quaternion getFinalObserverRotation(int index) { - - if (environment != null) { - VRViewManager vrvm = 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 - public Vector3f getFinalObserverPosition(int index) { - - if (environment != null) { - VRViewManager vrvm = environment.getVRViewManager(); - - if (vrvm != null) { - if (isInputDeviceTracking(index) == false) { - return null; - } - Object obs = environment.getObserver(); - Vector3f pos = getPosition(index); - if (obs instanceof Camera) { - ((Camera) obs).getRotation().mult(pos, pos); - return pos.addLocal(((Camera) obs).getLocation()); - } else { - ((Spatial) obs).getWorldRotation().mult(pos, pos); - return pos.addLocal(((Spatial) obs).getWorldTranslation()); - } - } 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 - VRSystem.VRSystem_TriggerHapticPulse(LWJGLOpenVRInput.controllerIndex[controllerIndex], - 0, (short) Math.round(3f * seconds / 1e-3f)); - } - - @Override - public void triggerHapticAction(String actionName, float duration, float frequency, float amplitude, String restrictToInput ){ - long hapticActionHandle; - if (!hapticActionHandles.containsKey(actionName)){ - //this is the first time the action has been used. We must obtain a handle to it to efficiently fetch it in future - hapticActionHandle = fetchActionHandle(actionName); - hapticActionHandles.put(actionName, hapticActionHandle); - }else{ - hapticActionHandle = hapticActionHandles.get(actionName); - } - - VRInput.VRInput_TriggerHapticVibrationAction(hapticActionHandle, 0, duration, frequency, amplitude, getOrFetchInputHandle(restrictToInput)); - } - - @Override - public void updateConnectedControllers() { - logger.config("Updating connected controllers."); - - if (environment != null) { - controllerCount = 0; - for (int i = 0; i < VR.k_unMaxTrackedDeviceCount; i++) { - int classCallback = VRSystem.VRSystem_GetTrackedDeviceClass(i); - if (classCallback == VR.ETrackedDeviceClass_TrackedDeviceClass_Controller || classCallback == VR.ETrackedDeviceClass_TrackedDeviceClass_GenericTracker) { - IntBuffer error = BufferUtils.createIntBuffer(1); - String controllerName = "Unknown"; - String manufacturerName = "Unknown"; - controllerName = VRSystem.VRSystem_GetStringTrackedDeviceProperty(i, VR.ETrackedDeviceProperty_Prop_TrackingSystemName_String, error); - manufacturerName = VRSystem.VRSystem_GetStringTrackedDeviceProperty(i, VR.ETrackedDeviceProperty_Prop_ManufacturerName_String, error); - - if (error.get(0) != 0) { - logger.warning("Error getting controller information " + controllerName + " " + manufacturerName + "Code (" + error.get(0) + ")"); - } - controllerIndex[controllerCount] = i; - - // Adding tracked controller to control. - if (trackedControllers == null) { - trackedControllers = new ArrayList(VR.k_unMaxTrackedDeviceCount); - } - trackedControllers.add(new LWJGLOpenVRTrackedController(i, this, controllerName, manufacturerName, environment)); - - // Send a Haptic pulse to the controller - triggerHapticPulse(controllerCount, 1.0f); - - controllerCount++; - logger.config(" Tracked controller " + (i + 1) + "/" + VR.k_unMaxTrackedDeviceCount + " " + controllerName + " (" + manufacturerName + ") attached."); - } else { - logger.config(" Controller " + (i + 1) + "/" + VR.k_unMaxTrackedDeviceCount + " ignored."); - } - } - } else { - throw new IllegalStateException("VR input is not attached to a VR environment."); - } - } - - @Override - public void updateControllerStates() { - - if (environment != null) { - switch(inputMode){ - case ACTION_BASED: - int errorCode = VRInput.VRInput_UpdateActionState(activeActionSets, VRActiveActionSet.SIZEOF); - if(errorCode!=0){ - logger.warning("An error code of " + errorCode + " was returned while upding the action states"); - } - break; - case LEGACY: - for (int i = 0; i < controllerCount; i++) { - int index = controllerIndex[i]; - VRSystem.VRSystem_GetControllerState(index, cStates[index], 64); - cStates[index].ulButtonPressed(); - cStates[index].rAxis(); - } - break; - } - - } else { - throw new IllegalStateException("VR input is not attached to a VR environment."); - } - - } - - /** - * Converts an action name (as it appears in the action manifest) to a handle (long) that the rest of the - * lwjgl (and openVR) wants to talk in - * @param actionName The name of the action. Will be something like /actions/main/in/openInventory - * @return a long that is the handle that can be used to refer to the action - */ - private long fetchActionHandle( String actionName ){ - LongBuffer longBuffer = BufferUtils.createLongBuffer(1); - int errorCode = VRInput.VRInput_GetActionHandle(actionName, longBuffer); - if (errorCode !=0 ){ - logger.warning( "An error code of " + errorCode + " was reported while registering an action manifest" ); - } - return longBuffer.get(0); - } - - /** - * Given an input name returns the handle to address it. - * - * If a cached handle is available it is returned, if not it is fetched from openVr - * - * @param inputName the input name, e.g. /user/hand/right. Or null, which means "any input" - * @return the input handle - */ - public long getOrFetchInputHandle( String inputName ){ - if(!inputHandles.containsKey(inputName)){ - LongBuffer longBuffer = BufferUtils.createLongBuffer(1); - - int errorCode = VRInput.VRInput_GetInputSourceHandle(inputName, longBuffer); - if (errorCode !=0 ){ - logger.warning( "An error code of " + errorCode + " was reported while fetching an input manifest" ); - } - long handle = longBuffer.get(0); - inputHandles.put(inputName, handle); - } - - return inputHandles.get(inputName); - } - -} \ No newline at end of file diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/lwjgl_openvr/LWJGLOpenVRMouseManager.java b/jme3-vr/src/main/java/com/jme3/input/vr/lwjgl_openvr/LWJGLOpenVRMouseManager.java deleted file mode 100644 index a21b2e3052..0000000000 --- a/jme3-vr/src/main/java/com/jme3/input/vr/lwjgl_openvr/LWJGLOpenVRMouseManager.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.jme3.input.vr.lwjgl_openvr; - -import com.jme3.app.VREnvironment; -import com.jme3.input.controls.AnalogListener; -import com.jme3.input.vr.AbstractVRMouseManager; -import com.jme3.input.vr.VRInputType; -import com.jme3.math.Vector2f; - - -/** - * A class dedicated to the handling of the mouse within VR environment. - * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr - */ -public class LWJGLOpenVRMouseManager 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 LWJGLOpenVRMouseManager(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/lwjgl_openvr/LWJGLOpenVRTrackedController.java b/jme3-vr/src/main/java/com/jme3/input/vr/lwjgl_openvr/LWJGLOpenVRTrackedController.java deleted file mode 100644 index c0705f0864..0000000000 --- a/jme3-vr/src/main/java/com/jme3/input/vr/lwjgl_openvr/LWJGLOpenVRTrackedController.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.jme3.input.vr.lwjgl_openvr; - -import com.jme3.app.VREnvironment; -import com.jme3.input.vr.VRInputAPI; -import com.jme3.input.vr.VRTrackedController; -import com.jme3.math.Matrix4f; -import com.jme3.math.Quaternion; -import com.jme3.math.Vector3f; - -/** - * A controller that is tracked within the VR environment. Such a controller can provide its position within the VR space. - * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr - * @author Rickard Edén - */ -public class LWJGLOpenVRTrackedController implements VRTrackedController{ - /** - * The index of the controller within the underlying VR API. - */ - private int controllerIndex = -1; - - /** - * The underlying VRAPI. - */ - private VRInputAPI hardware = null; - - /** - * The name of the controller. - */ - private String name; - - private VREnvironment environment; - - /** - * Wrap a new VR tracked controller on an OpenVR system. - * @param controllerIndex the index of the controller within the underlying VR system. - * @param hardware the underlying VR system. - * @param name the name of the controller. - * @param manufacturer the manufacturer of the controller. - * @param environment the VR environment. - */ - public LWJGLOpenVRTrackedController(int controllerIndex, VRInputAPI hardware, String name, String manufacturer, VREnvironment environment){ - this.controllerIndex = controllerIndex; - this.hardware = hardware; - - this.name = name; - this.manufacturer = manufacturer; - - this.environment = environment; - } - - /** - * The manufacturer of the controller. - */ - private String manufacturer; - - @Override - public Vector3f getPosition() { - if (hardware != null){ - return hardware.getPosition(controllerIndex); - } else { - throw new IllegalStateException("No underlying VR API."); - } - } - - @Override - public Quaternion getOrientation() { - if (hardware != null){ - return hardware.getOrientation(controllerIndex); - } else { - throw new IllegalStateException("No underlying VR API."); - } - } - - @Override - public Matrix4f getPose(){ - if (environment != null){ - if (hardware != null){ - return ((LWJGLOpenVR)environment.getVRHardware()).getPoseMatrices()[controllerIndex]; - } else { - throw new IllegalStateException("No underlying VR API."); - } - } else { - throw new IllegalStateException("VR tracked device is not attached to any environment."); - } - } - - @Override - public String getControllerName() { - return name; - } - - @Override - public String getControllerManufacturer() { - return manufacturer; - } -} \ No newline at end of file diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/lwjgl_openvr/LWJGLOpenVRViewManager.java b/jme3-vr/src/main/java/com/jme3/input/vr/lwjgl_openvr/LWJGLOpenVRViewManager.java deleted file mode 100644 index 2b658e53f4..0000000000 --- a/jme3-vr/src/main/java/com/jme3/input/vr/lwjgl_openvr/LWJGLOpenVRViewManager.java +++ /dev/null @@ -1,569 +0,0 @@ -package com.jme3.input.vr.lwjgl_openvr; - -import com.jme3.app.VREnvironment; -import com.jme3.input.vr.AbstractVRViewManager; -import com.jme3.input.vr.VRAPI; -import com.jme3.math.ColorRGBA; -import com.jme3.math.Quaternion; -import com.jme3.math.Vector2f; -import com.jme3.math.Vector3f; -import com.jme3.renderer.Camera; -import com.jme3.renderer.ViewPort; -import com.jme3.renderer.queue.RenderQueue.Bucket; -import com.jme3.scene.Spatial; -import com.jme3.texture.FrameBuffer; -import com.jme3.texture.Image; -import com.jme3.texture.Texture2D; -import com.jme3.ui.Picture; -import com.jme3.util.VRGUIPositioningMode; - -import java.util.Iterator; -import java.util.logging.Logger; -import org.lwjgl.openvr.VRTextureBounds; -import org.lwjgl.openvr.Texture; -import org.lwjgl.openvr.VR; -import org.lwjgl.openvr.VRCompositor; - -/** - * A VR view manager based on OpenVR. This class enable to submit 3D views to - * the VR compositor. - * - * @author reden - phr00t - * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr - * @author Rickard Edén - */ -public class LWJGLOpenVRViewManager extends AbstractVRViewManager { - - private static final Logger logger = Logger.getLogger(LWJGLOpenVRViewManager.class.getName()); - - // OpenVR values - private VRTextureBounds leftTextureBounds; - private Texture leftTextureType; - - private VRTextureBounds rightTextureBounds; - private Texture rightTextureType; - - private Texture2D dualEyeTex; - - //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 LWJGLOpenVRViewManager(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 getLeftTexture().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 getRightTexture().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 dualEyeTex.getImage().getId(); - } - - /** - * Initialize the system binds of the textures. - */ - private void initTextureSubmitStructs() { - leftTextureType = Texture.create(); - rightTextureType = Texture.create(); - - if (environment != null) { - if (environment.getVRHardware() instanceof LWJGLOpenVR) { - leftTextureBounds = VRTextureBounds.create(); - rightTextureBounds = VRTextureBounds.create(); - // left eye - leftTextureBounds.set(0f, 0f, 0.5f, 1f); - // right eye - rightTextureBounds.set(0.5f, 0f, 1f, 1f); - // texture type - leftTextureType.set(-1, VR.ETextureType_TextureType_OpenGL, VR.EColorSpace_ColorSpace_Gamma); - rightTextureType.set(-1, VR.ETextureType_TextureType_OpenGL, VR.EColorSpace_ColorSpace_Gamma); - - } - } else { - throw new IllegalStateException("This VR view manager is not attached to any VR environment."); - } - } - - /** - * updatePose can be called here because appstates are always called before the main renderer. This way we get the latest pose close to when it's supposed to render - */ - @Override - public void render() { - 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, getLeftCamera()); - finalizeCamera(dev.getHMDVectorPoseRightEye(), objPos, getRightCamera()); - } else { - getLeftCamera().setFrame(objPos, objRot); - getRightCamera().setFrame(objPos, objRot); - } - } - } - - @Override - public void postRender() { - - if (environment != null) { - if (environment.isInVR()) { - VRAPI api = environment.getVRHardware(); - // using the compositor... - int errl = 0, errr = 0; - if (environment.isInstanceRendering()) { - if (leftTextureType.handle() == -1 || leftTextureType.handle() != getFullTexId()) { - leftTextureType.set(getFullTexId(), leftTextureType.eType(), leftTextureType.eColorSpace()); - } else { - if (api instanceof LWJGLOpenVR) { - int submitFlag = VR.EVRSubmitFlags_Submit_Default; - errr = VRCompositor.VRCompositor_Submit(VR.EVREye_Eye_Right, rightTextureType, rightTextureBounds, submitFlag); - errl = VRCompositor.VRCompositor_Submit(VR.EVREye_Eye_Left, leftTextureType, leftTextureBounds, submitFlag); - } - } - } else if (leftTextureType.handle() == -1 || rightTextureType.handle() == -1 - || leftTextureType.handle() != getLeftTexId() || rightTextureType.handle() != getRightTexId()) { - leftTextureType.set(getLeftTexId(), leftTextureType.eType(), leftTextureType.eColorSpace()); - rightTextureType.set(getRightTexId(), leftTextureType.eType(), leftTextureType.eColorSpace()); - } else { - if (api instanceof LWJGLOpenVR) { - int submitFlag = VR.EVRSubmitFlags_Submit_Default; - errr = VRCompositor.VRCompositor_Submit(VR.EVREye_Eye_Right, rightTextureType, null, submitFlag); - errl = VRCompositor.VRCompositor_Submit(VR.EVREye_Eye_Left, leftTextureType, null, submitFlag); - } else { - - } - } - - if (errl != 0) { - logger.severe("Submit to left compositor error: " + " (" + Integer.toString(errl) + ")"); - 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: " + " (" + 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."); - } - - VRCompositor.VRCompositor_PostPresentHandoff(); - - } - - @Override - 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(); - } - - logger.config("Initialized VR view manager [SUCCESS]"); - - } 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) { - 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 environment is not attached to any application."); - } - - } else { - throw new IllegalStateException("This VR view manager is not attached to any VR environment."); - } - - } - - /** - * Replaces rootNode with the distortion mesh as the main camera's scene. - */ - private void setupVRScene() { - - if (environment != null) { - if (environment.getApplication() != null) { - // no special scene to set up 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.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) { - - 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); - } - - private void setupCamerasAndViews() { - - if (environment != null) { - // get desired frustum from original camera - Camera origCam = environment.getCamera(); - float fFar = origCam.getFrustumFar(); - float fNear = origCam.getFrustumNear(); - - // restore frustum 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(); - } - - 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(); - if (environment.getVRHardware() != null) { - getRightCamera().setProjectionMatrix(environment.getVRHardware().getHMDMatrixProjectionRightEye(getRightCamera())); - } - 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()); - } else { - 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(); - environment.getVRHardware().getHMDMatrixPoseRightEye(); - } - } else { - throw new IllegalStateException("This VR view manager is not attached to any VR environment."); - } - } - - private ViewPort setupMirrorBuffers(Camera cam, Texture2D 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(), 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(Texture2D.MinFilter.BilinearNoMipMaps); - dualEyeTex.setMagFilter(Texture2D.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(Texture2D.MinFilter.BilinearNoMipMaps); - offTex.setMagFilter(Texture2D.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."); - } - } - -} \ No newline at end of file diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/oculus/OculusMouseManager.java b/jme3-vr/src/main/java/com/jme3/input/vr/oculus/OculusMouseManager.java deleted file mode 100644 index fc52ee467a..0000000000 --- a/jme3-vr/src/main/java/com/jme3/input/vr/oculus/OculusMouseManager.java +++ /dev/null @@ -1,106 +0,0 @@ -package com.jme3.input.vr.oculus; - -import com.jme3.app.VREnvironment; -import com.jme3.input.controls.AnalogListener; -import com.jme3.input.vr.AbstractVRMouseManager; -import com.jme3.input.vr.VRInputType; -import com.jme3.math.Vector2f; - -/** - * A class dedicated to the mouse handling within Oculus Rift based VR experience. - * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr - * - */ -public class OculusMouseManager 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 OculusMouseManager(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.OculusThumbstickAxis); - } else { - tpDelta = getVREnvironment().getVRinput().getAxisDeltaSinceLastCall(inputIndex, VRInputType.OculusThumbstickAxis); - } - - 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/oculus/OculusVR.java b/jme3-vr/src/main/java/com/jme3/input/vr/oculus/OculusVR.java deleted file mode 100644 index 75c14c1647..0000000000 --- a/jme3-vr/src/main/java/com/jme3/input/vr/oculus/OculusVR.java +++ /dev/null @@ -1,663 +0,0 @@ -package com.jme3.input.vr.oculus; - -import com.jme3.app.VREnvironment; -import com.jme3.input.vr.HmdType; -import com.jme3.input.vr.VRAPI; -import com.jme3.math.*; -import com.jme3.renderer.Camera; -import com.jme3.texture.*; -import org.lwjgl.*; -import org.lwjgl.ovr.*; - -import java.nio.IntBuffer; -import java.util.logging.Logger; - -import static org.lwjgl.BufferUtils.createPointerBuffer; -import static org.lwjgl.ovr.OVR.*; -import static org.lwjgl.ovr.OVRErrorCode.ovrSuccess; -import static org.lwjgl.ovr.OVRUtil.ovr_Detect; -import static org.lwjgl.system.MemoryUtil.*; - -/** - * Oculus VR (LibOVR 1.3.0) Native support. - *

- * A few notes about the Oculus coordinate system: - *

    - *
  • Matrices should be transposed
  • - *
  • Quaternions should be inverted
  • - *
  • Vectors should have their X and Z axes flipped, but apparently not Y.
  • - *
- * - * @author Campbell Suter (znix@znix.xyz) - */ -public class OculusVR implements VRAPI { - - private static final Logger LOGGER = Logger.getLogger(OculusVR.class.getName()); - - private final VREnvironment environment; - private boolean initialized; - - /** - * Pointer to the HMD object - */ - private long session; - - /** - * Information about the VR session (should the app quit, is - * it visible or is the universal menu open, etcetera) - */ - private OVRSessionStatus sessionStatus; - - /** - * HMD information, such as product name and manufacturer. - */ - private OVRHmdDesc hmdDesc; - - /** - * The horizontal resolution of the HMD - */ - private int resolutionW; - - /** - * The vertical resolution of the HMD - */ - private int resolutionH; - - /** - * Field-of-view data for each eye (how many degrees from the - * center can the user see). - */ - private final OVRFovPort fovPorts[] = new OVRFovPort[2]; - - /** - * Data about each eye to be rendered - in particular, the - * offset from the center of the HMD to the eye. - */ - private final OVREyeRenderDesc eyeRenderDesc[] = new OVREyeRenderDesc[2]; - - /** - * Store the projections for each eye, so we don't have to malloc - * and recalculate them each frame. - */ - private final OVRMatrix4f[] projections = new OVRMatrix4f[2]; - - /** - * Store the poses for each eye, relative to the HMD. - * - * @see #getHMDMatrixPoseLeftEye() - */ - private final Matrix4f[] hmdRelativeEyePoses = new Matrix4f[2]; - - /** - * Store the positions for each eye, relative to the HMD. - * - * @see #getHMDVectorPoseLeftEye() - */ - private final Vector3f[] hmdRelativeEyePositions = new Vector3f[2]; - - /** - * The current state of the tracked components (HMD, touch) - */ - private OVRTrackingState trackingState; - - /** - * The position and orientation of the user's head. - */ - private OVRPosef headPose; - - /** - * The state of the Touch controllers. - */ - private OculusVRInput input; - - // The size of the texture drawn onto the HMD - private int textureW; - private int textureH; - - // Layers to render into - private PointerBuffer layers; - private OVRLayerEyeFov layer0; - - /** - * Chain texture set thing. - */ - private long chains[]; - - /** - * Frame buffers we can draw into. - */ - private FrameBuffer framebuffers[][]; - - public OculusVR(VREnvironment environment) { - this.environment = environment; - } - - @Override - public OculusVRInput getVRinput() { - return input; - } - - @Override - public String getName() { - return "OVR"; - } - - @Override - public int getDisplayFrequency() { - // TODO find correct frequency. I'm not sure - // if LibOVR has a way to do that, though. - return 60; - } - - @Override - public boolean initialize() { - // Check to make sure the HMD is connected - OVRDetectResult detect = OVRDetectResult.calloc(); - ovr_Detect(0, detect); - boolean connected = detect.IsOculusHMDConnected(); - LOGGER.config("OVRDetectResult.IsOculusHMDConnected = " + connected); - LOGGER.config("OVRDetectResult.IsOculusServiceRunning = " + detect.IsOculusServiceRunning()); - detect.free(); - - if (!connected) { - LOGGER.info("Oculus Rift not connected"); - return false; - } - - initialized = true; - - // Set up the HMD - OVRLogCallback callback = new OVRLogCallback() { - @Override - public void invoke(long userData, int level, long message) { - LOGGER.fine("LibOVR [" + userData + "] [" + level + "] " + memASCII(message)); - } - }; - OVRInitParams initParams = OVRInitParams.calloc(); - initParams.LogCallback(callback); - if (ovr_Initialize(initParams) != ovrSuccess) { - LOGGER.severe("LibOVR Init Failed"); - return false; // TODO fix memory leak - destroy() is not called - } - LOGGER.config("LibOVR Version " + ovr_GetVersionString()); - initParams.free(); - - // Get access to the HMD - LOGGER.info("Initialize HMD Session"); - PointerBuffer pHmd = memAllocPointer(1); - OVRGraphicsLuid luid = OVRGraphicsLuid.calloc(); - if (ovr_Create(pHmd, luid) != ovrSuccess) { - LOGGER.severe("Failed to create HMD"); - return false; // TODO fix memory leak - destroy() is not called - } - session = pHmd.get(0); - memFree(pHmd); - luid.free(); - sessionStatus = OVRSessionStatus.calloc(); - - // Get the information about the HMD - LOGGER.fine("Get HMD properties"); - hmdDesc = OVRHmdDesc.malloc(); - ovr_GetHmdDesc(session, hmdDesc); - if (hmdDesc.Type() == ovrHmd_None) { - LOGGER.warning("No HMD connected"); - return false; // TODO fix memory leak - destroy() is not called - } - - resolutionW = hmdDesc.Resolution().w(); - resolutionH = hmdDesc.Resolution().h(); - - LOGGER.config("HMD Properties: " - + "\t Manufacturer: " + hmdDesc.ManufacturerString() - + "\t Product: " + hmdDesc.ProductNameString() - + "\t Serial: " // + hmdDesc.SerialNumberString() // Hidden for privacy reasons - + "\t Type: " + hmdDesc.Type() - + "\t Resolution (total): " + resolutionW + "," + resolutionH); - - if (resolutionW == 0) { - LOGGER.severe("HMD width=0 : aborting"); - return false; // TODO fix memory leak - destroy() is not called - } - - // Find the FOV for each eye - for (int eye = 0; eye < 2; eye++) { - fovPorts[eye] = hmdDesc.DefaultEyeFov(eye); - } - - // Get the pose for each eye, and cache it for later. - for (int eye = 0; eye < 2; eye++) { - // Create the projection objects - projections[eye] = OVRMatrix4f.malloc(); - hmdRelativeEyePoses[eye] = new Matrix4f(); - hmdRelativeEyePositions[eye] = new Vector3f(); - - // Find the eye render information - we use this in the - // view manager for giving LibOVR its timewarp information. - eyeRenderDesc[eye] = OVREyeRenderDesc.malloc(); - ovr_GetRenderDesc(session, eye, fovPorts[eye], eyeRenderDesc[eye]); - - // Get the pose of the eye - OVRPosef pose = eyeRenderDesc[eye].HmdToEyePose(); - - // Get the position and rotation of the eye - vecO2J(pose.Position(), hmdRelativeEyePositions[eye]); - Quaternion rotation = quatO2J(pose.Orientation(), new Quaternion()); - - // Put it into a matrix for the get eye pose functions - hmdRelativeEyePoses[eye].loadIdentity(); - hmdRelativeEyePoses[eye].setTranslation(hmdRelativeEyePositions[eye]); - hmdRelativeEyePoses[eye].setRotationQuaternion(rotation); - } - - // Recenter the HMD. The game itself should do this too, but just in case / before they do. - reset(); - - // Do this so others relying on our texture size (the GUI in particular) get it correct. - findHMDTextureSize(); - - // Allocate the memory for the tracking state - we actually - // set it up later, but Input uses it so calloc it now. - trackingState = OVRTrackingState.calloc(); - - // Set up the input - input = new OculusVRInput(this, session, sessionStatus, trackingState); - - // TODO find some way to get in ovrTrackingOrigin_FloorLevel - - // throw new UnsupportedOperationException("Not yet implemented!"); - return true; - } - - @Override - public void updatePose() { - double ftiming = ovr_GetPredictedDisplayTime(session, 0); - ovr_GetTrackingState(session, ftiming, true, trackingState); - ovr_GetSessionStatus(session, sessionStatus); - - input.updateControllerStates(); - - headPose = trackingState.HeadPose().ThePose(); - } - - @Override - public boolean isInitialized() { - return initialized; - } - - @Override - public void destroy() { - // fovPorts: contents are managed by LibOVR, no need to do anything. - - // Clean up the input - input.dispose(); - - // Check if we've set up rendering - if so, clean that up. - if (chains != null) { - // Destroy our set of huge buffer images. - for (long chain : chains) { - ovr_DestroyTextureSwapChain(session, chain); - } - - // Free up the layer - layer0.free(); - - // The layers array apparently takes care of itself (and crashes if we try to free it) - } - - for (OVREyeRenderDesc eye : eyeRenderDesc) { - eye.free(); - } - for (OVRMatrix4f projection : projections) { - projection.free(); - } - - hmdDesc.free(); - trackingState.free(); - sessionStatus.free(); - - // Wrap everything up - ovr_Destroy(session); - ovr_Shutdown(); - } - - @Override - public void reset() { - // Reset the coordinate system - where the user's head is now is facing forwards from [0,0,0] - ovr_RecenterTrackingOrigin(session); - } - - @Override - public void getRenderSize(Vector2f store) { - if (!isInitialized()) { - throw new IllegalStateException("Cannot call getRenderSize() before initialized!"); - } - store.x = textureW; - store.y = textureH; - } - - @Override - public float getInterpupillaryDistance() { - return 0.065f; // TODO - } - - @Override - public Quaternion getOrientation() { - return quatO2J(headPose.Orientation(), new Quaternion()); - } - - @Override - public Vector3f getPosition() { - return vecO2J(headPose.Position(), new Vector3f()); - } - - @Override - public void getPositionAndOrientation(Vector3f storePos, Quaternion storeRot) { - storePos.set(getPosition()); - storeRot.set(getOrientation()); - } - - private Matrix4f calculateProjection(int eye, Camera cam) { - Matrix4f mat = new Matrix4f(); - - // Get LibOVR to find the correct projection - OVRUtil.ovrMatrix4f_Projection(fovPorts[eye], cam.getFrustumNear(), cam.getFrustumFar(), OVRUtil.ovrProjection_None, projections[eye]); - - matrixO2J(projections[eye], mat); - - return mat; - } - - @Override - public Matrix4f getHMDMatrixProjectionLeftEye(Camera cam) { - return calculateProjection(ovrEye_Left, cam); - } - - @Override - public Matrix4f getHMDMatrixProjectionRightEye(Camera cam) { - return calculateProjection(ovrEye_Right, cam); - } - - @Override - public Vector3f getHMDVectorPoseLeftEye() { - return hmdRelativeEyePositions[ovrEye_Left]; - } - - @Override - public Vector3f getHMDVectorPoseRightEye() { - return hmdRelativeEyePositions[ovrEye_Right]; - } - - @Override - public Vector3f getSeatedToAbsolutePosition() { - throw new UnsupportedOperationException(); - } - - @Override - public Matrix4f getHMDMatrixPoseLeftEye() { - return hmdRelativeEyePoses[ovrEye_Left]; - } - - @Override - public Matrix4f getHMDMatrixPoseRightEye() { - return hmdRelativeEyePoses[ovrEye_Left]; - } - - @Override - public HmdType getType() { - return HmdType.OCULUS_RIFT; - } - - @Override - public boolean initVRCompositor(boolean set) { - if (!set) { - throw new UnsupportedOperationException("Cannot use LibOVR without compositor!"); - } - - setupLayers(); - - framebuffers = new FrameBuffer[2][]; - for (int eye = 0; eye < 2; eye++) - setupFramebuffers(eye); - - // TODO move initialization code here from VRViewManagerOculus - return true; - } - - @Override - public void printLatencyInfoToConsole(boolean set) { - throw new UnsupportedOperationException("Not yet implemented!"); - } - - @Override - public void setFlipEyes(boolean set) { - throw new UnsupportedOperationException("Not yet implemented!"); - } - - @Override - public Void getCompositor() { - throw new UnsupportedOperationException("Not yet implemented!"); - } - - @Override - public Void getVRSystem() { - throw new UnsupportedOperationException("Not yet implemented!"); - } - - // Rendering-type stuff - - public void findHMDTextureSize() { - // Texture sizes - float pixelScaling = 1.0f; // pixelsPerDisplayPixel - - OVRSizei leftTextureSize = OVRSizei.malloc(); - ovr_GetFovTextureSize(session, ovrEye_Left, fovPorts[ovrEye_Left], pixelScaling, leftTextureSize); - - OVRSizei rightTextureSize = OVRSizei.malloc(); - ovr_GetFovTextureSize(session, ovrEye_Right, fovPorts[ovrEye_Right], pixelScaling, rightTextureSize); - - if (leftTextureSize.w() != rightTextureSize.w()) { - throw new IllegalStateException("Texture sizes do not match [horizontal]"); - } - if (leftTextureSize.h() != rightTextureSize.h()) { - throw new IllegalStateException("Texture sizes do not match [vertical]"); - } - - textureW = leftTextureSize.w(); - textureH = leftTextureSize.h(); - - leftTextureSize.free(); - rightTextureSize.free(); - } - - private long setupTextureChain() { - // Set up the information for the texture buffer chain thing - OVRTextureSwapChainDesc swapChainDesc = OVRTextureSwapChainDesc.calloc() - .Type(ovrTexture_2D) - .ArraySize(1) - .Format(OVR_FORMAT_R8G8B8A8_UNORM_SRGB) - .Width(textureW) - .Height(textureH) - .MipLevels(1) - .SampleCount(1) - .StaticImage(false); // ovrFalse - - // Create the chain - PointerBuffer textureSetPB = createPointerBuffer(1); - if (OVRGL.ovr_CreateTextureSwapChainGL(session, swapChainDesc, textureSetPB) != ovrSuccess) { - throw new RuntimeException("Failed to create Swap Texture Set"); - } - swapChainDesc.free(); - - return textureSetPB.get(); // TODO is this a memory leak? - } - - public void setupLayers() { - //Layers - layer0 = OVRLayerEyeFov.calloc(); - layer0.Header().Type(ovrLayerType_EyeFov); - layer0.Header().Flags(ovrLayerFlag_TextureOriginAtBottomLeft); - - chains = new long[2]; - for (int eye = 0; eye < 2; eye++) { - long eyeChain = setupTextureChain(); - chains[eye] = eyeChain; - - OVRRecti viewport = OVRRecti.calloc(); - viewport.Pos().x(0); - viewport.Pos().y(0); - viewport.Size().w(textureW); - viewport.Size().h(textureH); - - layer0.ColorTexture(eye, eyeChain); - layer0.Viewport(eye, viewport); - layer0.Fov(eye, fovPorts[eye]); - - viewport.free(); - // we update pose only when we have it in the render loop - } - - layers = createPointerBuffer(1); - layers.put(0, layer0); - } - - /** - * Create a framebuffer for an eye. - */ - public void setupFramebuffers(int eye) { - // Find the chain length - IntBuffer length = BufferUtils.createIntBuffer(1); - ovr_GetTextureSwapChainLength(session, chains[eye], length); - int chainLength = length.get(); - - LOGGER.fine("HMD Eye #" + eye + " texture chain length: " + chainLength); - - // Create the frame buffers - framebuffers[eye] = new FrameBuffer[chainLength]; - for (int i = 0; i < chainLength; i++) { - // find the GL texture ID for this texture - IntBuffer textureIdB = BufferUtils.createIntBuffer(1); - OVRGL.ovr_GetTextureSwapChainBufferGL(session, chains[eye], i, textureIdB); - int textureId = textureIdB.get(); - - // TODO less hacky way of getting our texture into JMonkeyEngine - Image img = new Image(); - img.setId(textureId); - img.setFormat(Image.Format.RGBA8); - img.setWidth(textureW); - img.setHeight(textureH); - - Texture2D tex = new Texture2D(img); - - FrameBuffer buffer = new FrameBuffer(textureW, textureH, 1); - buffer.setDepthBuffer(Image.Format.Depth); - buffer.setColorTexture(tex); - - framebuffers[eye][i] = buffer; - } - } - - // UTILITIES - // TODO move to helper class - - /** - * Copy the values from a LibOVR matrix into a jMonkeyEngine matrix. - * - * @param from The matrix to copy from. - * @param to The matrix to copy to. - * @return The {@code to} argument. - */ - public static Matrix4f matrixO2J(OVRMatrix4f from, Matrix4f to) { - to.loadIdentity(); // For the additional columns (unless I'm badly misunderstanding matrices) - - for (int x = 0; x < 4; x++) { - for (int y = 0; y < 4; y++) { - float val = from.M(x + y * 4); // TODO verify this - to.set(x, y, val); - } - } - - to.transposeLocal(); // jME vs LibOVR coordinate spaces - Yay! - - return to; - } - - /** - * Copy the values from a LibOVR quaternion into a jMonkeyEngine quaternion. - * - * @param from The quaternion to copy from. - * @param to The quaternion to copy to. - * @return The {@code to} argument. - */ - public static Quaternion quatO2J(OVRQuatf from, Quaternion to) { - // jME and LibOVR do their coordinate spaces differently for rotations, so flip Y and W (thanks, jMonkeyVR). - to.set( - from.x(), - -from.y(), - from.z(), - -from.w() - ); - - to.normalizeLocal(); - - return to; - } - - /** - * Copy the values from a LibOVR vector into a jMonkeyEngine vector. - * - * @param from The vector to copy from. - * @param to The vector to copy to. - * @return The {@code to} argument. - */ - public static Vector3f vecO2J(OVRVector3f from, Vector3f to) { - // jME and LibOVR disagree on which way X and Z are, too. - to.set( - -from.x(), - from.y(), - -from.z() - ); - - return to; - } - - // Getters, intended for VRViewManager. - - public long getSessionPointer() { - return session; - } - - public long getChain(int eye) { - return chains[eye]; - } - - public FrameBuffer[] getFramebuffers(int eye) { - return framebuffers[eye]; - } - - public PointerBuffer getLayers() { - return layers; - } - - public OVRLayerEyeFov getLayer0() { - return layer0; - } - - public OVRFovPort getFovPort() { - return fovPorts[ovrEye_Left]; // TODO checking the left and right eyes match - } - - public OVRPosef getHeadPose() { - return headPose; - } - - public OVRPosef getEyePose(int eye) { - return eyeRenderDesc[eye].HmdToEyePose(); - } - - public VREnvironment getEnvironment() { - return environment; - } -} - -/* vim: set ts=4 softtabstop=0 sw=4 expandtab: */ - diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/oculus/OculusVRInput.java b/jme3-vr/src/main/java/com/jme3/input/vr/oculus/OculusVRInput.java deleted file mode 100644 index f2ce772fbb..0000000000 --- a/jme3-vr/src/main/java/com/jme3/input/vr/oculus/OculusVRInput.java +++ /dev/null @@ -1,370 +0,0 @@ -package com.jme3.input.vr.oculus; - -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.*; -import com.jme3.renderer.Camera; -import com.jme3.scene.Spatial; - -import org.lwjgl.ovr.*; - -import static org.lwjgl.ovr.OVR.*; - -public class OculusVRInput implements VRInputAPI { - // State control - private final OVRInputState inputState; - private final OVRSessionStatus sessionStatus; - private final OVRTrackingState trackingState; - private final OculusVR hardware; - private long session; - - // Setup values - private float axisMultiplier = 1; - - // Cached stuff - private int buttons, touch; - - // Used to calculate sinceLastCall stuff - private int lastButtons, lastTouch; - private final Vector2f[][] lastAxes; - - /** - * The state data (linear and angular velocity and acceleration) for each hand - */ - private OVRPoseStatef[] handStates; - - /** - * The position and orientation of the Touch controllers. - */ - private OVRPosef[] handPoses; - - /** - * The object forms of the tracked controllers. - */ - private final OculusController[] controllers = { - new OculusController(0), - new OculusController(1) - }; - - public OculusVRInput(OculusVR hardware, long session, - OVRSessionStatus sessionStatus, OVRTrackingState trackingState) { - this.hardware = hardware; - this.session = session; - this.sessionStatus = sessionStatus; - this.trackingState = trackingState; - - inputState = OVRInputState.calloc(); - - handStates = new OVRPoseStatef[ovrHand_Count]; - handPoses = new OVRPosef[handStates.length]; - lastAxes = new Vector2f[handStates.length][3]; // trigger+grab+thumbstick for each hand. - } - - public void dispose() { - inputState.free(); - session = 0; // Crashing > undefined behaviour if this object is incorrectly accessed again. - } - - @Override - public void updateControllerStates() { - // Handle buttons, axes - ovr_GetInputState(session, ovrControllerType_Touch, inputState); - buttons = inputState.Buttons(); - touch = inputState.Touches(); - - // Get the touch controller poses - // TODO what if no touch controllers are available? - for (int hand = 0; hand < handPoses.length; hand++) { - handStates[hand] = trackingState.HandPoses(hand); - handPoses[hand] = handStates[hand].ThePose(); - } - } - - private Vector3f cv(OVRVector3f in) { - // TODO do we want to reuse vectors rather than making new ones? - // TODO OpenVRInput does this, but it will probably cause some bugs. - return OculusVR.vecO2J(in, new Vector3f()); // This also fixes the coordinate space transform issues. - } - - private Vector2f cv(OVRVector2f in) { - // TODO do we want to reuse vectors rather than making new ones? - // TODO OpenVRInput does this, but it will probably cause some bugs. - return new Vector2f(in.x(), in.y()); - } - - private Quaternion cq(OVRQuatf in) { - // TODO do we want to reuse quaternions rather than making new ones? - // TODO OpenVRInput does this, but it will probably cause some bugs. - return OculusVR.quatO2J(in, new Quaternion()); // This also fixes the coordinate space transform issues. - } - - private Vector2f axis(float input) { - // See above comments about reusing vectors - return new Vector2f(input, input); - } - - // Tracking (position, rotation, velocity, status) - - @Override - public Vector3f getPosition(int index) { - return cv(handPoses[index].Position()); - } - - @Override - public Vector3f getVelocity(int controllerIndex) { - return cv(handStates[controllerIndex].LinearVelocity()); - } - - @Override - public Quaternion getOrientation(int index) { - return cq(handPoses[index].Orientation()); - } - - @Override - public Vector3f getAngularVelocity(int controllerIndex) { - return cv(handStates[controllerIndex].AngularVelocity()); - } - - @Override - public Quaternion getFinalObserverRotation(int index) { - // Copied from OpenVRInput - - VREnvironment env = hardware.getEnvironment(); - OculusViewManager vrvm = (OculusViewManager) hardware.getEnvironment().getVRViewManager(); - - Object obs = env.getObserver(); - Quaternion tempQuaternion = new Quaternion(); // TODO move to class scope? - if (obs instanceof Camera) { - tempQuaternion.set(((Camera) obs).getRotation()); - } else { - tempQuaternion.set(((Spatial) obs).getWorldRotation()); - } - - return tempQuaternion.multLocal(getOrientation(index)); - } - - @Override - public Vector3f getFinalObserverPosition(int index) { - // Copied from OpenVRInput - - VREnvironment env = hardware.getEnvironment(); - OculusViewManager vrvm = (OculusViewManager) hardware.getEnvironment().getVRViewManager(); - - Object obs = env.getObserver(); - Vector3f pos = getPosition(index); - if (obs instanceof Camera) { - ((Camera) obs).getRotation().mult(pos, pos); - return pos.addLocal(((Camera) obs).getLocation()); - } else { - ((Spatial) obs).getWorldRotation().mult(pos, pos); - return pos.addLocal(((Spatial) obs).getWorldTranslation()); - } - } - - @Override - public boolean isInputDeviceTracking(int index) { - int flags = trackingState.HandStatusFlags(index); - return (flags & ovrStatus_PositionTracked) != 0; // TODO do we require orientation as well? - } - - // Input Getters - - @Override - public Vector2f getAxis(int controllerIndex, VRInputType forAxis) { - Vector2f result = getAxisRaw(controllerIndex, forAxis); - return result == null ? null : result.multLocal(axisMultiplier); - } - - @Override - public Vector2f getAxisRaw(int controllerIndex, VRInputType forAxis) { - switch (forAxis) { - case OculusThumbstickAxis: - return cv(inputState.Thumbstick(controllerIndex)); - case OculusTriggerAxis: - return axis(inputState.IndexTrigger(controllerIndex)); - case OculusGripAxis: - return axis(inputState.HandTrigger(controllerIndex)); - default: - return null; - } - } - - @Override - public boolean isButtonDown(int controllerIndex, VRInputType checkButton) { - return isButtonDownForStatus(controllerIndex, checkButton, buttons, touch); - } - - public boolean isButtonDownForStatus(int controllerIndex, VRInputType checkButton, int buttons, int touch) { - int buttonMask = (controllerIndex == ovrHand_Left) ? ovrButton_LMask : ovrButton_RMask; - int touchMask = (controllerIndex == ovrHand_Left) ? - (ovrTouch_LButtonMask + ovrTouch_LPoseMask) : - (ovrTouch_RButtonMask + ovrTouch_RPoseMask); - - switch (checkButton) { - default: - return false; - - case OculusTopButton: // Physical buttons - case OculusBottomButton: - case OculusThumbstickButton: - case OculusMenuButton: - return (buttons & buttonMask & checkButton.getValue()) != 0; - - case OculusTopTouch: // Standard capacitive buttons - case OculusBottomTouch: - case OculusThumbstickTouch: - case OculusThumbrestTouch: - case OculusIndexTouch: - case OculusThumbUp: // Calculated/virtual capacitive buttons - case OculusIndexPointing: - return (touch & touchMask & checkButton.getValue()) != 0; - } - } - - // Since-last-call stuff - - @Override - public void resetInputSinceLastCall() { - lastButtons = 0; - lastTouch = 0; - } - - @Override - public boolean wasButtonPressedSinceLastCall(int controllerIndex, VRInputType checkButton) { - boolean wasPressed = isButtonDownForStatus(controllerIndex, checkButton, lastButtons, lastTouch); - lastButtons = buttons; - lastTouch = touch; - return !wasPressed && isButtonDown(controllerIndex, checkButton); - } - - @Override - public Vector2f getAxisDeltaSinceLastCall(int controllerIndex, VRInputType forAxis) { - int index; - switch (forAxis) { - case OculusTriggerAxis: - index = 0; - break; - case OculusGripAxis: - index = 1; - break; - case OculusThumbstickAxis: - index = 2; - break; - default: - return null; - } - - Vector2f last = lastAxes[controllerIndex][index]; - if (last == null) { - last = lastAxes[controllerIndex][index] = new Vector2f(); - } - - Vector2f current = getAxis(controllerIndex, forAxis); - - // TODO could this lead to accuracy problems? - current.subtractLocal(last); - last.addLocal(current); - - return current; - } - - // Misc - - @Override - public boolean init() { - throw new UnsupportedOperationException("Input initialized at creation time"); - } - - @Override - public void updateConnectedControllers() { - throw new UnsupportedOperationException("Automatically done by LibOVR (I think?)"); - } - - @Override - public float getAxisMultiplier() { - return axisMultiplier; - } - - @Override - public void setAxisMultiplier(float axisMultiplier) { - this.axisMultiplier = axisMultiplier; - } - - @Override - public void triggerHapticPulse(int controllerIndex, float seconds) { - // TODO: How do we time so we can turn the feedback off? - } - - @Override - public boolean isInputFocused() { - return sessionStatus.IsVisible(); // TODO do we need HmdMounted, or is it counted in IsVisible - } - - @Override - public Object getRawControllerState(int index) { - throw new UnsupportedOperationException("Cannot get raw controller state!"); - } - - @Override - public void swapHands() { - // Do nothing. - // TODO although OSVR and OpenVR if it has more than two controllers both do nothing, shouldn't we be - // TODO throwing an exception or something? - } - - @Override - public int getTrackedControllerCount() { - // TODO: Shouldn't we be seeing if the user has the touch controllers first? - return 2; - } - - @Override - public VRTrackedController getTrackedController(int index) { - return controllers[index]; - } - - /** - * The object form representation of a controller. - */ - public class OculusController implements VRTrackedController { - - /** - * The ID of the hand to track - */ - private int hand; - - public OculusController(int hand) { - this.hand = hand; - } - - @Override - public String getControllerName() { - return "Touch"; // TODO - } - - @Override - public String getControllerManufacturer() { - return "Oculus"; // TODO - } - - @Override - public Vector3f getPosition() { - return OculusVRInput.this.getPosition(hand); - } - - @Override - public Quaternion getOrientation() { - return OculusVRInput.this.getOrientation(hand); - } - - @Override - public Matrix4f getPose() { - Matrix4f mat = new Matrix4f(); - mat.setRotationQuaternion(getOrientation()); - mat.setTranslation(getPosition()); - return mat; - } - } -} 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 deleted file mode 100644 index 6ebbab1cf9..0000000000 --- a/jme3-vr/src/main/java/com/jme3/input/vr/oculus/OculusViewManager.java +++ /dev/null @@ -1,340 +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.vr.oculus; - -import com.jme3.app.VREnvironment; -import com.jme3.input.vr.AbstractVRViewManager; -import com.jme3.input.vr.VRAPI; -import com.jme3.math.*; -import com.jme3.renderer.Camera; -import com.jme3.renderer.ViewPort; -import com.jme3.scene.Spatial; -import com.jme3.util.BufferUtils; -import com.jme3.util.VRGUIPositioningMode; - -import java.nio.IntBuffer; -import java.util.Iterator; -import java.util.Objects; - -import org.lwjgl.ovr.OVRFovPort; -import org.lwjgl.ovr.OVRPosef; -import org.lwjgl.ovr.OVRUtil; - -import static org.lwjgl.ovr.OVR.*; -import static org.lwjgl.ovr.OVRErrorCode.*; - -/** - * A rendering system for Oculus's LibOVR API. - * - * @author Campbell Suter (znix@znix.xyz) - */ -public class OculusViewManager extends AbstractVRViewManager { - - private final VREnvironment environment; - private final OculusVR hardware; - - // Copied from OSVR - //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(); - - public OculusViewManager(VREnvironment environment) { - this.environment = environment; - - VRAPI hardware = environment.getVRHardware(); - Objects.requireNonNull(hardware, "Attached VR Hardware cannot be null"); - if (!(hardware instanceof OculusVR)) { - throw new IllegalStateException("Cannot use Oculus VR view manager on non-Oculus hardware state!"); - } - - this.hardware = (OculusVR) hardware; - - if (!environment.compositorAllowed()) { - throw new UnsupportedOperationException("Cannot render without compositor on LibOVR"); - } - } - - @Override - public void initialize() { - setupCamerasAndViews(); - - if (environment.hasTraditionalGUIOverlay()) { - - environment.getVRMouseManager().initialize(); - - // update the pose to position the gui correctly on start - update(0f); - environment.getVRGUIManager().positionGui(); - } - } - - private long session() { - return hardware.getSessionPointer(); - } - - @Override - public void update(float tpf) { - // TODO - - hardware.updatePose(); - - // TODO deduplicate - if (environment == null) { - throw new IllegalStateException("This VR view manager is not attached to any VR environment."); - } - - // 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(); - } - - // update the HMD's position & orientation - hardware.getPositionAndOrientation(hmdPos, hmdRot); - if (obs != null) { - // update hmdPos based on obs rotation - finalRotation.set(objRot); - finalRotation.mult(hmdPos, hmdPos); - finalRotation.multLocal(hmdRot); - } - - // Update both eye cameras - finalizeCamera(hardware.getHMDVectorPoseLeftEye(), objPos, leftCamera); - finalizeCamera(hardware.getHMDVectorPoseRightEye(), objPos, rightCamera); - - // Update the main camera, so it shows the same basic view the HMD is getting - // TODO: Do this in VRAppState, so it works on all HMDs. - // I only have a Rift, so I can't test it on anything else. - if(!environment.isInstanceRendering()) { // We use the app camera as the left camera here - // TODO: Double up on rendering and use one eye, to reduce GPU load rendering the scene again. - // TODO: Snip at the image to remove the distorted corners from a very high FOV. - finalizeCamera(Vector3f.ZERO, objPos, environment.getApplication().getCamera()); - } - - 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(); - } - } - } - - /** - * 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); - } - - @Override - public void render() { - - // Calculate the render pose (translation/rotation) for each eye. - // LibOVR takes the difference between this and the real position of each eye at display time - // to apply AZW (timewarp). - - OVRPosef.Buffer hmdToEyeOffsets = OVRPosef.calloc(2); - hmdToEyeOffsets.put(0, hardware.getEyePose(ovrEye_Left)); - hmdToEyeOffsets.put(1, hardware.getEyePose(ovrEye_Right)); - - //calculate eye poses - OVRUtil.ovr_CalcEyePoses(hardware.getHeadPose(), hmdToEyeOffsets, hardware.getLayer0().RenderPose()); - hmdToEyeOffsets.free(); - - for (int eye = 0; eye < 2; eye++) { - IntBuffer currentIndexB = BufferUtils.createIntBuffer(1); - ovr_GetTextureSwapChainCurrentIndex(session(), hardware.getChain(eye), currentIndexB); - int index = currentIndexB.get(); - - // Constantly (each frame) rotating through a series of - // frame buffers, so make sure we write into the correct one. - (eye == ovrEye_Left ? leftViewPort : rightViewPort).setOutputFrameBuffer(hardware.getFramebuffers(eye)[index]); - } - - // Now the game will render into the buffers given to us by LibOVR - } - - @Override - public void postRender() { - // We're done with our textures now - the game is done drawing into them. - for (int eye = 0; eye < 2; eye++) { - ovr_CommitTextureSwapChain(session(), hardware.getChain(eye)); - } - - // Send the result to the HMD - int result = ovr_SubmitFrame(session(), 0, null, hardware.getLayers()); - if (result != ovrSuccess) { - throw new IllegalStateException("Failed to submit frame!"); - } - } - - /* - ********************************************************* - * Show's over, now it's just boring camera stuff etc. * - ********************************************************* - */ - - /** - * Set up the cameras and views for each eye and the mirror display. - */ - private void setupCamerasAndViews() { - // TODO: Use LobOVR IPD etc - if (environment != null) { - // get desired frustum from original camera - Camera origCam = environment.getCamera(); - float fFar = origCam.getFrustumFar(); - float fNear = origCam.getFrustumNear(); - - // restore frustum on distortion scene cam, if needed - if (environment.isInstanceRendering()) { - leftCamera = origCam; - } else { - leftCamera = origCam.clone(); - } - - OVRFovPort fp = hardware.getFovPort(); - float hFov = fp.LeftTan() + fp.RightTan(); - float vFov = fp.UpTan() + fp.DownTan(); - getLeftCamera().setFrustumPerspective(hFov / FastMath.TWO_PI * 360, vFov / hFov, 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(); - if (environment.getVRHardware() != null) { - getRightCamera().setProjectionMatrix(environment.getVRHardware().getHMDMatrixProjectionRightEye(getRightCamera())); - } - rightViewPort = setupViewBuffers(getRightCamera(), RIGHT_VIEW_NAME); - } else if (environment.getApplication() != null) { - throw new UnsupportedOperationException("Not yet implemented!"); - } else { - throw new IllegalStateException("This VR environment is not attached to any application."); - } - - // setup gui - environment.getVRGUIManager().setupGui(getLeftCamera(), getRightCamera(), getLeftViewPort(), getRightViewPort()); - } else { - throw new IllegalStateException("This VR view manager is not attached to any VR environment."); - } - } - - private void prepareCameraSize(Camera cam, float xMult) { - // TODO this function is identical to that in VRViewManagerOpenVR; merge the two. - if (environment != null) { - if (environment.getApplication() != null) { - 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 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) { - // TODO this function is identical to that in VRViewManagerOpenVR; merge the two. - if (environment != null) { - if (environment.getApplication() != null) { - 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()); - } - - // The target view buffer will be set during prerender. - 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."); - } - } -} diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/oculus/package-info.java b/jme3-vr/src/main/java/com/jme3/input/vr/oculus/package-info.java deleted file mode 100644 index ab7b1bbb89..0000000000 --- a/jme3-vr/src/main/java/com/jme3/input/vr/oculus/package-info.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -/** - * user-input classes for Oculus Rift headsets - */ -package com.jme3.input.vr.oculus; 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 deleted file mode 100644 index 4489bd9f99..0000000000 --- a/jme3-vr/src/main/java/com/jme3/input/vr/openvr/OpenVR.java +++ /dev/null @@ -1,584 +0,0 @@ -package com.jme3.input.vr.openvr; - -import com.jme3.app.VREnvironment; -import com.jme3.input.vr.HmdType; -import com.jme3.input.vr.VRAPI; -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.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.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 java.nio.IntBuffer; -import java.util.Locale; -import java.util.concurrent.TimeUnit; -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * 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 boolean initSuccess = false; - private static boolean flipEyes = false; - - private IntBuffer hmdDisplayFrequency; - private TrackedDevicePose_t.ByReference hmdTrackedDevicePoseReference; - protected TrackedDevicePose_t[] hmdTrackedDevicePoses; - - protected IntByReference hmdErrorStore; - - private final Quaternion rotStore = new Quaternion(); - private final Vector3f posStore = new Vector3f(); - - private static FloatByReference tlastVsync; - - /** - * The actual frame count. - */ - public static LongByReference _tframeCount; - - // for debugging latency - 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 VREnvironment environment = null; - - /** - * Convert specific OpenVR {@link com.jme3.system.jopenvr.HmdMatrix34_t HmdMatrix34_t} into JME {@link Matrix4f Matrix4f} - * @param hmdMatrix the input matrix - * @param mat the converted matrix - * @return the converted matrix - */ - public static Matrix4f convertSteamVRMatrix3ToMatrix4f(com.jme3.system.jopenvr.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], - 0f, 0f, 0f, 1f); - return mat; - } - - /** - * Convert specific OpenVR {@link com.jme3.system.jopenvr.HmdMatrix44_t HmdMatrix34_t} into JME {@link Matrix4f Matrix4f} - * @param hmdMatrix the input matrix - * @param mat the converted matrix - * @return the converted matrix - */ - public static Matrix4f convertSteamVRMatrix4ToMatrix4f(com.jme3.system.jopenvr.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]); - return mat; - } - - /** - * 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 String getName() { - return "OpenVR"; - } - - private static long latencyWaitTime = 0; - - @Override - public void setFlipEyes(boolean set) { - flipEyes = set; - } - - private boolean enableDebugLatency = false; - - @Override - public void printLatencyInfoToConsole(boolean set) { - enableDebugLatency = set; - } - - @Override - public int getDisplayFrequency() { - if( hmdDisplayFrequency == null ) return 0; - return hmdDisplayFrequency.get(0); - } - - @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; - } - - 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()); - } - - if( vrSystemFunctions == null || hmdErrorStore.getValue() != 0 ) { - logger.severe("OpenVR Initialize Result: " + JOpenVRLibrary.VR_GetVRInitErrorAsEnglishDescription(hmdErrorStore.getValue()).getString(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(); - - hmdDisplayFrequency = IntBuffer.allocate(1); - hmdDisplayFrequency.put(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]; - 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"); - } - } - } - } - - @Override - public void destroy() { - JOpenVRLibrary.VR_ShutdownInternal(); - } - - @Override - public boolean isInitialized() { - return initSuccess; - } - - @Override - public void reset() { - if( vrSystemFunctions == null ) return; - vrSystemFunctions.ResetSeatedZeroPose.apply(); - hmdSeatToStand = null; - } - - @Override - public void getRenderSize(Vector2f store) { - if( vrSystemFunctions == null ) { - // 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(); - } - } - /* - @Override - public float getFOV(int dir) { - float val = 0f; - if( vrsystemFunctions != null ) { - val = vrsystemFunctions.GetFloatTrackedDeviceProperty.apply(JOpenVRLibrary.k_unTrackedDeviceIndex_Hmd, dir, hmdErrorStore); - } - // verification of number - if( val == 0f ) { - return 55f; - } else if( val <= 10f ) { - // most likely a radian number - return val * 57.2957795f; - } - 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); - } - - @Override - public Quaternion getOrientation() { - VRUtil.convertMatrix4toQuat(hmdPose, rotStore); - return rotStore; - } - - @Override - public Vector3f getPosition() { - // the hmdPose comes in rotated funny, fix that here - hmdPose.toTranslationVector(posStore); - posStore.x = -posStore.x; - 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); - } else { - // wait - if( latencyWaitTime > 0 ) VRUtil.sleepNanos(latencyWaitTime); - - vrSystemFunctions.GetTimeSinceLastVsync.apply(tlastVsync, _tframeCount); - float fSecondsUntilPhotons = (float)timePerFrame - tlastVsync.getValue() + 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; - } - - // handle skipping frame stuff - long nowCount = _tframeCount.getValue(); - if( nowCount - frameCount > 1 ) { - // skipped a frame! - if( enableDebugLatency ) System.out.println("Frame skipped!"); - frameCountRun = 0; - if( latencyWaitTime > 0 ) { - latencyWaitTime -= TimeUnit.MILLISECONDS.toNanos(1); - if( latencyWaitTime < 0 ) latencyWaitTime = 0; - } - } else if( latencyWaitTime < timePerFrame * 1000000000.0 ) { - // didn't skip a frame, lets try waiting longer to improve latency - frameCountRun++; - latencyWaitTime += Math.round(Math.pow(frameCountRun / 10.0, 2.0)); - } - - frameCount = nowCount; - - vrSystemFunctions.GetDeviceToAbsoluteTrackingPose.apply( - environment.isSeatedExperience()?JOpenVRLibrary.ETrackingUniverseOrigin.ETrackingUniverseOrigin_TrackingUniverseSeated: - JOpenVRLibrary.ETrackingUniverseOrigin.ETrackingUniverseOrigin_TrackingUniverseStanding, - fSecondsUntilPhotons, hmdTrackedDevicePoseReference, JOpenVRLibrary.k_unMaxTrackedDeviceCount); - } - - // deal with controllers being plugged in and out - // causing an invalid memory crash... skipping for now - /*boolean hasEvent = false; - while( JOpenVRLibrary.VR_IVRSystem_PollNextEvent(OpenVR.getVRSystemInstance(), tempEvent) != 0 ) { - // Wait until the events are clear. - hasEvent = true; - } - if( hasEvent ) { - // an event probably changed controller state - VRInput._updateConnectedControllers(); - }*/ - //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"); - convertSteamVRMatrix3ToMatrix4f(hmdTrackedDevicePoses[nDevice].mDeviceToAbsoluteTracking, poseMatrices[nDevice]); - } - } - - if ( hmdTrackedDevicePoses[JOpenVRLibrary.k_unTrackedDeviceIndex_Hmd].bPoseIsValid != 0 ){ - hmdPose.set(poseMatrices[JOpenVRLibrary.k_unTrackedDeviceIndex_Hmd]); - } else { - hmdPose.set(Matrix4f.IDENTITY); - } - } - - @Override - public Matrix4f getHMDMatrixProjectionLeftEye(Camera cam){ - if( hmdProjectionLeftEye != null ) { - return hmdProjectionLeftEye; - } else if(vrSystemFunctions == null){ - return cam.getProjectionMatrix(); - } else { - HmdMatrix44_t mat = vrSystemFunctions.GetProjectionMatrix.apply(JOpenVRLibrary.EVREye.EVREye_Eye_Left, cam.getFrustumNear(), cam.getFrustumFar()); - hmdProjectionLeftEye = new Matrix4f(); - convertSteamVRMatrix4ToMatrix4f(mat, hmdProjectionLeftEye); - return hmdProjectionLeftEye; - } - } - - @Override - public Matrix4f getHMDMatrixProjectionRightEye(Camera cam){ - if( hmdProjectionRightEye != null ) { - return hmdProjectionRightEye; - } else if(vrSystemFunctions == null){ - return cam.getProjectionMatrix(); - } else { - HmdMatrix44_t mat = vrSystemFunctions.GetProjectionMatrix.apply(JOpenVRLibrary.EVREye.EVREye_Eye_Right, cam.getFrustumNear(), cam.getFrustumFar()); - hmdProjectionRightEye = new Matrix4f(); - convertSteamVRMatrix4ToMatrix4f(mat, hmdProjectionRightEye); - return hmdProjectionRightEye; - } - } - - @Override - public Vector3f getHMDVectorPoseLeftEye() { - if( hmdPoseLeftEyeVec == null ) { - hmdPoseLeftEyeVec = getHMDMatrixPoseLeftEye().toTranslationVector(); - // set default IPD if none or broken - if( hmdPoseLeftEyeVec.x <= 0.080f * -0.5f || hmdPoseLeftEyeVec.x >= 0.040f * -0.5f ) { - 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 = getHMDMatrixPoseRightEye().toTranslationVector(); - // set default IPD if none or broken - if( hmdPoseRightEyeVec.x >= 0.080f * 0.5f || hmdPoseRightEyeVec.x <= 0.040f * 0.5f ) { - hmdPoseRightEyeVec.x = 0.065f * 0.5f; - } - if( flipEyes == false ) hmdPoseRightEyeVec.x *= -1f; // it seems these need flipping - } - 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 tempMatrix = new Matrix4f(); - convertSteamVRMatrix3ToMatrix4f(mat, tempMatrix); - tempMatrix.toTranslationVector(hmdSeatToStand); - } - return hmdSeatToStand; - } - - @Override - public Matrix4f getHMDMatrixPoseLeftEye(){ - if( hmdPoseLeftEye != null ) { - return hmdPoseLeftEye; - } else if(vrSystemFunctions == null) { - return Matrix4f.IDENTITY; - } else { - HmdMatrix34_t mat = vrSystemFunctions.GetEyeToHeadTransform.apply(JOpenVRLibrary.EVREye.EVREye_Eye_Left); - hmdPoseLeftEye = new Matrix4f(); - return 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("index") ) { - return HmdType.VALVE_INDEX; - } 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; - } - } - } else return HmdType.NONE; - return HmdType.OTHER; - } - - @Override - public Matrix4f getHMDMatrixPoseRightEye(){ - if( hmdPoseRightEye != null ) { - return hmdPoseRightEye; - } else if(vrSystemFunctions == null) { - return Matrix4f.IDENTITY; - } else { - HmdMatrix34_t mat = vrSystemFunctions.GetEyeToHeadTransform.apply(JOpenVRLibrary.EVREye.EVREye_Eye_Right); - hmdPoseRightEye = new Matrix4f(); - return convertSteamVRMatrix3ToMatrix4f(mat, hmdPoseRightEye); - } - } -} 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 deleted file mode 100644 index ed53274888..0000000000 --- a/jme3-vr/src/main/java/com/jme3/input/vr/openvr/OpenVRBounds.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.jme3.input.vr.openvr; - -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 java.util.logging.Logger; - -/** - * A class that represents VR world bounds. - * @author reden - phr00t - https://github.com/phr00t - * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr - */ -public class OpenVRBounds implements VRBounds { - private static Logger logger = Logger.getLogger(OpenVRBounds.class.getName()); - - private VR_IVRChaperone_FnTable vrChaperone; - private Vector2f playSize; - - /** - * 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 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 deleted file mode 100644 index 6e4e536aec..0000000000 --- a/jme3-vr/src/main/java/com/jme3/input/vr/openvr/OpenVRInput.java +++ /dev/null @@ -1,498 +0,0 @@ -package com.jme3.input.vr.openvr; - -import java.util.ArrayList; -import java.util.List; -import java.util.logging.Level; -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.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; - -/* -make helper functions to pull the following easily from raw data (DONE) - -trigger: -Controller#1, Axis#0 X: 0.0, Y: 0.0 -Controller#1, Axis#1 X: 1.0, Y: 0.0 -Controller#1, Axis#2 X: 0.0, Y: 0.0 -Controller#1, Axis#3 X: 0.0, Y: 0.0 -Controller#1, Axis#4 X: 0.0, Y: 0.0 -Button press: 8589934592 (when full), touch: 8589934592 - -touchpad (upper left): -Controller#1, Axis#0 X: -0.6059755, Y: 0.2301706 -Controller#1, Axis#1 X: 0.0, Y: 0.0 -Controller#1, Axis#2 X: 0.0, Y: 0.0 -Controller#1, Axis#3 X: 0.0, Y: 0.0 -Controller#1, Axis#4 X: 0.0, Y: 0.0 -Button press: 4294967296 (when pressed in), touch: 4294967296 - -grip: -Controller#1, Axis#0 X: 0.0, Y: 0.0 -Controller#1, Axis#1 X: 0.0, Y: 0.0 -Controller#1, Axis#2 X: 0.0, Y: 0.0 -Controller#1, Axis#3 X: 0.0, Y: 0.0 -Controller#1, Axis#4 X: 0.0, Y: 0.0 -Button press: 4, touch: 4 - -thumb: -Controller#1, Axis#0 X: 0.0, Y: 0.0 -Controller#1, Axis#1 X: 0.0, Y: 0.0 -Controller#1, Axis#2 X: 0.0, Y: 0.0 -Controller#1, Axis#3 X: 0.0, Y: 0.0 -Controller#1, Axis#4 X: 0.0, Y: 0.0 -Button press: 2, touch: 2 - -*/ - -/** - * A class that wraps an OpenVR input.
- * null values will be returned if no valid pose exists, or that input device isn't available - * user code should check for null values. - * @author reden - phr00t - https://github.com/phr00t - * @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 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 float axisMultiplier = 1f; - - private final Vector3f tempVel = new Vector3f(); - - private final Quaternion tempQuaternion = new Quaternion(); - - 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. - */ - 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; - 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]]; - switch( checkButton ) { - default: - return false; - case ViveGripButton: - return (cs.ulButtonPressed & 4) != 0; - case ViveMenuButton: - return (cs.ulButtonPressed & 2) != 0; - case ViveTrackpadAxis: - return (cs.ulButtonPressed & 4294967296l) != 0; - case ViveTriggerAxis: - return (cs.ulButtonPressed & 8589934592l) != 0; - } - } - - @Override - public boolean wasButtonPressedSinceLastCall(int controllerIndex, VRInputType checkButton) { - boolean buttonDownNow = isButtonDown(controllerIndex, checkButton); - int checkButtonValue = checkButton.getValue(); - int cIndex = OpenVRInput.controllerIndex[controllerIndex]; - boolean retval = buttonDownNow == true && buttonDown[cIndex][checkButtonValue] == false; - buttonDown[cIndex][checkButtonValue] = buttonDownNow; - return retval; - } - - @Override - public void resetInputSinceLastCall() { - for(int i=0;i 0) && (index < trackedControllers.size())){ - return trackedControllers.get(index); - } - } - - return null; - } - - @Override - public int getTrackedControllerCount() { - return controllerCount; - } - - @Override - public VRControllerState_t getRawControllerState(int index) { - if( isInputDeviceTracking(index) == false ) return null; - return cStates[controllerIndex[index]]; - } - - //public Matrix4f getPoseForInputDevice(int index) { - // if( isInputDeviceTracking(index) == false ) return null; - // return OpenVR.poseMatrices[controllerIndex[index]]; - //} - - @Override - public boolean isInputFocused() { - if (environment != null){ - return ((VR_IVRSystem_FnTable)environment.getVRHardware().getVRSystem()).IsInputAvailable.apply() == 0; - } else { - throw new IllegalStateException("VR input is not attached to a VR environment."); - } - } - - @Override - public boolean isInputDeviceTracking(int index) { - if( index < 0 || index >= controllerCount ){ - return false; - } - - if (environment != null){ - if (environment.getVRHardware() instanceof OpenVR){ - return ((OpenVR)environment.getVRHardware()).hmdTrackedDevicePoses[controllerIndex[index]].bPoseIsValid != 0; - } else { - throw new IllegalStateException("VR hardware "+environment.getVRHardware().getClass().getSimpleName()+" is not a subclass of "+OpenVR.class.getSimpleName()); - } - } else { - 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]); - return rotStore[index]; - } else { - throw new IllegalStateException("VR hardware "+environment.getVRHardware().getClass().getSimpleName()+" is not a subclass of "+OpenVR.class.getSimpleName()); - } - } else { - throw new IllegalStateException("VR input is not attached to a VR environment."); - } - } - - @Override - 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]; - ((OpenVR)environment.getVRHardware()).poseMatrices[index].toTranslationVector(posStore[index]); - posStore[index].x = -posStore[index].x; - posStore[index].z = -posStore[index].z; - return posStore[index]; - } else { - throw new IllegalStateException("VR hardware "+environment.getVRHardware().getClass().getSimpleName()+" is not a subclass of "+OpenVR.class.getSimpleName()); - } - } 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 ) { - tempQuaternion.set(((Camera)obs).getRotation()); - } else { - tempQuaternion.set(((Spatial)obs).getWorldRotation()); - } - - return tempQuaternion.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 - public Vector3f getFinalObserverPosition(int index) { - if (environment != null){ - OpenVRViewManager vrvm = (OpenVRViewManager)environment.getVRViewManager(); - - if (vrvm != null){ - if(isInputDeviceTracking(index) == false ){ - return null; - } - Object obs = environment.getObserver(); - Vector3f pos = getPosition(index); - if( obs instanceof Camera ) { - ((Camera)obs).getRotation().mult(pos, pos); - return pos.addLocal(((Camera)obs).getLocation()); - } else { - ((Spatial)obs).getWorldRotation().mult(pos, pos); - return pos.addLocal(((Spatial)obs).getWorldTranslation()); - } - } 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)); - } - - @Override - public void updateConnectedControllers() { - logger.config("Updating connected controllers."); - - if (environment != null){ - controllerCount = 0; - for(int i=0;i(JOpenVRLibrary.k_unMaxTrackedDeviceCount); - } - trackedControllers.add(new OpenVRTrackedController(i, this, controllerName, manufacturerName, environment)); - - // Send a Haptic pulse to the controller - triggerHapticPulse(controllerCount, 1.0f); - - controllerCount++; - logger.config(" Tracked controller "+(i+1)+"/"+JOpenVRLibrary.k_unMaxTrackedDeviceCount+" "+controllerName+" ("+manufacturerName+") attached."); - } else { - logger.config(" Controller "+(i+1)+"/"+JOpenVRLibrary.k_unMaxTrackedDeviceCount+" ignored."); - } - } - } else { - throw new IllegalStateException("VR input is not attached to a VR environment."); - } - } - - @Override - public void updateControllerStates() { - if (environment != null){ - for(int i=0;ihttp://www.seinturier.fr - */ -public class OpenVRMouseManager 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 OpenVRMouseManager(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/openvr/OpenVRTrackedController.java b/jme3-vr/src/main/java/com/jme3/input/vr/openvr/OpenVRTrackedController.java deleted file mode 100644 index bcd521e891..0000000000 --- a/jme3-vr/src/main/java/com/jme3/input/vr/openvr/OpenVRTrackedController.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.jme3.input.vr.openvr; - -import com.jme3.app.VREnvironment; -import com.jme3.input.vr.VRTrackedController; -import com.jme3.math.Matrix4f; -import com.jme3.math.Quaternion; -import com.jme3.math.Vector3f; - -/** - * A controller that is tracked within the VR environment. Such a controller can provide its position within the VR space. - * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr - * - */ -public class OpenVRTrackedController implements VRTrackedController{ - /** - * The index of the controller within the underlying VR API. - */ - private int controllerIndex = -1; - - /** - * The underlying VRAPI. - */ - private OpenVRInput hardware = null; - - /** - * The name of the controller. - */ - private String name; - - private VREnvironment environment; - - /** - * Wrap a new VR tracked controller on an OpenVR system. - * @param controllerIndex the index of the controller within the underlying VR system. - * @param hardware the underlying VR system. - * @param name the name of the controller. - * @param manufacturer the manufacturer of the controller. - * @param environment the VR environment. - */ - public OpenVRTrackedController(int controllerIndex, OpenVRInput hardware, String name, String manufacturer, VREnvironment environment){ - this.controllerIndex = controllerIndex; - this.hardware = hardware; - - this.name = name; - this.manufacturer = manufacturer; - - this.environment = environment; - } - - /** - * The manufacturer of the controller. - */ - private String manufacturer; - - @Override - public Vector3f getPosition() { - if (hardware != null){ - return hardware.getPosition(controllerIndex); - } else { - throw new IllegalStateException("No underlying VR API."); - } - } - - @Override - public Quaternion getOrientation() { - if (hardware != null){ - return hardware.getOrientation(controllerIndex); - } else { - throw new IllegalStateException("No underlying VR API."); - } - } - - @Override - public Matrix4f getPose(){ - if (environment != null){ - if (hardware != null){ - return ((OpenVR)environment.getVRHardware()).poseMatrices[controllerIndex]; - } else { - throw new IllegalStateException("No underlying VR API."); - } - } else { - throw new IllegalStateException("VR tracked device is not attached to any environment."); - } - } - - @Override - public String getControllerName() { - return name; - } - - @Override - public String getControllerManufacturer() { - return manufacturer; - } -} diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/openvr/OpenVRViewManager.java b/jme3-vr/src/main/java/com/jme3/input/vr/openvr/OpenVRViewManager.java deleted file mode 100644 index c6d0237321..0000000000 --- a/jme3-vr/src/main/java/com/jme3/input/vr/openvr/OpenVRViewManager.java +++ /dev/null @@ -1,733 +0,0 @@ -package com.jme3.input.vr.openvr; - -import com.jme3.app.VREnvironment; -import com.jme3.input.vr.AbstractVRViewManager; -import com.jme3.input.vr.VRAPI; -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.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.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.VRTextureBounds_t; -import com.jme3.system.jopenvr.VR_IVRSystem_FnTable; -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 java.util.Iterator; -import java.util.logging.Logger; - -/** - * A VR view manager based on OpenVR. This class enable to submit 3D views to the VR compositor. - * @author reden - phr00t - https://github.com/phr00t - * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr - */ -public class OpenVRViewManager extends AbstractVRViewManager { - private static final Logger logger = Logger.getLogger(OpenVRViewManager.class.getName()); - - // OpenVR values - private VRTextureBounds_t leftTextureBounds; - private Texture_t leftTextureType; - - private VRTextureBounds_t rightTextureBounds; - private Texture_t rightTextureType; - - private Texture2D dualEyeTex; - - //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 OpenVRViewManager(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 getLeftTexture().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 getRightTexture().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 dualEyeTex.getImage().getId(); - } - - /** - * Initialize the system binds of the textures. - */ - private void initTextureSubmitStructs() { - leftTextureType = new Texture_t(); - rightTextureType = new Texture_t(); - - if (environment != null){ - if( environment.getVRHardware() instanceof OpenVR ) { - leftTextureBounds = new VRTextureBounds_t(); - rightTextureBounds = new VRTextureBounds_t(); - // left eye - leftTextureBounds.uMax = 0.5f; - leftTextureBounds.uMin = 0f; - leftTextureBounds.vMax = 1f; - leftTextureBounds.vMin = 0f; - leftTextureBounds.setAutoSynch(false); - leftTextureBounds.setAutoRead(false); - leftTextureBounds.setAutoWrite(false); - leftTextureBounds.write(); - // right eye - rightTextureBounds.uMax = 1f; - rightTextureBounds.uMin = 0.5f; - rightTextureBounds.vMax = 1f; - rightTextureBounds.vMin = 0f; - rightTextureBounds.setAutoSynch(false); - rightTextureBounds.setAutoRead(false); - rightTextureBounds.setAutoWrite(false); - rightTextureBounds.write(); - // texture type - leftTextureType.eColorSpace = JOpenVRLibrary.EColorSpace.EColorSpace_ColorSpace_Gamma; - leftTextureType.eType = JOpenVRLibrary.ETextureType.ETextureType_TextureType_OpenGL; - leftTextureType.setAutoSynch(false); - leftTextureType.setAutoRead(false); - leftTextureType.setAutoWrite(false); - leftTextureType.handle = -1; - rightTextureType.eColorSpace = JOpenVRLibrary.EColorSpace.EColorSpace_ColorSpace_Gamma; - rightTextureType.eType = JOpenVRLibrary.ETextureType.ETextureType_TextureType_OpenGL; - rightTextureType.setAutoSynch(false); - rightTextureType.setAutoRead(false); - rightTextureType.setAutoWrite(false); - rightTextureType.handle = -1; - - logger.config("Init eyes native texture binds"); - logger.config(" Left eye texture"); - logger.config(" address: "+leftTextureType.getPointer()); - logger.config(" size: "+leftTextureType.size()+" bytes"); - logger.config(" color space: "+OpenVRUtil.getEColorSpaceString(leftTextureType.eColorSpace)); - logger.config(" type: "+OpenVRUtil.getETextureTypeString(leftTextureType.eType)); - logger.config(" auto read: "+leftTextureType.getAutoRead()); - logger.config(" auto write: "+leftTextureType.getAutoWrite()); - logger.config(" handle address: "+leftTextureType.handle); - logger.config(" handle value: "+leftTextureType.handle); - logger.config(""); - logger.config(" Right eye texture"); - logger.config(" address: "+rightTextureType.getPointer()); - logger.config(" size: "+rightTextureType.size()+" bytes"); - logger.config(" color space: "+OpenVRUtil.getEColorSpaceString(rightTextureType.eColorSpace)); - logger.config(" type: "+OpenVRUtil.getETextureTypeString(rightTextureType.eType)); - logger.config(" auto read: "+rightTextureType.getAutoRead()); - logger.config(" auto write: "+rightTextureType.getAutoWrite()); - logger.config(" handle address: "+rightTextureType.handle); - logger.config(" handle value: "+rightTextureType.handle); - } - } else { - throw new IllegalStateException("This VR view manager is not attached to any VR environment."); - } - } - - @Override - public void render() { - } - - @Override - 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(); - } - } else { - if( api instanceof OpenVR ) { - int submitFlag = JOpenVRLibrary.EVRSubmitFlags.EVRSubmitFlags_Submit_Default; - errr = ((OpenVR)api).getCompositor().Submit.apply(JOpenVRLibrary.EVREye.EVREye_Eye_Right, leftTextureType, rightTextureBounds, submitFlag); - errl = ((OpenVR)api).getCompositor().Submit.apply(JOpenVRLibrary.EVREye.EVREye_Eye_Left, leftTextureType, leftTextureBounds, submitFlag); - } - } - } 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(); - } - rightTextureType.handle = getRightTexId(); - if( rightTextureType.handle != -1 ) { - logger.fine("Writing Right texture to native memory at " + leftTextureType.getPointer()); - rightTextureType.write(); - } - } else { - if( api instanceof OpenVR ) { - errl = ((OpenVR)api).getCompositor().Submit.apply(JOpenVRLibrary.EVREye.EVREye_Eye_Left, leftTextureType, null, - JOpenVRLibrary.EVRSubmitFlags.EVRSubmitFlags_Submit_Default); - errr = ((OpenVR)api).getCompositor().Submit.apply(JOpenVRLibrary.EVREye.EVREye_Eye_Right, rightTextureType, null, - JOpenVRLibrary.EVRSubmitFlags.EVRSubmitFlags_Submit_Default); - } else { - - } - } - - 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."); - } - } - - @Override - 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(); - } - - logger.config("Initialized VR view manager [SUCCESS]"); - - } 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){ - 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 environment is not attached to any application."); - } - - } else { - throw new IllegalStateException("This VR view manager is not attached to any VR environment."); - } - } - - /** - * Replaces rootNode with the distortion mesh as the main camera's scene. - */ - private void setupVRScene(){ - if (environment != null){ - if (environment.getApplication() != null){ - // no special scene to set up 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."); - } - } - - @Override - 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); -/* - // 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); - 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); - } - - private void setupCamerasAndViews() { - if (environment != null){ - // get desired frustum from original camera - Camera origCam = environment.getCamera(); - float fFar = origCam.getFrustumFar(); - float fNear = origCam.getFrustumNear(); - - // restore frustum 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(); - } - - 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(); - if( environment.getVRHardware() != null ){ - getRightCamera().setProjectionMatrix(environment.getVRHardware().getHMDMatrixProjectionRightEye(getRightCamera())); - } - 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()); - } else { - 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(); - environment.getVRHardware().getHMDMatrixPoseRightEye(); - } - } 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."); - } - } - - /** - * Set up 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 set up 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; - } -} diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/openvr/package-info.java b/jme3-vr/src/main/java/com/jme3/input/vr/openvr/package-info.java deleted file mode 100644 index e74abe7d49..0000000000 --- a/jme3-vr/src/main/java/com/jme3/input/vr/openvr/package-info.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -/** - * user-input classes for devices that use the OpenVR API - */ -package com.jme3.input.vr.openvr; diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/package-info.java b/jme3-vr/src/main/java/com/jme3/input/vr/package-info.java deleted file mode 100644 index b260858f81..0000000000 --- a/jme3-vr/src/main/java/com/jme3/input/vr/package-info.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -/** - * user-input classes for Virtual Reality (VR) applications - */ -package com.jme3.input.vr; diff --git a/jme3-vr/src/main/java/com/jme3/post/CartoonSSAO.java b/jme3-vr/src/main/java/com/jme3/post/CartoonSSAO.java deleted file mode 100644 index eb1ddd5404..0000000000 --- a/jme3-vr/src/main/java/com/jme3/post/CartoonSSAO.java +++ /dev/null @@ -1,160 +0,0 @@ -package com.jme3.post; - -import com.jme3.asset.AssetManager; -import com.jme3.material.Material; -import com.jme3.math.Vector2f; -import com.jme3.math.Vector3f; -import com.jme3.post.Filter; -import com.jme3.renderer.RenderManager; -import com.jme3.renderer.ViewPort; -import com.jme3.renderer.queue.RenderQueue; -import com.jme3.texture.Image.Format; - -/** - * A Cartoon Screen Space Ambient Occlusion filter with instance rendering capabilities. - * @author reden - phr00t - https://github.com/phr00t - * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr - * - * @deprecated The jme3-vr module is deprecated and will be removed in a future version (as it only supports OpenVR). - * For new Virtual Reality projects, use user libraries that provide OpenXR support. - * See Virtual Reality JME wiki section - * for more information. - */ -@Deprecated -public class CartoonSSAO extends Filter{ - private Pass normalPass; - private Vector3f frustumCorner; - private Vector2f frustumNearFar; - private boolean useOutline = true; - private float downsample = 1f, applyDistance = 0.0005f; - - private boolean instancedRendering = false; - - RenderManager renderManager; - ViewPort viewPort; - - /** - * Create a Screen Space Ambient Occlusion Filter. - * @param instancedRendering true if this filter has to use instance rendering and false (default) otherwise. - */ - public CartoonSSAO(boolean instancedRendering) { - super("CartoonSSAO"); - this.instancedRendering = instancedRendering; - } - - /** - * Create a Screen Space Ambient Occlusion Filter. - * @param downsample factor to divide resolution by for filter, >1 increases speed but degrades quality. - * @param instancedRendering true if this filter has to use instance rendering and false (default) otherwise. - */ - public CartoonSSAO(float downsample, boolean instancedRendering) { - this(instancedRendering); - this.downsample = downsample; - } - - /** - * Create a Screen Space Ambient Occlusion Filter from the given one (by copy). - * @param cloneFrom the original filter. - */ - public CartoonSSAO(CartoonSSAO cloneFrom) { - this(cloneFrom.downsample, cloneFrom.instancedRendering); - } - - @Override - protected boolean isRequiresDepthTexture() { - return true; - } - - @Override - protected void postQueue(RenderQueue renderQueue) { - PreNormalCaching.getPreNormals(renderManager, normalPass, viewPort); - } - - /** - * Set if outline has to be enabled. - * @param set true if the outline has to be enabled and false otherwise. - * @see #isOutlineEnabled() - */ - public void setOutlineEnabled(boolean set) { - useOutline = set; - if( material != null ) { - if( useOutline ) { - material.clearParam("disableOutline"); - } else { - material.setBoolean("disableOutline", true); - } - } - } - - /** - * Is outline rendering is enabled. - * @return true if the outline is enabled and false otherwise. - * @see #setOutlineEnabled(boolean) - */ - public boolean isOutlineEnabled() { - return useOutline; - } - - /** - * Set the down sampling value. - * @param downsample the down sampling value. - * @see #getDownsampling() - */ - public void setDownsampling(float downsample) { - this.downsample = downsample; - } - - /** - * Get the down sampling value. - * @return the down sampling value. - * @see #setDownsampling(float) - */ - public float getDownsampling() { - return this.downsample; - } - - @Override - protected Material getMaterial() { - return material; - } - - /** - * Set the distance of the material. - * @param dist the distance of the material. - */ - public void setDistance(float dist) { - applyDistance = dist; - if( material != null ) material.setFloat("Distance", dist); - } - - @Override - protected void initFilter(AssetManager manager, RenderManager renderManager, ViewPort vp, int w, int h) { - this.renderManager = renderManager; - this.viewPort = vp; - - int screenWidth = Math.round(w / downsample); - int screenHeight = Math.round(h / downsample); - - normalPass = new Pass(); - normalPass.init(renderManager.getRenderer(), screenWidth, screenHeight, Format.RGBA8, Format.Depth); - - frustumNearFar = new Vector2f(); - - float farY = (vp.getCamera().getFrustumTop() / vp.getCamera().getFrustumNear()) * vp.getCamera().getFrustumFar(); - float farX = farY * (screenWidth / (float) screenHeight); - frustumCorner = new Vector3f(farX, farY, vp.getCamera().getFrustumFar()); - frustumNearFar.x = vp.getCamera().getFrustumNear(); - frustumNearFar.y = vp.getCamera().getFrustumFar(); - - //ssao Pass - material = new Material(manager, "Common/MatDefs/VR/CartoonSSAO.j3md"); - material.setTexture("Normals", normalPass.getRenderedTexture()); - - material.setVector3("FrustumCorner", frustumCorner); - material.setVector2("FrustumNearFar", frustumNearFar); - material.setFloat("Distance", applyDistance); - if( useOutline == false ) material.setBoolean("disableOutline", true); - if( instancedRendering ) material.setBoolean("useInstancing", true); - } - -} \ No newline at end of file diff --git a/jme3-vr/src/main/java/com/jme3/post/FilterUtil.java b/jme3-vr/src/main/java/com/jme3/post/FilterUtil.java deleted file mode 100644 index f2d1d437ae..0000000000 --- a/jme3-vr/src/main/java/com/jme3/post/FilterUtil.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.jme3.post; - -import com.jme3.asset.AssetManager; -import com.jme3.post.filters.FogFilter; -import com.jme3.post.ssao.SSAOFilter; -import com.jme3.shadow.DirectionalLightShadowFilter; - -/** - * - * @author Rickard - * @deprecated The jme3-vr module is deprecated and will be removed in a future version (as it only supports OpenVR). - * For new Virtual Reality projects, use user libraries that provide OpenXR support. - * See Virtual Reality JME wiki section - * for more information. - */ -@Deprecated -public class FilterUtil { - /** - * A private constructor to inhibit instantiation of this class. - */ - private FilterUtil() { - } - - public static FogFilter cloneFogFilter(FogFilter fogFilter){ - FogFilter filterClone = new FogFilter(); - filterClone.setFogColor(fogFilter.getFogColor()); - filterClone.setFogDensity(fogFilter.getFogDensity()); - filterClone.setFogDistance(fogFilter.getFogDistance()); - filterClone.setName(fogFilter.getName() + " Clone"); - - return filterClone; - } - - public static SSAOFilter cloneSSAOFilter(SSAOFilter filter){ - SSAOFilter clone = new SSAOFilter(); - clone.setSampleRadius(filter.getSampleRadius()); - clone.setIntensity(filter.getIntensity()); - clone.setScale(filter.getScale()); - clone.setBias(filter.getBias()); - return clone; - } - - public static DirectionalLightShadowFilter cloneDirectionalLightShadowFilter(AssetManager assetManager, DirectionalLightShadowFilter filter){ - DirectionalLightShadowFilter clone = new DirectionalLightShadowFilter(assetManager, 512, 3); - clone.setLight(filter.getLight()); - clone.setLambda(filter.getLambda()); - clone.setShadowIntensity(filter.getShadowIntensity()); - clone.setEdgeFilteringMode(filter.getEdgeFilteringMode()); -// clone.setEnabled(filter.isEnabled()); - return clone; - } - -} diff --git a/jme3-vr/src/main/java/com/jme3/post/PreNormalCaching.java b/jme3-vr/src/main/java/com/jme3/post/PreNormalCaching.java deleted file mode 100644 index 082e0edc07..0000000000 --- a/jme3-vr/src/main/java/com/jme3/post/PreNormalCaching.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.jme3.post; - -import com.jme3.post.Filter.Pass; -import com.jme3.renderer.Caps; -import com.jme3.renderer.RenderManager; -import com.jme3.renderer.Renderer; -import com.jme3.renderer.ViewPort; -import com.jme3.texture.FrameBuffer; - -/** - * Pre normal caching class. - * @author reden - phr00t - https://github.com/phr00t - * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr - * @deprecated The jme3-vr module is deprecated and will be removed in a future version (as it only supports OpenVR). - * For new Virtual Reality projects, use user libraries that provide OpenXR support. - * See Virtual Reality JME wiki section - * for more information. - */ -@Deprecated -public class PreNormalCaching { - - private static FrameBuffer cachedPreNormals; - private static int lastNormalPassesCount, curCount; - - /** - * A private constructor to inhibit instantiation of this class. - */ - private PreNormalCaching() { - } - - /** - * Get pre-normals from the given rendering. - * @param renderManager the render manager. - * @param normalPass the normal pass. - * @param viewPort the viewport. - */ - public static void getPreNormals(RenderManager renderManager, Pass normalPass, ViewPort viewPort) { - curCount++; - // do we already have a valid cache to set the framebuffer to? - Renderer r = renderManager.getRenderer(); - if( cachedPreNormals != null ) { - r.copyFrameBuffer(cachedPreNormals, normalPass.getRenderFrameBuffer(),true, false); - } else { - // let's make the prenormals - r.setFrameBuffer(normalPass.getRenderFrameBuffer()); - renderManager.getRenderer().clearBuffers(true, true, true); - if( renderManager.getRenderer().getCaps().contains(Caps.GLSL150) ) { - renderManager.setForcedTechnique("PreNormalPass15"); - } else { - renderManager.setForcedTechnique("PreNormalPass"); - } - renderManager.renderViewPortQueues(viewPort, false); - renderManager.setForcedTechnique(null); - // if we should cache this, do it now - if( lastNormalPassesCount > 1 ) { - cachedPreNormals = normalPass.getRenderFrameBuffer(); - } - } - renderManager.getRenderer().setFrameBuffer(viewPort.getOutputFrameBuffer()); - } - - /** - * Reset the cache - * @param stereo true if the rendering is stereo based and false otherwise. - */ - public static void resetCache(boolean stereo) { - if( stereo == false ) { - // only use this feature if we are NOT in VR - // we can't use the same normal information for another eye, - // because it will be different! - lastNormalPassesCount = curCount; - } - cachedPreNormals = null; - curCount = 0; - } - -} diff --git a/jme3-vr/src/main/java/com/jme3/scene/CenterQuad.java b/jme3-vr/src/main/java/com/jme3/scene/CenterQuad.java deleted file mode 100644 index e2911eba6f..0000000000 --- a/jme3-vr/src/main/java/com/jme3/scene/CenterQuad.java +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Copyright (c) 2009-2021 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.scene; - -import com.jme3.export.InputCapsule; -import com.jme3.export.JmeExporter; -import com.jme3.export.JmeImporter; -import com.jme3.export.OutputCapsule; -import com.jme3.scene.VertexBuffer.Type; -import java.io.IOException; - -/** - * A static, indexed, Triangles-mode mesh for an axis-aligned rectangle in the - * X-Y plane. - * - *

The rectangle extends from (-width/2, -height/2, 0) to - * (width/2, height/2, 0) with normals set to (0,0,1). - * - *

This differs from com.jme3.scene.shape.Quad because it puts - * (0,0,0) at the rectangle's center instead of in a corner. - * - * @author Kirill Vainer - * @deprecated use com.jme3.scene.shape.CenterQuad - */ -@Deprecated -public class CenterQuad extends Mesh { - - public static CenterQuad UnitQuad = new CenterQuad(0.5f, 0.5f); - public static Mesh CenterSplitQuad; - - private float width; - private float height; - - /** - * Create a quad with the given width and height. The quad - * is always created in the XY plane. - * - * @param width The X extent or width - * @param height The Y extent or width - */ - public CenterQuad(float width, float height){ - updateGeometry(width, height); - } - - /** - * Create a quad with the given width and height. The quad - * is always created in the XY plane. - * - * @param width The X extent or width - * @param height The Y extent or width - * @param flipCoords If true, the texture coordinates will be flipped - * along the Y axis. - */ - public CenterQuad(float width, float height, boolean flipCoords){ - updateGeometry(width, height, flipCoords); - this.setStatic(); - } - - /** - * For serialization only. Do not use. - */ - protected CenterQuad() { - } - - public float getHeight() { - return height; - } - - public float getWidth() { - return width; - } - - public void updateGeometry(float width, float height){ - updateGeometry(width, height, false); - } - - public void updateGeometry(float width, float height, boolean flipCoords) { - this.width = width; - this.height = height; - setBuffer(Type.Position, 3, new float[]{-width/2, -height/2, 0, - width/2, -height/2, 0, - width/2, height/2, 0, - -width/2, height/2, 0 - }); - - - if (flipCoords){ - setBuffer(Type.TexCoord, 2, new float[]{0, 1, - 1, 1, - 1, 0, - 0, 0}); - }else{ - setBuffer(Type.TexCoord, 2, new float[]{0, 0, - 1, 0, - 1, 1, - 0, 1}); - } - setBuffer(Type.Normal, 3, new float[]{0, 0, 1, - 0, 0, 1, - 0, 0, 1, - 0, 0, 1}); - if (height < 0){ - setBuffer(Type.Index, 3, new short[]{0, 2, 1, - 0, 3, 2}); - }else{ - setBuffer(Type.Index, 3, new short[]{0, 1, 2, - 0, 2, 3}); - } - - updateBound(); - } - - /** - * De-serializes from the specified importer, for example when loading from - * a J3O file. - * - * @param importer the importer to use (not null) - * @throws IOException from the importer - */ - @Override - public void read(JmeImporter importer) throws IOException { - super.read(importer); - InputCapsule capsule = importer.getCapsule(this); - - width = capsule.readFloat("width", 0f); - height = capsule.readFloat("height", 0f); - } - - /** - * Serializes to the specified exporter, for example when saving to a J3O - * file. The current instance is unaffected. - * - * @param exporter the exporter to use (not null) - * @throws IOException from the exporter - */ - @Override - public void write(JmeExporter exporter) throws IOException { - super.write(exporter); - OutputCapsule capsule = exporter.getCapsule(this); - - capsule.write(width, "width", 0f); - capsule.write(height, "height", 0f); - } -} diff --git a/jme3-vr/src/main/java/com/jme3/shadow/AbstractShadowFilterVR.java b/jme3-vr/src/main/java/com/jme3/shadow/AbstractShadowFilterVR.java deleted file mode 100644 index f49f4c7d66..0000000000 --- a/jme3-vr/src/main/java/com/jme3/shadow/AbstractShadowFilterVR.java +++ /dev/null @@ -1,325 +0,0 @@ -package com.jme3.shadow; - -/* - * Copyright (c) 2009-2021 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. - */ - -import com.jme3.asset.AssetManager; -import com.jme3.export.JmeExporter; -import com.jme3.export.JmeImporter; -import com.jme3.material.Material; -import com.jme3.material.RenderState; -import com.jme3.math.Matrix4f; -import com.jme3.math.Vector4f; -import com.jme3.post.Filter; -import com.jme3.renderer.RenderManager; -import com.jme3.renderer.ViewPort; -import com.jme3.renderer.queue.RenderQueue; -import com.jme3.texture.FrameBuffer; - -import java.io.IOException; - -/** - * Generic abstract filter that holds common implementations for the different - * shadow filters. - * - * @author Rémy Bouquet aka Nehon - * @author reden - phr00t - https://github.com/phr00t - * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr - * @param the type of the underlying renderer (subclass of {@link AbstractShadowRendererVR}). - * @deprecated The jme3-vr module is deprecated and will be removed in a future version (as it only supports OpenVR). - * For new Virtual Reality projects, use user libraries that provide OpenXR support. - * See Virtual Reality JME wiki section - * for more information. - */ -@Deprecated -public abstract class AbstractShadowFilterVR extends Filter { - - protected T shadowRenderer; - protected ViewPort viewPort; - - /** - * Abstract class constructor - * - * @param manager the application asset manager - * @param shadowMapSize the size of the rendered shadowmaps (512,1024,2048, - * etc...) - * @param shadowRenderer the shadowRenderer to use for this Filter - */ - @SuppressWarnings("all") - protected AbstractShadowFilterVR(AssetManager manager, int shadowMapSize, T shadowRenderer) { - super("Post Shadow"); - material = new Material(manager, "Common/MatDefs/Shadow/PostShadowFilter.j3md"); - this.shadowRenderer = shadowRenderer; - this.shadowRenderer.setPostShadowMaterial(material); - - //this is legacy setting for shadows with backface shadows - this.shadowRenderer.setRenderBackFacesShadows(true); - } - - @SuppressWarnings("all") - protected AbstractShadowFilterVR(AssetManager manager, int shadowMapSize, T shadowRenderer, String useMatDef) { - super("Post Shadow"); - material = new Material(manager, useMatDef); - this.shadowRenderer = shadowRenderer; - this.shadowRenderer.setPostShadowMaterial(material); - } - - @Override - protected Material getMaterial() { - return material; - } - - @Override - protected boolean isRequiresDepthTexture() { - return true; - } - - /** - * Get the {@link Material material} used by this filter. - * @return the {@link Material material} used by this filter. - */ - public Material getShadowMaterial() { - return material; - } - - Vector4f tmpv = new Vector4f(); - - @Override - protected void preFrame(float tpf) { - shadowRenderer.preFrame(tpf); - material.setMatrix4("ViewProjectionMatrixInverse", viewPort.getCamera().getViewProjectionMatrix().invert()); - Matrix4f m = viewPort.getCamera().getViewProjectionMatrix(); - material.setVector4("ViewProjectionMatrixRow2", tmpv.set(m.m20, m.m21, m.m22, m.m23)); - - } - - @Override - protected void postQueue(RenderQueue queue) { - shadowRenderer.postQueue(queue); - if(shadowRenderer.skipPostPass){ - //removing the shadow map so that the post pass is skipped - material.setTexture("ShadowMap0", null); - } - } - - @Override - protected void postFrame(RenderManager renderManager, ViewPort viewPort, FrameBuffer prevFilterBuffer, FrameBuffer sceneBuffer) { - if(!shadowRenderer.skipPostPass){ - shadowRenderer.setPostShadowParams(); - } - } - - @Override - protected void initFilter(AssetManager manager, RenderManager renderManager, ViewPort vp, int w, int h) { - shadowRenderer.needsfallBackMaterial = true; - shadowRenderer.initialize(renderManager, vp); - this.viewPort = vp; - } - - /** - * How far the shadows are rendered in the view - * - * @see #setShadowZExtend(float zFar) - * @return shadowZExtend - */ - public float getShadowZExtend() { - return shadowRenderer.getShadowZExtend(); - } - - /** - * Set the distance from the eye where the shadows will be rendered default - * value is dynamically computed to the shadow casters/receivers union bound - * zFar, capped to view frustum far value. - * - * @param zFar the zFar values that override the computed one - */ - public void setShadowZExtend(float zFar) { - shadowRenderer.setShadowZExtend(zFar); - } - - /** - * Define the length over which the shadow will fade out when using a - * shadowZextend - * - * @param length the fade length in world units - */ - public void setShadowZFadeLength(float length) { - shadowRenderer.setShadowZFadeLength(length); - } - - /** - * get the length over which the shadow will fade out when using a - * shadowZextend - * - * @return the fade length in world units - */ - public float getShadowZFadeLength() { - return shadowRenderer.getShadowZFadeLength(); - } - - /** - * returns the shadow intensity - * - * @see #setShadowIntensity(float shadowIntensity) - * @return shadowIntensity - */ - public float getShadowIntensity() { - return shadowRenderer.getShadowIntensity(); - } - - /** - * Set the shadowIntensity, the value should be between 0 and 1, a 0 value - * gives a bright and invisible shadow, a 1 value gives a pitch black - * shadow, default is 0.7 - * - * @param shadowIntensity the darkness of the shadow - */ - final public void setShadowIntensity(float shadowIntensity) { - shadowRenderer.setShadowIntensity(shadowIntensity); - } - - /** - * returns the edges thickness
- * - * @see #setEdgesThickness(int edgesThickness) - * @return edgesThickness - */ - public int getEdgesThickness() { - return shadowRenderer.getEdgesThickness(); - } - - /** - * Sets the shadow edge thickness. Default is 1. Setting it to lower values - * can help to reduce the jagged effect of the shadow edges. - * @param edgesThickness the edge thickness. - */ - public void setEdgesThickness(int edgesThickness) { - shadowRenderer.setEdgesThickness(edgesThickness); - } - - /** - * isFlushQueues does nothing and is kept only for backward compatibility. - * @return false - * @deprecated does nothing and is kept only for backward compatibility. - */ - @Deprecated - public boolean isFlushQueues() { - return shadowRenderer.isFlushQueues(); - } - - /** - * Sets the shadow compare mode (see {@link CompareMode} for more info). - * @param compareMode the compare mode. - */ - final public void setShadowCompareMode(CompareMode compareMode) { - shadowRenderer.setShadowCompareMode(compareMode); - } - - /** - * Get the shadow compare mode. - * - * @return the shadow compare mode. - * @see CompareMode - */ - public CompareMode getShadowCompareMode() { - return shadowRenderer.getShadowCompareMode(); - } - - /** - * Sets the filtering mode for shadow edges see {@link EdgeFilteringMode} for more info - * @param filterMode the filtering mode for shadow edges. - */ - final public void setEdgeFilteringMode(EdgeFilteringMode filterMode) { - shadowRenderer.setEdgeFilteringMode(filterMode); - } - - /** - * - * WARNING this parameter is defaulted to true for the shadow filter. Setting it to true, may produce edges artifacts on shadows.
- *
- * Set to true if you want back faces shadows on geometries. - * Note that back faces shadows will be blended over dark lighten areas and may produce overly dark lighting.
- *
- * Setting this parameter will override this parameter for ALL materials in the scene. - * This also will automatically adjust the face cull mode and the PolyOffset of the pre shadow pass. - * You can modify them by using {@link #getPreShadowForcedRenderState()}.
- *
- * If you want to set it differently for each material in the scene you have to use the ShadowRenderer instead - * of the shadow filter. - * - * @param renderBackFacesShadows true if back faces shadows on geometries have to be rendered and false otherwise. - */ - public void setRenderBackFacesShadows(Boolean renderBackFacesShadows) { - shadowRenderer.setRenderBackFacesShadows(renderBackFacesShadows); - } - - /** - * Is this filter renders back faces shadows. - * @return true if this filter renders back faces shadows and false otherwise. - */ - public boolean isRenderBackFacesShadows() { - return shadowRenderer.isRenderBackFacesShadows(); - } - - /** - * Get the pre-shadows pass render state. - * use it to adjust the RenderState parameters of the pre shadow pass. - * Note that this will be overridden if the preShadow technique in the material has a ForcedRenderState - * @return the pre shadow render state. - */ - public RenderState getPreShadowForcedRenderState() { - return shadowRenderer.getPreShadowForcedRenderState(); - } - - - /** - * Get the edge filtering mode. - * @return the edge filtering mode. - */ - public EdgeFilteringMode getEdgeFilteringMode() { - return shadowRenderer.getEdgeFilteringMode(); - } - - @Override - public void write(JmeExporter ex) throws IOException { - super.write(ex); - //OutputCapsule oc = ex.getCapsule(this); - - } - - @Override - public void read(JmeImporter im) throws IOException { - super.read(im); - //InputCapsule ic = im.getCapsule(this); - - } -} diff --git a/jme3-vr/src/main/java/com/jme3/shadow/AbstractShadowRendererVR.java b/jme3-vr/src/main/java/com/jme3/shadow/AbstractShadowRendererVR.java deleted file mode 100644 index ac2df723c4..0000000000 --- a/jme3-vr/src/main/java/com/jme3/shadow/AbstractShadowRendererVR.java +++ /dev/null @@ -1,844 +0,0 @@ -package com.jme3.shadow; - -/* - * Copyright (c) 2009-2021 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. - */ - -import com.jme3.asset.AssetManager; -import com.jme3.export.*; -import com.jme3.light.LightFilter; -import com.jme3.light.NullLightFilter; -import com.jme3.material.Material; -import com.jme3.material.RenderState; -import com.jme3.math.ColorRGBA; -import com.jme3.math.Matrix4f; -import com.jme3.math.Vector2f; -import com.jme3.math.Vector3f; -import com.jme3.post.SceneProcessor; -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.GeometryList; -import com.jme3.renderer.queue.OpaqueComparator; -import com.jme3.renderer.queue.RenderQueue; -import com.jme3.renderer.queue.RenderQueue.ShadowMode; -import com.jme3.scene.Geometry; -import com.jme3.scene.Spatial; -import com.jme3.scene.debug.WireFrustum; -import com.jme3.texture.FrameBuffer; -import com.jme3.texture.Image.Format; -import com.jme3.texture.Texture.MagFilter; -import com.jme3.texture.Texture.MinFilter; -import com.jme3.texture.Texture.ShadowCompareMode; -import com.jme3.texture.Texture2D; -import com.jme3.texture.FrameBuffer.FrameBufferTarget; -import com.jme3.ui.Picture; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -/** - * Abstract shadow renderer that holds commons feature to have for a shadow - * renderer. - * - * @author Rémy Bouquet aka Nehon - * @author reden - phr00t - https://github.com/phr00t - * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr - * @deprecated The jme3-vr module is deprecated and will be removed in a future version (as it only supports OpenVR). - * For new Virtual Reality projects, use user libraries that provide OpenXR support. - * See Virtual Reality JME wiki section - * for more information. - */ -@Deprecated -public abstract class AbstractShadowRendererVR implements SceneProcessor, Savable { - private static final LightFilter NULL_LIGHT_FILTER = new NullLightFilter(); - protected int nbShadowMaps = 1; - protected float shadowMapSize; - protected float shadowIntensity = 0.7f; - protected RenderManager renderManager; - protected ViewPort viewPort; - protected FrameBuffer[] shadowFB; - protected Texture2D[] shadowMaps; - protected Texture2D dummyTex; - protected Material preshadowMat; - protected Material postshadowMat; - protected Matrix4f[] lightViewProjectionsMatrices; - protected AssetManager assetManager; - protected boolean debug = false; - protected float edgesThickness = 1.0f; - protected EdgeFilteringMode edgeFilteringMode = EdgeFilteringMode.Bilinear; - protected CompareMode shadowCompareMode = CompareMode.Hardware; - protected Picture[] dispPic; - protected RenderState forcedRenderState = new RenderState(); - protected boolean renderBackFacesShadows; - - protected AppProfiler profiler = null; - - /** - * true if the fallback material should be used, otherwise false - */ - protected boolean needsfallBackMaterial = false; - /** - * name of the post material technique - */ - protected String postTechniqueName = "PostShadow"; - /** - * list of materials for post shadow queue geometries - */ - protected List matCache = new ArrayList<>(); - protected GeometryList lightReceivers = new GeometryList(new OpaqueComparator()); - protected GeometryList shadowMapOccluders = new GeometryList(new OpaqueComparator()); - private String[] shadowMapStringCache; - private String[] lightViewStringCache; - /** - * fade shadows at distance - */ - protected float zFarOverride = 0; - protected Vector2f fadeInfo; - protected float fadeLength; - protected Camera frustumCam; - /** - * true to skip the post pass when there are no shadow casters - */ - protected boolean skipPostPass; - - /** - * used for serialization - */ - protected AbstractShadowRendererVR(){ - } - - /** - * Create an abstract shadow renderer. Subclasses invoke this constructor. - * - * @param assetManager the application asset manager - * @param shadowMapSize the size of the rendered shadow maps (512,1024,2048, - * etc...) - * @param nbShadowMaps the number of shadow maps rendered (the more shadow - * maps the more quality, the fewer fps). - */ - protected AbstractShadowRendererVR(AssetManager assetManager, int shadowMapSize, int nbShadowMaps) { - - this.assetManager = assetManager; - this.nbShadowMaps = nbShadowMaps; - this.shadowMapSize = shadowMapSize; - init(assetManager, nbShadowMaps, shadowMapSize); - - } - - private void init(AssetManager assetManager, int nbShadowMaps, int shadowMapSize) { - this.postshadowMat = new Material(assetManager, "Common/MatDefs/Shadow/PostShadow.j3md"); - shadowFB = new FrameBuffer[nbShadowMaps]; - shadowMaps = new Texture2D[nbShadowMaps]; - dispPic = new Picture[nbShadowMaps]; - lightViewProjectionsMatrices = new Matrix4f[nbShadowMaps]; - shadowMapStringCache = new String[nbShadowMaps]; - lightViewStringCache = new String[nbShadowMaps]; - - //DO NOT COMMENT THIS (It prevents the OSX incomplete read buffer crash.) - dummyTex = new Texture2D(shadowMapSize, shadowMapSize, Format.RGBA8); - - preshadowMat = new Material(assetManager, "Common/MatDefs/Shadow/PreShadow.j3md"); - postshadowMat.setFloat("ShadowMapSize", shadowMapSize); - - for (int i = 0; i < nbShadowMaps; i++) { - lightViewProjectionsMatrices[i] = new Matrix4f(); - shadowFB[i] = new FrameBuffer(shadowMapSize, shadowMapSize, 1); - shadowMaps[i] = new Texture2D(shadowMapSize, shadowMapSize, Format.Depth); - - shadowFB[i].setDepthTarget(FrameBufferTarget.newTarget(shadowMaps[i])); - - //DO NOT COMMENT THIS (It prevents the OSX incomplete read buffer crash.) - shadowFB[i].addColorTarget(FrameBufferTarget.newTarget(dummyTex)); - shadowMapStringCache[i] = "ShadowMap" + i; - lightViewStringCache[i] = "LightViewProjectionMatrix" + i; - - postshadowMat.setTexture(shadowMapStringCache[i], shadowMaps[i]); - - //quads for debugging purposes - dispPic[i] = new Picture("Picture" + i); - dispPic[i].setTexture(assetManager, shadowMaps[i], false); - } - - setShadowCompareMode(shadowCompareMode); - setEdgeFilteringMode(edgeFilteringMode); - setShadowIntensity(shadowIntensity); - initForcedRenderState(); - setRenderBackFacesShadows(isRenderBackFacesShadows()); - } - - protected void initForcedRenderState() { - forcedRenderState.setFaceCullMode(RenderState.FaceCullMode.Front); - forcedRenderState.setColorWrite(false); - forcedRenderState.setDepthWrite(true); - forcedRenderState.setDepthTest(true); - } - - /** - * set the post shadow material for this renderer - * - * @param postShadowMat - */ - protected final void setPostShadowMaterial(Material postShadowMat) { - this.postshadowMat = postShadowMat; - postshadowMat.setFloat("ShadowMapSize", shadowMapSize); - for (int i = 0; i < nbShadowMaps; i++) { - postshadowMat.setTexture(shadowMapStringCache[i], shadowMaps[i]); - } - setShadowCompareMode(shadowCompareMode); - setEdgeFilteringMode(edgeFilteringMode); - setShadowIntensity(shadowIntensity); - } - - /** - * Sets the filtering mode for shadow edges. See {@link EdgeFilteringMode} - * for more info. - * - * @param filterMode the desired filter mode (not null) - */ - final public void setEdgeFilteringMode(EdgeFilteringMode filterMode) { - if (filterMode == null) { - throw new IllegalArgumentException("filterMode cannot be null"); - } - - this.edgeFilteringMode = filterMode; - postshadowMat.setInt("FilterMode", filterMode.getMaterialParamValue()); - postshadowMat.setFloat("PCFEdge", edgesThickness); - if (shadowCompareMode == CompareMode.Hardware) { - for (Texture2D shadowMap : shadowMaps) { - if (filterMode == EdgeFilteringMode.Bilinear) { - shadowMap.setMagFilter(MagFilter.Bilinear); - shadowMap.setMinFilter(MinFilter.BilinearNoMipMaps); - } else { - shadowMap.setMagFilter(MagFilter.Nearest); - shadowMap.setMinFilter(MinFilter.NearestNoMipMaps); - } - } - } - } - - /** - * Get the edge filtering mode. - * @return the edge filtering mode. - */ - public EdgeFilteringMode getEdgeFilteringMode() { - return edgeFilteringMode; - } - - /** - * Sets the shadow compare mode. See {@link CompareMode} for more info. - * - * @param compareMode the desired compare mode (not null) - */ - final public void setShadowCompareMode(CompareMode compareMode) { - if (compareMode == null) { - throw new IllegalArgumentException("Shadow compare mode cannot be null"); - } - - this.shadowCompareMode = compareMode; - for (Texture2D shadowMap : shadowMaps) { - if (compareMode == CompareMode.Hardware) { - shadowMap.setShadowCompareMode(ShadowCompareMode.LessOrEqual); - if (edgeFilteringMode == EdgeFilteringMode.Bilinear) { - shadowMap.setMagFilter(MagFilter.Bilinear); - shadowMap.setMinFilter(MinFilter.BilinearNoMipMaps); - } else { - shadowMap.setMagFilter(MagFilter.Nearest); - shadowMap.setMinFilter(MinFilter.NearestNoMipMaps); - } - } else { - shadowMap.setShadowCompareMode(ShadowCompareMode.Off); - shadowMap.setMagFilter(MagFilter.Nearest); - shadowMap.setMinFilter(MinFilter.NearestNoMipMaps); - } - } - postshadowMat.setBoolean("HardwareShadows", compareMode == CompareMode.Hardware); - } - - /** - * returns the shadow compare mode - * - * @see CompareMode - * @return the shadowCompareMode - */ - public CompareMode getShadowCompareMode() { - return shadowCompareMode; - } - - /** - * debug function to create a visible frustum - */ - protected Geometry createFrustum(Vector3f[] pts, int i) { - WireFrustum frustum = new WireFrustum(pts); - Geometry frustumMdl = new Geometry("f", frustum); - frustumMdl.setCullHint(Spatial.CullHint.Never); - frustumMdl.setShadowMode(ShadowMode.Off); - Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); - mat.getAdditionalRenderState().setWireframe(true); - frustumMdl.setMaterial(mat); - switch (i) { - case 0: - frustumMdl.getMaterial().setColor("Color", ColorRGBA.Pink); - break; - case 1: - frustumMdl.getMaterial().setColor("Color", ColorRGBA.Red); - break; - case 2: - frustumMdl.getMaterial().setColor("Color", ColorRGBA.Green); - break; - case 3: - frustumMdl.getMaterial().setColor("Color", ColorRGBA.Blue); - break; - default: - frustumMdl.getMaterial().setColor("Color", ColorRGBA.White); - break; - } - - frustumMdl.updateGeometricState(); - return frustumMdl; - } - - /** - * Initialize this shadow renderer prior to its first update. - * - * @param rm the render manager - * @param vp the viewport - */ - @Override - public void initialize(RenderManager rm, ViewPort vp) { - renderManager = rm; - viewPort = vp; - postTechniqueName = "PostShadow"; - if(zFarOverride>0 && frustumCam == null){ - initFrustumCam(); - } - } - - /** - * delegates the initialization of the frustum cam to child renderers - */ - protected abstract void initFrustumCam(); - - /** - * Test whether this shadow renderer has been initialized. - * - * @return true if initialized, otherwise false - */ - @Override - public boolean isInitialized() { - return viewPort != null; - } - - /** - * Invoked once per frame to update the shadow cams according to the light - * view. - * - * @param viewCam the scene cam - */ - protected abstract void updateShadowCams(Camera viewCam); - - /** - * Returns a subclass-specific geometryList containing the occluders to be - * rendered in the shadow map - * - * @param shadowMapIndex the index of the shadow map being rendered - * @param shadowMapOccluders the list of occluders - * @return a list of occluders - */ - protected abstract GeometryList getOccludersToRender(int shadowMapIndex, GeometryList shadowMapOccluders); - - /** - * return the shadow camera to use for rendering the shadow map according - * the given index - * - * @param shadowMapIndex the index of the shadow map being rendered - * @return the shadowCam - */ - protected abstract Camera getShadowCam(int shadowMapIndex); - - @Override - public void setProfiler(AppProfiler profiler) { - this.profiler = profiler; - } - - /** - * responsible for displaying the frustum of the shadow cam for debug - * purpose - * - * @param shadowMapIndex - */ - protected void doDisplayFrustumDebug(int shadowMapIndex) { - } - - @SuppressWarnings("fallthrough") - @Override - public void postQueue(RenderQueue rq) { - lightReceivers.clear(); - skipPostPass = false; - if ( !checkCulling(viewPort.getCamera()) ) { - skipPostPass = true; - return; - } - - updateShadowCams(viewPort.getCamera()); - - Renderer r = renderManager.getRenderer(); - renderManager.setForcedMaterial(preshadowMat); - renderManager.setForcedTechnique("PreShadow"); - - for (int shadowMapIndex = 0; shadowMapIndex < nbShadowMaps; shadowMapIndex++) { - - if (debugfrustums) { - doDisplayFrustumDebug(shadowMapIndex); - } - renderShadowMap(shadowMapIndex); - - } - - debugfrustums = false; - - //restore setting for future rendering - r.setFrameBuffer(viewPort.getOutputFrameBuffer()); - renderManager.setForcedMaterial(null); - renderManager.setForcedTechnique(null); - renderManager.setCamera(viewPort.getCamera(), false); - } - - protected void renderShadowMap(int shadowMapIndex) { - shadowMapOccluders = getOccludersToRender(shadowMapIndex, shadowMapOccluders); - Camera shadowCam = getShadowCam(shadowMapIndex); - - //saving light view projection matrix for this split - lightViewProjectionsMatrices[shadowMapIndex].set(shadowCam.getViewProjectionMatrix()); - renderManager.setCamera(shadowCam, false); - - renderManager.getRenderer().setFrameBuffer(shadowFB[shadowMapIndex]); - renderManager.getRenderer().clearBuffers(true, true, true); - renderManager.setForcedRenderState(forcedRenderState); - - // render shadow casters to shadow map and disables the lightfilter - LightFilter tmpLightFilter = renderManager.getLightFilter(); - renderManager.setLightFilter(NULL_LIGHT_FILTER); - viewPort.getQueue().renderShadowQueue(shadowMapOccluders, renderManager, shadowCam, true); - renderManager.setLightFilter(tmpLightFilter); - renderManager.setForcedRenderState(null); - } - boolean debugfrustums = false; - - /** - * Force the frustum to be displayed. - */ - public void displayFrustum() { - debugfrustums = true; - } - - /** - * For debugging purposes, display depth shadow maps. - */ - protected void displayShadowMap(Renderer r) { - Camera cam = viewPort.getCamera(); - renderManager.setCamera(cam, true); - int h = cam.getHeight(); - for (int i = 0; i < dispPic.length; i++) { - dispPic[i].setPosition((128 * i) + (150 + 64 * (i + 1)), h / 20f); - dispPic[i].setWidth(128); - dispPic[i].setHeight(128); - dispPic[i].updateGeometricState(); - renderManager.renderGeometry(dispPic[i]); - } - renderManager.setCamera(cam, false); - } - - /** - * For debugging purposes, "snapshot" the current frustum to the scene. - */ - public void displayDebug() { - debug = true; - } - - protected abstract void getReceivers(GeometryList lightReceivers); - - @Override - public void postFrame(FrameBuffer out) { - if (skipPostPass) { - return; - } - if (debug) { - displayShadowMap(renderManager.getRenderer()); - } - - getReceivers(lightReceivers); - - if (lightReceivers.size() != 0) { - //setting params to receiving geometry list - setMatParams(lightReceivers); - - Camera cam = viewPort.getCamera(); - //If some materials in the scene do not have a post shadow technique, use the fallback material. - if (needsfallBackMaterial) { - renderManager.setForcedMaterial(postshadowMat); - } - - //forcing the post shadow technique and render state - renderManager.setForcedTechnique(postTechniqueName); - - //rendering the post shadow pass - viewPort.getQueue().renderShadowQueue(lightReceivers, renderManager, cam, false); - - //resetting renderManager settings - renderManager.setForcedTechnique(null); - renderManager.setForcedMaterial(null); - renderManager.setCamera(cam, false); - - //clearing the params in case there are some other shadow renderers - clearMatParams(); - } - } - - /** - * This method is called once per frame and is responsible for clearing any - * material parameters that subclasses may need to clear on the post material. - * - * @param material the material that was used for the post shadow pass - */ - protected abstract void clearMaterialParameters(Material material); - - private void clearMatParams(){ - for (Material mat : matCache) { - //clearing only necessary params, the others may be set by other - //renderers - //Note that j start at 1 because other shadow renderers will have - //at least 1 shadow map and will set it on each frame anyway. - for (int j = 1; j < nbShadowMaps; j++) { - mat.clearParam(lightViewStringCache[j]); - } - for (int j = 1; j < nbShadowMaps; j++) { - mat.clearParam(shadowMapStringCache[j]); - } - mat.clearParam("FadeInfo"); - clearMaterialParameters(mat); - } - //No need to clear the postShadowMat params as the instance is locale to each renderer - } - - /** - * This method is called once per frame and is responsible for setting any - * material parameters that subclasses may need to set on the post material. - * - * @param material the material to use for the post shadow pass - */ - protected abstract void setMaterialParameters(Material material); - - private void setMatParams(GeometryList l) { - //iterate through all the geometries of the list to gather the materials - - buildMatCache(l); - - //iterating through the mat cache and setting the parameters - for (Material mat : matCache) { - - mat.setFloat("ShadowMapSize", shadowMapSize); - - for (int j = 0; j < nbShadowMaps; j++) { - mat.setMatrix4(lightViewStringCache[j], lightViewProjectionsMatrices[j]); - } - for (int j = 0; j < nbShadowMaps; j++) { - mat.setTexture(shadowMapStringCache[j], shadowMaps[j]); - } - mat.setBoolean("HardwareShadows", shadowCompareMode == CompareMode.Hardware); - mat.setInt("FilterMode", edgeFilteringMode.getMaterialParamValue()); - mat.setFloat("PCFEdge", edgesThickness); - mat.setFloat("ShadowIntensity", shadowIntensity); - mat.setBoolean("BackfaceShadows", renderBackFacesShadows); - - if (fadeInfo != null) { - mat.setVector2("FadeInfo", fadeInfo); - } - - setMaterialParameters(mat); - } - - //At least one material of the receiving geoms does not support the post shadow technique, - //so we fall back to the forced material solution. (Transparent shadows won't be supported for these objects.) - if (needsfallBackMaterial) { - setPostShadowParams(); - } - - } - - private void buildMatCache(GeometryList l) { - matCache.clear(); - for (int i = 0; i < l.size(); i++) { - Material mat = l.get(i).getMaterial(); - //checking if the material has the post technique and adding it to the material cache - if (mat.getMaterialDef().getTechniqueDefs(postTechniqueName) != null) { - if (!matCache.contains(mat)) { - matCache.add(mat); - } - } else { - needsfallBackMaterial = true; - } - } - } - - /** - * for internal use only - */ - protected void setPostShadowParams() { - setMaterialParameters(postshadowMat); - for (int j = 0; j < nbShadowMaps; j++) { - postshadowMat.setMatrix4(lightViewStringCache[j], lightViewProjectionsMatrices[j]); - postshadowMat.setTexture(shadowMapStringCache[j], shadowMaps[j]); - } - if (fadeInfo != null) { - postshadowMat.setVector2("FadeInfo", fadeInfo); - } - postshadowMat.setBoolean("BackfaceShadows", renderBackFacesShadows); - } - - /** - * How far the shadows are rendered in the view - * - * @see #setShadowZExtend(float zFar) - * @return shadowZExtend - */ - public float getShadowZExtend() { - return zFarOverride; - } - - /** - * Set the distance from the eye where the shadows will be rendered default - * value is dynamically computed to the shadow casters/receivers union bound - * zFar, capped to view frustum far value. - * - * @param zFar the zFar values that override the computed one - */ - public void setShadowZExtend(float zFar) { - this.zFarOverride = zFar; - if(zFarOverride == 0){ - fadeInfo = null; - frustumCam = null; - }else{ - if (fadeInfo != null) { - fadeInfo.set(zFarOverride - fadeLength, 1f / fadeLength); - } - if(frustumCam == null && viewPort != null){ - initFrustumCam(); - } - } - } - - /** - * Define the length over which the shadow will fade out when using a - * shadowZextend This is useful to make dynamic shadows fade into baked - * shadows in the distance. - * - * @param length the fade length in world units - */ - public void setShadowZFadeLength(float length) { - if (length == 0) { - fadeInfo = null; - fadeLength = 0; - postshadowMat.clearParam("FadeInfo"); - } else { - if (zFarOverride == 0) { - fadeInfo = new Vector2f(0, 0); - } else { - fadeInfo = new Vector2f(zFarOverride - length, 1.0f / length); - } - fadeLength = length; - postshadowMat.setVector2("FadeInfo", fadeInfo); - } - } - - /** - * get the length over which the shadow will fade out when using a - * shadowZextend - * - * @return the fade length in world units - */ - public float getShadowZFadeLength() { - if (fadeInfo != null) { - return zFarOverride - fadeInfo.x; - } - return 0f; - } - - /** - * returns true if the light source bounding box is in the view frustum - * @return true if box in frustum - */ - protected abstract boolean checkCulling(Camera viewCam); - - @Override - public void preFrame(float tpf) { - } - - @Override - public void cleanup() { - } - - @Override - public void reshape(ViewPort vp, int w, int h) { - } - - /** - * Returns the shadow intensity. - * - * @see #setShadowIntensity(float shadowIntensity) - * @return shadowIntensity - */ - public float getShadowIntensity() { - return shadowIntensity; - } - - /** - * Set the shadowIntensity. The value should be between 0 and 1. A 0 value - * gives a bright and invisible shadow, a 1 value gives a pitch black - * shadow. The default is 0.7 - * - * @param shadowIntensity the darkness of the shadow - */ - final public void setShadowIntensity(float shadowIntensity) { - this.shadowIntensity = shadowIntensity; - postshadowMat.setFloat("ShadowIntensity", shadowIntensity); - } - - /** - * returns the edges thickness - * - * @see #setEdgesThickness(int edgesThickness) - * @return edgesThickness - */ - public int getEdgesThickness() { - return (int) (edgesThickness * 10); - } - - /** - * Sets the shadow edge thickness. Default is 1. Setting it to lower values - * can help to reduce the jagged effect of the shadow edges. - * @param edgesThickness the shadow edge thickness. - */ - public void setEdgesThickness(int edgesThickness) { - this.edgesThickness = Math.max(1, Math.min(edgesThickness, 10)); - this.edgesThickness *= 0.1f; - postshadowMat.setFloat("PCFEdge", edgesThickness); - } - - /** - * This method does nothing now and is kept only for backward compatibility. - * @return false - * @deprecated This method does nothing now and is kept only for backward compatibility. - */ - @Deprecated - public boolean isFlushQueues() { return false; } - - /** - * Returns the pre shadows pass render state. - * use it to adjust the RenderState parameters of the pre shadow pass. - * Note that this will be overridden if the preShadow technique in the material has a ForcedRenderState - * @return the pre shadow render state. - */ - public RenderState getPreShadowForcedRenderState() { - return forcedRenderState; - } - - /** - * Set to true if you want back faces shadows on geometries. - * Note that back faces shadows will be blended over dark lighten areas and may produce overly dark lighting. - * - * Also note that setting this parameter will override this parameter for ALL materials in the scene. - * You can alternatively change this parameter on a single material using {@link Material#setBoolean(String, boolean)} - * - * This also will automatically adjust the faceCullMode and the PolyOffset of the pre shadow pass. - * You can modify them by using {@link #getPreShadowForcedRenderState()} - * - * @param renderBackFacesShadows true or false. - */ - public void setRenderBackFacesShadows(Boolean renderBackFacesShadows) { - this.renderBackFacesShadows = renderBackFacesShadows; - if(renderBackFacesShadows) { - getPreShadowForcedRenderState().setPolyOffset(5, 3); - getPreShadowForcedRenderState().setFaceCullMode(RenderState.FaceCullMode.Back); - }else{ - getPreShadowForcedRenderState().setPolyOffset(0, 0); - getPreShadowForcedRenderState().setFaceCullMode(RenderState.FaceCullMode.Front); - } - } - - /** - * if this processor renders back faces shadows - * - * @return true if this processor renders back faces shadows - */ - public boolean isRenderBackFacesShadows() { - return renderBackFacesShadows; - } - - /** - * De-serialize this instance, for example when loading from a J3O file. - * - * @param im importer (not null) - */ - @Override - public void read(JmeImporter im) throws IOException { - InputCapsule ic = im.getCapsule(this); - assetManager = im.getAssetManager(); - nbShadowMaps = ic.readInt("nbShadowMaps", 1); - shadowMapSize = ic.readFloat("shadowMapSize", 0f); - shadowIntensity = ic.readFloat("shadowIntensity", 0.7f); - edgeFilteringMode = ic.readEnum("edgeFilteringMode", EdgeFilteringMode.class, EdgeFilteringMode.Bilinear); - shadowCompareMode = ic.readEnum("shadowCompareMode", CompareMode.class, CompareMode.Hardware); - init(assetManager, nbShadowMaps, (int) shadowMapSize); - edgesThickness = ic.readFloat("edgesThickness", 1.0f); - postshadowMat.setFloat("PCFEdge", edgesThickness); - - } - - /** - * Serialize this instance, for example when saving to a J3O file. - * - * @param ex exporter (not null) - */ - @Override - public void write(JmeExporter ex) throws IOException { - OutputCapsule oc = ex.getCapsule(this); - oc.write(nbShadowMaps, "nbShadowMaps", 1); - oc.write(shadowMapSize, "shadowMapSize", 0); - oc.write(shadowIntensity, "shadowIntensity", 0.7f); - oc.write(edgeFilteringMode, "edgeFilteringMode", EdgeFilteringMode.Bilinear); - oc.write(shadowCompareMode, "shadowCompareMode", CompareMode.Hardware); - oc.write(edgesThickness, "edgesThickness", 1.0f); - } -} diff --git a/jme3-vr/src/main/java/com/jme3/shadow/DirectionalLightShadowFilterVR.java b/jme3-vr/src/main/java/com/jme3/shadow/DirectionalLightShadowFilterVR.java deleted file mode 100644 index 77f3b71844..0000000000 --- a/jme3-vr/src/main/java/com/jme3/shadow/DirectionalLightShadowFilterVR.java +++ /dev/null @@ -1,177 +0,0 @@ -package com.jme3.shadow; - -/* - * 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. - */ - -import com.jme3.asset.AssetManager; -import com.jme3.export.InputCapsule; -import com.jme3.export.JmeExporter; -import com.jme3.export.JmeImporter; -import com.jme3.export.OutputCapsule; -import com.jme3.light.DirectionalLight; -import java.io.IOException; - -/** - * - * This Filter does basically the same as a DirectionalLightShadowRenderer - * except it renders the post shadow pass as a fullscreen quad pass instead of a - * geometry pass. It's mostly faster than PssmShadowRenderer as long as you have - * more than about ten shadow receiving objects. The expense is the drawback - * that the shadow Receive mode set on spatial is ignored. So basically all and - * only objects that render depth in the scene receive shadows. See this post - * for more details - * http://jmonkeyengine.org/groups/general-2/forum/topic/silly-question-about-shadow-rendering/#post-191599 - * - * API is basically the same as the PssmShadowRenderer; - * - * @author Rémy Bouquet aka Nehon - * @author reden - phr00t - https://github.com/phr00t - * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr - * @deprecated The jme3-vr module is deprecated and will be removed in a future version (as it only supports OpenVR). - * For new Virtual Reality projects, use user libraries that provide OpenXR support. - * See Virtual Reality JME wiki section - * for more information. - */ -@Deprecated -public class DirectionalLightShadowFilterVR extends AbstractShadowFilterVR { - - /** - * Creates a DirectionalLightShadowFilter Shadow Filter More info on the - * technique at http://http.developer.nvidia.com/GPUGems3/gpugems3_ch10.html - * - * @param assetManager the application asset manager - * @param shadowMapSize the size of the rendered shadowmaps (512, 1024, 2048, - * etcetera) - * @param nbSplits the number of shadow maps rendered (More shadow maps yield - * better quality, fewer fps.) - */ - public DirectionalLightShadowFilterVR(AssetManager assetManager, int shadowMapSize, int nbSplits) { - super(assetManager, shadowMapSize, new DirectionalLightShadowRendererVR(assetManager, shadowMapSize, nbSplits)); - } - - /** - * Creates a DirectionalLight shadow filter. More info on the - * technique at http://http.developer.nvidia.com/GPUGems3/gpugems3_ch10.html. - * - * @param assetManager the application's asset manager - * @param shadowMapSize the size of the rendered shadowmaps (512, 1024, 2048, etc...) - * @param nbSplits the number of shadow maps rendered (More shadow maps yield - * better quality, fewer fps.) - * @param useMatDef the material to attach to this filter. - */ - public DirectionalLightShadowFilterVR(AssetManager assetManager, int shadowMapSize, int nbSplits, String useMatDef) { - super(assetManager, shadowMapSize, new DirectionalLightShadowRendererVR(assetManager, shadowMapSize, nbSplits), useMatDef); - } - - /** - * return the light used to cast shadows - * - * @return the DirectionalLight - */ - public DirectionalLight getLight() { - return shadowRenderer.getLight(); - } - - /** - * Sets the light to use to cast shadows - * - * @param light a DirectionalLight - */ - public void setLight(DirectionalLight light) { - shadowRenderer.setLight(light); - } - - /** - * returns the lambda parameter - * - * @see #setLambda(float lambda) - * @return lambda - */ - public float getLambda() { - return shadowRenderer.getLambda(); - } - - /** - * Adjusts the partition of the shadow extend into shadow maps. - * Lambda is usually between 0 and 1. - * A low value gives a more linear partition, - * resulting in consistent shadow quality over the extend, - * but near shadows could look very jagged. - * A high value gives a more logarithmic partition, - * resulting in high quality for near shadows, - * but quality decreases rapidly with distance. - * The default value is 0.65 (the theoretical optimum). - * - * @param lambda the lambda value. - */ - public void setLambda(float lambda) { - shadowRenderer.setLambda(lambda); - } - - /** - * Check if stabilization is enabled. - * @return true if the stabilization is enabled and false otherwise. - * @see #setEnabledStabilization(boolean) - */ - public boolean isEnabledStabilization() { - return shadowRenderer.isEnabledStabilization(); - } - - /** - * Enables the stabilization of the shadow's edges. (default is true) - * This prevents shadow edges from flickering when the camera moves. - * However, it can lead to some loss of shadow quality in particular scenes. - * - * @param stabilize true if the stabilization has to be enabled and false otherwise. - * @see #isEnabledStabilization() - */ - public void setEnabledStabilization(boolean stabilize) { - shadowRenderer.setEnabledStabilization(stabilize); - } - - @Override - public void write(JmeExporter ex) throws IOException { - super.write(ex); - OutputCapsule oc = ex.getCapsule(this); - oc.write(shadowRenderer, "shadowRenderer", null); - - } - - @Override - public void read(JmeImporter im) throws IOException { - super.read(im); - InputCapsule ic = im.getCapsule(this); - shadowRenderer = (DirectionalLightShadowRendererVR) ic.readSavable("shadowRenderer", null); - } -} diff --git a/jme3-vr/src/main/java/com/jme3/shadow/DirectionalLightShadowRendererVR.java b/jme3-vr/src/main/java/com/jme3/shadow/DirectionalLightShadowRendererVR.java deleted file mode 100644 index 426cce6364..0000000000 --- a/jme3-vr/src/main/java/com/jme3/shadow/DirectionalLightShadowRendererVR.java +++ /dev/null @@ -1,313 +0,0 @@ -package com.jme3.shadow; - -/* - * Copyright (c) 2009-2021 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. - */ - -import com.jme3.asset.AssetManager; -import com.jme3.export.InputCapsule; -import com.jme3.export.JmeExporter; -import com.jme3.export.JmeImporter; -import com.jme3.export.OutputCapsule; -import com.jme3.light.DirectionalLight; -import com.jme3.material.Material; -import com.jme3.math.ColorRGBA; -import com.jme3.math.Vector2f; -import com.jme3.math.Vector3f; -import com.jme3.renderer.Camera; -import com.jme3.renderer.queue.GeometryList; -import com.jme3.renderer.queue.RenderQueue; -import com.jme3.scene.Node; -import com.jme3.scene.Spatial; - -import java.io.IOException; - -/** - * DirectionalLightShadowRenderer renderer use Parallel Split Shadow Mapping - * technique (pssm)
It splits the view frustum in several parts and compute - * a shadow map for each one.
splits are distributed so that the closer they - * are from the camera, the smaller they are to maximize the resolution used of - * the shadow map.
This results in a better quality shadow than standard - * shadow mapping.
for more information on this read http://http.developer.nvidia.com/GPUGems3/gpugems3_ch10.html
- * - * @author Rémy Bouquet aka Nehon - * @author reden - phr00t - https://github.com/phr00t - * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr - * @deprecated The jme3-vr module is deprecated and will be removed in a future version (as it only supports OpenVR). - * For new Virtual Reality projects, use user libraries that provide OpenXR support. - * See Virtual Reality JME wiki section - * for more information. - */ -@Deprecated -public class DirectionalLightShadowRendererVR extends AbstractShadowRendererVR { - - protected float lambda = 0.65f; - protected Camera shadowCam; - protected ColorRGBA splits; - protected float[] splitsArray; - protected DirectionalLight light; - protected Vector3f[] points = new Vector3f[8]; - //Holding the info for fading shadows in the far distance - private boolean stabilize = true; - - /** - * Used for serialization use - * DirectionalLightShadowRenderer#DirectionalLightShadowRenderer(AssetManager - * assetManager, int shadowMapSize, int nbSplits) - */ - public DirectionalLightShadowRendererVR() { - super(); - } - - /** - * Creates a DirectionalLight shadow renderer. More info on the technique at http://http.developer.nvidia.com/GPUGems3/gpugems3_ch10.html - * - * @param assetManager the application's asset manager - * @param shadowMapSize the size of the rendered shadowmaps (512, 1024, 2048, - * etcetera) - * @param nbSplits the number of shadow maps rendered (More shadow maps yield - * better quality, fewer fps.) - */ - public DirectionalLightShadowRendererVR(AssetManager assetManager, int shadowMapSize, int nbSplits) { - super(assetManager, shadowMapSize, nbSplits); - init(nbSplits, shadowMapSize); - } - - private void init(int nbSplits, int shadowMapSize) { - nbShadowMaps = Math.max(Math.min(nbSplits, 4), 1); - if (nbShadowMaps != nbSplits) { - throw new IllegalArgumentException("Number of splits must be between 1 and 4. Given value : " + nbSplits); - } - splits = new ColorRGBA(); - splitsArray = new float[nbSplits + 1]; - shadowCam = new Camera(shadowMapSize, shadowMapSize); - shadowCam.setParallelProjection(true); - for (int i = 0; i < points.length; i++) { - points[i] = new Vector3f(); - } - } - - @Override - protected void initFrustumCam() { - //nothing to do - } - - /** - * return the light used to cast shadows - * @return the DirectionalLight - */ - public DirectionalLight getLight() { - return light; - } - - /** - * Sets the light to use to cast shadows - * @param light a DirectionalLight - */ - public void setLight(DirectionalLight light) { - this.light = light; - } - - @Override - protected void updateShadowCams(Camera viewCam) { - - float zFar = zFarOverride; - if (zFar == 0) { - zFar = viewCam.getFrustumFar(); - } - - //We prevent computing the frustum points and splits with zeroed or negative near clip value - float frustumNear = Math.max(viewCam.getFrustumNear(), 0.001f); - ShadowUtil.updateFrustumPoints(viewCam, frustumNear, zFar, 1.0f, points); - - //shadowCam.setDirection(direction); - shadowCam.getRotation().lookAt(light.getDirection(), shadowCam.getUp()); - shadowCam.update(); - shadowCam.updateViewProjection(); - - PssmShadowUtil.updateFrustumSplits(splitsArray, frustumNear, zFar, lambda); - - // in parallel projection shadow position goe from 0 to 1 - if(viewCam.isParallelProjection()){ - for (int i = 0; i < nbShadowMaps; i++) { - splitsArray[i] = splitsArray[i]/(zFar- frustumNear); - } - } - - switch (splitsArray.length) { - case 5: - splits.a = splitsArray[4]; - case 4: - splits.b = splitsArray[3]; - case 3: - splits.g = splitsArray[2]; - case 2: - case 1: - splits.r = splitsArray[1]; - break; - } - - } - - @Override - protected GeometryList getOccludersToRender(int shadowMapIndex, GeometryList shadowMapOccluders) { - - // update frustum points based on current camera and split - ShadowUtil.updateFrustumPoints(viewPort.getCamera(), splitsArray[shadowMapIndex], splitsArray[shadowMapIndex + 1], 1.0f, points); - - //Updating shadow cam with current split frusta - if (lightReceivers.size()==0) { - for (Spatial scene : viewPort.getScenes()) { - ShadowUtil.getGeometriesInCamFrustum(scene, viewPort.getCamera(), RenderQueue.ShadowMode.Receive, lightReceivers); - } - } - ShadowUtil.updateShadowCamera(viewPort, lightReceivers, shadowCam, points, shadowMapOccluders, stabilize?shadowMapSize:0); - - return shadowMapOccluders; - } - - @Override - protected void getReceivers(GeometryList lightReceivers) { - if (lightReceivers.size()==0) { - for (Spatial scene : viewPort.getScenes()) { - ShadowUtil.getGeometriesInCamFrustum(scene, viewPort.getCamera(), RenderQueue.ShadowMode.Receive, lightReceivers); - } - } - } - - @Override - protected Camera getShadowCam(int shadowMapIndex) { - return shadowCam; - } - - @Override - protected void doDisplayFrustumDebug(int shadowMapIndex) { - ((Node) viewPort.getScenes().get(0)).attachChild(createFrustum(points, shadowMapIndex)); - ShadowUtil.updateFrustumPoints2(shadowCam, points); - ((Node) viewPort.getScenes().get(0)).attachChild(createFrustum(points, shadowMapIndex)); - } - - @Override - protected void setMaterialParameters(Material material) { - material.setColor("Splits", splits); - material.setVector3("LightDir", light.getDirection()); - if (fadeInfo != null) { - material.setVector2("FadeInfo", fadeInfo); - } - } - - @Override - protected void clearMaterialParameters(Material material) { - material.clearParam("Splits"); - material.clearParam("FadeInfo"); - material.clearParam("LightDir"); - } - - /** - * returns the lambda parameter see #setLambda(float lambda) - * - * @return lambda - */ - public float getLambda() { - return lambda; - } - - /** - * Adjusts the partition of the shadow extend into shadow maps. - * Lambda is usually between 0 and 1. - * A low value gives a more linear partition, - * resulting in consistent shadow quality over the extend, - * but near shadows could look very jagged. - * A high value gives a more logarithmic partition, - * resulting in high quality for near shadows, - * but quality decreases rapidly with distance. - * The default value is 0.65 (the theoretical optimum). - * - * @param lambda the lambda value. - */ - public void setLambda(float lambda) { - this.lambda = lambda; - } - - /** - * Check if the stabilization is enabled. - * @return true if stabilization is enabled and false otherwise. - */ - public boolean isEnabledStabilization() { - return stabilize; - } - - /** - * Enables the stabilization of the shadow's edges. (default is true) - * This prevents shadow edges from flickering when the camera moves. - * However, it can lead to some loss of shadow quality in particular scenes. - * - * @param stabilize true if stabilization has to be enabled and false otherwise. - */ - public void setEnabledStabilization(boolean stabilize) { - this.stabilize = stabilize; - } - - @Override - public void read(JmeImporter im) throws IOException { - super.read(im); - InputCapsule ic = im.getCapsule(this); - lambda = ic.readFloat("lambda", 0.65f); - zFarOverride = ic.readInt("zFarOverride", 0); - light = (DirectionalLight) ic.readSavable("light", null); - fadeInfo = (Vector2f) ic.readSavable("fadeInfo", null); - fadeLength = ic.readFloat("fadeLength", 0f); - init(nbShadowMaps, (int) shadowMapSize); - } - - @Override - public void write(JmeExporter ex) throws IOException { - super.write(ex); - OutputCapsule oc = ex.getCapsule(this); - oc.write(lambda, "lambda", 0.65f); - oc.write(zFarOverride, "zFarOverride", 0); - oc.write(light, "light", null); - oc.write(fadeInfo, "fadeInfo", null); - oc.write(fadeLength, "fadeLength", 0f); - } - - /** - * Directional light is always in the view frustum - * @param viewCam - * @return true - */ - @Override - protected boolean checkCulling(Camera viewCam) { - return true; - } -} diff --git a/jme3-vr/src/main/java/com/jme3/shadow/InstancedDirectionalShadowFilter.java b/jme3-vr/src/main/java/com/jme3/shadow/InstancedDirectionalShadowFilter.java deleted file mode 100644 index cdcd25594e..0000000000 --- a/jme3-vr/src/main/java/com/jme3/shadow/InstancedDirectionalShadowFilter.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.jme3.shadow; - -import com.jme3.app.Application; -import com.jme3.math.Matrix4f; -import com.jme3.math.Vector4f; -import com.jme3.renderer.Camera; - -/** - * An instanced version of the {@link DirectionalLightShadowFilterVR directional light shadow filter}. - * @author reden - phr00t - https://github.com/phr00t - * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr - * @deprecated The jme3-vr module is deprecated and will be removed in a future version (as it only supports OpenVR). - * For new Virtual Reality projects, use user libraries that provide OpenXR support. - * See Virtual Reality JME wiki section - * for more information. - */ -@Deprecated -public class InstancedDirectionalShadowFilter extends DirectionalLightShadowFilterVR { - private final Vector4f temp4f = new Vector4f(), temp4f2 = new Vector4f(); - - private boolean instanceRendering = false; - - private Camera rightCamera = null; - - /** - * Create a new instanced version of the {@link DirectionalLightShadowFilterVR directional light shadow filter}. - * @param application the application that this filter is attached to. - * @param camera - * @param shadowMapSize the size of the rendered shadowmaps (512, 1024, 2048, etcetera) - * @param nbSplits the number of shadow maps rendered (More shadow maps yield - * better quality, fewer frames per second.) - * @param instancedRendering true if this filter has to use instance rendering and false otherwise. - * @param rightCamera the camera used as right eye in stereo rendering mode. - */ - public InstancedDirectionalShadowFilter(Application application, Camera camera, int shadowMapSize, int nbSplits, boolean instancedRendering, Camera rightCamera) { - super(application.getAssetManager(), shadowMapSize, nbSplits, "Common/MatDefs/VR/PostShadowFilter.j3md"); - this.instanceRendering = instancedRendering; - this.rightCamera = rightCamera; - } - - @Override - protected void preFrame(float tpf) { - shadowRenderer.preFrame(tpf); - if( instanceRendering ) { - material.setMatrix4("ViewProjectionMatrixInverseRight", rightCamera.getViewProjectionMatrix().invert()); - Matrix4f m = rightCamera.getViewProjectionMatrix(); - material.setVector4("ViewProjectionMatrixRow2Right", temp4f2.set(m.m20, m.m21, m.m22, m.m23)); - } - material.setMatrix4("ViewProjectionMatrixInverse", viewPort.getCamera().getViewProjectionMatrix().invert()); - Matrix4f m = viewPort.getCamera().getViewProjectionMatrix(); - material.setVector4("ViewProjectionMatrixRow2", temp4f.set(m.m20, m.m21, m.m22, m.m23)); - } - - /** - * Get if this filter is using instance rendering. - * @return true if this filter is using instance rendering and false otherwise. - * @see #setInstanceRendering(boolean) - */ - public boolean isInstanceRendering() { - return instanceRendering; - } - - /** - * Set if this filter has to use instance rendering. - * @param instanceRendering true if this filter has to use instance rendering and false otherwise. - * @see #isInstanceRendering() - */ - public void setInstanceRendering(boolean instanceRendering) { - this.instanceRendering = instanceRendering; - } -} diff --git a/jme3-vr/src/main/java/com/jme3/shadow/VRDirectionalLightShadowRenderer.java b/jme3-vr/src/main/java/com/jme3/shadow/VRDirectionalLightShadowRenderer.java deleted file mode 100644 index d4977ea098..0000000000 --- a/jme3-vr/src/main/java/com/jme3/shadow/VRDirectionalLightShadowRenderer.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2009-2021 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.shadow; - -import com.jme3.asset.AssetManager; -import com.jme3.shadow.DirectionalLightShadowRenderer; - -/** - * DirectionalLightShadowRenderer renderer use Parallel Split Shadow Mapping - * technique (pssm)
It splits the view frustum in several parts and compute - * a shadow map for each one.
splits are distributed so that the closer they - * are from the camera, the smaller they are to maximize the resolution used of - * the shadow map.
This results in a better quality shadow than standard - * shadow mapping.
for more information on this read http://http.developer.nvidia.com/GPUGems3/gpugems3_ch10.html
- * - * @author Rémy Bouquet aka Nehon - * @deprecated The jme3-vr module is deprecated and will be removed in a future version (as it only supports OpenVR). - * For new Virtual Reality projects, use user libraries that provide OpenXR support. - * See Virtual Reality JME wiki section - * for more information. - */ -@Deprecated -public class VRDirectionalLightShadowRenderer extends DirectionalLightShadowRenderer { - - /** - * Create an OculusDirectionalLightShadowRenderer More info on the technique at http://http.developer.nvidia.com/GPUGems3/gpugems3_ch10.html - * - * @param assetManager the application asset manager - * @param shadowMapSize the size of the rendered shadowmaps (512,1024,2048, - * etc...) - * @param nbSplits the number of shadow maps rendered (More shadow maps - * result in higher quality, fewer fps.) - */ - public VRDirectionalLightShadowRenderer(AssetManager assetManager, int shadowMapSize, int nbSplits) { - super(assetManager, shadowMapSize, nbSplits); - } - - @Override - public VRDirectionalLightShadowRenderer clone() { - VRDirectionalLightShadowRenderer clone = new VRDirectionalLightShadowRenderer(assetManager, (int)shadowMapSize, nbShadowMaps); - clone.setEdgeFilteringMode(getEdgeFilteringMode()); - clone.setEdgesThickness(getEdgesThickness()); - clone.setEnabledStabilization(isEnabledStabilization()); - clone.setLambda(getLambda()); - clone.setLight(getLight()); - clone.setShadowCompareMode(getShadowCompareMode()); - clone.setShadowIntensity(getShadowIntensity()); - clone.setShadowZExtend(getShadowZExtend()); - clone.setShadowZFadeLength(getShadowZFadeLength()); - return clone; - } -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/AppOverrideKeys_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/AppOverrideKeys_t.java deleted file mode 100644 index f88400e2bd..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/AppOverrideKeys_t.java +++ /dev/null @@ -1,50 +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:1485
- * 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(); - } - @Override - 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 5c3d4fc08e..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/COpenVRContext.java +++ /dev/null @@ -1,110 +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:1670
- * 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; - /** - * class vr::IVRInput *
- * C type : intptr_t - */ - public IntByReference m_pVRInput; - /** - * class vr::IVRIOBuffer *
- * C type : intptr_t - */ - public IntByReference m_pVRIOBuffer; - /** - * class vr::IVRSpatialAnchors *
- * C type : intptr_t - */ - public IntByReference m_pVRSpatialAnchors; - public COpenVRContext() { - super(); - } - @Override - 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", "m_pVRInput", "m_pVRIOBuffer", "m_pVRSpatialAnchors"); - } - 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/CVRSettingHelper.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/CVRSettingHelper.java deleted file mode 100644 index 5be90516cb..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/CVRSettingHelper.java +++ /dev/null @@ -1,43 +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:1592
- * 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 CVRSettingHelper extends Structure { - /** - * class vr::IVRSettings *
- * C type : intptr_t - */ - public IntByReference m_pSettings; - public CVRSettingHelper() { - super(); - } - @Override - protected List getFieldOrder() { - return Arrays.asList("m_pSettings"); - } - /** - * @param m_pSettings class vr::IVRSettings *
- * C type : intptr_t - */ - public CVRSettingHelper(IntByReference m_pSettings) { - super(); - this.m_pSettings = m_pSettings; - } - public CVRSettingHelper(Pointer peer) { - super(peer); - } - public static class ByReference extends CVRSettingHelper implements Structure.ByReference { - - }; - public static class ByValue extends CVRSettingHelper 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 ebbc398bd6..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:1466
- * 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 { - /** - * 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(); - } - @Override - protected List getFieldOrder() { - return Arrays.asList("eFrameType", "nWidth", "nHeight", "nBytesPerPixel", "nFrameSequence", "standingTrackedDevicePose"); - } - /** - * @param eFrameType @see JOpenVRLibrary.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 3b426b7b8f..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/Compositor_CumulativeStats.java +++ /dev/null @@ -1,44 +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:1528
- * 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(); - } - @Override - 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 ede38a055b..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/Compositor_FrameTiming.java +++ /dev/null @@ -1,54 +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:1511
- * 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(); - } - @Override - 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 3afba14f1d..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/Compositor_OverlaySettings.java +++ /dev/null @@ -1,44 +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:1452
- * 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(); - } - @Override - 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 c902ad237a..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/D3D12TextureData_t.java +++ /dev/null @@ -1,54 +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:1301
- * 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(); - } - @Override - 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 59e0ab3dd1..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/DistortionCoordinates_t.java +++ /dev/null @@ -1,64 +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:1237
- * 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(); - } - @Override - 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/DriverDirectMode_FrameTiming.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/DriverDirectMode_FrameTiming.java deleted file mode 100644 index 4b89bc4746..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/DriverDirectMode_FrameTiming.java +++ /dev/null @@ -1,42 +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:1473
- * 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 DriverDirectMode_FrameTiming extends Structure { - public int m_nSize; - public int m_nNumFramePresents; - public int m_nNumMisPresented; - public int m_nNumDroppedFrames; - public int m_nReprojectionFlags; - public DriverDirectMode_FrameTiming() { - super(); - } - @Override - protected List getFieldOrder() { - return Arrays.asList("m_nSize", "m_nNumFramePresents", "m_nNumMisPresented", "m_nNumDroppedFrames", "m_nReprojectionFlags"); - } - public DriverDirectMode_FrameTiming(int m_nSize, int m_nNumFramePresents, int m_nNumMisPresented, int m_nNumDroppedFrames, int m_nReprojectionFlags) { - super(); - this.m_nSize = m_nSize; - this.m_nNumFramePresents = m_nNumFramePresents; - this.m_nNumMisPresented = m_nNumMisPresented; - this.m_nNumDroppedFrames = m_nNumDroppedFrames; - this.m_nReprojectionFlags = m_nReprojectionFlags; - } - public DriverDirectMode_FrameTiming(Pointer peer) { - super(peer); - } - public static class ByReference extends DriverDirectMode_FrameTiming implements Structure.ByReference { - - }; - public static class ByValue extends DriverDirectMode_FrameTiming 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 2844685d11..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HiddenAreaMesh_t.java +++ /dev/null @@ -1,44 +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:1425
- * 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(); - } - @Override - 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 6387f1f0f7..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdColor_t.java +++ /dev/null @@ -1,40 +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:1221
- * 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(); - } - @Override - 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/HmdMatrix33_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdMatrix33_t.java deleted file mode 100644 index 25e7f8d670..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdMatrix33_t.java +++ /dev/null @@ -1,44 +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:1183
- * 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 HmdMatrix33_t extends Structure { - /** - * float[3][3]
- * C type : float[3][3] - */ - public float[] m = new float[((3) * (3))]; - public HmdMatrix33_t() { - super(); - } - @Override - protected List getFieldOrder() { - return Arrays.asList("m"); - } - /** - * @param m float[3][3]
- * C type : float[3][3] - */ - public HmdMatrix33_t(float m[]) { - super(); - if ((m.length != this.m.length)) - throw new IllegalArgumentException("Wrong array size !"); - this.m = m; - } - public HmdMatrix33_t(Pointer peer) { - super(peer); - } - public static class ByReference extends HmdMatrix33_t implements Structure.ByReference { - - }; - public static class ByValue extends HmdMatrix33_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 175bc07f75..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdMatrix34_t.java +++ /dev/null @@ -1,44 +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:1179
- * 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(); - } - @Override - 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 2243e8f5fa..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdMatrix44_t.java +++ /dev/null @@ -1,44 +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:1187
- * 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(); - } - @Override - 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 28abf8f754..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdQuad_t.java +++ /dev/null @@ -1,44 +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:1225
- * 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(); - } - @Override - 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 d26c2acfef..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdQuaternion_t.java +++ /dev/null @@ -1,40 +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:1209
- * 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(); - } - @Override - 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/HmdQuaternionf_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdQuaternionf_t.java deleted file mode 100644 index b24d5c071d..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdQuaternionf_t.java +++ /dev/null @@ -1,40 +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:1215
- * 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 HmdQuaternionf_t extends Structure { - public float w; - public float x; - public float y; - public float z; - public HmdQuaternionf_t() { - super(); - } - @Override - protected List getFieldOrder() { - return Arrays.asList("w", "x", "y", "z"); - } - public HmdQuaternionf_t(float w, float x, float y, float z) { - super(); - this.w = w; - this.x = x; - this.y = y; - this.z = z; - } - public HmdQuaternionf_t(Pointer peer) { - super(peer); - } - public static class ByReference extends HmdQuaternionf_t implements Structure.ByReference { - - }; - public static class ByValue extends HmdQuaternionf_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 a8c25431db..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdRect2_t.java +++ /dev/null @@ -1,42 +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:1229
- * 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(); - } - @Override - 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 f66240574d..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector2_t.java +++ /dev/null @@ -1,44 +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 HmdVector2_t extends Structure { - /** - * float[2]
- * C type : float[2] - */ - public float[] v = new float[2]; - public HmdVector2_t() { - super(); - } - @Override - 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 92ad299605..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector3_t.java +++ /dev/null @@ -1,44 +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:1191
- * 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(); - } - @Override - 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 7bde50647c..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector3d_t.java +++ /dev/null @@ -1,44 +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:1199
- * 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(); - } - @Override - 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 1db01177cf..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector4_t.java +++ /dev/null @@ -1,44 +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:1195
- * 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(); - } - @Override - 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/ImuSample_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/ImuSample_t.java deleted file mode 100644 index 1cadc4b7f2..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/ImuSample_t.java +++ /dev/null @@ -1,46 +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:1479
- * 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 ImuSample_t extends Structure { - public double fSampleTime; - /** C type : HmdVector3d_t */ - public HmdVector3d_t vAccel; - /** C type : HmdVector3d_t */ - public HmdVector3d_t vGyro; - public int unOffScaleFlags; - public ImuSample_t() { - super(); - } - @Override - protected List getFieldOrder() { - return Arrays.asList("fSampleTime", "vAccel", "vGyro", "unOffScaleFlags"); - } - /** - * @param vAccel C type : HmdVector3d_t
- * @param vGyro C type : HmdVector3d_t - */ - public ImuSample_t(double fSampleTime, HmdVector3d_t vAccel, HmdVector3d_t vGyro, int unOffScaleFlags) { - super(); - this.fSampleTime = fSampleTime; - this.vAccel = vAccel; - this.vGyro = vGyro; - this.unOffScaleFlags = unOffScaleFlags; - } - public ImuSample_t(Pointer peer) { - super(peer); - } - public static class ByReference extends ImuSample_t implements Structure.ByReference { - - }; - public static class ByValue extends ImuSample_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/InputAnalogActionData_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/InputAnalogActionData_t.java deleted file mode 100644 index 7f7a2a6922..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/InputAnalogActionData_t.java +++ /dev/null @@ -1,52 +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:1603
- * 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 InputAnalogActionData_t extends Structure { - public byte bActive; - /** C type : VRInputValueHandle_t */ - public long activeOrigin; - public float x; - public float y; - public float z; - public float deltaX; - public float deltaY; - public float deltaZ; - public float fUpdateTime; - public InputAnalogActionData_t() { - super(); - } - @Override - protected List getFieldOrder() { - return Arrays.asList("bActive", "activeOrigin", "x", "y", "z", "deltaX", "deltaY", "deltaZ", "fUpdateTime"); - } - /** @param activeOrigin C type : VRInputValueHandle_t */ - public InputAnalogActionData_t(byte bActive, long activeOrigin, float x, float y, float z, float deltaX, float deltaY, float deltaZ, float fUpdateTime) { - super(); - this.bActive = bActive; - this.activeOrigin = activeOrigin; - this.x = x; - this.y = y; - this.z = z; - this.deltaX = deltaX; - this.deltaY = deltaY; - this.deltaZ = deltaZ; - this.fUpdateTime = fUpdateTime; - } - public InputAnalogActionData_t(Pointer peer) { - super(peer); - } - public static class ByReference extends InputAnalogActionData_t implements Structure.ByReference { - - }; - public static class ByValue extends InputAnalogActionData_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/InputDigitalActionData_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/InputDigitalActionData_t.java deleted file mode 100644 index 3b212e44af..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/InputDigitalActionData_t.java +++ /dev/null @@ -1,44 +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:1610
- * 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 InputDigitalActionData_t extends Structure { - public byte bActive; - /** C type : VRInputValueHandle_t */ - public long activeOrigin; - public byte bState; - public byte bChanged; - public float fUpdateTime; - public InputDigitalActionData_t() { - super(); - } - @Override - protected List getFieldOrder() { - return Arrays.asList("bActive", "activeOrigin", "bState", "bChanged", "fUpdateTime"); - } - /** @param activeOrigin C type : VRInputValueHandle_t */ - public InputDigitalActionData_t(byte bActive, long activeOrigin, byte bState, byte bChanged, float fUpdateTime) { - super(); - this.bActive = bActive; - this.activeOrigin = activeOrigin; - this.bState = bState; - this.bChanged = bChanged; - this.fUpdateTime = fUpdateTime; - } - public InputDigitalActionData_t(Pointer peer) { - super(peer); - } - public static class ByReference extends InputDigitalActionData_t implements Structure.ByReference { - - }; - public static class ByValue extends InputDigitalActionData_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/InputOriginInfo_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/InputOriginInfo_t.java deleted file mode 100644 index eff72867ae..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/InputOriginInfo_t.java +++ /dev/null @@ -1,52 +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:1626
- * 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 InputOriginInfo_t extends Structure { - /** C type : VRInputValueHandle_t */ - public long devicePath; - /** C type : TrackedDeviceIndex_t */ - public int trackedDeviceIndex; - /** - * char[128]
- * C type : char*[128] - */ - public Pointer[] rchRenderModelComponentName = new Pointer[128]; - public InputOriginInfo_t() { - super(); - } - @Override - protected List getFieldOrder() { - return Arrays.asList("devicePath", "trackedDeviceIndex", "rchRenderModelComponentName"); - } - /** - * @param devicePath C type : VRInputValueHandle_t
- * @param trackedDeviceIndex C type : TrackedDeviceIndex_t
- * @param rchRenderModelComponentName char[128]
- * C type : char*[128] - */ - public InputOriginInfo_t(long devicePath, int trackedDeviceIndex, Pointer rchRenderModelComponentName[]) { - super(); - this.devicePath = devicePath; - this.trackedDeviceIndex = trackedDeviceIndex; - if ((rchRenderModelComponentName.length != this.rchRenderModelComponentName.length)) - throw new IllegalArgumentException("Wrong array size !"); - this.rchRenderModelComponentName = rchRenderModelComponentName; - } - public InputOriginInfo_t(Pointer peer) { - super(peer); - } - public static class ByReference extends InputOriginInfo_t implements Structure.ByReference { - - }; - public static class ByValue extends InputOriginInfo_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/InputPoseActionData_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/InputPoseActionData_t.java deleted file mode 100644 index bc375f1a57..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/InputPoseActionData_t.java +++ /dev/null @@ -1,44 +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:1615
- * 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 InputPoseActionData_t extends Structure { - public byte bActive; - /** C type : VRInputValueHandle_t */ - public long activeOrigin; - /** C type : TrackedDevicePose_t */ - public TrackedDevicePose_t pose; - public InputPoseActionData_t() { - super(); - } - @Override - protected List getFieldOrder() { - return Arrays.asList("bActive", "activeOrigin", "pose"); - } - /** - * @param activeOrigin C type : VRInputValueHandle_t
- * @param pose C type : TrackedDevicePose_t - */ - public InputPoseActionData_t(byte bActive, long activeOrigin, TrackedDevicePose_t pose) { - super(); - this.bActive = bActive; - this.activeOrigin = activeOrigin; - this.pose = pose; - } - public InputPoseActionData_t(Pointer peer) { - super(peer); - } - public static class ByReference extends InputPoseActionData_t implements Structure.ByReference { - - }; - public static class ByValue extends InputPoseActionData_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/InputSkeletalActionData_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/InputSkeletalActionData_t.java deleted file mode 100644 index 8d1f26514b..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/InputSkeletalActionData_t.java +++ /dev/null @@ -1,40 +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:1620
- * 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 InputSkeletalActionData_t extends Structure { - public byte bActive; - /** C type : VRInputValueHandle_t */ - public long activeOrigin; - public int boneCount; - public InputSkeletalActionData_t() { - super(); - } - @Override - protected List getFieldOrder() { - return Arrays.asList("bActive", "activeOrigin", "boneCount"); - } - /** @param activeOrigin C type : VRInputValueHandle_t */ - public InputSkeletalActionData_t(byte bActive, long activeOrigin, int boneCount) { - super(); - this.bActive = bActive; - this.activeOrigin = activeOrigin; - this.boneCount = boneCount; - } - public InputSkeletalActionData_t(Pointer peer) { - super(peer); - } - public static class ByReference extends InputSkeletalActionData_t implements Structure.ByReference { - - }; - public static class ByValue extends InputSkeletalActionData_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 8c994f84ba..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/IntersectionMaskCircle_t.java +++ /dev/null @@ -1,38 +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:1552
- * 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(); - } - @Override - 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 e33a836db9..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/IntersectionMaskRectangle_t.java +++ /dev/null @@ -1,40 +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:1547
- * 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(); - } - @Override - 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 4a00707fed..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/JOpenVRLibrary.java +++ /dev/null @@ -1,2332 +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"; - - /** - * Init the native binding to the underlying system library. - */ - 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:229
- * enum values - */ - public static interface EVREye { - /** native declaration : headers\openvr_capi.h:227 */ - public static final int EVREye_Eye_Left = 0; - /** native declaration : headers\openvr_capi.h:228 */ - public static final int EVREye_Eye_Right = 1; - }; - /** - * native declaration : headers\openvr_capi.h:239
- * enum values - */ - public static interface ETextureType { - /** native declaration : headers\openvr_capi.h:231 */ - public static final int ETextureType_TextureType_Invalid = -1; - /** native declaration : headers\openvr_capi.h:232 */ - public static final int ETextureType_TextureType_DirectX = 0; - /** native declaration : headers\openvr_capi.h:233 */ - public static final int ETextureType_TextureType_OpenGL = 1; - /** native declaration : headers\openvr_capi.h:234 */ - public static final int ETextureType_TextureType_Vulkan = 2; - /** native declaration : headers\openvr_capi.h:235 */ - public static final int ETextureType_TextureType_IOSurface = 3; - /** native declaration : headers\openvr_capi.h:236 */ - public static final int ETextureType_TextureType_DirectX12 = 4; - /** native declaration : headers\openvr_capi.h:237 */ - public static final int ETextureType_TextureType_DXGISharedHandle = 5; - /** native declaration : headers\openvr_capi.h:238 */ - public static final int ETextureType_TextureType_Metal = 6; - }; - /** - * native declaration : headers\openvr_capi.h:244
- * enum values - */ - public static interface EColorSpace { - /** native declaration : headers\openvr_capi.h:241 */ - public static final int EColorSpace_ColorSpace_Auto = 0; - /** native declaration : headers\openvr_capi.h:242 */ - public static final int EColorSpace_ColorSpace_Gamma = 1; - /** native declaration : headers\openvr_capi.h:243 */ - public static final int EColorSpace_ColorSpace_Linear = 2; - }; - /** - * native declaration : headers\openvr_capi.h:251
- * enum values - */ - public static interface ETrackingResult { - /** native declaration : headers\openvr_capi.h:246 */ - public static final int ETrackingResult_TrackingResult_Uninitialized = 1; - /** native declaration : headers\openvr_capi.h:247 */ - public static final int ETrackingResult_TrackingResult_Calibrating_InProgress = 100; - /** native declaration : headers\openvr_capi.h:248 */ - public static final int ETrackingResult_TrackingResult_Calibrating_OutOfRange = 101; - /** native declaration : headers\openvr_capi.h:249 */ - public static final int ETrackingResult_TrackingResult_Running_OK = 200; - /** native declaration : headers\openvr_capi.h:250 */ - public static final int ETrackingResult_TrackingResult_Running_OutOfRange = 201; - }; - /** - * native declaration : headers\openvr_capi.h:260
- * enum values - */ - public static interface ETrackedDeviceClass { - /** native declaration : headers\openvr_capi.h:253 */ - public static final int ETrackedDeviceClass_TrackedDeviceClass_Invalid = 0; - /** native declaration : headers\openvr_capi.h:254 */ - public static final int ETrackedDeviceClass_TrackedDeviceClass_HMD = 1; - /** native declaration : headers\openvr_capi.h:255 */ - public static final int ETrackedDeviceClass_TrackedDeviceClass_Controller = 2; - /** native declaration : headers\openvr_capi.h:256 */ - public static final int ETrackedDeviceClass_TrackedDeviceClass_GenericTracker = 3; - /** native declaration : headers\openvr_capi.h:257 */ - public static final int ETrackedDeviceClass_TrackedDeviceClass_TrackingReference = 4; - /** native declaration : headers\openvr_capi.h:258 */ - public static final int ETrackedDeviceClass_TrackedDeviceClass_DisplayRedirect = 5; - /** native declaration : headers\openvr_capi.h:259 */ - public static final int ETrackedDeviceClass_TrackedDeviceClass_Max = 6; - }; - /** - * native declaration : headers\openvr_capi.h:267
- * enum values - */ - public static interface ETrackedControllerRole { - /** native declaration : headers\openvr_capi.h:262 */ - public static final int ETrackedControllerRole_TrackedControllerRole_Invalid = 0; - /** native declaration : headers\openvr_capi.h:263 */ - public static final int ETrackedControllerRole_TrackedControllerRole_LeftHand = 1; - /** native declaration : headers\openvr_capi.h:264 */ - public static final int ETrackedControllerRole_TrackedControllerRole_RightHand = 2; - /** native declaration : headers\openvr_capi.h:265 */ - public static final int ETrackedControllerRole_TrackedControllerRole_OptOut = 3; - /** native declaration : headers\openvr_capi.h:266 */ - public static final int ETrackedControllerRole_TrackedControllerRole_Max = 4; - }; - /** - * native declaration : headers\openvr_capi.h:272
- * enum values - */ - public static interface ETrackingUniverseOrigin { - /** native declaration : headers\openvr_capi.h:269 */ - public static final int ETrackingUniverseOrigin_TrackingUniverseSeated = 0; - /** native declaration : headers\openvr_capi.h:270 */ - public static final int ETrackingUniverseOrigin_TrackingUniverseStanding = 1; - /** native declaration : headers\openvr_capi.h:271 */ - public static final int ETrackingUniverseOrigin_TrackingUniverseRawAndUncalibrated = 2; - }; - /** - * native declaration : headers\openvr_capi.h:432
- * enum values - */ - public static interface ETrackedDeviceProperty { - /** native declaration : headers\openvr_capi.h:274 */ - public static final int ETrackedDeviceProperty_Prop_Invalid = 0; - /** native declaration : headers\openvr_capi.h:275 */ - public static final int ETrackedDeviceProperty_Prop_TrackingSystemName_String = 1000; - /** native declaration : headers\openvr_capi.h:276 */ - public static final int ETrackedDeviceProperty_Prop_ModelNumber_String = 1001; - /** native declaration : headers\openvr_capi.h:277 */ - public static final int ETrackedDeviceProperty_Prop_SerialNumber_String = 1002; - /** native declaration : headers\openvr_capi.h:278 */ - public static final int ETrackedDeviceProperty_Prop_RenderModelName_String = 1003; - /** native declaration : headers\openvr_capi.h:279 */ - public static final int ETrackedDeviceProperty_Prop_WillDriftInYaw_Bool = 1004; - /** native declaration : headers\openvr_capi.h:280 */ - public static final int ETrackedDeviceProperty_Prop_ManufacturerName_String = 1005; - /** native declaration : headers\openvr_capi.h:281 */ - public static final int ETrackedDeviceProperty_Prop_TrackingFirmwareVersion_String = 1006; - /** native declaration : headers\openvr_capi.h:282 */ - public static final int ETrackedDeviceProperty_Prop_HardwareRevision_String = 1007; - /** native declaration : headers\openvr_capi.h:283 */ - public static final int ETrackedDeviceProperty_Prop_AllWirelessDongleDescriptions_String = 1008; - /** native declaration : headers\openvr_capi.h:284 */ - public static final int ETrackedDeviceProperty_Prop_ConnectedWirelessDongle_String = 1009; - /** native declaration : headers\openvr_capi.h:285 */ - public static final int ETrackedDeviceProperty_Prop_DeviceIsWireless_Bool = 1010; - /** native declaration : headers\openvr_capi.h:286 */ - public static final int ETrackedDeviceProperty_Prop_DeviceIsCharging_Bool = 1011; - /** native declaration : headers\openvr_capi.h:287 */ - public static final int ETrackedDeviceProperty_Prop_DeviceBatteryPercentage_Float = 1012; - /** native declaration : headers\openvr_capi.h:288 */ - public static final int ETrackedDeviceProperty_Prop_StatusDisplayTransform_Matrix34 = 1013; - /** native declaration : headers\openvr_capi.h:289 */ - public static final int ETrackedDeviceProperty_Prop_Firmware_UpdateAvailable_Bool = 1014; - /** native declaration : headers\openvr_capi.h:290 */ - public static final int ETrackedDeviceProperty_Prop_Firmware_ManualUpdate_Bool = 1015; - /** native declaration : headers\openvr_capi.h:291 */ - public static final int ETrackedDeviceProperty_Prop_Firmware_ManualUpdateURL_String = 1016; - /** native declaration : headers\openvr_capi.h:292 */ - public static final int ETrackedDeviceProperty_Prop_HardwareRevision_Uint64 = 1017; - /** native declaration : headers\openvr_capi.h:293 */ - public static final int ETrackedDeviceProperty_Prop_FirmwareVersion_Uint64 = 1018; - /** native declaration : headers\openvr_capi.h:294 */ - public static final int ETrackedDeviceProperty_Prop_FPGAVersion_Uint64 = 1019; - /** native declaration : headers\openvr_capi.h:295 */ - public static final int ETrackedDeviceProperty_Prop_VRCVersion_Uint64 = 1020; - /** native declaration : headers\openvr_capi.h:296 */ - public static final int ETrackedDeviceProperty_Prop_RadioVersion_Uint64 = 1021; - /** native declaration : headers\openvr_capi.h:297 */ - public static final int ETrackedDeviceProperty_Prop_DongleVersion_Uint64 = 1022; - /** native declaration : headers\openvr_capi.h:298 */ - public static final int ETrackedDeviceProperty_Prop_BlockServerShutdown_Bool = 1023; - /** native declaration : headers\openvr_capi.h:299 */ - public static final int ETrackedDeviceProperty_Prop_CanUnifyCoordinateSystemWithHmd_Bool = 1024; - /** native declaration : headers\openvr_capi.h:300 */ - public static final int ETrackedDeviceProperty_Prop_ContainsProximitySensor_Bool = 1025; - /** native declaration : headers\openvr_capi.h:301 */ - public static final int ETrackedDeviceProperty_Prop_DeviceProvidesBatteryStatus_Bool = 1026; - /** native declaration : headers\openvr_capi.h:302 */ - public static final int ETrackedDeviceProperty_Prop_DeviceCanPowerOff_Bool = 1027; - /** native declaration : headers\openvr_capi.h:303 */ - public static final int ETrackedDeviceProperty_Prop_Firmware_ProgrammingTarget_String = 1028; - /** native declaration : headers\openvr_capi.h:304 */ - public static final int ETrackedDeviceProperty_Prop_DeviceClass_Int32 = 1029; - /** native declaration : headers\openvr_capi.h:305 */ - public static final int ETrackedDeviceProperty_Prop_HasCamera_Bool = 1030; - /** native declaration : headers\openvr_capi.h:306 */ - public static final int ETrackedDeviceProperty_Prop_DriverVersion_String = 1031; - /** native declaration : headers\openvr_capi.h:307 */ - public static final int ETrackedDeviceProperty_Prop_Firmware_ForceUpdateRequired_Bool = 1032; - /** native declaration : headers\openvr_capi.h:308 */ - public static final int ETrackedDeviceProperty_Prop_ViveSystemButtonFixRequired_Bool = 1033; - /** native declaration : headers\openvr_capi.h:309 */ - public static final int ETrackedDeviceProperty_Prop_ParentDriver_Uint64 = 1034; - /** native declaration : headers\openvr_capi.h:310 */ - public static final int ETrackedDeviceProperty_Prop_ResourceRoot_String = 1035; - /** native declaration : headers\openvr_capi.h:311 */ - public static final int ETrackedDeviceProperty_Prop_RegisteredDeviceType_String = 1036; - /** native declaration : headers\openvr_capi.h:312 */ - public static final int ETrackedDeviceProperty_Prop_InputProfilePath_String = 1037; - /** native declaration : headers\openvr_capi.h:313 */ - public static final int ETrackedDeviceProperty_Prop_NeverTracked_Bool = 1038; - /** native declaration : headers\openvr_capi.h:314 */ - public static final int ETrackedDeviceProperty_Prop_NumCameras_Int32 = 1039; - /** native declaration : headers\openvr_capi.h:315 */ - public static final int ETrackedDeviceProperty_Prop_CameraFrameLayout_Int32 = 1040; - /** native declaration : headers\openvr_capi.h:316 */ - public static final int ETrackedDeviceProperty_Prop_ReportsTimeSinceVSync_Bool = 2000; - /** native declaration : headers\openvr_capi.h:317 */ - public static final int ETrackedDeviceProperty_Prop_SecondsFromVsyncToPhotons_Float = 2001; - /** native declaration : headers\openvr_capi.h:318 */ - public static final int ETrackedDeviceProperty_Prop_DisplayFrequency_Float = 2002; - /** native declaration : headers\openvr_capi.h:319 */ - public static final int ETrackedDeviceProperty_Prop_UserIpdMeters_Float = 2003; - /** native declaration : headers\openvr_capi.h:320 */ - public static final int ETrackedDeviceProperty_Prop_CurrentUniverseId_Uint64 = 2004; - /** native declaration : headers\openvr_capi.h:321 */ - public static final int ETrackedDeviceProperty_Prop_PreviousUniverseId_Uint64 = 2005; - /** native declaration : headers\openvr_capi.h:322 */ - public static final int ETrackedDeviceProperty_Prop_DisplayFirmwareVersion_Uint64 = 2006; - /** native declaration : headers\openvr_capi.h:323 */ - public static final int ETrackedDeviceProperty_Prop_IsOnDesktop_Bool = 2007; - /** native declaration : headers\openvr_capi.h:324 */ - public static final int ETrackedDeviceProperty_Prop_DisplayMCType_Int32 = 2008; - /** native declaration : headers\openvr_capi.h:325 */ - public static final int ETrackedDeviceProperty_Prop_DisplayMCOffset_Float = 2009; - /** native declaration : headers\openvr_capi.h:326 */ - public static final int ETrackedDeviceProperty_Prop_DisplayMCScale_Float = 2010; - /** native declaration : headers\openvr_capi.h:327 */ - public static final int ETrackedDeviceProperty_Prop_EdidVendorID_Int32 = 2011; - /** native declaration : headers\openvr_capi.h:328 */ - public static final int ETrackedDeviceProperty_Prop_DisplayMCImageLeft_String = 2012; - /** native declaration : headers\openvr_capi.h:329 */ - public static final int ETrackedDeviceProperty_Prop_DisplayMCImageRight_String = 2013; - /** native declaration : headers\openvr_capi.h:330 */ - public static final int ETrackedDeviceProperty_Prop_DisplayGCBlackClamp_Float = 2014; - /** native declaration : headers\openvr_capi.h:331 */ - public static final int ETrackedDeviceProperty_Prop_EdidProductID_Int32 = 2015; - /** native declaration : headers\openvr_capi.h:332 */ - public static final int ETrackedDeviceProperty_Prop_CameraToHeadTransform_Matrix34 = 2016; - /** native declaration : headers\openvr_capi.h:333 */ - public static final int ETrackedDeviceProperty_Prop_DisplayGCType_Int32 = 2017; - /** native declaration : headers\openvr_capi.h:334 */ - public static final int ETrackedDeviceProperty_Prop_DisplayGCOffset_Float = 2018; - /** native declaration : headers\openvr_capi.h:335 */ - public static final int ETrackedDeviceProperty_Prop_DisplayGCScale_Float = 2019; - /** native declaration : headers\openvr_capi.h:336 */ - public static final int ETrackedDeviceProperty_Prop_DisplayGCPrescale_Float = 2020; - /** native declaration : headers\openvr_capi.h:337 */ - public static final int ETrackedDeviceProperty_Prop_DisplayGCImage_String = 2021; - /** native declaration : headers\openvr_capi.h:338 */ - public static final int ETrackedDeviceProperty_Prop_LensCenterLeftU_Float = 2022; - /** native declaration : headers\openvr_capi.h:339 */ - public static final int ETrackedDeviceProperty_Prop_LensCenterLeftV_Float = 2023; - /** native declaration : headers\openvr_capi.h:340 */ - public static final int ETrackedDeviceProperty_Prop_LensCenterRightU_Float = 2024; - /** native declaration : headers\openvr_capi.h:341 */ - public static final int ETrackedDeviceProperty_Prop_LensCenterRightV_Float = 2025; - /** native declaration : headers\openvr_capi.h:342 */ - public static final int ETrackedDeviceProperty_Prop_UserHeadToEyeDepthMeters_Float = 2026; - /** native declaration : headers\openvr_capi.h:343 */ - public static final int ETrackedDeviceProperty_Prop_CameraFirmwareVersion_Uint64 = 2027; - /** native declaration : headers\openvr_capi.h:344 */ - public static final int ETrackedDeviceProperty_Prop_CameraFirmwareDescription_String = 2028; - /** native declaration : headers\openvr_capi.h:345 */ - public static final int ETrackedDeviceProperty_Prop_DisplayFPGAVersion_Uint64 = 2029; - /** native declaration : headers\openvr_capi.h:346 */ - public static final int ETrackedDeviceProperty_Prop_DisplayBootloaderVersion_Uint64 = 2030; - /** native declaration : headers\openvr_capi.h:347 */ - public static final int ETrackedDeviceProperty_Prop_DisplayHardwareVersion_Uint64 = 2031; - /** native declaration : headers\openvr_capi.h:348 */ - public static final int ETrackedDeviceProperty_Prop_AudioFirmwareVersion_Uint64 = 2032; - /** native declaration : headers\openvr_capi.h:349 */ - public static final int ETrackedDeviceProperty_Prop_CameraCompatibilityMode_Int32 = 2033; - /** native declaration : headers\openvr_capi.h:350 */ - public static final int ETrackedDeviceProperty_Prop_ScreenshotHorizontalFieldOfViewDegrees_Float = 2034; - /** native declaration : headers\openvr_capi.h:351 */ - public static final int ETrackedDeviceProperty_Prop_ScreenshotVerticalFieldOfViewDegrees_Float = 2035; - /** native declaration : headers\openvr_capi.h:352 */ - public static final int ETrackedDeviceProperty_Prop_DisplaySuppressed_Bool = 2036; - /** native declaration : headers\openvr_capi.h:353 */ - public static final int ETrackedDeviceProperty_Prop_DisplayAllowNightMode_Bool = 2037; - /** native declaration : headers\openvr_capi.h:354 */ - public static final int ETrackedDeviceProperty_Prop_DisplayMCImageWidth_Int32 = 2038; - /** native declaration : headers\openvr_capi.h:355 */ - public static final int ETrackedDeviceProperty_Prop_DisplayMCImageHeight_Int32 = 2039; - /** native declaration : headers\openvr_capi.h:356 */ - public static final int ETrackedDeviceProperty_Prop_DisplayMCImageNumChannels_Int32 = 2040; - /** native declaration : headers\openvr_capi.h:357 */ - public static final int ETrackedDeviceProperty_Prop_DisplayMCImageData_Binary = 2041; - /** native declaration : headers\openvr_capi.h:358 */ - public static final int ETrackedDeviceProperty_Prop_SecondsFromPhotonsToVblank_Float = 2042; - /** native declaration : headers\openvr_capi.h:359 */ - public static final int ETrackedDeviceProperty_Prop_DriverDirectModeSendsVsyncEvents_Bool = 2043; - /** native declaration : headers\openvr_capi.h:360 */ - public static final int ETrackedDeviceProperty_Prop_DisplayDebugMode_Bool = 2044; - /** native declaration : headers\openvr_capi.h:361 */ - public static final int ETrackedDeviceProperty_Prop_GraphicsAdapterLuid_Uint64 = 2045; - /** native declaration : headers\openvr_capi.h:362 */ - public static final int ETrackedDeviceProperty_Prop_DriverProvidedChaperonePath_String = 2048; - /** native declaration : headers\openvr_capi.h:363 */ - public static final int ETrackedDeviceProperty_Prop_ExpectedTrackingReferenceCount_Int32 = 2049; - /** native declaration : headers\openvr_capi.h:364 */ - public static final int ETrackedDeviceProperty_Prop_ExpectedControllerCount_Int32 = 2050; - /** native declaration : headers\openvr_capi.h:365 */ - public static final int ETrackedDeviceProperty_Prop_NamedIconPathControllerLeftDeviceOff_String = 2051; - /** native declaration : headers\openvr_capi.h:366 */ - public static final int ETrackedDeviceProperty_Prop_NamedIconPathControllerRightDeviceOff_String = 2052; - /** native declaration : headers\openvr_capi.h:367 */ - public static final int ETrackedDeviceProperty_Prop_NamedIconPathTrackingReferenceDeviceOff_String = 2053; - /** native declaration : headers\openvr_capi.h:368 */ - public static final int ETrackedDeviceProperty_Prop_DoNotApplyPrediction_Bool = 2054; - /** native declaration : headers\openvr_capi.h:369 */ - public static final int ETrackedDeviceProperty_Prop_CameraToHeadTransforms_Matrix34_Array = 2055; - /** native declaration : headers\openvr_capi.h:370 */ - public static final int ETrackedDeviceProperty_Prop_DistortionMeshResolution_Int32 = 2056; - /** native declaration : headers\openvr_capi.h:371 */ - public static final int ETrackedDeviceProperty_Prop_DriverIsDrawingControllers_Bool = 2057; - /** native declaration : headers\openvr_capi.h:372 */ - public static final int ETrackedDeviceProperty_Prop_DriverRequestsApplicationPause_Bool = 2058; - /** native declaration : headers\openvr_capi.h:373 */ - public static final int ETrackedDeviceProperty_Prop_DriverRequestsReducedRendering_Bool = 2059; - /** native declaration : headers\openvr_capi.h:374 */ - public static final int ETrackedDeviceProperty_Prop_MinimumIpdStepMeters_Float = 2060; - /** native declaration : headers\openvr_capi.h:375 */ - public static final int ETrackedDeviceProperty_Prop_AudioBridgeFirmwareVersion_Uint64 = 2061; - /** native declaration : headers\openvr_capi.h:376 */ - public static final int ETrackedDeviceProperty_Prop_ImageBridgeFirmwareVersion_Uint64 = 2062; - /** native declaration : headers\openvr_capi.h:377 */ - public static final int ETrackedDeviceProperty_Prop_ImuToHeadTransform_Matrix34 = 2063; - /** native declaration : headers\openvr_capi.h:378 */ - public static final int ETrackedDeviceProperty_Prop_ImuFactoryGyroBias_Vector3 = 2064; - /** native declaration : headers\openvr_capi.h:379 */ - public static final int ETrackedDeviceProperty_Prop_ImuFactoryGyroScale_Vector3 = 2065; - /** native declaration : headers\openvr_capi.h:380 */ - public static final int ETrackedDeviceProperty_Prop_ImuFactoryAccelerometerBias_Vector3 = 2066; - /** native declaration : headers\openvr_capi.h:381 */ - public static final int ETrackedDeviceProperty_Prop_ImuFactoryAccelerometerScale_Vector3 = 2067; - /** native declaration : headers\openvr_capi.h:382 */ - public static final int ETrackedDeviceProperty_Prop_ConfigurationIncludesLighthouse20Features_Bool = 2069; - /** native declaration : headers\openvr_capi.h:383 */ - public static final int ETrackedDeviceProperty_Prop_DriverRequestedMuraCorrectionMode_Int32 = 2200; - /** native declaration : headers\openvr_capi.h:384 */ - public static final int ETrackedDeviceProperty_Prop_DriverRequestedMuraFeather_InnerLeft_Int32 = 2201; - /** native declaration : headers\openvr_capi.h:385 */ - public static final int ETrackedDeviceProperty_Prop_DriverRequestedMuraFeather_InnerRight_Int32 = 2202; - /** native declaration : headers\openvr_capi.h:386 */ - public static final int ETrackedDeviceProperty_Prop_DriverRequestedMuraFeather_InnerTop_Int32 = 2203; - /** native declaration : headers\openvr_capi.h:387 */ - public static final int ETrackedDeviceProperty_Prop_DriverRequestedMuraFeather_InnerBottom_Int32 = 2204; - /** native declaration : headers\openvr_capi.h:388 */ - public static final int ETrackedDeviceProperty_Prop_DriverRequestedMuraFeather_OuterLeft_Int32 = 2205; - /** native declaration : headers\openvr_capi.h:389 */ - public static final int ETrackedDeviceProperty_Prop_DriverRequestedMuraFeather_OuterRight_Int32 = 2206; - /** native declaration : headers\openvr_capi.h:390 */ - public static final int ETrackedDeviceProperty_Prop_DriverRequestedMuraFeather_OuterTop_Int32 = 2207; - /** native declaration : headers\openvr_capi.h:391 */ - public static final int ETrackedDeviceProperty_Prop_DriverRequestedMuraFeather_OuterBottom_Int32 = 2208; - /** native declaration : headers\openvr_capi.h:392 */ - public static final int ETrackedDeviceProperty_Prop_AttachedDeviceId_String = 3000; - /** native declaration : headers\openvr_capi.h:393 */ - public static final int ETrackedDeviceProperty_Prop_SupportedButtons_Uint64 = 3001; - /** native declaration : headers\openvr_capi.h:394 */ - public static final int ETrackedDeviceProperty_Prop_Axis0Type_Int32 = 3002; - /** native declaration : headers\openvr_capi.h:395 */ - public static final int ETrackedDeviceProperty_Prop_Axis1Type_Int32 = 3003; - /** native declaration : headers\openvr_capi.h:396 */ - public static final int ETrackedDeviceProperty_Prop_Axis2Type_Int32 = 3004; - /** native declaration : headers\openvr_capi.h:397 */ - public static final int ETrackedDeviceProperty_Prop_Axis3Type_Int32 = 3005; - /** native declaration : headers\openvr_capi.h:398 */ - public static final int ETrackedDeviceProperty_Prop_Axis4Type_Int32 = 3006; - /** native declaration : headers\openvr_capi.h:399 */ - public static final int ETrackedDeviceProperty_Prop_ControllerRoleHint_Int32 = 3007; - /** native declaration : headers\openvr_capi.h:400 */ - public static final int ETrackedDeviceProperty_Prop_FieldOfViewLeftDegrees_Float = 4000; - /** native declaration : headers\openvr_capi.h:401 */ - public static final int ETrackedDeviceProperty_Prop_FieldOfViewRightDegrees_Float = 4001; - /** native declaration : headers\openvr_capi.h:402 */ - public static final int ETrackedDeviceProperty_Prop_FieldOfViewTopDegrees_Float = 4002; - /** native declaration : headers\openvr_capi.h:403 */ - public static final int ETrackedDeviceProperty_Prop_FieldOfViewBottomDegrees_Float = 4003; - /** native declaration : headers\openvr_capi.h:404 */ - public static final int ETrackedDeviceProperty_Prop_TrackingRangeMinimumMeters_Float = 4004; - /** native declaration : headers\openvr_capi.h:405 */ - public static final int ETrackedDeviceProperty_Prop_TrackingRangeMaximumMeters_Float = 4005; - /** native declaration : headers\openvr_capi.h:406 */ - public static final int ETrackedDeviceProperty_Prop_ModeLabel_String = 4006; - /** native declaration : headers\openvr_capi.h:407 */ - public static final int ETrackedDeviceProperty_Prop_IconPathName_String = 5000; - /** native declaration : headers\openvr_capi.h:408 */ - public static final int ETrackedDeviceProperty_Prop_NamedIconPathDeviceOff_String = 5001; - /** native declaration : headers\openvr_capi.h:409 */ - public static final int ETrackedDeviceProperty_Prop_NamedIconPathDeviceSearching_String = 5002; - /** native declaration : headers\openvr_capi.h:410 */ - public static final int ETrackedDeviceProperty_Prop_NamedIconPathDeviceSearchingAlert_String = 5003; - /** native declaration : headers\openvr_capi.h:411 */ - public static final int ETrackedDeviceProperty_Prop_NamedIconPathDeviceReady_String = 5004; - /** native declaration : headers\openvr_capi.h:412 */ - public static final int ETrackedDeviceProperty_Prop_NamedIconPathDeviceReadyAlert_String = 5005; - /** native declaration : headers\openvr_capi.h:413 */ - public static final int ETrackedDeviceProperty_Prop_NamedIconPathDeviceNotReady_String = 5006; - /** native declaration : headers\openvr_capi.h:414 */ - public static final int ETrackedDeviceProperty_Prop_NamedIconPathDeviceStandby_String = 5007; - /** native declaration : headers\openvr_capi.h:415 */ - public static final int ETrackedDeviceProperty_Prop_NamedIconPathDeviceAlertLow_String = 5008; - /** native declaration : headers\openvr_capi.h:416 */ - public static final int ETrackedDeviceProperty_Prop_DisplayHiddenArea_Binary_Start = 5100; - /** native declaration : headers\openvr_capi.h:417 */ - public static final int ETrackedDeviceProperty_Prop_DisplayHiddenArea_Binary_End = 5150; - /** native declaration : headers\openvr_capi.h:418 */ - public static final int ETrackedDeviceProperty_Prop_ParentContainer = 5151; - /** native declaration : headers\openvr_capi.h:419 */ - public static final int ETrackedDeviceProperty_Prop_UserConfigPath_String = 6000; - /** native declaration : headers\openvr_capi.h:420 */ - public static final int ETrackedDeviceProperty_Prop_InstallPath_String = 6001; - /** native declaration : headers\openvr_capi.h:421 */ - public static final int ETrackedDeviceProperty_Prop_HasDisplayComponent_Bool = 6002; - /** native declaration : headers\openvr_capi.h:422 */ - public static final int ETrackedDeviceProperty_Prop_HasControllerComponent_Bool = 6003; - /** native declaration : headers\openvr_capi.h:423 */ - public static final int ETrackedDeviceProperty_Prop_HasCameraComponent_Bool = 6004; - /** native declaration : headers\openvr_capi.h:424 */ - public static final int ETrackedDeviceProperty_Prop_HasDriverDirectModeComponent_Bool = 6005; - /** native declaration : headers\openvr_capi.h:425 */ - public static final int ETrackedDeviceProperty_Prop_HasVirtualDisplayComponent_Bool = 6006; - /** native declaration : headers\openvr_capi.h:426 */ - public static final int ETrackedDeviceProperty_Prop_HasSpatialAnchorsSupport_Bool = 6007; - /** native declaration : headers\openvr_capi.h:427 */ - public static final int ETrackedDeviceProperty_Prop_ControllerType_String = 7000; - /** native declaration : headers\openvr_capi.h:428 */ - public static final int ETrackedDeviceProperty_Prop_LegacyInputProfile_String = 7001; - /** native declaration : headers\openvr_capi.h:429 */ - public static final int ETrackedDeviceProperty_Prop_VendorSpecific_Reserved_Start = 10000; - /** native declaration : headers\openvr_capi.h:430 */ - public static final int ETrackedDeviceProperty_Prop_VendorSpecific_Reserved_End = 10999; - /** native declaration : headers\openvr_capi.h:431 */ - public static final int ETrackedDeviceProperty_Prop_TrackedDeviceProperty_Max = 1000000; - }; - /** - * native declaration : headers\openvr_capi.h:447
- * enum values - */ - public static interface ETrackedPropertyError { - /** native declaration : headers\openvr_capi.h:434 */ - public static final int ETrackedPropertyError_TrackedProp_Success = 0; - /** native declaration : headers\openvr_capi.h:435 */ - public static final int ETrackedPropertyError_TrackedProp_WrongDataType = 1; - /** native declaration : headers\openvr_capi.h:436 */ - public static final int ETrackedPropertyError_TrackedProp_WrongDeviceClass = 2; - /** native declaration : headers\openvr_capi.h:437 */ - public static final int ETrackedPropertyError_TrackedProp_BufferTooSmall = 3; - /** native declaration : headers\openvr_capi.h:438 */ - public static final int ETrackedPropertyError_TrackedProp_UnknownProperty = 4; - /** native declaration : headers\openvr_capi.h:439 */ - public static final int ETrackedPropertyError_TrackedProp_InvalidDevice = 5; - /** native declaration : headers\openvr_capi.h:440 */ - public static final int ETrackedPropertyError_TrackedProp_CouldNotContactServer = 6; - /** native declaration : headers\openvr_capi.h:441 */ - public static final int ETrackedPropertyError_TrackedProp_ValueNotProvidedByDevice = 7; - /** native declaration : headers\openvr_capi.h:442 */ - public static final int ETrackedPropertyError_TrackedProp_StringExceedsMaximumLength = 8; - /** native declaration : headers\openvr_capi.h:443 */ - public static final int ETrackedPropertyError_TrackedProp_NotYetAvailable = 9; - /** native declaration : headers\openvr_capi.h:444 */ - public static final int ETrackedPropertyError_TrackedProp_PermissionDenied = 10; - /** native declaration : headers\openvr_capi.h:445 */ - public static final int ETrackedPropertyError_TrackedProp_InvalidOperation = 11; - /** native declaration : headers\openvr_capi.h:446 */ - public static final int ETrackedPropertyError_TrackedProp_CannotWriteToWildcards = 12; - }; - /** - * native declaration : headers\openvr_capi.h:455
- * enum values - */ - public static interface EVRSubmitFlags { - /** native declaration : headers\openvr_capi.h:449 */ - public static final int EVRSubmitFlags_Submit_Default = 0; - /** native declaration : headers\openvr_capi.h:450 */ - public static final int EVRSubmitFlags_Submit_LensDistortionAlreadyApplied = 1; - /** native declaration : headers\openvr_capi.h:451 */ - public static final int EVRSubmitFlags_Submit_GlRenderBuffer = 2; - /** native declaration : headers\openvr_capi.h:452 */ - public static final int EVRSubmitFlags_Submit_Reserved = 4; - /** native declaration : headers\openvr_capi.h:453 */ - public static final int EVRSubmitFlags_Submit_TextureWithPose = 8; - /** native declaration : headers\openvr_capi.h:454 */ - public static final int EVRSubmitFlags_Submit_TextureWithDepth = 16; - }; - /** - * native declaration : headers\openvr_capi.h:466
- * enum values - */ - public static interface EVRState { - /** native declaration : headers\openvr_capi.h:457 */ - public static final int EVRState_VRState_Undefined = -1; - /** native declaration : headers\openvr_capi.h:458 */ - public static final int EVRState_VRState_Off = 0; - /** native declaration : headers\openvr_capi.h:459 */ - public static final int EVRState_VRState_Searching = 1; - /** native declaration : headers\openvr_capi.h:460 */ - public static final int EVRState_VRState_Searching_Alert = 2; - /** native declaration : headers\openvr_capi.h:461 */ - public static final int EVRState_VRState_Ready = 3; - /** native declaration : headers\openvr_capi.h:462 */ - public static final int EVRState_VRState_Ready_Alert = 4; - /** native declaration : headers\openvr_capi.h:463 */ - public static final int EVRState_VRState_NotReady = 5; - /** native declaration : headers\openvr_capi.h:464 */ - public static final int EVRState_VRState_Standby = 6; - /** native declaration : headers\openvr_capi.h:465 */ - public static final int EVRState_VRState_Ready_Alert_Low = 7; - }; - /** - * native declaration : headers\openvr_capi.h:616
- * enum values - */ - public static interface EVREventType { - /** native declaration : headers\openvr_capi.h:468 */ - public static final int EVREventType_VREvent_None = 0; - /** native declaration : headers\openvr_capi.h:469 */ - public static final int EVREventType_VREvent_TrackedDeviceActivated = 100; - /** native declaration : headers\openvr_capi.h:470 */ - public static final int EVREventType_VREvent_TrackedDeviceDeactivated = 101; - /** native declaration : headers\openvr_capi.h:471 */ - public static final int EVREventType_VREvent_TrackedDeviceUpdated = 102; - /** native declaration : headers\openvr_capi.h:472 */ - public static final int EVREventType_VREvent_TrackedDeviceUserInteractionStarted = 103; - /** native declaration : headers\openvr_capi.h:473 */ - public static final int EVREventType_VREvent_TrackedDeviceUserInteractionEnded = 104; - /** native declaration : headers\openvr_capi.h:474 */ - public static final int EVREventType_VREvent_IpdChanged = 105; - /** native declaration : headers\openvr_capi.h:475 */ - public static final int EVREventType_VREvent_EnterStandbyMode = 106; - /** native declaration : headers\openvr_capi.h:476 */ - public static final int EVREventType_VREvent_LeaveStandbyMode = 107; - /** native declaration : headers\openvr_capi.h:477 */ - public static final int EVREventType_VREvent_TrackedDeviceRoleChanged = 108; - /** native declaration : headers\openvr_capi.h:478 */ - public static final int EVREventType_VREvent_WatchdogWakeUpRequested = 109; - /** native declaration : headers\openvr_capi.h:479 */ - public static final int EVREventType_VREvent_LensDistortionChanged = 110; - /** native declaration : headers\openvr_capi.h:480 */ - public static final int EVREventType_VREvent_PropertyChanged = 111; - /** native declaration : headers\openvr_capi.h:481 */ - public static final int EVREventType_VREvent_WirelessDisconnect = 112; - /** native declaration : headers\openvr_capi.h:482 */ - public static final int EVREventType_VREvent_WirelessReconnect = 113; - /** native declaration : headers\openvr_capi.h:483 */ - public static final int EVREventType_VREvent_ButtonPress = 200; - /** native declaration : headers\openvr_capi.h:484 */ - public static final int EVREventType_VREvent_ButtonUnpress = 201; - /** native declaration : headers\openvr_capi.h:485 */ - public static final int EVREventType_VREvent_ButtonTouch = 202; - /** native declaration : headers\openvr_capi.h:486 */ - public static final int EVREventType_VREvent_ButtonUntouch = 203; - /** native declaration : headers\openvr_capi.h:487 */ - public static final int EVREventType_VREvent_DualAnalog_Press = 250; - /** native declaration : headers\openvr_capi.h:488 */ - public static final int EVREventType_VREvent_DualAnalog_Unpress = 251; - /** native declaration : headers\openvr_capi.h:489 */ - public static final int EVREventType_VREvent_DualAnalog_Touch = 252; - /** native declaration : headers\openvr_capi.h:490 */ - public static final int EVREventType_VREvent_DualAnalog_Untouch = 253; - /** native declaration : headers\openvr_capi.h:491 */ - public static final int EVREventType_VREvent_DualAnalog_Move = 254; - /** native declaration : headers\openvr_capi.h:492 */ - public static final int EVREventType_VREvent_DualAnalog_ModeSwitch1 = 255; - /** native declaration : headers\openvr_capi.h:493 */ - public static final int EVREventType_VREvent_DualAnalog_ModeSwitch2 = 256; - /** native declaration : headers\openvr_capi.h:494 */ - public static final int EVREventType_VREvent_DualAnalog_Cancel = 257; - /** native declaration : headers\openvr_capi.h:495 */ - public static final int EVREventType_VREvent_MouseMove = 300; - /** native declaration : headers\openvr_capi.h:496 */ - public static final int EVREventType_VREvent_MouseButtonDown = 301; - /** native declaration : headers\openvr_capi.h:497 */ - public static final int EVREventType_VREvent_MouseButtonUp = 302; - /** native declaration : headers\openvr_capi.h:498 */ - public static final int EVREventType_VREvent_FocusEnter = 303; - /** native declaration : headers\openvr_capi.h:499 */ - public static final int EVREventType_VREvent_FocusLeave = 304; - /** native declaration : headers\openvr_capi.h:500 */ - public static final int EVREventType_VREvent_Scroll = 305; - /** native declaration : headers\openvr_capi.h:501 */ - public static final int EVREventType_VREvent_TouchPadMove = 306; - /** native declaration : headers\openvr_capi.h:502 */ - public static final int EVREventType_VREvent_OverlayFocusChanged = 307; - /** native declaration : headers\openvr_capi.h:503 */ - public static final int EVREventType_VREvent_InputFocusCaptured = 400; - /** native declaration : headers\openvr_capi.h:504 */ - public static final int EVREventType_VREvent_InputFocusReleased = 401; - /** native declaration : headers\openvr_capi.h:505 */ - public static final int EVREventType_VREvent_SceneFocusLost = 402; - /** native declaration : headers\openvr_capi.h:506 */ - public static final int EVREventType_VREvent_SceneFocusGained = 403; - /** native declaration : headers\openvr_capi.h:507 */ - public static final int EVREventType_VREvent_SceneApplicationChanged = 404; - /** native declaration : headers\openvr_capi.h:508 */ - public static final int EVREventType_VREvent_SceneFocusChanged = 405; - /** native declaration : headers\openvr_capi.h:509 */ - public static final int EVREventType_VREvent_InputFocusChanged = 406; - /** native declaration : headers\openvr_capi.h:510 */ - public static final int EVREventType_VREvent_SceneApplicationSecondaryRenderingStarted = 407; - /** native declaration : headers\openvr_capi.h:511 */ - public static final int EVREventType_VREvent_SceneApplicationUsingWrongGraphicsAdapter = 408; - /** native declaration : headers\openvr_capi.h:512 */ - public static final int EVREventType_VREvent_ActionBindingReloaded = 409; - /** native declaration : headers\openvr_capi.h:513 */ - public static final int EVREventType_VREvent_HideRenderModels = 410; - /** native declaration : headers\openvr_capi.h:514 */ - public static final int EVREventType_VREvent_ShowRenderModels = 411; - /** native declaration : headers\openvr_capi.h:515 */ - public static final int EVREventType_VREvent_ConsoleOpened = 420; - /** native declaration : headers\openvr_capi.h:516 */ - public static final int EVREventType_VREvent_ConsoleClosed = 421; - /** native declaration : headers\openvr_capi.h:517 */ - public static final int EVREventType_VREvent_OverlayShown = 500; - /** native declaration : headers\openvr_capi.h:518 */ - public static final int EVREventType_VREvent_OverlayHidden = 501; - /** native declaration : headers\openvr_capi.h:519 */ - public static final int EVREventType_VREvent_DashboardActivated = 502; - /** native declaration : headers\openvr_capi.h:520 */ - public static final int EVREventType_VREvent_DashboardDeactivated = 503; - /** native declaration : headers\openvr_capi.h:521 */ - public static final int EVREventType_VREvent_DashboardThumbSelected = 504; - /** native declaration : headers\openvr_capi.h:522 */ - public static final int EVREventType_VREvent_DashboardRequested = 505; - /** native declaration : headers\openvr_capi.h:523 */ - public static final int EVREventType_VREvent_ResetDashboard = 506; - /** native declaration : headers\openvr_capi.h:524 */ - public static final int EVREventType_VREvent_RenderToast = 507; - /** native declaration : headers\openvr_capi.h:525 */ - public static final int EVREventType_VREvent_ImageLoaded = 508; - /** native declaration : headers\openvr_capi.h:526 */ - public static final int EVREventType_VREvent_ShowKeyboard = 509; - /** native declaration : headers\openvr_capi.h:527 */ - public static final int EVREventType_VREvent_HideKeyboard = 510; - /** native declaration : headers\openvr_capi.h:528 */ - public static final int EVREventType_VREvent_OverlayGamepadFocusGained = 511; - /** native declaration : headers\openvr_capi.h:529 */ - public static final int EVREventType_VREvent_OverlayGamepadFocusLost = 512; - /** native declaration : headers\openvr_capi.h:530 */ - public static final int EVREventType_VREvent_OverlaySharedTextureChanged = 513; - /** native declaration : headers\openvr_capi.h:531 */ - public static final int EVREventType_VREvent_ScreenshotTriggered = 516; - /** native declaration : headers\openvr_capi.h:532 */ - public static final int EVREventType_VREvent_ImageFailed = 517; - /** native declaration : headers\openvr_capi.h:533 */ - public static final int EVREventType_VREvent_DashboardOverlayCreated = 518; - /** native declaration : headers\openvr_capi.h:534 */ - public static final int EVREventType_VREvent_SwitchGamepadFocus = 519; - /** native declaration : headers\openvr_capi.h:535 */ - public static final int EVREventType_VREvent_RequestScreenshot = 520; - /** native declaration : headers\openvr_capi.h:536 */ - public static final int EVREventType_VREvent_ScreenshotTaken = 521; - /** native declaration : headers\openvr_capi.h:537 */ - public static final int EVREventType_VREvent_ScreenshotFailed = 522; - /** native declaration : headers\openvr_capi.h:538 */ - public static final int EVREventType_VREvent_SubmitScreenshotToDashboard = 523; - /** native declaration : headers\openvr_capi.h:539 */ - public static final int EVREventType_VREvent_ScreenshotProgressToDashboard = 524; - /** native declaration : headers\openvr_capi.h:540 */ - public static final int EVREventType_VREvent_PrimaryDashboardDeviceChanged = 525; - /** native declaration : headers\openvr_capi.h:541 */ - public static final int EVREventType_VREvent_RoomViewShown = 526; - /** native declaration : headers\openvr_capi.h:542 */ - public static final int EVREventType_VREvent_RoomViewHidden = 527; - /** native declaration : headers\openvr_capi.h:543 */ - public static final int EVREventType_VREvent_Notification_Shown = 600; - /** native declaration : headers\openvr_capi.h:544 */ - public static final int EVREventType_VREvent_Notification_Hidden = 601; - /** native declaration : headers\openvr_capi.h:545 */ - public static final int EVREventType_VREvent_Notification_BeginInteraction = 602; - /** native declaration : headers\openvr_capi.h:546 */ - public static final int EVREventType_VREvent_Notification_Destroyed = 603; - /** native declaration : headers\openvr_capi.h:547 */ - public static final int EVREventType_VREvent_Quit = 700; - /** native declaration : headers\openvr_capi.h:548 */ - public static final int EVREventType_VREvent_ProcessQuit = 701; - /** native declaration : headers\openvr_capi.h:549 */ - public static final int EVREventType_VREvent_QuitAborted_UserPrompt = 702; - /** native declaration : headers\openvr_capi.h:550 */ - public static final int EVREventType_VREvent_QuitAcknowledged = 703; - /** native declaration : headers\openvr_capi.h:551 */ - public static final int EVREventType_VREvent_DriverRequestedQuit = 704; - /** native declaration : headers\openvr_capi.h:552 */ - public static final int EVREventType_VREvent_ChaperoneDataHasChanged = 800; - /** native declaration : headers\openvr_capi.h:553 */ - public static final int EVREventType_VREvent_ChaperoneUniverseHasChanged = 801; - /** native declaration : headers\openvr_capi.h:554 */ - public static final int EVREventType_VREvent_ChaperoneTempDataHasChanged = 802; - /** native declaration : headers\openvr_capi.h:555 */ - public static final int EVREventType_VREvent_ChaperoneSettingsHaveChanged = 803; - /** native declaration : headers\openvr_capi.h:556 */ - public static final int EVREventType_VREvent_SeatedZeroPoseReset = 804; - /** native declaration : headers\openvr_capi.h:557 */ - public static final int EVREventType_VREvent_AudioSettingsHaveChanged = 820; - /** native declaration : headers\openvr_capi.h:558 */ - public static final int EVREventType_VREvent_BackgroundSettingHasChanged = 850; - /** native declaration : headers\openvr_capi.h:559 */ - public static final int EVREventType_VREvent_CameraSettingsHaveChanged = 851; - /** native declaration : headers\openvr_capi.h:560 */ - public static final int EVREventType_VREvent_ReprojectionSettingHasChanged = 852; - /** native declaration : headers\openvr_capi.h:561 */ - public static final int EVREventType_VREvent_ModelSkinSettingsHaveChanged = 853; - /** native declaration : headers\openvr_capi.h:562 */ - public static final int EVREventType_VREvent_EnvironmentSettingsHaveChanged = 854; - /** native declaration : headers\openvr_capi.h:563 */ - public static final int EVREventType_VREvent_PowerSettingsHaveChanged = 855; - /** native declaration : headers\openvr_capi.h:564 */ - public static final int EVREventType_VREvent_EnableHomeAppSettingsHaveChanged = 856; - /** native declaration : headers\openvr_capi.h:565 */ - public static final int EVREventType_VREvent_SteamVRSectionSettingChanged = 857; - /** native declaration : headers\openvr_capi.h:566 */ - public static final int EVREventType_VREvent_LighthouseSectionSettingChanged = 858; - /** native declaration : headers\openvr_capi.h:567 */ - public static final int EVREventType_VREvent_NullSectionSettingChanged = 859; - /** native declaration : headers\openvr_capi.h:568 */ - public static final int EVREventType_VREvent_UserInterfaceSectionSettingChanged = 860; - /** native declaration : headers\openvr_capi.h:569 */ - public static final int EVREventType_VREvent_NotificationsSectionSettingChanged = 861; - /** native declaration : headers\openvr_capi.h:570 */ - public static final int EVREventType_VREvent_KeyboardSectionSettingChanged = 862; - /** native declaration : headers\openvr_capi.h:571 */ - public static final int EVREventType_VREvent_PerfSectionSettingChanged = 863; - /** native declaration : headers\openvr_capi.h:572 */ - public static final int EVREventType_VREvent_DashboardSectionSettingChanged = 864; - /** native declaration : headers\openvr_capi.h:573 */ - public static final int EVREventType_VREvent_WebInterfaceSectionSettingChanged = 865; - /** native declaration : headers\openvr_capi.h:574 */ - public static final int EVREventType_VREvent_TrackersSectionSettingChanged = 866; - /** native declaration : headers\openvr_capi.h:575 */ - public static final int EVREventType_VREvent_StatusUpdate = 900; - /** native declaration : headers\openvr_capi.h:576 */ - public static final int EVREventType_VREvent_WebInterface_InstallDriverCompleted = 950; - /** native declaration : headers\openvr_capi.h:577 */ - public static final int EVREventType_VREvent_MCImageUpdated = 1000; - /** native declaration : headers\openvr_capi.h:578 */ - public static final int EVREventType_VREvent_FirmwareUpdateStarted = 1100; - /** native declaration : headers\openvr_capi.h:579 */ - public static final int EVREventType_VREvent_FirmwareUpdateFinished = 1101; - /** native declaration : headers\openvr_capi.h:580 */ - public static final int EVREventType_VREvent_KeyboardClosed = 1200; - /** native declaration : headers\openvr_capi.h:581 */ - public static final int EVREventType_VREvent_KeyboardCharInput = 1201; - /** native declaration : headers\openvr_capi.h:582 */ - public static final int EVREventType_VREvent_KeyboardDone = 1202; - /** native declaration : headers\openvr_capi.h:583 */ - public static final int EVREventType_VREvent_ApplicationTransitionStarted = 1300; - /** native declaration : headers\openvr_capi.h:584 */ - public static final int EVREventType_VREvent_ApplicationTransitionAborted = 1301; - /** native declaration : headers\openvr_capi.h:585 */ - public static final int EVREventType_VREvent_ApplicationTransitionNewAppStarted = 1302; - /** native declaration : headers\openvr_capi.h:586 */ - public static final int EVREventType_VREvent_ApplicationListUpdated = 1303; - /** native declaration : headers\openvr_capi.h:587 */ - public static final int EVREventType_VREvent_ApplicationMimeTypeLoad = 1304; - /** native declaration : headers\openvr_capi.h:588 */ - public static final int EVREventType_VREvent_ApplicationTransitionNewAppLaunchComplete = 1305; - /** native declaration : headers\openvr_capi.h:589 */ - public static final int EVREventType_VREvent_ProcessConnected = 1306; - /** native declaration : headers\openvr_capi.h:590 */ - public static final int EVREventType_VREvent_ProcessDisconnected = 1307; - /** native declaration : headers\openvr_capi.h:591 */ - public static final int EVREventType_VREvent_Compositor_MirrorWindowShown = 1400; - /** native declaration : headers\openvr_capi.h:592 */ - public static final int EVREventType_VREvent_Compositor_MirrorWindowHidden = 1401; - /** native declaration : headers\openvr_capi.h:593 */ - public static final int EVREventType_VREvent_Compositor_ChaperoneBoundsShown = 1410; - /** native declaration : headers\openvr_capi.h:594 */ - public static final int EVREventType_VREvent_Compositor_ChaperoneBoundsHidden = 1411; - /** native declaration : headers\openvr_capi.h:595 */ - public static final int EVREventType_VREvent_TrackedCamera_StartVideoStream = 1500; - /** native declaration : headers\openvr_capi.h:596 */ - public static final int EVREventType_VREvent_TrackedCamera_StopVideoStream = 1501; - /** native declaration : headers\openvr_capi.h:597 */ - public static final int EVREventType_VREvent_TrackedCamera_PauseVideoStream = 1502; - /** native declaration : headers\openvr_capi.h:598 */ - public static final int EVREventType_VREvent_TrackedCamera_ResumeVideoStream = 1503; - /** native declaration : headers\openvr_capi.h:599 */ - public static final int EVREventType_VREvent_TrackedCamera_EditingSurface = 1550; - /** native declaration : headers\openvr_capi.h:600 */ - public static final int EVREventType_VREvent_PerformanceTest_EnableCapture = 1600; - /** native declaration : headers\openvr_capi.h:601 */ - public static final int EVREventType_VREvent_PerformanceTest_DisableCapture = 1601; - /** native declaration : headers\openvr_capi.h:602 */ - public static final int EVREventType_VREvent_PerformanceTest_FidelityLevel = 1602; - /** native declaration : headers\openvr_capi.h:603 */ - public static final int EVREventType_VREvent_MessageOverlay_Closed = 1650; - /** native declaration : headers\openvr_capi.h:604 */ - public static final int EVREventType_VREvent_MessageOverlayCloseRequested = 1651; - /** native declaration : headers\openvr_capi.h:605 */ - public static final int EVREventType_VREvent_Input_HapticVibration = 1700; - /** native declaration : headers\openvr_capi.h:606 */ - public static final int EVREventType_VREvent_Input_BindingLoadFailed = 1701; - /** native declaration : headers\openvr_capi.h:607 */ - public static final int EVREventType_VREvent_Input_BindingLoadSuccessful = 1702; - /** native declaration : headers\openvr_capi.h:608 */ - public static final int EVREventType_VREvent_Input_ActionManifestReloaded = 1703; - /** native declaration : headers\openvr_capi.h:609 */ - public static final int EVREventType_VREvent_Input_ActionManifestLoadFailed = 1704; - /** native declaration : headers\openvr_capi.h:610 */ - public static final int EVREventType_VREvent_SpatialAnchors_PoseUpdated = 1800; - /** native declaration : headers\openvr_capi.h:611 */ - public static final int EVREventType_VREvent_SpatialAnchors_DescriptorUpdated = 1801; - /** native declaration : headers\openvr_capi.h:612 */ - public static final int EVREventType_VREvent_SpatialAnchors_RequestPoseUpdate = 1802; - /** native declaration : headers\openvr_capi.h:613 */ - public static final int EVREventType_VREvent_SpatialAnchors_RequestDescriptorUpdate = 1803; - /** native declaration : headers\openvr_capi.h:614 */ - public static final int EVREventType_VREvent_VendorSpecific_Reserved_Start = 10000; - /** native declaration : headers\openvr_capi.h:615 */ - public static final int EVREventType_VREvent_VendorSpecific_Reserved_End = 19999; - }; - /** - * native declaration : headers\openvr_capi.h:623
- * enum values - */ - public static interface EDeviceActivityLevel { - /** native declaration : headers\openvr_capi.h:618 */ - public static final int EDeviceActivityLevel_k_EDeviceActivityLevel_Unknown = -1; - /** native declaration : headers\openvr_capi.h:619 */ - public static final int EDeviceActivityLevel_k_EDeviceActivityLevel_Idle = 0; - /** native declaration : headers\openvr_capi.h:620 */ - public static final int EDeviceActivityLevel_k_EDeviceActivityLevel_UserInteraction = 1; - /** native declaration : headers\openvr_capi.h:621 */ - public static final int EDeviceActivityLevel_k_EDeviceActivityLevel_UserInteraction_Timeout = 2; - /** native declaration : headers\openvr_capi.h:622 */ - public static final int EDeviceActivityLevel_k_EDeviceActivityLevel_Standby = 3; - }; - /** - * native declaration : headers\openvr_capi.h:646
- * enum values - */ - public static interface EVRButtonId { - /** native declaration : headers\openvr_capi.h:625 */ - public static final int EVRButtonId_k_EButton_System = 0; - /** native declaration : headers\openvr_capi.h:626 */ - public static final int EVRButtonId_k_EButton_ApplicationMenu = 1; - /** native declaration : headers\openvr_capi.h:627 */ - public static final int EVRButtonId_k_EButton_Grip = 2; - /** native declaration : headers\openvr_capi.h:628 */ - public static final int EVRButtonId_k_EButton_DPad_Left = 3; - /** native declaration : headers\openvr_capi.h:629 */ - public static final int EVRButtonId_k_EButton_DPad_Up = 4; - /** native declaration : headers\openvr_capi.h:630 */ - public static final int EVRButtonId_k_EButton_DPad_Right = 5; - /** native declaration : headers\openvr_capi.h:631 */ - public static final int EVRButtonId_k_EButton_DPad_Down = 6; - /** native declaration : headers\openvr_capi.h:632 */ - public static final int EVRButtonId_k_EButton_A = 7; - /** native declaration : headers\openvr_capi.h:633 */ - public static final int EVRButtonId_k_EButton_ProximitySensor = 31; - /** native declaration : headers\openvr_capi.h:634 */ - public static final int EVRButtonId_k_EButton_Axis0 = 32; - /** native declaration : headers\openvr_capi.h:635 */ - public static final int EVRButtonId_k_EButton_Axis1 = 33; - /** native declaration : headers\openvr_capi.h:636 */ - public static final int EVRButtonId_k_EButton_Axis2 = 34; - /** native declaration : headers\openvr_capi.h:637 */ - public static final int EVRButtonId_k_EButton_Axis3 = 35; - /** native declaration : headers\openvr_capi.h:638 */ - public static final int EVRButtonId_k_EButton_Axis4 = 36; - /** native declaration : headers\openvr_capi.h:639 */ - public static final int EVRButtonId_k_EButton_SteamVR_Touchpad = 32; - /** native declaration : headers\openvr_capi.h:640 */ - public static final int EVRButtonId_k_EButton_SteamVR_Trigger = 33; - /** native declaration : headers\openvr_capi.h:641 */ - public static final int EVRButtonId_k_EButton_Dashboard_Back = 2; - /** native declaration : headers\openvr_capi.h:642 */ - public static final int EVRButtonId_k_EButton_Knuckles_A = 2; - /** native declaration : headers\openvr_capi.h:643 */ - public static final int EVRButtonId_k_EButton_Knuckles_B = 1; - /** native declaration : headers\openvr_capi.h:644 */ - public static final int EVRButtonId_k_EButton_Knuckles_JoyStick = 35; - /** native declaration : headers\openvr_capi.h:645 */ - public static final int EVRButtonId_k_EButton_Max = 64; - }; - /** - * native declaration : headers\openvr_capi.h:651
- * enum values - */ - public static interface EVRMouseButton { - /** native declaration : headers\openvr_capi.h:648 */ - public static final int EVRMouseButton_VRMouseButton_Left = 1; - /** native declaration : headers\openvr_capi.h:649 */ - public static final int EVRMouseButton_VRMouseButton_Right = 2; - /** native declaration : headers\openvr_capi.h:650 */ - public static final int EVRMouseButton_VRMouseButton_Middle = 4; - }; - /** - * native declaration : headers\openvr_capi.h:655
- * enum values - */ - public static interface EDualAnalogWhich { - /** native declaration : headers\openvr_capi.h:653 */ - public static final int EDualAnalogWhich_k_EDualAnalog_Left = 0; - /** native declaration : headers\openvr_capi.h:654 */ - public static final int EDualAnalogWhich_k_EDualAnalog_Right = 1; - }; - /** - * native declaration : headers\openvr_capi.h:674
- * enum values - */ - public static interface EVRInputError { - /** native declaration : headers\openvr_capi.h:657 */ - public static final int EVRInputError_VRInputError_None = 0; - /** native declaration : headers\openvr_capi.h:658 */ - public static final int EVRInputError_VRInputError_NameNotFound = 1; - /** native declaration : headers\openvr_capi.h:659 */ - public static final int EVRInputError_VRInputError_WrongType = 2; - /** native declaration : headers\openvr_capi.h:660 */ - public static final int EVRInputError_VRInputError_InvalidHandle = 3; - /** native declaration : headers\openvr_capi.h:661 */ - public static final int EVRInputError_VRInputError_InvalidParam = 4; - /** native declaration : headers\openvr_capi.h:662 */ - public static final int EVRInputError_VRInputError_NoSteam = 5; - /** native declaration : headers\openvr_capi.h:663 */ - public static final int EVRInputError_VRInputError_MaxCapacityReached = 6; - /** native declaration : headers\openvr_capi.h:664 */ - public static final int EVRInputError_VRInputError_IPCError = 7; - /** native declaration : headers\openvr_capi.h:665 */ - public static final int EVRInputError_VRInputError_NoActiveActionSet = 8; - /** native declaration : headers\openvr_capi.h:666 */ - public static final int EVRInputError_VRInputError_InvalidDevice = 9; - /** native declaration : headers\openvr_capi.h:667 */ - public static final int EVRInputError_VRInputError_InvalidSkeleton = 10; - /** native declaration : headers\openvr_capi.h:668 */ - public static final int EVRInputError_VRInputError_InvalidBoneCount = 11; - /** native declaration : headers\openvr_capi.h:669 */ - public static final int EVRInputError_VRInputError_InvalidCompressedData = 12; - /** native declaration : headers\openvr_capi.h:670 */ - public static final int EVRInputError_VRInputError_NoData = 13; - /** native declaration : headers\openvr_capi.h:671 */ - public static final int EVRInputError_VRInputError_BufferTooSmall = 14; - /** native declaration : headers\openvr_capi.h:672 */ - public static final int EVRInputError_VRInputError_MismatchedActionManifest = 15; - /** native declaration : headers\openvr_capi.h:673 */ - public static final int EVRInputError_VRInputError_MissingSkeletonData = 16; - }; - /** - * native declaration : headers\openvr_capi.h:690
- * enum values - */ - public static interface EVRSpatialAnchorError { - /** native declaration : headers\openvr_capi.h:676 */ - public static final int EVRSpatialAnchorError_VRSpatialAnchorError_Success = 0; - /** native declaration : headers\openvr_capi.h:677 */ - public static final int EVRSpatialAnchorError_VRSpatialAnchorError_Internal = 1; - /** native declaration : headers\openvr_capi.h:678 */ - public static final int EVRSpatialAnchorError_VRSpatialAnchorError_UnknownHandle = 2; - /** native declaration : headers\openvr_capi.h:679 */ - public static final int EVRSpatialAnchorError_VRSpatialAnchorError_ArrayTooSmall = 3; - /** native declaration : headers\openvr_capi.h:680 */ - public static final int EVRSpatialAnchorError_VRSpatialAnchorError_InvalidDescriptorChar = 4; - /** native declaration : headers\openvr_capi.h:681 */ - public static final int EVRSpatialAnchorError_VRSpatialAnchorError_NotYetAvailable = 5; - /** native declaration : headers\openvr_capi.h:682 */ - public static final int EVRSpatialAnchorError_VRSpatialAnchorError_NotAvailableInThisUniverse = 6; - /** native declaration : headers\openvr_capi.h:683 */ - public static final int EVRSpatialAnchorError_VRSpatialAnchorError_PermanentlyUnavailable = 7; - /** native declaration : headers\openvr_capi.h:684 */ - public static final int EVRSpatialAnchorError_VRSpatialAnchorError_WrongDriver = 8; - /** native declaration : headers\openvr_capi.h:685 */ - public static final int EVRSpatialAnchorError_VRSpatialAnchorError_DescriptorTooLong = 9; - /** native declaration : headers\openvr_capi.h:686 */ - public static final int EVRSpatialAnchorError_VRSpatialAnchorError_Unknown = 10; - /** native declaration : headers\openvr_capi.h:687 */ - public static final int EVRSpatialAnchorError_VRSpatialAnchorError_NoRoomCalibration = 11; - /** native declaration : headers\openvr_capi.h:688 */ - public static final int EVRSpatialAnchorError_VRSpatialAnchorError_InvalidArgument = 12; - /** native declaration : headers\openvr_capi.h:689 */ - public static final int EVRSpatialAnchorError_VRSpatialAnchorError_UnknownDriver = 13; - }; - /** - * native declaration : headers\openvr_capi.h:696
- * enum values - */ - public static interface EHiddenAreaMeshType { - /** native declaration : headers\openvr_capi.h:692 */ - public static final int EHiddenAreaMeshType_k_eHiddenAreaMesh_Standard = 0; - /** native declaration : headers\openvr_capi.h:693 */ - public static final int EHiddenAreaMeshType_k_eHiddenAreaMesh_Inverse = 1; - /** native declaration : headers\openvr_capi.h:694 */ - public static final int EHiddenAreaMeshType_k_eHiddenAreaMesh_LineLoop = 2; - /** native declaration : headers\openvr_capi.h:695 */ - public static final int EHiddenAreaMeshType_k_eHiddenAreaMesh_Max = 3; - }; - /** - * native declaration : headers\openvr_capi.h:702
- * enum values - */ - public static interface EVRControllerAxisType { - /** native declaration : headers\openvr_capi.h:698 */ - public static final int EVRControllerAxisType_k_eControllerAxis_None = 0; - /** native declaration : headers\openvr_capi.h:699 */ - public static final int EVRControllerAxisType_k_eControllerAxis_TrackPad = 1; - /** native declaration : headers\openvr_capi.h:700 */ - public static final int EVRControllerAxisType_k_eControllerAxis_Joystick = 2; - /** native declaration : headers\openvr_capi.h:701 */ - public static final int EVRControllerAxisType_k_eControllerAxis_Trigger = 3; - }; - /** - * native declaration : headers\openvr_capi.h:706
- * enum values - */ - public static interface EVRControllerEventOutputType { - /** native declaration : headers\openvr_capi.h:704 */ - public static final int EVRControllerEventOutputType_ControllerEventOutput_OSEvents = 0; - /** native declaration : headers\openvr_capi.h:705 */ - public static final int EVRControllerEventOutputType_ControllerEventOutput_VREvents = 1; - }; - /** - * native declaration : headers\openvr_capi.h:714
- * enum values - */ - public static interface ECollisionBoundsStyle { - /** native declaration : headers\openvr_capi.h:708 */ - public static final int ECollisionBoundsStyle_COLLISION_BOUNDS_STYLE_BEGINNER = 0; - /** native declaration : headers\openvr_capi.h:709 */ - public static final int ECollisionBoundsStyle_COLLISION_BOUNDS_STYLE_INTERMEDIATE = 1; - /** native declaration : headers\openvr_capi.h:710 */ - public static final int ECollisionBoundsStyle_COLLISION_BOUNDS_STYLE_SQUARES = 2; - /** native declaration : headers\openvr_capi.h:711 */ - public static final int ECollisionBoundsStyle_COLLISION_BOUNDS_STYLE_ADVANCED = 3; - /** native declaration : headers\openvr_capi.h:712 */ - public static final int ECollisionBoundsStyle_COLLISION_BOUNDS_STYLE_NONE = 4; - /** native declaration : headers\openvr_capi.h:713 */ - public static final int ECollisionBoundsStyle_COLLISION_BOUNDS_STYLE_COUNT = 5; - }; - /** - * native declaration : headers\openvr_capi.h:740
- * enum values - */ - public static interface EVROverlayError { - /** native declaration : headers\openvr_capi.h:716 */ - public static final int EVROverlayError_VROverlayError_None = 0; - /** native declaration : headers\openvr_capi.h:717 */ - public static final int EVROverlayError_VROverlayError_UnknownOverlay = 10; - /** native declaration : headers\openvr_capi.h:718 */ - public static final int EVROverlayError_VROverlayError_InvalidHandle = 11; - /** native declaration : headers\openvr_capi.h:719 */ - public static final int EVROverlayError_VROverlayError_PermissionDenied = 12; - /** native declaration : headers\openvr_capi.h:720 */ - public static final int EVROverlayError_VROverlayError_OverlayLimitExceeded = 13; - /** native declaration : headers\openvr_capi.h:721 */ - public static final int EVROverlayError_VROverlayError_WrongVisibilityType = 14; - /** native declaration : headers\openvr_capi.h:722 */ - public static final int EVROverlayError_VROverlayError_KeyTooLong = 15; - /** native declaration : headers\openvr_capi.h:723 */ - public static final int EVROverlayError_VROverlayError_NameTooLong = 16; - /** native declaration : headers\openvr_capi.h:724 */ - public static final int EVROverlayError_VROverlayError_KeyInUse = 17; - /** native declaration : headers\openvr_capi.h:725 */ - public static final int EVROverlayError_VROverlayError_WrongTransformType = 18; - /** native declaration : headers\openvr_capi.h:726 */ - public static final int EVROverlayError_VROverlayError_InvalidTrackedDevice = 19; - /** native declaration : headers\openvr_capi.h:727 */ - public static final int EVROverlayError_VROverlayError_InvalidParameter = 20; - /** native declaration : headers\openvr_capi.h:728 */ - public static final int EVROverlayError_VROverlayError_ThumbnailCantBeDestroyed = 21; - /** native declaration : headers\openvr_capi.h:729 */ - public static final int EVROverlayError_VROverlayError_ArrayTooSmall = 22; - /** native declaration : headers\openvr_capi.h:730 */ - public static final int EVROverlayError_VROverlayError_RequestFailed = 23; - /** native declaration : headers\openvr_capi.h:731 */ - public static final int EVROverlayError_VROverlayError_InvalidTexture = 24; - /** native declaration : headers\openvr_capi.h:732 */ - public static final int EVROverlayError_VROverlayError_UnableToLoadFile = 25; - /** native declaration : headers\openvr_capi.h:733 */ - public static final int EVROverlayError_VROverlayError_KeyboardAlreadyInUse = 26; - /** native declaration : headers\openvr_capi.h:734 */ - public static final int EVROverlayError_VROverlayError_NoNeighbor = 27; - /** native declaration : headers\openvr_capi.h:735 */ - public static final int EVROverlayError_VROverlayError_TooManyMaskPrimitives = 29; - /** native declaration : headers\openvr_capi.h:736 */ - public static final int EVROverlayError_VROverlayError_BadMaskPrimitive = 30; - /** native declaration : headers\openvr_capi.h:737 */ - public static final int EVROverlayError_VROverlayError_TextureAlreadyLocked = 31; - /** native declaration : headers\openvr_capi.h:738 */ - public static final int EVROverlayError_VROverlayError_TextureLockCapacityReached = 32; - /** native declaration : headers\openvr_capi.h:739 */ - public static final int EVROverlayError_VROverlayError_TextureNotLocked = 33; - }; - /** - * native declaration : headers\openvr_capi.h:751
- * enum values - */ - public static interface EVRApplicationType { - /** native declaration : headers\openvr_capi.h:742 */ - public static final int EVRApplicationType_VRApplication_Other = 0; - /** native declaration : headers\openvr_capi.h:743 */ - public static final int EVRApplicationType_VRApplication_Scene = 1; - /** native declaration : headers\openvr_capi.h:744 */ - public static final int EVRApplicationType_VRApplication_Overlay = 2; - /** native declaration : headers\openvr_capi.h:745 */ - public static final int EVRApplicationType_VRApplication_Background = 3; - /** native declaration : headers\openvr_capi.h:746 */ - public static final int EVRApplicationType_VRApplication_Utility = 4; - /** native declaration : headers\openvr_capi.h:747 */ - public static final int EVRApplicationType_VRApplication_VRMonitor = 5; - /** native declaration : headers\openvr_capi.h:748 */ - public static final int EVRApplicationType_VRApplication_SteamWatchdog = 6; - /** native declaration : headers\openvr_capi.h:749 */ - public static final int EVRApplicationType_VRApplication_Bootstrapper = 7; - /** native declaration : headers\openvr_capi.h:750 */ - public static final int EVRApplicationType_VRApplication_Max = 8; - }; - /** - * native declaration : headers\openvr_capi.h:756
- * enum values - */ - public static interface EVRFirmwareError { - /** native declaration : headers\openvr_capi.h:753 */ - public static final int EVRFirmwareError_VRFirmwareError_None = 0; - /** native declaration : headers\openvr_capi.h:754 */ - public static final int EVRFirmwareError_VRFirmwareError_Success = 1; - /** native declaration : headers\openvr_capi.h:755 */ - public static final int EVRFirmwareError_VRFirmwareError_Fail = 2; - }; - /** - * native declaration : headers\openvr_capi.h:763
- * enum values - */ - public static interface EVRNotificationError { - /** native declaration : headers\openvr_capi.h:758 */ - public static final int EVRNotificationError_VRNotificationError_OK = 0; - /** native declaration : headers\openvr_capi.h:759 */ - public static final int EVRNotificationError_VRNotificationError_InvalidNotificationId = 100; - /** native declaration : headers\openvr_capi.h:760 */ - public static final int EVRNotificationError_VRNotificationError_NotificationQueueFull = 101; - /** native declaration : headers\openvr_capi.h:761 */ - public static final int EVRNotificationError_VRNotificationError_InvalidOverlayHandle = 102; - /** native declaration : headers\openvr_capi.h:762 */ - public static final int EVRNotificationError_VRNotificationError_SystemWithUserValueAlreadyExists = 103; - }; - /** - * native declaration : headers\openvr_capi.h:767
- * enum values - */ - public static interface EVRSkeletalMotionRange { - /** native declaration : headers\openvr_capi.h:765 */ - public static final int EVRSkeletalMotionRange_VRSkeletalMotionRange_WithController = 0; - /** native declaration : headers\openvr_capi.h:766 */ - public static final int EVRSkeletalMotionRange_VRSkeletalMotionRange_WithoutController = 1; - }; - /** - * native declaration : headers\openvr_capi.h:857
- * enum values - */ - public static interface EVRInitError { - /** native declaration : headers\openvr_capi.h:769 */ - public static final int EVRInitError_VRInitError_None = 0; - /** native declaration : headers\openvr_capi.h:770 */ - public static final int EVRInitError_VRInitError_Unknown = 1; - /** native declaration : headers\openvr_capi.h:771 */ - public static final int EVRInitError_VRInitError_Init_InstallationNotFound = 100; - /** native declaration : headers\openvr_capi.h:772 */ - public static final int EVRInitError_VRInitError_Init_InstallationCorrupt = 101; - /** native declaration : headers\openvr_capi.h:773 */ - public static final int EVRInitError_VRInitError_Init_VRClientDLLNotFound = 102; - /** native declaration : headers\openvr_capi.h:774 */ - public static final int EVRInitError_VRInitError_Init_FileNotFound = 103; - /** native declaration : headers\openvr_capi.h:775 */ - public static final int EVRInitError_VRInitError_Init_FactoryNotFound = 104; - /** native declaration : headers\openvr_capi.h:776 */ - public static final int EVRInitError_VRInitError_Init_InterfaceNotFound = 105; - /** native declaration : headers\openvr_capi.h:777 */ - public static final int EVRInitError_VRInitError_Init_InvalidInterface = 106; - /** native declaration : headers\openvr_capi.h:778 */ - public static final int EVRInitError_VRInitError_Init_UserConfigDirectoryInvalid = 107; - /** native declaration : headers\openvr_capi.h:779 */ - public static final int EVRInitError_VRInitError_Init_HmdNotFound = 108; - /** native declaration : headers\openvr_capi.h:780 */ - public static final int EVRInitError_VRInitError_Init_NotInitialized = 109; - /** native declaration : headers\openvr_capi.h:781 */ - public static final int EVRInitError_VRInitError_Init_PathRegistryNotFound = 110; - /** native declaration : headers\openvr_capi.h:782 */ - public static final int EVRInitError_VRInitError_Init_NoConfigPath = 111; - /** native declaration : headers\openvr_capi.h:783 */ - public static final int EVRInitError_VRInitError_Init_NoLogPath = 112; - /** native declaration : headers\openvr_capi.h:784 */ - public static final int EVRInitError_VRInitError_Init_PathRegistryNotWritable = 113; - /** native declaration : headers\openvr_capi.h:785 */ - public static final int EVRInitError_VRInitError_Init_AppInfoInitFailed = 114; - /** native declaration : headers\openvr_capi.h:786 */ - public static final int EVRInitError_VRInitError_Init_Retry = 115; - /** native declaration : headers\openvr_capi.h:787 */ - public static final int EVRInitError_VRInitError_Init_InitCanceledByUser = 116; - /** native declaration : headers\openvr_capi.h:788 */ - public static final int EVRInitError_VRInitError_Init_AnotherAppLaunching = 117; - /** native declaration : headers\openvr_capi.h:789 */ - public static final int EVRInitError_VRInitError_Init_SettingsInitFailed = 118; - /** native declaration : headers\openvr_capi.h:790 */ - public static final int EVRInitError_VRInitError_Init_ShuttingDown = 119; - /** native declaration : headers\openvr_capi.h:791 */ - public static final int EVRInitError_VRInitError_Init_TooManyObjects = 120; - /** native declaration : headers\openvr_capi.h:792 */ - public static final int EVRInitError_VRInitError_Init_NoServerForBackgroundApp = 121; - /** native declaration : headers\openvr_capi.h:793 */ - public static final int EVRInitError_VRInitError_Init_NotSupportedWithCompositor = 122; - /** native declaration : headers\openvr_capi.h:794 */ - public static final int EVRInitError_VRInitError_Init_NotAvailableToUtilityApps = 123; - /** native declaration : headers\openvr_capi.h:795 */ - public static final int EVRInitError_VRInitError_Init_Internal = 124; - /** native declaration : headers\openvr_capi.h:796 */ - public static final int EVRInitError_VRInitError_Init_HmdDriverIdIsNone = 125; - /** native declaration : headers\openvr_capi.h:797 */ - public static final int EVRInitError_VRInitError_Init_HmdNotFoundPresenceFailed = 126; - /** native declaration : headers\openvr_capi.h:798 */ - public static final int EVRInitError_VRInitError_Init_VRMonitorNotFound = 127; - /** native declaration : headers\openvr_capi.h:799 */ - public static final int EVRInitError_VRInitError_Init_VRMonitorStartupFailed = 128; - /** native declaration : headers\openvr_capi.h:800 */ - public static final int EVRInitError_VRInitError_Init_LowPowerWatchdogNotSupported = 129; - /** native declaration : headers\openvr_capi.h:801 */ - public static final int EVRInitError_VRInitError_Init_InvalidApplicationType = 130; - /** native declaration : headers\openvr_capi.h:802 */ - public static final int EVRInitError_VRInitError_Init_NotAvailableToWatchdogApps = 131; - /** native declaration : headers\openvr_capi.h:803 */ - public static final int EVRInitError_VRInitError_Init_WatchdogDisabledInSettings = 132; - /** native declaration : headers\openvr_capi.h:804 */ - public static final int EVRInitError_VRInitError_Init_VRDashboardNotFound = 133; - /** native declaration : headers\openvr_capi.h:805 */ - public static final int EVRInitError_VRInitError_Init_VRDashboardStartupFailed = 134; - /** native declaration : headers\openvr_capi.h:806 */ - public static final int EVRInitError_VRInitError_Init_VRHomeNotFound = 135; - /** native declaration : headers\openvr_capi.h:807 */ - public static final int EVRInitError_VRInitError_Init_VRHomeStartupFailed = 136; - /** native declaration : headers\openvr_capi.h:808 */ - public static final int EVRInitError_VRInitError_Init_RebootingBusy = 137; - /** native declaration : headers\openvr_capi.h:809 */ - public static final int EVRInitError_VRInitError_Init_FirmwareUpdateBusy = 138; - /** native declaration : headers\openvr_capi.h:810 */ - public static final int EVRInitError_VRInitError_Init_FirmwareRecoveryBusy = 139; - /** native declaration : headers\openvr_capi.h:811 */ - public static final int EVRInitError_VRInitError_Init_USBServiceBusy = 140; - /** native declaration : headers\openvr_capi.h:812 */ - public static final int EVRInitError_VRInitError_Init_VRWebHelperStartupFailed = 141; - /** native declaration : headers\openvr_capi.h:813 */ - public static final int EVRInitError_VRInitError_Init_TrackerManagerInitFailed = 142; - /** native declaration : headers\openvr_capi.h:814 */ - public static final int EVRInitError_VRInitError_Driver_Failed = 200; - /** native declaration : headers\openvr_capi.h:815 */ - public static final int EVRInitError_VRInitError_Driver_Unknown = 201; - /** native declaration : headers\openvr_capi.h:816 */ - public static final int EVRInitError_VRInitError_Driver_HmdUnknown = 202; - /** native declaration : headers\openvr_capi.h:817 */ - public static final int EVRInitError_VRInitError_Driver_NotLoaded = 203; - /** native declaration : headers\openvr_capi.h:818 */ - public static final int EVRInitError_VRInitError_Driver_RuntimeOutOfDate = 204; - /** native declaration : headers\openvr_capi.h:819 */ - public static final int EVRInitError_VRInitError_Driver_HmdInUse = 205; - /** native declaration : headers\openvr_capi.h:820 */ - public static final int EVRInitError_VRInitError_Driver_NotCalibrated = 206; - /** native declaration : headers\openvr_capi.h:821 */ - public static final int EVRInitError_VRInitError_Driver_CalibrationInvalid = 207; - /** native declaration : headers\openvr_capi.h:822 */ - public static final int EVRInitError_VRInitError_Driver_HmdDisplayNotFound = 208; - /** native declaration : headers\openvr_capi.h:823 */ - public static final int EVRInitError_VRInitError_Driver_TrackedDeviceInterfaceUnknown = 209; - /** native declaration : headers\openvr_capi.h:824 */ - public static final int EVRInitError_VRInitError_Driver_HmdDriverIdOutOfBounds = 211; - /** native declaration : headers\openvr_capi.h:825 */ - public static final int EVRInitError_VRInitError_Driver_HmdDisplayMirrored = 212; - /** native declaration : headers\openvr_capi.h:826 */ - public static final int EVRInitError_VRInitError_IPC_ServerInitFailed = 300; - /** native declaration : headers\openvr_capi.h:827 */ - public static final int EVRInitError_VRInitError_IPC_ConnectFailed = 301; - /** native declaration : headers\openvr_capi.h:828 */ - public static final int EVRInitError_VRInitError_IPC_SharedStateInitFailed = 302; - /** native declaration : headers\openvr_capi.h:829 */ - public static final int EVRInitError_VRInitError_IPC_CompositorInitFailed = 303; - /** native declaration : headers\openvr_capi.h:830 */ - public static final int EVRInitError_VRInitError_IPC_MutexInitFailed = 304; - /** native declaration : headers\openvr_capi.h:831 */ - public static final int EVRInitError_VRInitError_IPC_Failed = 305; - /** native declaration : headers\openvr_capi.h:832 */ - public static final int EVRInitError_VRInitError_IPC_CompositorConnectFailed = 306; - /** native declaration : headers\openvr_capi.h:833 */ - public static final int EVRInitError_VRInitError_IPC_CompositorInvalidConnectResponse = 307; - /** native declaration : headers\openvr_capi.h:834 */ - public static final int EVRInitError_VRInitError_IPC_ConnectFailedAfterMultipleAttempts = 308; - /** native declaration : headers\openvr_capi.h:835 */ - public static final int EVRInitError_VRInitError_Compositor_Failed = 400; - /** native declaration : headers\openvr_capi.h:836 */ - public static final int EVRInitError_VRInitError_Compositor_D3D11HardwareRequired = 401; - /** native declaration : headers\openvr_capi.h:837 */ - public static final int EVRInitError_VRInitError_Compositor_FirmwareRequiresUpdate = 402; - /** native declaration : headers\openvr_capi.h:838 */ - public static final int EVRInitError_VRInitError_Compositor_OverlayInitFailed = 403; - /** native declaration : headers\openvr_capi.h:839 */ - public static final int EVRInitError_VRInitError_Compositor_ScreenshotsInitFailed = 404; - /** native declaration : headers\openvr_capi.h:840 */ - public static final int EVRInitError_VRInitError_Compositor_UnableToCreateDevice = 405; - /** native declaration : headers\openvr_capi.h:841 */ - public static final int EVRInitError_VRInitError_VendorSpecific_UnableToConnectToOculusRuntime = 1000; - /** native declaration : headers\openvr_capi.h:842 */ - public static final int EVRInitError_VRInitError_VendorSpecific_WindowsNotInDevMode = 1001; - /** native declaration : headers\openvr_capi.h:843 */ - public static final int EVRInitError_VRInitError_VendorSpecific_HmdFound_CantOpenDevice = 1101; - /** native declaration : headers\openvr_capi.h:844 */ - public static final int EVRInitError_VRInitError_VendorSpecific_HmdFound_UnableToRequestConfigStart = 1102; - /** native declaration : headers\openvr_capi.h:845 */ - public static final int EVRInitError_VRInitError_VendorSpecific_HmdFound_NoStoredConfig = 1103; - /** native declaration : headers\openvr_capi.h:846 */ - public static final int EVRInitError_VRInitError_VendorSpecific_HmdFound_ConfigTooBig = 1104; - /** native declaration : headers\openvr_capi.h:847 */ - public static final int EVRInitError_VRInitError_VendorSpecific_HmdFound_ConfigTooSmall = 1105; - /** native declaration : headers\openvr_capi.h:848 */ - public static final int EVRInitError_VRInitError_VendorSpecific_HmdFound_UnableToInitZLib = 1106; - /** native declaration : headers\openvr_capi.h:849 */ - public static final int EVRInitError_VRInitError_VendorSpecific_HmdFound_CantReadFirmwareVersion = 1107; - /** native declaration : headers\openvr_capi.h:850 */ - public static final int EVRInitError_VRInitError_VendorSpecific_HmdFound_UnableToSendUserDataStart = 1108; - /** native declaration : headers\openvr_capi.h:851 */ - public static final int EVRInitError_VRInitError_VendorSpecific_HmdFound_UnableToGetUserDataStart = 1109; - /** native declaration : headers\openvr_capi.h:852 */ - public static final int EVRInitError_VRInitError_VendorSpecific_HmdFound_UnableToGetUserDataNext = 1110; - /** native declaration : headers\openvr_capi.h:853 */ - public static final int EVRInitError_VRInitError_VendorSpecific_HmdFound_UserDataAddressRange = 1111; - /** native declaration : headers\openvr_capi.h:854 */ - public static final int EVRInitError_VRInitError_VendorSpecific_HmdFound_UserDataError = 1112; - /** native declaration : headers\openvr_capi.h:855 */ - public static final int EVRInitError_VRInitError_VendorSpecific_HmdFound_ConfigFailedSanityCheck = 1113; - /** native declaration : headers\openvr_capi.h:856 */ - public static final int EVRInitError_VRInitError_Steam_SteamInstallationNotFound = 2000; - }; - /** - * native declaration : headers\openvr_capi.h:865
- * enum values - */ - public static interface EVRScreenshotType { - /** native declaration : headers\openvr_capi.h:859 */ - public static final int EVRScreenshotType_VRScreenshotType_None = 0; - /** native declaration : headers\openvr_capi.h:860 */ - public static final int EVRScreenshotType_VRScreenshotType_Mono = 1; - /** native declaration : headers\openvr_capi.h:861 */ - public static final int EVRScreenshotType_VRScreenshotType_Stereo = 2; - /** native declaration : headers\openvr_capi.h:862 */ - public static final int EVRScreenshotType_VRScreenshotType_Cubemap = 3; - /** native declaration : headers\openvr_capi.h:863 */ - public static final int EVRScreenshotType_VRScreenshotType_MonoPanorama = 4; - /** native declaration : headers\openvr_capi.h:864 */ - public static final int EVRScreenshotType_VRScreenshotType_StereoPanorama = 5; - }; - /** - * native declaration : headers\openvr_capi.h:869
- * enum values - */ - public static interface EVRScreenshotPropertyFilenames { - /** native declaration : headers\openvr_capi.h:867 */ - public static final int EVRScreenshotPropertyFilenames_VRScreenshotPropertyFilenames_Preview = 0; - /** native declaration : headers\openvr_capi.h:868 */ - public static final int EVRScreenshotPropertyFilenames_VRScreenshotPropertyFilenames_VR = 1; - }; - /** - * native declaration : headers\openvr_capi.h:888
- * enum values - */ - public static interface EVRTrackedCameraError { - /** native declaration : headers\openvr_capi.h:871 */ - public static final int EVRTrackedCameraError_VRTrackedCameraError_None = 0; - /** native declaration : headers\openvr_capi.h:872 */ - public static final int EVRTrackedCameraError_VRTrackedCameraError_OperationFailed = 100; - /** native declaration : headers\openvr_capi.h:873 */ - public static final int EVRTrackedCameraError_VRTrackedCameraError_InvalidHandle = 101; - /** native declaration : headers\openvr_capi.h:874 */ - public static final int EVRTrackedCameraError_VRTrackedCameraError_InvalidFrameHeaderVersion = 102; - /** native declaration : headers\openvr_capi.h:875 */ - public static final int EVRTrackedCameraError_VRTrackedCameraError_OutOfHandles = 103; - /** native declaration : headers\openvr_capi.h:876 */ - public static final int EVRTrackedCameraError_VRTrackedCameraError_IPCFailure = 104; - /** native declaration : headers\openvr_capi.h:877 */ - public static final int EVRTrackedCameraError_VRTrackedCameraError_NotSupportedForThisDevice = 105; - /** native declaration : headers\openvr_capi.h:878 */ - public static final int EVRTrackedCameraError_VRTrackedCameraError_SharedMemoryFailure = 106; - /** native declaration : headers\openvr_capi.h:879 */ - public static final int EVRTrackedCameraError_VRTrackedCameraError_FrameBufferingFailure = 107; - /** native declaration : headers\openvr_capi.h:880 */ - public static final int EVRTrackedCameraError_VRTrackedCameraError_StreamSetupFailure = 108; - /** native declaration : headers\openvr_capi.h:881 */ - public static final int EVRTrackedCameraError_VRTrackedCameraError_InvalidGLTextureId = 109; - /** native declaration : headers\openvr_capi.h:882 */ - public static final int EVRTrackedCameraError_VRTrackedCameraError_InvalidSharedTextureHandle = 110; - /** native declaration : headers\openvr_capi.h:883 */ - public static final int EVRTrackedCameraError_VRTrackedCameraError_FailedToGetGLTextureId = 111; - /** native declaration : headers\openvr_capi.h:884 */ - public static final int EVRTrackedCameraError_VRTrackedCameraError_SharedTextureFailure = 112; - /** native declaration : headers\openvr_capi.h:885 */ - public static final int EVRTrackedCameraError_VRTrackedCameraError_NoFrameAvailable = 113; - /** native declaration : headers\openvr_capi.h:886 */ - public static final int EVRTrackedCameraError_VRTrackedCameraError_InvalidArgument = 114; - /** native declaration : headers\openvr_capi.h:887 */ - public static final int EVRTrackedCameraError_VRTrackedCameraError_InvalidFrameBufferSize = 115; - }; - /** - * native declaration : headers\openvr_capi.h:894
- * enum values - */ - public static interface EVRTrackedCameraFrameLayout { - /** native declaration : headers\openvr_capi.h:890 */ - public static final int EVRTrackedCameraFrameLayout_Mono = 1; - /** native declaration : headers\openvr_capi.h:891 */ - public static final int EVRTrackedCameraFrameLayout_Stereo = 2; - /** native declaration : headers\openvr_capi.h:892 */ - public static final int EVRTrackedCameraFrameLayout_VerticalLayout = 16; - /** native declaration : headers\openvr_capi.h:893 */ - public static final int EVRTrackedCameraFrameLayout_HorizontalLayout = 32; - }; - /** - * native declaration : headers\openvr_capi.h:900
- * enum values - */ - public static interface EVRTrackedCameraFrameType { - /** native declaration : headers\openvr_capi.h:896 */ - public static final int EVRTrackedCameraFrameType_VRTrackedCameraFrameType_Distorted = 0; - /** native declaration : headers\openvr_capi.h:897 */ - public static final int EVRTrackedCameraFrameType_VRTrackedCameraFrameType_Undistorted = 1; - /** native declaration : headers\openvr_capi.h:898 */ - public static final int EVRTrackedCameraFrameType_VRTrackedCameraFrameType_MaximumUndistorted = 2; - /** native declaration : headers\openvr_capi.h:899 */ - public static final int EVRTrackedCameraFrameType_MAX_CAMERA_FRAME_TYPES = 3; - }; - /** - * native declaration : headers\openvr_capi.h:905
- * enum values - */ - public static interface EVSync { - /** native declaration : headers\openvr_capi.h:902 */ - public static final int EVSync_VSync_None = 0; - /** native declaration : headers\openvr_capi.h:903 */ - public static final int EVSync_VSync_WaitRender = 1; - /** native declaration : headers\openvr_capi.h:904 */ - public static final int EVSync_VSync_NoWaitRender = 2; - }; - /** - * native declaration : headers\openvr_capi.h:909
- * enum values - */ - public static interface EVRMuraCorrectionMode { - /** native declaration : headers\openvr_capi.h:907 */ - public static final int EVRMuraCorrectionMode_Default = 0; - /** native declaration : headers\openvr_capi.h:908 */ - public static final int EVRMuraCorrectionMode_NoCorrection = 1; - }; - /** - * native declaration : headers\openvr_capi.h:917
- * enum values - */ - public static interface Imu_OffScaleFlags { - /** native declaration : headers\openvr_capi.h:911 */ - public static final int Imu_OffScaleFlags_OffScale_AccelX = 1; - /** native declaration : headers\openvr_capi.h:912 */ - public static final int Imu_OffScaleFlags_OffScale_AccelY = 2; - /** native declaration : headers\openvr_capi.h:913 */ - public static final int Imu_OffScaleFlags_OffScale_AccelZ = 4; - /** native declaration : headers\openvr_capi.h:914 */ - public static final int Imu_OffScaleFlags_OffScale_GyroX = 8; - /** native declaration : headers\openvr_capi.h:915 */ - public static final int Imu_OffScaleFlags_OffScale_GyroY = 16; - /** native declaration : headers\openvr_capi.h:916 */ - public static final int Imu_OffScaleFlags_OffScale_GyroZ = 32; - }; - /** - * native declaration : headers\openvr_capi.h:940
- * enum values - */ - public static interface EVRApplicationError { - /** native declaration : headers\openvr_capi.h:919 */ - public static final int EVRApplicationError_VRApplicationError_None = 0; - /** native declaration : headers\openvr_capi.h:920 */ - public static final int EVRApplicationError_VRApplicationError_AppKeyAlreadyExists = 100; - /** native declaration : headers\openvr_capi.h:921 */ - public static final int EVRApplicationError_VRApplicationError_NoManifest = 101; - /** native declaration : headers\openvr_capi.h:922 */ - public static final int EVRApplicationError_VRApplicationError_NoApplication = 102; - /** native declaration : headers\openvr_capi.h:923 */ - public static final int EVRApplicationError_VRApplicationError_InvalidIndex = 103; - /** native declaration : headers\openvr_capi.h:924 */ - public static final int EVRApplicationError_VRApplicationError_UnknownApplication = 104; - /** native declaration : headers\openvr_capi.h:925 */ - public static final int EVRApplicationError_VRApplicationError_IPCFailed = 105; - /** native declaration : headers\openvr_capi.h:926 */ - public static final int EVRApplicationError_VRApplicationError_ApplicationAlreadyRunning = 106; - /** native declaration : headers\openvr_capi.h:927 */ - public static final int EVRApplicationError_VRApplicationError_InvalidManifest = 107; - /** native declaration : headers\openvr_capi.h:928 */ - public static final int EVRApplicationError_VRApplicationError_InvalidApplication = 108; - /** native declaration : headers\openvr_capi.h:929 */ - public static final int EVRApplicationError_VRApplicationError_LaunchFailed = 109; - /** native declaration : headers\openvr_capi.h:930 */ - public static final int EVRApplicationError_VRApplicationError_ApplicationAlreadyStarting = 110; - /** native declaration : headers\openvr_capi.h:931 */ - public static final int EVRApplicationError_VRApplicationError_LaunchInProgress = 111; - /** native declaration : headers\openvr_capi.h:932 */ - public static final int EVRApplicationError_VRApplicationError_OldApplicationQuitting = 112; - /** native declaration : headers\openvr_capi.h:933 */ - public static final int EVRApplicationError_VRApplicationError_TransitionAborted = 113; - /** native declaration : headers\openvr_capi.h:934 */ - public static final int EVRApplicationError_VRApplicationError_IsTemplate = 114; - /** native declaration : headers\openvr_capi.h:935 */ - public static final int EVRApplicationError_VRApplicationError_SteamVRIsExiting = 115; - /** native declaration : headers\openvr_capi.h:936 */ - public static final int EVRApplicationError_VRApplicationError_BufferTooSmall = 200; - /** native declaration : headers\openvr_capi.h:937 */ - public static final int EVRApplicationError_VRApplicationError_PropertyNotSet = 201; - /** native declaration : headers\openvr_capi.h:938 */ - public static final int EVRApplicationError_VRApplicationError_UnknownProperty = 202; - /** native declaration : headers\openvr_capi.h:939 */ - public static final int EVRApplicationError_VRApplicationError_InvalidParameter = 203; - }; - /** - * native declaration : headers\openvr_capi.h:959
- * enum values - */ - public static interface EVRApplicationProperty { - /** native declaration : headers\openvr_capi.h:942 */ - public static final int EVRApplicationProperty_VRApplicationProperty_Name_String = 0; - /** native declaration : headers\openvr_capi.h:943 */ - public static final int EVRApplicationProperty_VRApplicationProperty_LaunchType_String = 11; - /** native declaration : headers\openvr_capi.h:944 */ - public static final int EVRApplicationProperty_VRApplicationProperty_WorkingDirectory_String = 12; - /** native declaration : headers\openvr_capi.h:945 */ - public static final int EVRApplicationProperty_VRApplicationProperty_BinaryPath_String = 13; - /** native declaration : headers\openvr_capi.h:946 */ - public static final int EVRApplicationProperty_VRApplicationProperty_Arguments_String = 14; - /** native declaration : headers\openvr_capi.h:947 */ - public static final int EVRApplicationProperty_VRApplicationProperty_URL_String = 15; - /** native declaration : headers\openvr_capi.h:948 */ - public static final int EVRApplicationProperty_VRApplicationProperty_Description_String = 50; - /** native declaration : headers\openvr_capi.h:949 */ - public static final int EVRApplicationProperty_VRApplicationProperty_NewsURL_String = 51; - /** native declaration : headers\openvr_capi.h:950 */ - public static final int EVRApplicationProperty_VRApplicationProperty_ImagePath_String = 52; - /** native declaration : headers\openvr_capi.h:951 */ - public static final int EVRApplicationProperty_VRApplicationProperty_Source_String = 53; - /** native declaration : headers\openvr_capi.h:952 */ - public static final int EVRApplicationProperty_VRApplicationProperty_ActionManifestURL_String = 54; - /** native declaration : headers\openvr_capi.h:953 */ - public static final int EVRApplicationProperty_VRApplicationProperty_IsDashboardOverlay_Bool = 60; - /** native declaration : headers\openvr_capi.h:954 */ - public static final int EVRApplicationProperty_VRApplicationProperty_IsTemplate_Bool = 61; - /** native declaration : headers\openvr_capi.h:955 */ - public static final int EVRApplicationProperty_VRApplicationProperty_IsInstanced_Bool = 62; - /** native declaration : headers\openvr_capi.h:956 */ - public static final int EVRApplicationProperty_VRApplicationProperty_IsInternal_Bool = 63; - /** native declaration : headers\openvr_capi.h:957 */ - public static final int EVRApplicationProperty_VRApplicationProperty_WantsCompositorPauseInStandby_Bool = 64; - /** native declaration : headers\openvr_capi.h:958 */ - public static final int EVRApplicationProperty_VRApplicationProperty_LastLaunchTime_Uint64 = 70; - }; - /** - * native declaration : headers\openvr_capi.h:965
- * enum values - */ - public static interface EVRApplicationTransitionState { - /** native declaration : headers\openvr_capi.h:961 */ - public static final int EVRApplicationTransitionState_VRApplicationTransition_None = 0; - /** native declaration : headers\openvr_capi.h:962 */ - public static final int EVRApplicationTransitionState_VRApplicationTransition_OldAppQuitSent = 10; - /** native declaration : headers\openvr_capi.h:963 */ - public static final int EVRApplicationTransitionState_VRApplicationTransition_WaitingForExternalLaunch = 11; - /** native declaration : headers\openvr_capi.h:964 */ - public static final int EVRApplicationTransitionState_VRApplicationTransition_NewAppLaunched = 20; - }; - /** - * native declaration : headers\openvr_capi.h:977
- * enum values - */ - public static interface ChaperoneCalibrationState { - /** native declaration : headers\openvr_capi.h:967 */ - public static final int ChaperoneCalibrationState_OK = 1; - /** native declaration : headers\openvr_capi.h:968 */ - public static final int ChaperoneCalibrationState_Warning = 100; - /** native declaration : headers\openvr_capi.h:969 */ - public static final int ChaperoneCalibrationState_Warning_BaseStationMayHaveMoved = 101; - /** native declaration : headers\openvr_capi.h:970 */ - public static final int ChaperoneCalibrationState_Warning_BaseStationRemoved = 102; - /** native declaration : headers\openvr_capi.h:971 */ - public static final int ChaperoneCalibrationState_Warning_SeatedBoundsInvalid = 103; - /** native declaration : headers\openvr_capi.h:972 */ - public static final int ChaperoneCalibrationState_Error = 200; - /** native declaration : headers\openvr_capi.h:973 */ - public static final int ChaperoneCalibrationState_Error_BaseStationUninitialized = 201; - /** native declaration : headers\openvr_capi.h:974 */ - public static final int ChaperoneCalibrationState_Error_BaseStationConflict = 202; - /** native declaration : headers\openvr_capi.h:975 */ - public static final int ChaperoneCalibrationState_Error_PlayAreaInvalid = 203; - /** native declaration : headers\openvr_capi.h:976 */ - public static final int ChaperoneCalibrationState_Error_CollisionBoundsInvalid = 204; - }; - /** - * native declaration : headers\openvr_capi.h:981
- * enum values - */ - public static interface EChaperoneConfigFile { - /** native declaration : headers\openvr_capi.h:979 */ - public static final int EChaperoneConfigFile_Live = 1; - /** native declaration : headers\openvr_capi.h:980 */ - public static final int EChaperoneConfigFile_Temp = 2; - }; - /** - * native declaration : headers\openvr_capi.h:984
- * enum values - */ - public static interface EChaperoneImportFlags { - /** native declaration : headers\openvr_capi.h:983 */ - public static final int EChaperoneImportFlags_EChaperoneImport_BoundsOnly = 1; - }; - /** - * native declaration : headers\openvr_capi.h:998
- * enum values - */ - public static interface EVRCompositorError { - /** native declaration : headers\openvr_capi.h:986 */ - public static final int EVRCompositorError_VRCompositorError_None = 0; - /** native declaration : headers\openvr_capi.h:987 */ - public static final int EVRCompositorError_VRCompositorError_RequestFailed = 1; - /** native declaration : headers\openvr_capi.h:988 */ - public static final int EVRCompositorError_VRCompositorError_IncompatibleVersion = 100; - /** native declaration : headers\openvr_capi.h:989 */ - public static final int EVRCompositorError_VRCompositorError_DoNotHaveFocus = 101; - /** native declaration : headers\openvr_capi.h:990 */ - public static final int EVRCompositorError_VRCompositorError_InvalidTexture = 102; - /** native declaration : headers\openvr_capi.h:991 */ - public static final int EVRCompositorError_VRCompositorError_IsNotSceneApplication = 103; - /** native declaration : headers\openvr_capi.h:992 */ - public static final int EVRCompositorError_VRCompositorError_TextureIsOnWrongDevice = 104; - /** native declaration : headers\openvr_capi.h:993 */ - public static final int EVRCompositorError_VRCompositorError_TextureUsesUnsupportedFormat = 105; - /** native declaration : headers\openvr_capi.h:994 */ - public static final int EVRCompositorError_VRCompositorError_SharedTexturesNotSupported = 106; - /** native declaration : headers\openvr_capi.h:995 */ - public static final int EVRCompositorError_VRCompositorError_IndexOutOfRange = 107; - /** native declaration : headers\openvr_capi.h:996 */ - public static final int EVRCompositorError_VRCompositorError_AlreadySubmitted = 108; - /** native declaration : headers\openvr_capi.h:997 */ - public static final int EVRCompositorError_VRCompositorError_InvalidBounds = 109; - }; - /** - * native declaration : headers\openvr_capi.h:1003
- * enum values - */ - public static interface EVRCompositorTimingMode { - /** native declaration : headers\openvr_capi.h:1000 */ - public static final int EVRCompositorTimingMode_VRCompositorTimingMode_Implicit = 0; - /** native declaration : headers\openvr_capi.h:1001 */ - public static final int EVRCompositorTimingMode_VRCompositorTimingMode_Explicit_RuntimePerformsPostPresentHandoff = 1; - /** native declaration : headers\openvr_capi.h:1002 */ - public static final int EVRCompositorTimingMode_VRCompositorTimingMode_Explicit_ApplicationPerformsPostPresentHandoff = 2; - }; - /** - * native declaration : headers\openvr_capi.h:1008
- * enum values - */ - public static interface VROverlayInputMethod { - /** native declaration : headers\openvr_capi.h:1005 */ - public static final int VROverlayInputMethod_None = 0; - /** native declaration : headers\openvr_capi.h:1006 */ - public static final int VROverlayInputMethod_Mouse = 1; - /** native declaration : headers\openvr_capi.h:1007 */ - public static final int VROverlayInputMethod_DualAnalog = 2; - }; - /** - * native declaration : headers\openvr_capi.h:1014
- * enum values - */ - public static interface VROverlayTransformType { - /** native declaration : headers\openvr_capi.h:1010 */ - public static final int VROverlayTransformType_VROverlayTransform_Absolute = 0; - /** native declaration : headers\openvr_capi.h:1011 */ - public static final int VROverlayTransformType_VROverlayTransform_TrackedDeviceRelative = 1; - /** native declaration : headers\openvr_capi.h:1012 */ - public static final int VROverlayTransformType_VROverlayTransform_SystemOverlay = 2; - /** native declaration : headers\openvr_capi.h:1013 */ - public static final int VROverlayTransformType_VROverlayTransform_TrackedComponent = 3; - }; - /** - * native declaration : headers\openvr_capi.h:1032
- * enum values - */ - public static interface VROverlayFlags { - /** native declaration : headers\openvr_capi.h:1016 */ - public static final int VROverlayFlags_None = 0; - /** native declaration : headers\openvr_capi.h:1017 */ - public static final int VROverlayFlags_Curved = 1; - /** native declaration : headers\openvr_capi.h:1018 */ - public static final int VROverlayFlags_RGSS4X = 2; - /** native declaration : headers\openvr_capi.h:1019 */ - public static final int VROverlayFlags_NoDashboardTab = 3; - /** native declaration : headers\openvr_capi.h:1020 */ - public static final int VROverlayFlags_AcceptsGamepadEvents = 4; - /** native declaration : headers\openvr_capi.h:1021 */ - public static final int VROverlayFlags_ShowGamepadFocus = 5; - /** native declaration : headers\openvr_capi.h:1022 */ - public static final int VROverlayFlags_SendVRScrollEvents = 6; - /** native declaration : headers\openvr_capi.h:1023 */ - public static final int VROverlayFlags_SendVRTouchpadEvents = 7; - /** native declaration : headers\openvr_capi.h:1024 */ - public static final int VROverlayFlags_ShowTouchPadScrollWheel = 8; - /** native declaration : headers\openvr_capi.h:1025 */ - public static final int VROverlayFlags_TransferOwnershipToInternalProcess = 9; - /** native declaration : headers\openvr_capi.h:1026 */ - public static final int VROverlayFlags_SideBySide_Parallel = 10; - /** native declaration : headers\openvr_capi.h:1027 */ - public static final int VROverlayFlags_SideBySide_Crossed = 11; - /** native declaration : headers\openvr_capi.h:1028 */ - public static final int VROverlayFlags_Panorama = 12; - /** native declaration : headers\openvr_capi.h:1029 */ - public static final int VROverlayFlags_StereoPanorama = 13; - /** native declaration : headers\openvr_capi.h:1030 */ - public static final int VROverlayFlags_SortWithNonSceneOverlays = 14; - /** native declaration : headers\openvr_capi.h:1031 */ - public static final int VROverlayFlags_VisibleInDashboard = 15; - }; - /** - * native declaration : headers\openvr_capi.h:1041
- * enum values - */ - public static interface VRMessageOverlayResponse { - /** native declaration : headers\openvr_capi.h:1034 */ - public static final int VRMessageOverlayResponse_ButtonPress_0 = 0; - /** native declaration : headers\openvr_capi.h:1035 */ - public static final int VRMessageOverlayResponse_ButtonPress_1 = 1; - /** native declaration : headers\openvr_capi.h:1036 */ - public static final int VRMessageOverlayResponse_ButtonPress_2 = 2; - /** native declaration : headers\openvr_capi.h:1037 */ - public static final int VRMessageOverlayResponse_ButtonPress_3 = 3; - /** native declaration : headers\openvr_capi.h:1038 */ - public static final int VRMessageOverlayResponse_CouldntFindSystemOverlay = 4; - /** native declaration : headers\openvr_capi.h:1039 */ - public static final int VRMessageOverlayResponse_CouldntFindOrCreateClientOverlay = 5; - /** native declaration : headers\openvr_capi.h:1040 */ - public static final int VRMessageOverlayResponse_ApplicationQuit = 6; - }; - /** - * native declaration : headers\openvr_capi.h:1046
- * enum values - */ - public static interface EGamepadTextInputMode { - /** native declaration : headers\openvr_capi.h:1043 */ - public static final int EGamepadTextInputMode_k_EGamepadTextInputModeNormal = 0; - /** native declaration : headers\openvr_capi.h:1044 */ - public static final int EGamepadTextInputMode_k_EGamepadTextInputModePassword = 1; - /** native declaration : headers\openvr_capi.h:1045 */ - public static final int EGamepadTextInputMode_k_EGamepadTextInputModeSubmit = 2; - }; - /** - * native declaration : headers\openvr_capi.h:1050
- * enum values - */ - public static interface EGamepadTextInputLineMode { - /** native declaration : headers\openvr_capi.h:1048 */ - public static final int EGamepadTextInputLineMode_k_EGamepadTextInputLineModeSingleLine = 0; - /** native declaration : headers\openvr_capi.h:1049 */ - public static final int EGamepadTextInputLineMode_k_EGamepadTextInputLineModeMultipleLines = 1; - }; - /** - * native declaration : headers\openvr_capi.h:1057
- * enum values - */ - public static interface EOverlayDirection { - /** native declaration : headers\openvr_capi.h:1052 */ - public static final int EOverlayDirection_OverlayDirection_Up = 0; - /** native declaration : headers\openvr_capi.h:1053 */ - public static final int EOverlayDirection_OverlayDirection_Down = 1; - /** native declaration : headers\openvr_capi.h:1054 */ - public static final int EOverlayDirection_OverlayDirection_Left = 2; - /** native declaration : headers\openvr_capi.h:1055 */ - public static final int EOverlayDirection_OverlayDirection_Right = 3; - /** native declaration : headers\openvr_capi.h:1056 */ - public static final int EOverlayDirection_OverlayDirection_Count = 4; - }; - /** - * native declaration : headers\openvr_capi.h:1061
- * enum values - */ - public static interface EVROverlayIntersectionMaskPrimitiveType { - /** native declaration : headers\openvr_capi.h:1059 */ - public static final int EVROverlayIntersectionMaskPrimitiveType_OverlayIntersectionPrimitiveType_Rectangle = 0; - /** native declaration : headers\openvr_capi.h:1060 */ - public static final int EVROverlayIntersectionMaskPrimitiveType_OverlayIntersectionPrimitiveType_Circle = 1; - }; - /** - * native declaration : headers\openvr_capi.h:1076
- * enum values - */ - public static interface EVRRenderModelError { - /** native declaration : headers\openvr_capi.h:1063 */ - public static final int EVRRenderModelError_VRRenderModelError_None = 0; - /** native declaration : headers\openvr_capi.h:1064 */ - public static final int EVRRenderModelError_VRRenderModelError_Loading = 100; - /** native declaration : headers\openvr_capi.h:1065 */ - public static final int EVRRenderModelError_VRRenderModelError_NotSupported = 200; - /** native declaration : headers\openvr_capi.h:1066 */ - public static final int EVRRenderModelError_VRRenderModelError_InvalidArg = 300; - /** native declaration : headers\openvr_capi.h:1067 */ - public static final int EVRRenderModelError_VRRenderModelError_InvalidModel = 301; - /** native declaration : headers\openvr_capi.h:1068 */ - public static final int EVRRenderModelError_VRRenderModelError_NoShapes = 302; - /** native declaration : headers\openvr_capi.h:1069 */ - public static final int EVRRenderModelError_VRRenderModelError_MultipleShapes = 303; - /** native declaration : headers\openvr_capi.h:1070 */ - public static final int EVRRenderModelError_VRRenderModelError_TooManyVertices = 304; - /** native declaration : headers\openvr_capi.h:1071 */ - public static final int EVRRenderModelError_VRRenderModelError_MultipleTextures = 305; - /** native declaration : headers\openvr_capi.h:1072 */ - public static final int EVRRenderModelError_VRRenderModelError_BufferTooSmall = 306; - /** native declaration : headers\openvr_capi.h:1073 */ - public static final int EVRRenderModelError_VRRenderModelError_NotEnoughNormals = 307; - /** native declaration : headers\openvr_capi.h:1074 */ - public static final int EVRRenderModelError_VRRenderModelError_NotEnoughTexCoords = 308; - /** native declaration : headers\openvr_capi.h:1075 */ - public static final int EVRRenderModelError_VRRenderModelError_InvalidTexture = 400; - }; - /** - * native declaration : headers\openvr_capi.h:1083
- * enum values - */ - public static interface EVRComponentProperty { - /** native declaration : headers\openvr_capi.h:1078 */ - public static final int EVRComponentProperty_VRComponentProperty_IsStatic = 1; - /** native declaration : headers\openvr_capi.h:1079 */ - public static final int EVRComponentProperty_VRComponentProperty_IsVisible = 2; - /** native declaration : headers\openvr_capi.h:1080 */ - public static final int EVRComponentProperty_VRComponentProperty_IsTouched = 4; - /** native declaration : headers\openvr_capi.h:1081 */ - public static final int EVRComponentProperty_VRComponentProperty_IsPressed = 8; - /** native declaration : headers\openvr_capi.h:1082 */ - public static final int EVRComponentProperty_VRComponentProperty_IsScrolled = 16; - }; - /** - * native declaration : headers\openvr_capi.h:1088
- * enum values - */ - public static interface EVRNotificationType { - /** native declaration : headers\openvr_capi.h:1085 */ - public static final int EVRNotificationType_Transient = 0; - /** native declaration : headers\openvr_capi.h:1086 */ - public static final int EVRNotificationType_Persistent = 1; - /** native declaration : headers\openvr_capi.h:1087 */ - public static final int EVRNotificationType_Transient_SystemWithUserValue = 2; - }; - /** - * native declaration : headers\openvr_capi.h:1095
- * enum values - */ - public static interface EVRNotificationStyle { - /** native declaration : headers\openvr_capi.h:1090 */ - public static final int EVRNotificationStyle_None = 0; - /** native declaration : headers\openvr_capi.h:1091 */ - public static final int EVRNotificationStyle_Application = 100; - /** native declaration : headers\openvr_capi.h:1092 */ - public static final int EVRNotificationStyle_Contact_Disabled = 200; - /** native declaration : headers\openvr_capi.h:1093 */ - public static final int EVRNotificationStyle_Contact_Enabled = 201; - /** native declaration : headers\openvr_capi.h:1094 */ - public static final int EVRNotificationStyle_Contact_Active = 202; - }; - /** - * native declaration : headers\openvr_capi.h:1103
- * enum values - */ - public static interface EVRSettingsError { - /** native declaration : headers\openvr_capi.h:1097 */ - public static final int EVRSettingsError_VRSettingsError_None = 0; - /** native declaration : headers\openvr_capi.h:1098 */ - public static final int EVRSettingsError_VRSettingsError_IPCFailed = 1; - /** native declaration : headers\openvr_capi.h:1099 */ - public static final int EVRSettingsError_VRSettingsError_WriteFailed = 2; - /** native declaration : headers\openvr_capi.h:1100 */ - public static final int EVRSettingsError_VRSettingsError_ReadFailed = 3; - /** native declaration : headers\openvr_capi.h:1101 */ - public static final int EVRSettingsError_VRSettingsError_JsonParseFailed = 4; - /** native declaration : headers\openvr_capi.h:1102 */ - public static final int EVRSettingsError_VRSettingsError_UnsetSettingHasNoDefault = 5; - }; - /** - * native declaration : headers\openvr_capi.h:1111
- * enum values - */ - public static interface EVRScreenshotError { - /** native declaration : headers\openvr_capi.h:1105 */ - public static final int EVRScreenshotError_VRScreenshotError_None = 0; - /** native declaration : headers\openvr_capi.h:1106 */ - public static final int EVRScreenshotError_VRScreenshotError_RequestFailed = 1; - /** native declaration : headers\openvr_capi.h:1107 */ - public static final int EVRScreenshotError_VRScreenshotError_IncompatibleVersion = 100; - /** native declaration : headers\openvr_capi.h:1108 */ - public static final int EVRScreenshotError_VRScreenshotError_NotFound = 101; - /** native declaration : headers\openvr_capi.h:1109 */ - public static final int EVRScreenshotError_VRScreenshotError_BufferTooSmall = 102; - /** native declaration : headers\openvr_capi.h:1110 */ - public static final int EVRScreenshotError_VRScreenshotError_ScreenshotAlreadyInProgress = 108; - }; - /** - * native declaration : headers\openvr_capi.h:1116
- * enum values - */ - public static interface EVRSkeletalTransformSpace { - /** native declaration : headers\openvr_capi.h:1113 */ - public static final int EVRSkeletalTransformSpace_VRSkeletalTransformSpace_Model = 0; - /** native declaration : headers\openvr_capi.h:1114 */ - public static final int EVRSkeletalTransformSpace_VRSkeletalTransformSpace_Parent = 1; - /** native declaration : headers\openvr_capi.h:1115 */ - public static final int EVRSkeletalTransformSpace_VRSkeletalTransformSpace_Additive = 2; - }; - /** - * native declaration : headers\openvr_capi.h:1120
- * enum values - */ - public static interface EVRInputFilterCancelType { - /** native declaration : headers\openvr_capi.h:1118 */ - public static final int EVRInputFilterCancelType_VRInputFilterCancel_Timers = 0; - /** native declaration : headers\openvr_capi.h:1119 */ - public static final int EVRInputFilterCancelType_VRInputFilterCancel_Momentum = 1; - }; - /** - * native declaration : headers\openvr_capi.h:1129
- * enum values - */ - public static interface EIOBufferError { - /** native declaration : headers\openvr_capi.h:1122 */ - public static final int EIOBufferError_IOBuffer_Success = 0; - /** native declaration : headers\openvr_capi.h:1123 */ - public static final int EIOBufferError_IOBuffer_OperationFailed = 100; - /** native declaration : headers\openvr_capi.h:1124 */ - public static final int EIOBufferError_IOBuffer_InvalidHandle = 101; - /** native declaration : headers\openvr_capi.h:1125 */ - public static final int EIOBufferError_IOBuffer_InvalidArgument = 102; - /** native declaration : headers\openvr_capi.h:1126 */ - public static final int EIOBufferError_IOBuffer_PathExists = 103; - /** native declaration : headers\openvr_capi.h:1127 */ - public static final int EIOBufferError_IOBuffer_PathDoesNotExist = 104; - /** native declaration : headers\openvr_capi.h:1128 */ - public static final int EIOBufferError_IOBuffer_Permission = 105; - }; - /** - * native declaration : headers\openvr_capi.h:1134
- * enum values - */ - public static interface EIOBufferMode { - /** native declaration : headers\openvr_capi.h:1131 */ - public static final int EIOBufferMode_IOBufferMode_Read = 1; - /** native declaration : headers\openvr_capi.h:1132 */ - public static final int EIOBufferMode_IOBufferMode_Write = 2; - /** native declaration : headers\openvr_capi.h:1133 */ - public static final int EIOBufferMode_IOBufferMode_Create = 512; - }; - /** 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 = 64; - 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 long k_ulInvalidDriverHandle = 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_unPathHandleInfoTag = 31; - public static final int k_unActionPropertyTag = 32; - public static final int k_unInputValuePropertyTag = 33; - public static final int k_unWildcardPropertyTag = 34; - public static final int k_unHapticVibrationPropertyTag = 35; - public static final int k_unSkeletonPropertyTag = 36; - public static final int k_unSpatialAnchorPosePropertyTag = 40; - 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 long k_ulInvalidActionHandle = 0; - public static final long k_ulInvalidActionSetHandle = 0; - public static final long k_ulInvalidInputValueHandle = 0; - 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 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 int k_unNotificationTextMaxSize = 256; - public static final int k_unMaxSettingsKeyLength = 128; - public static final int k_unMaxActionNameLength = 64; - public static final int k_unMaxActionSetNameLength = 64; - public static final int k_unMaxActionOriginCount = 16; - public static final long k_ulInvalidIOBufferHandle = 0; - public static final int k_ulInvalidSpatialAnchorHandle = 0; - - - public static final String IVRSystem_Version = "IVRSystem_019"; - public static final String IVRExtendedDisplay_Version = "IVRExtendedDisplay_001"; - public static final String IVRTrackedCamera_Version = "IVRTrackedCamera_003"; - public static final String k_pch_MimeType_HomeApp = "vr/home"; - public static final String k_pch_MimeType_GameTheater = "vr/game_theater"; - public static final String IVRApplications_Version = "IVRApplications_006"; - public static final String IVRChaperone_Version = "IVRChaperone_003"; - public static final String IVRChaperoneSetup_Version = "IVRChaperoneSetup_005"; - public static final String IVRCompositor_Version = "IVRCompositor_022"; - public static final String IVROverlay_Version = "IVROverlay_018"; - 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 String IVRRenderModels_Version = "IVRRenderModels_006"; - public static final String IVRNotifications_Version = "IVRNotifications_002"; - public static final String IVRSettings_Version = "IVRSettings_002"; - 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_SteamVR_SupersampleManualOverride_Bool = "supersampleManualOverride"; - public static final String k_pch_SteamVR_EnableLinuxVulkanAsync_Bool = "enableLinuxVulkanAsync"; - public static final String k_pch_SteamVR_AllowDisplayLockedMode_Bool = "allowDisplayLockedMode"; - public static final String k_pch_SteamVR_HaveStartedTutorialForNativeChaperoneDriver_Bool = "haveStartedTutorialForNativeChaperoneDriver"; - public static final String k_pch_SteamVR_ForceWindows32bitVRMonitor = "forceWindows32BitVRMonitor"; - public static final String k_pch_SteamVR_DebugInput = "debugInput"; - public static final String k_pch_SteamVR_LegacyInputRebinding = "legacyInputRebinding"; - public static final String k_pch_SteamVR_DebugInputBinding = "debugInputBinding"; - public static final String k_pch_SteamVR_InputBindingUIBlock = "inputBindingUI"; - public static final String k_pch_SteamVR_RenderCameraMode = "renderCameraMode"; - 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_DisableIMUExceptHMD_Bool = "disableimuexcepthmd"; - 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_Lighthouse_EnableBluetooth_Bool = "enableBluetooth"; - public static final String k_pch_Lighthouse_PowerManagedBaseStations_String = "PowerManagedBaseStations"; - 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_Camera_RoomViewMode_Int32 = "cameraRoomViewMode"; - 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_Dashboard_EnableWebUI = "webUI"; - public static final String k_pch_Dashboard_EnableWebUIDevTools = "webUIDevTools"; - public static final String k_pch_Dashboard_EnableWebUIDashboardReplacement = "webUIDashboard"; - public static final String k_pch_modelskin_Section = "modelskins"; - public static final String k_pch_Driver_Enable_Bool = "enable"; - public static final String k_pch_WebInterface_Section = "WebInterface"; - public static final String k_pch_WebInterface_WebEnable_Bool = "WebEnable"; - public static final String k_pch_WebInterface_WebPort_String = "WebPort"; - public static final String k_pch_TrackingOverride_Section = "TrackingOverrides"; - public static final String k_pch_App_BindingAutosaveURLSuffix_String = "AutosaveURL"; - public static final String k_pch_App_BindingCurrentURLSuffix_String = "CurrentURL"; - public static final String k_pch_App_NeedToUpdateAutosaveSuffix_Bool = "NeedToUpdateAutosave"; - public static final String k_pch_App_ActionManifestURL_String = "ActionManifestURL"; - public static final String k_pch_Trackers_Section = "trackers"; - public static final String IVRScreenshots_Version = "IVRScreenshots_001"; - public static final String IVRResources_Version = "IVRResources_001"; - public static final String IVRDriverManager_Version = "IVRDriverManager_001"; - public static final String IVRInput_Version = "IVRInput_004"; - public static final String IVRIOBuffer_Version = "IVRIOBuffer_001"; - public static final String IVRSpatialAnchors_Version = "IVRSpatialAnchors_001"; - - - /** - * Global entry points
- * Original signature : intptr_t VR_InitInternal(EVRInitError*, EVRApplicationType)
- * native declaration : headers\openvr_capi.h:2378
- * @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:2378 - */ - public static native IntByReference VR_InitInternal(IntBuffer peError, int eType); - /** - * Original signature : void VR_ShutdownInternal()
- * native declaration : headers\openvr_capi.h:2380 - */ - public static native void VR_ShutdownInternal(); - /** - * Original signature : bool VR_IsHmdPresent()
- * native declaration : headers\openvr_capi.h:2382 - */ - public static native byte VR_IsHmdPresent(); - /** - * Original signature : intptr_t VR_GetGenericInterface(const char*, EVRInitError*)
- * native declaration : headers\openvr_capi.h:2384
- * @deprecated use the safer method - * {@link #VR_GetGenericInterface(java.lang.String, 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:2384 - */ - public static native IntByReference VR_GetGenericInterface(String pchInterfaceVersion, IntByReference peError); - /** - * Original signature : bool VR_IsRuntimeInstalled()
- * native declaration : headers\openvr_capi.h:2386 - */ - public static native byte VR_IsRuntimeInstalled(); - /** - * Original signature : char* VR_GetVRInitErrorAsSymbol(EVRInitError)
- * native declaration : headers\openvr_capi.h:2388 - */ - public static native Pointer VR_GetVRInitErrorAsSymbol(int error); - /** - * Original signature : char* VR_GetVRInitErrorAsEnglishDescription(EVRInitError)
- * native declaration : headers\openvr_capi.h:2390 - */ - 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 b9aaffe311..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/NotificationBitmap_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; -/** - * native declaration : headers\openvr_capi.h:1588
- * 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(); - } - @Override - 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 2d075cf80a..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/OpenVRUtil.java +++ /dev/null @@ -1,779 +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 { - /** - * A private constructor to inhibit instantiation of this class. - */ - private 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 7e72d93c88..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_ComponentState_t.java +++ /dev/null @@ -1,46 +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:1557
- * 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(); - } - @Override - 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 cf1eac008f..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_ControllerMode_State_t.java +++ /dev/null @@ -1,34 +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:1581
- * 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(); - } - @Override - 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 41670df53b..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_TextureMap_t.java +++ /dev/null @@ -1,46 +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:1569
- * 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(); - } - @Override - 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 17fac6dd53..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_Vertex_t.java +++ /dev/null @@ -1,52 +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:1563
- * 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(); - } - @Override - 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 9828f148fe..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_t.java +++ /dev/null @@ -1,59 +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:1578
- * 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(); - } - @Override - 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/SpatialAnchorPose_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/SpatialAnchorPose_t.java deleted file mode 100644 index 2d3fc2cfdb..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/SpatialAnchorPose_t.java +++ /dev/null @@ -1,36 +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:1636
- * 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 SpatialAnchorPose_t extends Structure { - /** C type : HmdMatrix34_t */ - public HmdMatrix34_t mAnchorToAbsoluteTracking; - public SpatialAnchorPose_t() { - super(); - } - @Override - protected List getFieldOrder() { - return Arrays.asList("mAnchorToAbsoluteTracking"); - } - /** @param mAnchorToAbsoluteTracking C type : HmdMatrix34_t */ - public SpatialAnchorPose_t(HmdMatrix34_t mAnchorToAbsoluteTracking) { - super(); - this.mAnchorToAbsoluteTracking = mAnchorToAbsoluteTracking; - } - public SpatialAnchorPose_t(Pointer peer) { - super(peer); - } - public static class ByReference extends SpatialAnchorPose_t implements Structure.ByReference { - - }; - public static class ByValue extends SpatialAnchorPose_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 fc6cfeb95e..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/Texture_t.java +++ /dev/null @@ -1,56 +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:1247
- * 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; - /** - * C type : ETextureType - */ - public int eType; - /** - * C type : EColorSpace - */ - public int eColorSpace; - public Texture_t() { - super(); - } - @Override - protected List getFieldOrder() { - return Arrays.asList("handle", "eType", "eColorSpace"); - } - /** - * @param handle void *
- * C type : void*
- * @param eType @see JOpenVRLibrary.ETextureType
- * C type : ETextureType
- * @param eColorSpace @see JOpenVRLibrary.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 d2a39b1184..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:1257
- * 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; - /** - * C type : ETrackingResult - */ - public int eTrackingResult; - public byte bPoseIsValid; - public byte bDeviceIsConnected; - public TrackedDevicePose_t() { - super(); - } - @Override - 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 JOpenVRLibrary.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/VRActiveActionSet_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRActiveActionSet_t.java deleted file mode 100644 index 49720d038e..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRActiveActionSet_t.java +++ /dev/null @@ -1,50 +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:1633
- * 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 VRActiveActionSet_t extends Structure { - /** C type : VRActionSetHandle_t */ - public long ulActionSet; - /** C type : VRInputValueHandle_t */ - public long ulRestrictedToDevice; - /** C type : VRActionSetHandle_t */ - public long ulSecondaryActionSet; - public int unPadding; - public int nPriority; - public VRActiveActionSet_t() { - super(); - } - @Override - protected List getFieldOrder() { - return Arrays.asList("ulActionSet", "ulRestrictedToDevice", "ulSecondaryActionSet", "unPadding", "nPriority"); - } - /** - * @param ulActionSet C type : VRActionSetHandle_t
- * @param ulRestrictedToDevice C type : VRInputValueHandle_t
- * @param ulSecondaryActionSet C type : VRActionSetHandle_t - */ - public VRActiveActionSet_t(long ulActionSet, long ulRestrictedToDevice, long ulSecondaryActionSet, int unPadding, int nPriority) { - super(); - this.ulActionSet = ulActionSet; - this.ulRestrictedToDevice = ulRestrictedToDevice; - this.ulSecondaryActionSet = ulSecondaryActionSet; - this.unPadding = unPadding; - this.nPriority = nPriority; - } - public VRActiveActionSet_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VRActiveActionSet_t implements Structure.ByReference { - - }; - public static class ByValue extends VRActiveActionSet_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRBoneTransform_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRBoneTransform_t.java deleted file mode 100644 index e6e7626d24..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRBoneTransform_t.java +++ /dev/null @@ -1,42 +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:1456
- * 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 VRBoneTransform_t extends Structure { - /** C type : HmdVector4_t */ - public HmdVector4_t position; - /** C type : HmdQuaternionf_t */ - public HmdQuaternionf_t orientation; - public VRBoneTransform_t() { - super(); - } - @Override - protected List getFieldOrder() { - return Arrays.asList("position", "orientation"); - } - /** - * @param position C type : HmdVector4_t
- * @param orientation C type : HmdQuaternionf_t - */ - public VRBoneTransform_t(HmdVector4_t position, HmdQuaternionf_t orientation) { - super(); - this.position = position; - this.orientation = orientation; - } - public VRBoneTransform_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VRBoneTransform_t implements Structure.ByReference { - - }; - public static class ByValue extends VRBoneTransform_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 41f0e13665..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRControllerAxis_t.java +++ /dev/null @@ -1,36 +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:1429
- * 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(); - } - @Override - 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 9adc41c7d2..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRControllerState_t.java +++ /dev/null @@ -1,50 +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:1436
- * 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(); - } - @Override - 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 845ca8799c..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_ApplicationLaunch_t.java +++ /dev/null @@ -1,36 +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:1373
- * 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(); - } - @Override - 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 92e97a4580..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Chaperone_t.java +++ /dev/null @@ -1,36 +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:1350
- * 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(); - } - @Override - 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 e7959582cc..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Controller_t.java +++ /dev/null @@ -1,34 +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:1304
- * 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(); - } - @Override - 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 983a7da823..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:1686
- * 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_DualAnalog_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_DualAnalog_t.java deleted file mode 100644 index f5e45f5b24..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_DualAnalog_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:1395
- * 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_DualAnalog_t extends Structure { - public float x; - public float y; - public float transformedX; - public float transformedY; - /** - * C type : EDualAnalogWhich - */ - public int which; - public VREvent_DualAnalog_t() { - super(); - } - @Override - protected List getFieldOrder() { - return Arrays.asList("x", "y", "transformedX", "transformedY", "which"); - } - /** - * @param which @see JOpenVRLibrary.EDualAnalogWhich
- * C type : EDualAnalogWhich - */ - public VREvent_DualAnalog_t(float x, float y, float transformedX, float transformedY, int which) { - super(); - this.x = x; - this.y = y; - this.transformedX = transformedX; - this.transformedY = transformedY; - this.which = which; - } - public VREvent_DualAnalog_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_DualAnalog_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_DualAnalog_t implements 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 5a54cdd582..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_EditingCameraSurface_t.java +++ /dev/null @@ -1,36 +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:1377
- * 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(); - } - @Override - 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_HapticVibration_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_HapticVibration_t.java deleted file mode 100644 index 7175e4c862..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_HapticVibration_t.java +++ /dev/null @@ -1,42 +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:1402
- * 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_HapticVibration_t extends Structure { - public long containerHandle; - public long componentHandle; - public float fDurationSeconds; - public float fFrequency; - public float fAmplitude; - public VREvent_HapticVibration_t() { - super(); - } - @Override - protected List getFieldOrder() { - return Arrays.asList("containerHandle", "componentHandle", "fDurationSeconds", "fFrequency", "fAmplitude"); - } - public VREvent_HapticVibration_t(long containerHandle, long componentHandle, float fDurationSeconds, float fFrequency, float fAmplitude) { - super(); - this.containerHandle = containerHandle; - this.componentHandle = componentHandle; - this.fDurationSeconds = fDurationSeconds; - this.fFrequency = fFrequency; - this.fAmplitude = fAmplitude; - } - public VREvent_HapticVibration_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_HapticVibration_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_HapticVibration_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_InputActionManifestLoad_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_InputActionManifestLoad_t.java deleted file mode 100644 index 427eddfbc2..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_InputActionManifestLoad_t.java +++ /dev/null @@ -1,40 +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:1417
- * 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_InputActionManifestLoad_t extends Structure { - public long pathAppKey; - public long pathMessage; - public long pathMessageParam; - public long pathManifestPath; - public VREvent_InputActionManifestLoad_t() { - super(); - } - @Override - protected List getFieldOrder() { - return Arrays.asList("pathAppKey", "pathMessage", "pathMessageParam", "pathManifestPath"); - } - public VREvent_InputActionManifestLoad_t(long pathAppKey, long pathMessage, long pathMessageParam, long pathManifestPath) { - super(); - this.pathAppKey = pathAppKey; - this.pathMessage = pathMessage; - this.pathMessageParam = pathMessageParam; - this.pathManifestPath = pathManifestPath; - } - public VREvent_InputActionManifestLoad_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_InputActionManifestLoad_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_InputActionManifestLoad_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_InputBindingLoad_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_InputBindingLoad_t.java deleted file mode 100644 index 9b88905847..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_InputBindingLoad_t.java +++ /dev/null @@ -1,42 +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:1411
- * 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_InputBindingLoad_t extends Structure { - /** C type : PropertyContainerHandle_t */ - public long ulAppContainer; - public long pathMessage; - public long pathUrl; - public long pathControllerType; - public VREvent_InputBindingLoad_t() { - super(); - } - @Override - protected List getFieldOrder() { - return Arrays.asList("ulAppContainer", "pathMessage", "pathUrl", "pathControllerType"); - } - /** @param ulAppContainer C type : PropertyContainerHandle_t */ - public VREvent_InputBindingLoad_t(long ulAppContainer, long pathMessage, long pathUrl, long pathControllerType) { - super(); - this.ulAppContainer = ulAppContainer; - this.pathMessage = pathMessage; - this.pathUrl = pathUrl; - this.pathControllerType = pathControllerType; - } - public VREvent_InputBindingLoad_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_InputBindingLoad_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_InputBindingLoad_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 afc05f74ea..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Ipd_t.java +++ /dev/null @@ -1,34 +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:1346
- * 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(); - } - @Override - 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 9cf8c64ed3..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Keyboard_t.java +++ /dev/null @@ -1,46 +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:1343
- * 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(); - } - @Override - 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 b0fe1b8c2e..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_MessageOverlay_t.java +++ /dev/null @@ -1,34 +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:1380
- * 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(); - } - @Override - 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 d20db8c841..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Mouse_t.java +++ /dev/null @@ -1,38 +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:1309
- * 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(); - } - @Override - 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 fa67bd5e7c..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Notification_t.java +++ /dev/null @@ -1,36 +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:1326
- * 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(); - } - @Override - 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 683c485ab7..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Overlay_t.java +++ /dev/null @@ -1,36 +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:1335
- * 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 long devicePath; - public VREvent_Overlay_t() { - super(); - } - @Override - protected List getFieldOrder() { - return Arrays.asList("overlayHandle", "devicePath"); - } - public VREvent_Overlay_t(long overlayHandle, long devicePath) { - super(); - this.overlayHandle = overlayHandle; - this.devicePath = devicePath; - } - 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 13f14852cc..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_PerformanceTest_t.java +++ /dev/null @@ -1,34 +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:1359
- * 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(); - } - @Override - 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 0e7f9ae2fb..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Process_t.java +++ /dev/null @@ -1,38 +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:1331
- * 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(); - } - @Override - 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 be84aa3129..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:1386
- * 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; - /** - * C type : ETrackedDeviceProperty - */ - public int prop; - public VREvent_Property_t() { - super(); - } - @Override - protected List getFieldOrder() { - return Arrays.asList("container", "prop"); - } - /** - * @param container C type : PropertyContainerHandle_t
- * @param prop @see JOpenVRLibrary.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 13f0c8d822..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Reserved_t.java +++ /dev/null @@ -1,40 +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:1356
- * 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 long reserved2; - public long reserved3; - public VREvent_Reserved_t() { - super(); - } - @Override - protected List getFieldOrder() { - return Arrays.asList("reserved0", "reserved1", "reserved2", "reserved3"); - } - public VREvent_Reserved_t(long reserved0, long reserved1, long reserved2, long reserved3) { - super(); - this.reserved0 = reserved0; - this.reserved1 = reserved1; - this.reserved2 = reserved2; - this.reserved3 = reserved3; - } - 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 b0511dbc24..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_ScreenshotProgress_t.java +++ /dev/null @@ -1,34 +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:1369
- * 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(); - } - @Override - 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 c35acd1390..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Screenshot_t.java +++ /dev/null @@ -1,36 +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:1366
- * 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(); - } - @Override - 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 1d29ea839b..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Scroll_t.java +++ /dev/null @@ -1,38 +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:1314
- * 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(); - } - @Override - 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 cb7c9f62c5..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_SeatedZeroPoseReset_t.java +++ /dev/null @@ -1,34 +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:1362
- * 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(); - } - @Override - 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_SpatialAnchor_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_SpatialAnchor_t.java deleted file mode 100644 index eeb51f2e26..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_SpatialAnchor_t.java +++ /dev/null @@ -1,36 +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:1420
- * 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_SpatialAnchor_t extends Structure { - /** C type : SpatialAnchorHandle_t */ - public int unHandle; - public VREvent_SpatialAnchor_t() { - super(); - } - @Override - protected List getFieldOrder() { - return Arrays.asList("unHandle"); - } - /** @param unHandle C type : SpatialAnchorHandle_t */ - public VREvent_SpatialAnchor_t(int unHandle) { - super(); - this.unHandle = unHandle; - } - public VREvent_SpatialAnchor_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_SpatialAnchor_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_SpatialAnchor_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 d16d2c0727..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Status_t.java +++ /dev/null @@ -1,34 +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:1338
- * 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(); - } - @Override - 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 dd123e0d3b..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_TouchPadMove_t.java +++ /dev/null @@ -1,44 +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:1322
- * 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(); - } - @Override - 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_WebConsole_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_WebConsole_t.java deleted file mode 100644 index 21d9bdf390..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_WebConsole_t.java +++ /dev/null @@ -1,36 +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:1405
- * 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_WebConsole_t extends Structure { - /** C type : WebConsoleHandle_t */ - public long webConsoleHandle; - public VREvent_WebConsole_t() { - super(); - } - @Override - protected List getFieldOrder() { - return Arrays.asList("webConsoleHandle"); - } - /** @param webConsoleHandle C type : WebConsoleHandle_t */ - public VREvent_WebConsole_t(long webConsoleHandle) { - super(); - this.webConsoleHandle = webConsoleHandle; - } - public VREvent_WebConsole_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_WebConsole_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_WebConsole_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 843f9da821..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_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; -/** - * An event posted by the server to all running applications
- * native declaration : headers\openvr_capi.h:1694
- * 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(); - } - @Override - 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 9020bf2852..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:1698
- * 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 e0396fda97..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:1702
- * 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 { - /** - * C type : EVROverlayIntersectionMaskPrimitiveType - */ - public int m_nPrimitiveType; - /** C type : VROverlayIntersectionMaskPrimitive_Data_t */ - public VROverlayIntersectionMaskPrimitive_Data_t m_Primitive; - public VROverlayIntersectionMaskPrimitive_t() { - super(); - } - @Override - protected List getFieldOrder() { - return Arrays.asList("m_nPrimitiveType", "m_Primitive"); - } - /** - * @param m_nPrimitiveType @see JOpenVRLibrary.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 053942a0e3..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:1535
- * 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; - /** - * C type : ETrackingUniverseOrigin - */ - public int eOrigin; - public VROverlayIntersectionParams_t() { - super(); - } - @Override - protected List getFieldOrder() { - return Arrays.asList("vSource", "vDirection", "eOrigin"); - } - /** - * @param vSource C type : HmdVector3_t
- * @param vDirection C type : HmdVector3_t
- * @param eOrigin @see JOpenVRLibrary.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 7fa5b020f2..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VROverlayIntersectionResults_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; -/** - * native declaration : headers\openvr_capi.h:1541
- * 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(); - } - @Override - 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 88c779846c..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRTextureBounds_t.java +++ /dev/null @@ -1,40 +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 VRTextureBounds_t extends Structure { - public float uMin; - public float vMin; - public float uMax; - public float vMax; - public VRTextureBounds_t() { - super(); - } - @Override - 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/VRTextureDepthInfo_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRTextureDepthInfo_t.java deleted file mode 100644 index 89f42f80be..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRTextureDepthInfo_t.java +++ /dev/null @@ -1,50 +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:1272
- * 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 VRTextureDepthInfo_t extends Structure { - /** - * void *
- * C type : void* - */ - public Pointer handle; - /** C type : HmdMatrix44_t */ - public HmdMatrix44_t mProjection; - /** C type : HmdVector2_t */ - public HmdVector2_t vRange; - public VRTextureDepthInfo_t() { - super(); - } - @Override - protected List getFieldOrder() { - return Arrays.asList("handle", "mProjection", "vRange"); - } - /** - * @param handle void *
- * C type : void*
- * @param mProjection C type : HmdMatrix44_t
- * @param vRange C type : HmdVector2_t - */ - public VRTextureDepthInfo_t(Pointer handle, HmdMatrix44_t mProjection, HmdVector2_t vRange) { - super(); - this.handle = handle; - this.mProjection = mProjection; - this.vRange = vRange; - } - public VRTextureDepthInfo_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VRTextureDepthInfo_t implements Structure.ByReference { - - }; - public static class ByValue extends VRTextureDepthInfo_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRTextureWithDepth_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRTextureWithDepth_t.java deleted file mode 100644 index 0601b2b7a3..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRTextureWithDepth_t.java +++ /dev/null @@ -1,36 +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:1275
- * 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 VRTextureWithDepth_t extends Structure { - /** C type : VRTextureDepthInfo_t */ - public VRTextureDepthInfo_t depth; - public VRTextureWithDepth_t() { - super(); - } - @Override - protected List getFieldOrder() { - return Arrays.asList("depth"); - } - /** @param depth C type : VRTextureDepthInfo_t */ - public VRTextureWithDepth_t(VRTextureDepthInfo_t depth) { - super(); - this.depth = depth; - } - public VRTextureWithDepth_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VRTextureWithDepth_t implements Structure.ByReference { - - }; - public static class ByValue extends VRTextureWithDepth_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRTextureWithPoseAndDepth_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRTextureWithPoseAndDepth_t.java deleted file mode 100644 index bbe447ba2c..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRTextureWithPoseAndDepth_t.java +++ /dev/null @@ -1,36 +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:1278
- * 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 VRTextureWithPoseAndDepth_t extends Structure { - /** C type : VRTextureDepthInfo_t */ - public VRTextureDepthInfo_t depth; - public VRTextureWithPoseAndDepth_t() { - super(); - } - @Override - protected List getFieldOrder() { - return Arrays.asList("depth"); - } - /** @param depth C type : VRTextureDepthInfo_t */ - public VRTextureWithPoseAndDepth_t(VRTextureDepthInfo_t depth) { - super(); - this.depth = depth; - } - public VRTextureWithPoseAndDepth_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VRTextureWithPoseAndDepth_t implements Structure.ByReference { - - }; - public static class ByValue extends VRTextureWithPoseAndDepth_t implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRTextureWithPose_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRTextureWithPose_t.java deleted file mode 100644 index 8eff35c066..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRTextureWithPose_t.java +++ /dev/null @@ -1,36 +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:1266
- * 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 VRTextureWithPose_t extends Structure { - /** C type : HmdMatrix34_t */ - public HmdMatrix34_t mDeviceToAbsoluteTracking; - public VRTextureWithPose_t() { - super(); - } - @Override - protected List getFieldOrder() { - return Arrays.asList("mDeviceToAbsoluteTracking"); - } - /** @param mDeviceToAbsoluteTracking C type : HmdMatrix34_t */ - public VRTextureWithPose_t(HmdMatrix34_t mDeviceToAbsoluteTracking) { - super(); - this.mDeviceToAbsoluteTracking = mDeviceToAbsoluteTracking; - } - public VRTextureWithPose_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VRTextureWithPose_t implements Structure.ByReference { - - }; - public static class ByValue extends VRTextureWithPose_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 9ac3eb08bf..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRVulkanTextureData_t.java +++ /dev/null @@ -1,59 +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:1294
- * 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(); - } - @Override - 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 eed61b3e02..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRApplications_FnTable.java +++ /dev/null @@ -1,217 +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:1897
- * 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:1866 */ - public interface AddApplicationManifest_callback extends Callback { - int apply(Pointer pchApplicationManifestFullPath, byte bTemporary); - }; - /** native declaration : headers\openvr_capi.h:1867 */ - public interface RemoveApplicationManifest_callback extends Callback { - int apply(Pointer pchApplicationManifestFullPath); - }; - /** native declaration : headers\openvr_capi.h:1868 */ - public interface IsApplicationInstalled_callback extends Callback { - byte apply(Pointer pchAppKey); - }; - /** native declaration : headers\openvr_capi.h:1869 */ - public interface GetApplicationCount_callback extends Callback { - int apply(); - }; - /** native declaration : headers\openvr_capi.h:1870 */ - public interface GetApplicationKeyByIndex_callback extends Callback { - int apply(int unApplicationIndex, Pointer pchAppKeyBuffer, int unAppKeyBufferLen); - }; - /** native declaration : headers\openvr_capi.h:1871 */ - public interface GetApplicationKeyByProcessId_callback extends Callback { - int apply(int unProcessId, Pointer pchAppKeyBuffer, int unAppKeyBufferLen); - }; - /** native declaration : headers\openvr_capi.h:1872 */ - public interface LaunchApplication_callback extends Callback { - int apply(Pointer pchAppKey); - }; - /** native declaration : headers\openvr_capi.h:1873 */ - public interface LaunchTemplateApplication_callback extends Callback { - int apply(Pointer pchTemplateAppKey, Pointer pchNewAppKey, AppOverrideKeys_t pKeys, int unKeys); - }; - /** native declaration : headers\openvr_capi.h:1874 */ - public interface LaunchApplicationFromMimeType_callback extends Callback { - int apply(Pointer pchMimeType, Pointer pchArgs); - }; - /** native declaration : headers\openvr_capi.h:1875 */ - public interface LaunchDashboardOverlay_callback extends Callback { - int apply(Pointer pchAppKey); - }; - /** native declaration : headers\openvr_capi.h:1876 */ - public interface CancelApplicationLaunch_callback extends Callback { - byte apply(Pointer pchAppKey); - }; - /** native declaration : headers\openvr_capi.h:1877 */ - public interface IdentifyApplication_callback extends Callback { - int apply(int unProcessId, Pointer pchAppKey); - }; - /** native declaration : headers\openvr_capi.h:1878 */ - public interface GetApplicationProcessId_callback extends Callback { - int apply(Pointer pchAppKey); - }; - /** native declaration : headers\openvr_capi.h:1879 */ - public interface GetApplicationsErrorNameFromEnum_callback extends Callback { - Pointer apply(int error); - }; - /** native declaration : headers\openvr_capi.h:1880 */ - public interface GetApplicationPropertyString_callback extends Callback { - int apply(Pointer pchAppKey, int eProperty, Pointer pchPropertyValueBuffer, int unPropertyValueBufferLen, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:1881 */ - public interface GetApplicationPropertyBool_callback extends Callback { - byte apply(Pointer pchAppKey, int eProperty, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:1882 */ - public interface GetApplicationPropertyUint64_callback extends Callback { - long apply(Pointer pchAppKey, int eProperty, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:1883 */ - public interface SetApplicationAutoLaunch_callback extends Callback { - int apply(Pointer pchAppKey, byte bAutoLaunch); - }; - /** native declaration : headers\openvr_capi.h:1884 */ - public interface GetApplicationAutoLaunch_callback extends Callback { - byte apply(Pointer pchAppKey); - }; - /** native declaration : headers\openvr_capi.h:1885 */ - public interface SetDefaultApplicationForMimeType_callback extends Callback { - int apply(Pointer pchAppKey, Pointer pchMimeType); - }; - /** native declaration : headers\openvr_capi.h:1886 */ - public interface GetDefaultApplicationForMimeType_callback extends Callback { - byte apply(Pointer pchMimeType, Pointer pchAppKeyBuffer, int unAppKeyBufferLen); - }; - /** native declaration : headers\openvr_capi.h:1887 */ - public interface GetApplicationSupportedMimeTypes_callback extends Callback { - byte apply(Pointer pchAppKey, Pointer pchMimeTypesBuffer, int unMimeTypesBuffer); - }; - /** native declaration : headers\openvr_capi.h:1888 */ - public interface GetApplicationsThatSupportMimeType_callback extends Callback { - int apply(Pointer pchMimeType, Pointer pchAppKeysThatSupportBuffer, int unAppKeysThatSupportBuffer); - }; - /** native declaration : headers\openvr_capi.h:1889 */ - public interface GetApplicationLaunchArguments_callback extends Callback { - int apply(int unHandle, Pointer pchArgs, int unArgs); - }; - /** native declaration : headers\openvr_capi.h:1890 */ - public interface GetStartingApplication_callback extends Callback { - int apply(Pointer pchAppKeyBuffer, int unAppKeyBufferLen); - }; - /** native declaration : headers\openvr_capi.h:1891 */ - public interface GetTransitionState_callback extends Callback { - int apply(); - }; - /** native declaration : headers\openvr_capi.h:1892 */ - public interface PerformApplicationPrelaunchCheck_callback extends Callback { - int apply(Pointer pchAppKey); - }; - /** native declaration : headers\openvr_capi.h:1893 */ - public interface GetApplicationsTransitionStateNameFromEnum_callback extends Callback { - Pointer apply(int state); - }; - /** native declaration : headers\openvr_capi.h:1894 */ - public interface IsQuitUserPromptRequested_callback extends Callback { - byte apply(); - }; - /** native declaration : headers\openvr_capi.h:1895 */ - public interface LaunchInternalProcess_callback extends Callback { - int apply(Pointer pchBinaryPath, Pointer pchArguments, Pointer pchWorkingDirectory); - }; - /** native declaration : headers\openvr_capi.h:1896 */ - public interface GetCurrentSceneProcessId_callback extends Callback { - int apply(); - }; - public VR_IVRApplications_FnTable() { - super(); - } - @Override - 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 5795f54df7..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRChaperoneSetup_FnTable.java +++ /dev/null @@ -1,152 +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:1957
- * 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:1937 */ - public interface CommitWorkingCopy_callback extends Callback { - byte apply(int configFile); - }; - /** native declaration : headers\openvr_capi.h:1938 */ - public interface RevertWorkingCopy_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:1939 */ - public interface GetWorkingPlayAreaSize_callback extends Callback { - byte apply(FloatByReference pSizeX, FloatByReference pSizeZ); - }; - /** native declaration : headers\openvr_capi.h:1940 */ - public interface GetWorkingPlayAreaRect_callback extends Callback { - byte apply(HmdQuad_t rect); - }; - /** native declaration : headers\openvr_capi.h:1941 */ - public interface GetWorkingCollisionBoundsInfo_callback extends Callback { - byte apply(HmdQuad_t pQuadsBuffer, IntByReference punQuadsCount); - }; - /** native declaration : headers\openvr_capi.h:1942 */ - public interface GetLiveCollisionBoundsInfo_callback extends Callback { - byte apply(HmdQuad_t pQuadsBuffer, IntByReference punQuadsCount); - }; - /** native declaration : headers\openvr_capi.h:1943 */ - public interface GetWorkingSeatedZeroPoseToRawTrackingPose_callback extends Callback { - byte apply(HmdMatrix34_t pmatSeatedZeroPoseToRawTrackingPose); - }; - /** native declaration : headers\openvr_capi.h:1944 */ - public interface GetWorkingStandingZeroPoseToRawTrackingPose_callback extends Callback { - byte apply(HmdMatrix34_t pmatStandingZeroPoseToRawTrackingPose); - }; - /** native declaration : headers\openvr_capi.h:1945 */ - public interface SetWorkingPlayAreaSize_callback extends Callback { - void apply(float sizeX, float sizeZ); - }; - /** native declaration : headers\openvr_capi.h:1946 */ - public interface SetWorkingCollisionBoundsInfo_callback extends Callback { - void apply(HmdQuad_t pQuadsBuffer, int unQuadsCount); - }; - /** native declaration : headers\openvr_capi.h:1947 */ - public interface SetWorkingSeatedZeroPoseToRawTrackingPose_callback extends Callback { - void apply(HmdMatrix34_t pMatSeatedZeroPoseToRawTrackingPose); - }; - /** native declaration : headers\openvr_capi.h:1948 */ - public interface SetWorkingStandingZeroPoseToRawTrackingPose_callback extends Callback { - void apply(HmdMatrix34_t pMatStandingZeroPoseToRawTrackingPose); - }; - /** native declaration : headers\openvr_capi.h:1949 */ - public interface ReloadFromDisk_callback extends Callback { - void apply(int configFile); - }; - /** native declaration : headers\openvr_capi.h:1950 */ - public interface GetLiveSeatedZeroPoseToRawTrackingPose_callback extends Callback { - byte apply(HmdMatrix34_t pmatSeatedZeroPoseToRawTrackingPose); - }; - /** native declaration : headers\openvr_capi.h:1951 */ - public interface SetWorkingCollisionBoundsTagsInfo_callback extends Callback { - void apply(Pointer pTagsBuffer, int unTagCount); - }; - /** native declaration : headers\openvr_capi.h:1952 */ - public interface GetLiveCollisionBoundsTagsInfo_callback extends Callback { - byte apply(Pointer pTagsBuffer, IntByReference punTagCount); - }; - /** native declaration : headers\openvr_capi.h:1953 */ - public interface SetWorkingPhysicalBoundsInfo_callback extends Callback { - byte apply(HmdQuad_t pQuadsBuffer, int unQuadsCount); - }; - /** native declaration : headers\openvr_capi.h:1954 */ - public interface GetLivePhysicalBoundsInfo_callback extends Callback { - byte apply(HmdQuad_t pQuadsBuffer, IntByReference punQuadsCount); - }; - /** native declaration : headers\openvr_capi.h:1955 */ - public interface ExportLiveToBuffer_callback extends Callback { - byte apply(Pointer pBuffer, IntByReference pnBufferLength); - }; - /** native declaration : headers\openvr_capi.h:1956 */ - public interface ImportFromBufferToWorking_callback extends Callback { - byte apply(Pointer pBuffer, int nImportFlags); - }; - public VR_IVRChaperoneSetup_FnTable() { - super(); - } - @Override - 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 1a575c6c09..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRChaperone_FnTable.java +++ /dev/null @@ -1,100 +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:1915
- * 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:1907 */ - public interface GetCalibrationState_callback extends Callback { - int apply(); - }; - /** native declaration : headers\openvr_capi.h:1908 */ - public interface GetPlayAreaSize_callback extends Callback { - byte apply(FloatByReference pSizeX, FloatByReference pSizeZ); - }; - /** native declaration : headers\openvr_capi.h:1909 */ - public interface GetPlayAreaRect_callback extends Callback { - byte apply(HmdQuad_t rect); - }; - /** native declaration : headers\openvr_capi.h:1910 */ - public interface ReloadInfo_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:1911 */ - public interface SetSceneColor_callback extends Callback { - void apply(HmdColor_t.ByValue color); - }; - /** native declaration : headers\openvr_capi.h:1912 */ - public interface GetBoundsColor_callback extends Callback { - void apply(HmdColor_t pOutputColorArray, int nNumOutputColors, float flCollisionBoundsFadeDistance, HmdColor_t pOutputCameraColor); - }; - /** native declaration : headers\openvr_capi.h:1913 */ - public interface AreBoundsVisible_callback extends Callback { - byte apply(); - }; - /** native declaration : headers\openvr_capi.h:1914 */ - public interface ForceBoundsVisible_callback extends Callback { - void apply(byte bForce); - }; - public VR_IVRChaperone_FnTable() { - super(); - } - @Override - 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 53a3039437..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRCompositor_FnTable.java +++ /dev/null @@ -1,291 +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:2045
- * 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; - /** C type : SetExplicitTimingMode_callback* */ - public VR_IVRCompositor_FnTable.SetExplicitTimingMode_callback SetExplicitTimingMode; - /** C type : SubmitExplicitTimingData_callback* */ - public VR_IVRCompositor_FnTable.SubmitExplicitTimingData_callback SubmitExplicitTimingData; - /** native declaration : headers\openvr_capi.h:2002 */ - public interface SetTrackingSpace_callback extends Callback { - void apply(int eOrigin); - }; - /** native declaration : headers\openvr_capi.h:2003 */ - public interface GetTrackingSpace_callback extends Callback { - int apply(); - }; - /** native declaration : headers\openvr_capi.h:2004 */ - public interface WaitGetPoses_callback extends Callback { - int apply(TrackedDevicePose_t pRenderPoseArray, int unRenderPoseArrayCount, TrackedDevicePose_t pGamePoseArray, int unGamePoseArrayCount); - }; - /** native declaration : headers\openvr_capi.h:2005 */ - public interface GetLastPoses_callback extends Callback { - int apply(TrackedDevicePose_t pRenderPoseArray, int unRenderPoseArrayCount, TrackedDevicePose_t pGamePoseArray, int unGamePoseArrayCount); - }; - /** native declaration : headers\openvr_capi.h:2006 */ - public interface GetLastPoseForTrackedDeviceIndex_callback extends Callback { - int apply(int unDeviceIndex, TrackedDevicePose_t pOutputPose, TrackedDevicePose_t pOutputGamePose); - }; - /** native declaration : headers\openvr_capi.h:2007 */ - public interface Submit_callback extends Callback { - int apply(int eEye, Texture_t pTexture, VRTextureBounds_t pBounds, int nSubmitFlags); - }; - /** native declaration : headers\openvr_capi.h:2008 */ - public interface ClearLastSubmittedFrame_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:2009 */ - public interface PostPresentHandoff_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:2010 */ - public interface GetFrameTiming_callback extends Callback { - byte apply(Compositor_FrameTiming pTiming, int unFramesAgo); - }; - /** native declaration : headers\openvr_capi.h:2011 */ - public interface GetFrameTimings_callback extends Callback { - int apply(Compositor_FrameTiming pTiming, int nFrames); - }; - /** native declaration : headers\openvr_capi.h:2012 */ - public interface GetFrameTimeRemaining_callback extends Callback { - float apply(); - }; - /** native declaration : headers\openvr_capi.h:2013 */ - public interface GetCumulativeStats_callback extends Callback { - void apply(Compositor_CumulativeStats pStats, int nStatsSizeInBytes); - }; - /** native declaration : headers\openvr_capi.h:2014 */ - 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:2015 */ - public interface GetCurrentFadeColor_callback extends Callback { - com.jme3.system.jopenvr.HmdColor_t.ByValue apply(byte bBackground); - }; - /** native declaration : headers\openvr_capi.h:2016 */ - public interface FadeGrid_callback extends Callback { - void apply(float fSeconds, byte bFadeIn); - }; - /** native declaration : headers\openvr_capi.h:2017 */ - public interface GetCurrentGridAlpha_callback extends Callback { - float apply(); - }; - /** native declaration : headers\openvr_capi.h:2018 */ - public interface SetSkyboxOverride_callback extends Callback { - int apply(Texture_t pTextures, int unTextureCount); - }; - /** native declaration : headers\openvr_capi.h:2019 */ - public interface ClearSkyboxOverride_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:2020 */ - public interface CompositorBringToFront_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:2021 */ - public interface CompositorGoToBack_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:2022 */ - public interface CompositorQuit_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:2023 */ - public interface IsFullscreen_callback extends Callback { - byte apply(); - }; - /** native declaration : headers\openvr_capi.h:2024 */ - public interface GetCurrentSceneFocusProcess_callback extends Callback { - int apply(); - }; - /** native declaration : headers\openvr_capi.h:2025 */ - public interface GetLastFrameRenderer_callback extends Callback { - int apply(); - }; - /** native declaration : headers\openvr_capi.h:2026 */ - public interface CanRenderScene_callback extends Callback { - byte apply(); - }; - /** native declaration : headers\openvr_capi.h:2027 */ - public interface ShowMirrorWindow_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:2028 */ - public interface HideMirrorWindow_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:2029 */ - public interface IsMirrorWindowVisible_callback extends Callback { - byte apply(); - }; - /** native declaration : headers\openvr_capi.h:2030 */ - public interface CompositorDumpImages_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:2031 */ - public interface ShouldAppRenderWithLowResources_callback extends Callback { - byte apply(); - }; - /** native declaration : headers\openvr_capi.h:2032 */ - public interface ForceInterleavedReprojectionOn_callback extends Callback { - void apply(byte bOverride); - }; - /** native declaration : headers\openvr_capi.h:2033 */ - public interface ForceReconnectProcess_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:2034 */ - public interface SuspendRendering_callback extends Callback { - void apply(byte bSuspend); - }; - /** native declaration : headers\openvr_capi.h:2035 */ - public interface GetMirrorTextureD3D11_callback extends Callback { - int apply(int eEye, Pointer pD3D11DeviceOrResource, PointerByReference ppD3D11ShaderResourceView); - }; - /** native declaration : headers\openvr_capi.h:2036 */ - public interface ReleaseMirrorTextureD3D11_callback extends Callback { - void apply(Pointer pD3D11ShaderResourceView); - }; - /** native declaration : headers\openvr_capi.h:2037 */ - public interface GetMirrorTextureGL_callback extends Callback { - int apply(int eEye, IntByReference pglTextureId, PointerByReference pglSharedTextureHandle); - }; - /** native declaration : headers\openvr_capi.h:2038 */ - public interface ReleaseSharedGLTexture_callback extends Callback { - byte apply(int glTextureId, Pointer glSharedTextureHandle); - }; - /** native declaration : headers\openvr_capi.h:2039 */ - public interface LockGLSharedTextureForAccess_callback extends Callback { - void apply(Pointer glSharedTextureHandle); - }; - /** native declaration : headers\openvr_capi.h:2040 */ - public interface UnlockGLSharedTextureForAccess_callback extends Callback { - void apply(Pointer glSharedTextureHandle); - }; - /** native declaration : headers\openvr_capi.h:2041 */ - public interface GetVulkanInstanceExtensionsRequired_callback extends Callback { - int apply(Pointer pchValue, int unBufferSize); - }; - /** native declaration : headers\openvr_capi.h:2042 */ - public interface GetVulkanDeviceExtensionsRequired_callback extends Callback { - int apply(VkPhysicalDevice_T pPhysicalDevice, Pointer pchValue, int unBufferSize); - }; - /** native declaration : headers\openvr_capi.h:2043 */ - public interface SetExplicitTimingMode_callback extends Callback { - void apply(int eTimingMode); - }; - /** native declaration : headers\openvr_capi.h:2044 */ - public interface SubmitExplicitTimingData_callback extends Callback { - int apply(); - }; - public VR_IVRCompositor_FnTable() { - super(); - } - @Override - 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", "SetExplicitTimingMode", "SubmitExplicitTimingData"); - } - 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 13e444730b..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRDriverManager_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 java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:2313
- * 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; - /** C type : GetDriverHandle_callback* */ - public VR_IVRDriverManager_FnTable.GetDriverHandle_callback GetDriverHandle; - /** native declaration : headers\openvr_capi.h:2310 */ - public interface GetDriverCount_callback extends Callback { - int apply(); - }; - /** native declaration : headers\openvr_capi.h:2311 */ - public interface GetDriverName_callback extends Callback { - int apply(int nDriver, Pointer pchValue, int unBufferSize); - }; - /** native declaration : headers\openvr_capi.h:2312 */ - public interface GetDriverHandle_callback extends Callback { - long apply(Pointer pchDriverName); - }; - public VR_IVRDriverManager_FnTable() { - super(); - } - @Override - protected List getFieldOrder() { - return Arrays.asList("GetDriverCount", "GetDriverName", "GetDriverHandle"); - } - /** - * @param GetDriverCount C type : GetDriverCount_callback*
- * @param GetDriverName C type : GetDriverName_callback*
- * @param GetDriverHandle C type : GetDriverHandle_callback* - */ - public VR_IVRDriverManager_FnTable(VR_IVRDriverManager_FnTable.GetDriverCount_callback GetDriverCount, VR_IVRDriverManager_FnTable.GetDriverName_callback GetDriverName, VR_IVRDriverManager_FnTable.GetDriverHandle_callback GetDriverHandle) { - super(); - this.GetDriverCount = GetDriverCount; - this.GetDriverName = GetDriverName; - this.GetDriverHandle = GetDriverHandle; - } - 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 2b04732a73..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRExtendedDisplay_FnTable.java +++ /dev/null @@ -1,60 +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:1807
- * 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:1804 */ - public interface GetWindowBounds_callback extends Callback { - void apply(IntByReference pnX, IntByReference pnY, IntByReference pnWidth, IntByReference pnHeight); - }; - /** native declaration : headers\openvr_capi.h:1805 */ - public interface GetEyeOutputViewport_callback extends Callback { - void apply(int eEye, IntByReference pnX, IntByReference pnY, IntByReference pnWidth, IntByReference pnHeight); - }; - /** native declaration : headers\openvr_capi.h:1806 */ - public interface GetDXGIOutputInfo_callback extends Callback { - void apply(IntByReference pnAdapterIndex, IntByReference pnAdapterOutputIndex); - }; - public VR_IVRExtendedDisplay_FnTable() { - super(); - } - @Override - 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_IVRIOBuffer_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRIOBuffer_FnTable.java deleted file mode 100644 index 5a6b9291d0..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRIOBuffer_FnTable.java +++ /dev/null @@ -1,77 +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 java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:2363
- * 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_IVRIOBuffer_FnTable extends Structure { - /** C type : Open_callback* */ - public VR_IVRIOBuffer_FnTable.Open_callback Open; - /** C type : Close_callback* */ - public VR_IVRIOBuffer_FnTable.Close_callback Close; - /** C type : Read_callback* */ - public VR_IVRIOBuffer_FnTable.Read_callback Read; - /** C type : Write_callback* */ - public VR_IVRIOBuffer_FnTable.Write_callback Write; - /** C type : PropertyContainer_callback* */ - public VR_IVRIOBuffer_FnTable.PropertyContainer_callback PropertyContainer; - /** native declaration : headers\openvr_capi.h:2358 */ - public interface Open_callback extends Callback { - int apply(Pointer pchPath, int mode, int unElementSize, int unElements, LongByReference pulBuffer); - }; - /** native declaration : headers\openvr_capi.h:2359 */ - public interface Close_callback extends Callback { - int apply(long ulBuffer); - }; - /** native declaration : headers\openvr_capi.h:2360 */ - public interface Read_callback extends Callback { - int apply(long ulBuffer, Pointer pDst, int unBytes, IntByReference punRead); - }; - /** native declaration : headers\openvr_capi.h:2361 */ - public interface Write_callback extends Callback { - int apply(long ulBuffer, Pointer pSrc, int unBytes); - }; - /** native declaration : headers\openvr_capi.h:2362 */ - public interface PropertyContainer_callback extends Callback { - long apply(long ulBuffer); - }; - public VR_IVRIOBuffer_FnTable() { - super(); - } - @Override - protected List getFieldOrder() { - return Arrays.asList("Open", "Close", "Read", "Write", "PropertyContainer"); - } - /** - * @param Open C type : Open_callback*
- * @param Close C type : Close_callback*
- * @param Read C type : Read_callback*
- * @param Write C type : Write_callback*
- * @param PropertyContainer C type : PropertyContainer_callback* - */ - public VR_IVRIOBuffer_FnTable(VR_IVRIOBuffer_FnTable.Open_callback Open, VR_IVRIOBuffer_FnTable.Close_callback Close, VR_IVRIOBuffer_FnTable.Read_callback Read, VR_IVRIOBuffer_FnTable.Write_callback Write, VR_IVRIOBuffer_FnTable.PropertyContainer_callback PropertyContainer) { - super(); - this.Open = Open; - this.Close = Close; - this.Read = Read; - this.Write = Write; - this.PropertyContainer = PropertyContainer; - } - public VR_IVRIOBuffer_FnTable(Pointer peer) { - super(peer); - } - public static class ByReference extends VR_IVRIOBuffer_FnTable implements Structure.ByReference { - - }; - public static class ByValue extends VR_IVRIOBuffer_FnTable implements Structure.ByValue { - - }; -} diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRInput_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRInput_FnTable.java deleted file mode 100644 index 44987cc991..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRInput_FnTable.java +++ /dev/null @@ -1,140 +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 java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:2351
- * 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_IVRInput_FnTable extends Structure { - /** C type : SetActionManifestPath_callback* */ - public VR_IVRInput_FnTable.SetActionManifestPath_callback SetActionManifestPath; - /** C type : GetActionSetHandle_callback* */ - public VR_IVRInput_FnTable.GetActionSetHandle_callback GetActionSetHandle; - /** C type : GetActionHandle_callback* */ - public VR_IVRInput_FnTable.GetActionHandle_callback GetActionHandle; - /** C type : GetInputSourceHandle_callback* */ - public VR_IVRInput_FnTable.GetInputSourceHandle_callback GetInputSourceHandle; - /** C type : UpdateActionState_callback* */ - public VR_IVRInput_FnTable.UpdateActionState_callback UpdateActionState; - /** C type : GetDigitalActionData_callback* */ - public VR_IVRInput_FnTable.GetDigitalActionData_callback GetDigitalActionData; - /** C type : GetAnalogActionData_callback* */ - public VR_IVRInput_FnTable.GetAnalogActionData_callback GetAnalogActionData; - /** C type : GetPoseActionData_callback* */ - public VR_IVRInput_FnTable.GetPoseActionData_callback GetPoseActionData; - /** C type : GetSkeletalActionData_callback* */ - public VR_IVRInput_FnTable.GetSkeletalActionData_callback GetSkeletalActionData; - /** C type : GetSkeletalBoneData_callback* */ - public VR_IVRInput_FnTable.GetSkeletalBoneData_callback GetSkeletalBoneData; - /** C type : GetSkeletalBoneDataCompressed_callback* */ - public VR_IVRInput_FnTable.GetSkeletalBoneDataCompressed_callback GetSkeletalBoneDataCompressed; - /** C type : DecompressSkeletalBoneData_callback* */ - public VR_IVRInput_FnTable.DecompressSkeletalBoneData_callback DecompressSkeletalBoneData; - /** C type : TriggerHapticVibrationAction_callback* */ - public VR_IVRInput_FnTable.TriggerHapticVibrationAction_callback TriggerHapticVibrationAction; - /** C type : GetActionOrigins_callback* */ - public VR_IVRInput_FnTable.GetActionOrigins_callback GetActionOrigins; - /** C type : GetOriginLocalizedName_callback* */ - public VR_IVRInput_FnTable.GetOriginLocalizedName_callback GetOriginLocalizedName; - /** C type : GetOriginTrackedDeviceInfo_callback* */ - public VR_IVRInput_FnTable.GetOriginTrackedDeviceInfo_callback GetOriginTrackedDeviceInfo; - /** C type : ShowActionOrigins_callback* */ - public VR_IVRInput_FnTable.ShowActionOrigins_callback ShowActionOrigins; - /** C type : ShowBindingsForActionSet_callback* */ - public VR_IVRInput_FnTable.ShowBindingsForActionSet_callback ShowBindingsForActionSet; - /** native declaration : headers\openvr_capi.h:2333 */ - public interface SetActionManifestPath_callback extends Callback { - int apply(Pointer pchActionManifestPath); - }; - /** native declaration : headers\openvr_capi.h:2334 */ - public interface GetActionSetHandle_callback extends Callback { - int apply(Pointer pchActionSetName, LongByReference pHandle); - }; - /** native declaration : headers\openvr_capi.h:2335 */ - public interface GetActionHandle_callback extends Callback { - int apply(Pointer pchActionName, LongByReference pHandle); - }; - /** native declaration : headers\openvr_capi.h:2336 */ - public interface GetInputSourceHandle_callback extends Callback { - int apply(Pointer pchInputSourcePath, LongByReference pHandle); - }; - /** native declaration : headers\openvr_capi.h:2337 */ - public interface UpdateActionState_callback extends Callback { - int apply(VRActiveActionSet_t pSets, int unSizeOfVRSelectedActionSet_t, int unSetCount); - }; - /** native declaration : headers\openvr_capi.h:2338 */ - public interface GetDigitalActionData_callback extends Callback { - int apply(long action, InputDigitalActionData_t pActionData, int unActionDataSize, long ulRestrictToDevice); - }; - /** native declaration : headers\openvr_capi.h:2339 */ - public interface GetAnalogActionData_callback extends Callback { - int apply(long action, InputAnalogActionData_t pActionData, int unActionDataSize, long ulRestrictToDevice); - }; - /** native declaration : headers\openvr_capi.h:2340 */ - public interface GetPoseActionData_callback extends Callback { - int apply(long action, int eOrigin, float fPredictedSecondsFromNow, InputPoseActionData_t pActionData, int unActionDataSize, long ulRestrictToDevice); - }; - /** native declaration : headers\openvr_capi.h:2341 */ - public interface GetSkeletalActionData_callback extends Callback { - int apply(long action, InputSkeletalActionData_t pActionData, int unActionDataSize, long ulRestrictToDevice); - }; - /** native declaration : headers\openvr_capi.h:2342 */ - public interface GetSkeletalBoneData_callback extends Callback { - int apply(long action, int eTransformSpace, int eMotionRange, VRBoneTransform_t pTransformArray, int unTransformArrayCount, long ulRestrictToDevice); - }; - /** native declaration : headers\openvr_capi.h:2343 */ - public interface GetSkeletalBoneDataCompressed_callback extends Callback { - int apply(long action, int eTransformSpace, int eMotionRange, Pointer pvCompressedData, int unCompressedSize, IntByReference punRequiredCompressedSize, long ulRestrictToDevice); - }; - /** native declaration : headers\openvr_capi.h:2344 */ - public interface DecompressSkeletalBoneData_callback extends Callback { - int apply(Pointer pvCompressedBuffer, int unCompressedBufferSize, IntByReference peTransformSpace, VRBoneTransform_t pTransformArray, int unTransformArrayCount); - }; - /** native declaration : headers\openvr_capi.h:2345 */ - public interface TriggerHapticVibrationAction_callback extends Callback { - int apply(long action, float fStartSecondsFromNow, float fDurationSeconds, float fFrequency, float fAmplitude, long ulRestrictToDevice); - }; - /** native declaration : headers\openvr_capi.h:2346 */ - public interface GetActionOrigins_callback extends Callback { - int apply(long actionSetHandle, long digitalActionHandle, LongByReference originsOut, int originOutCount); - }; - /** native declaration : headers\openvr_capi.h:2347 */ - public interface GetOriginLocalizedName_callback extends Callback { - int apply(long origin, Pointer pchNameArray, int unNameArraySize); - }; - /** native declaration : headers\openvr_capi.h:2348 */ - public interface GetOriginTrackedDeviceInfo_callback extends Callback { - int apply(long origin, InputOriginInfo_t pOriginInfo, int unOriginInfoSize); - }; - /** native declaration : headers\openvr_capi.h:2349 */ - public interface ShowActionOrigins_callback extends Callback { - int apply(long actionSetHandle, long ulActionHandle); - }; - /** native declaration : headers\openvr_capi.h:2350 */ - public interface ShowBindingsForActionSet_callback extends Callback { - int apply(VRActiveActionSet_t pSets, int unSizeOfVRSelectedActionSet_t, int unSetCount, long originToHighlight); - }; - public VR_IVRInput_FnTable() { - super(); - } - @Override - protected List getFieldOrder() { - return Arrays.asList("SetActionManifestPath", "GetActionSetHandle", "GetActionHandle", "GetInputSourceHandle", "UpdateActionState", "GetDigitalActionData", "GetAnalogActionData", "GetPoseActionData", "GetSkeletalActionData", "GetSkeletalBoneData", "GetSkeletalBoneDataCompressed", "DecompressSkeletalBoneData", "TriggerHapticVibrationAction", "GetActionOrigins", "GetOriginLocalizedName", "GetOriginTrackedDeviceInfo", "ShowActionOrigins", "ShowBindingsForActionSet"); - } - public VR_IVRInput_FnTable(Pointer peer) { - super(peer); - } - public static class ByReference extends VR_IVRInput_FnTable implements Structure.ByReference { - - }; - public static class ByValue extends VR_IVRInput_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 7e15f3591d..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRNotifications_FnTable.java +++ /dev/null @@ -1,52 +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:2257
- * 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:2255 */ - 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:2256 */ - public interface RemoveNotification_callback extends Callback { - int apply(int notificationId); - }; - public VR_IVRNotifications_FnTable() { - super(); - } - @Override - 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 f9405bb07d..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVROverlay_FnTable.java +++ /dev/null @@ -1,526 +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:2211
- * 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 : 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 : SetOverlayDualAnalogTransform_callback* */ - public VR_IVROverlay_FnTable.SetOverlayDualAnalogTransform_callback SetOverlayDualAnalogTransform; - /** C type : GetOverlayDualAnalogTransform_callback* */ - public VR_IVROverlay_FnTable.GetOverlayDualAnalogTransform_callback GetOverlayDualAnalogTransform; - /** 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; - /** C type : CloseMessageOverlay_callback* */ - public VR_IVROverlay_FnTable.CloseMessageOverlay_callback CloseMessageOverlay; - /** native declaration : headers\openvr_capi.h:2129 */ - public interface FindOverlay_callback extends Callback { - int apply(Pointer pchOverlayKey, LongByReference pOverlayHandle); - }; - /** native declaration : headers\openvr_capi.h:2130 */ - public interface CreateOverlay_callback extends Callback { - int apply(Pointer pchOverlayKey, Pointer pchOverlayName, LongByReference pOverlayHandle); - }; - /** native declaration : headers\openvr_capi.h:2131 */ - public interface DestroyOverlay_callback extends Callback { - int apply(long ulOverlayHandle); - }; - /** native declaration : headers\openvr_capi.h:2132 */ - public interface SetHighQualityOverlay_callback extends Callback { - int apply(long ulOverlayHandle); - }; - /** native declaration : headers\openvr_capi.h:2133 */ - public interface GetHighQualityOverlay_callback extends Callback { - long apply(); - }; - /** native declaration : headers\openvr_capi.h:2134 */ - public interface GetOverlayKey_callback extends Callback { - int apply(long ulOverlayHandle, Pointer pchValue, int unBufferSize, IntByReference pError); - }; - /** native declaration : headers\openvr_capi.h:2135 */ - public interface GetOverlayName_callback extends Callback { - int apply(long ulOverlayHandle, Pointer pchValue, int unBufferSize, IntByReference pError); - }; - /** native declaration : headers\openvr_capi.h:2136 */ - public interface SetOverlayName_callback extends Callback { - int apply(long ulOverlayHandle, Pointer pchName); - }; - /** native declaration : headers\openvr_capi.h:2137 */ - public interface GetOverlayImageData_callback extends Callback { - int apply(long ulOverlayHandle, Pointer pvBuffer, int unBufferSize, IntByReference punWidth, IntByReference punHeight); - }; - /** native declaration : headers\openvr_capi.h:2138 */ - public interface GetOverlayErrorNameFromEnum_callback extends Callback { - Pointer apply(int error); - }; - /** native declaration : headers\openvr_capi.h:2139 */ - public interface SetOverlayRenderingPid_callback extends Callback { - int apply(long ulOverlayHandle, int unPID); - }; - /** native declaration : headers\openvr_capi.h:2140 */ - public interface GetOverlayRenderingPid_callback extends Callback { - int apply(long ulOverlayHandle); - }; - /** native declaration : headers\openvr_capi.h:2141 */ - public interface SetOverlayFlag_callback extends Callback { - int apply(long ulOverlayHandle, int eOverlayFlag, byte bEnabled); - }; - /** native declaration : headers\openvr_capi.h:2142 */ - public interface GetOverlayFlag_callback extends Callback { - int apply(long ulOverlayHandle, int eOverlayFlag, Pointer pbEnabled); - }; - /** native declaration : headers\openvr_capi.h:2143 */ - public interface SetOverlayColor_callback extends Callback { - int apply(long ulOverlayHandle, float fRed, float fGreen, float fBlue); - }; - /** native declaration : headers\openvr_capi.h:2144 */ - public interface GetOverlayColor_callback extends Callback { - int apply(long ulOverlayHandle, FloatByReference pfRed, FloatByReference pfGreen, FloatByReference pfBlue); - }; - /** native declaration : headers\openvr_capi.h:2145 */ - public interface SetOverlayAlpha_callback extends Callback { - int apply(long ulOverlayHandle, float fAlpha); - }; - /** native declaration : headers\openvr_capi.h:2146 */ - public interface GetOverlayAlpha_callback extends Callback { - int apply(long ulOverlayHandle, FloatByReference pfAlpha); - }; - /** native declaration : headers\openvr_capi.h:2147 */ - public interface SetOverlayTexelAspect_callback extends Callback { - int apply(long ulOverlayHandle, float fTexelAspect); - }; - /** native declaration : headers\openvr_capi.h:2148 */ - public interface GetOverlayTexelAspect_callback extends Callback { - int apply(long ulOverlayHandle, FloatByReference pfTexelAspect); - }; - /** native declaration : headers\openvr_capi.h:2149 */ - public interface SetOverlaySortOrder_callback extends Callback { - int apply(long ulOverlayHandle, int unSortOrder); - }; - /** native declaration : headers\openvr_capi.h:2150 */ - public interface GetOverlaySortOrder_callback extends Callback { - int apply(long ulOverlayHandle, IntByReference punSortOrder); - }; - /** native declaration : headers\openvr_capi.h:2151 */ - public interface SetOverlayWidthInMeters_callback extends Callback { - int apply(long ulOverlayHandle, float fWidthInMeters); - }; - /** native declaration : headers\openvr_capi.h:2152 */ - public interface GetOverlayWidthInMeters_callback extends Callback { - int apply(long ulOverlayHandle, FloatByReference pfWidthInMeters); - }; - /** native declaration : headers\openvr_capi.h:2153 */ - public interface SetOverlayAutoCurveDistanceRangeInMeters_callback extends Callback { - int apply(long ulOverlayHandle, float fMinDistanceInMeters, float fMaxDistanceInMeters); - }; - /** native declaration : headers\openvr_capi.h:2154 */ - public interface GetOverlayAutoCurveDistanceRangeInMeters_callback extends Callback { - int apply(long ulOverlayHandle, FloatByReference pfMinDistanceInMeters, FloatByReference pfMaxDistanceInMeters); - }; - /** native declaration : headers\openvr_capi.h:2155 */ - public interface SetOverlayTextureColorSpace_callback extends Callback { - int apply(long ulOverlayHandle, int eTextureColorSpace); - }; - /** native declaration : headers\openvr_capi.h:2156 */ - public interface GetOverlayTextureColorSpace_callback extends Callback { - int apply(long ulOverlayHandle, IntByReference peTextureColorSpace); - }; - /** native declaration : headers\openvr_capi.h:2157 */ - public interface SetOverlayTextureBounds_callback extends Callback { - int apply(long ulOverlayHandle, VRTextureBounds_t pOverlayTextureBounds); - }; - /** native declaration : headers\openvr_capi.h:2158 */ - public interface GetOverlayTextureBounds_callback extends Callback { - int apply(long ulOverlayHandle, VRTextureBounds_t pOverlayTextureBounds); - }; - /** native declaration : headers\openvr_capi.h:2159 */ - 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:2160 */ - public interface SetOverlayRenderModel_callback extends Callback { - int apply(long ulOverlayHandle, Pointer pchRenderModel, HmdColor_t pColor); - }; - /** native declaration : headers\openvr_capi.h:2161 */ - public interface GetOverlayTransformType_callback extends Callback { - int apply(long ulOverlayHandle, IntByReference peTransformType); - }; - /** native declaration : headers\openvr_capi.h:2162 */ - public interface SetOverlayTransformAbsolute_callback extends Callback { - int apply(long ulOverlayHandle, int eTrackingOrigin, HmdMatrix34_t pmatTrackingOriginToOverlayTransform); - }; - /** native declaration : headers\openvr_capi.h:2163 */ - public interface GetOverlayTransformAbsolute_callback extends Callback { - int apply(long ulOverlayHandle, IntByReference peTrackingOrigin, HmdMatrix34_t pmatTrackingOriginToOverlayTransform); - }; - /** native declaration : headers\openvr_capi.h:2164 */ - public interface SetOverlayTransformTrackedDeviceRelative_callback extends Callback { - int apply(long ulOverlayHandle, int unTrackedDevice, HmdMatrix34_t pmatTrackedDeviceToOverlayTransform); - }; - /** native declaration : headers\openvr_capi.h:2165 */ - public interface GetOverlayTransformTrackedDeviceRelative_callback extends Callback { - int apply(long ulOverlayHandle, IntByReference punTrackedDevice, HmdMatrix34_t pmatTrackedDeviceToOverlayTransform); - }; - /** native declaration : headers\openvr_capi.h:2166 */ - public interface SetOverlayTransformTrackedDeviceComponent_callback extends Callback { - int apply(long ulOverlayHandle, int unDeviceIndex, Pointer pchComponentName); - }; - /** native declaration : headers\openvr_capi.h:2167 */ - public interface GetOverlayTransformTrackedDeviceComponent_callback extends Callback { - int apply(long ulOverlayHandle, IntByReference punDeviceIndex, Pointer pchComponentName, int unComponentNameSize); - }; - /** native declaration : headers\openvr_capi.h:2168 */ - public interface GetOverlayTransformOverlayRelative_callback extends Callback { - int apply(long ulOverlayHandle, LongByReference ulOverlayHandleParent, HmdMatrix34_t pmatParentOverlayToOverlayTransform); - }; - /** native declaration : headers\openvr_capi.h:2169 */ - public interface SetOverlayTransformOverlayRelative_callback extends Callback { - int apply(long ulOverlayHandle, long ulOverlayHandleParent, HmdMatrix34_t pmatParentOverlayToOverlayTransform); - }; - /** native declaration : headers\openvr_capi.h:2170 */ - public interface ShowOverlay_callback extends Callback { - int apply(long ulOverlayHandle); - }; - /** native declaration : headers\openvr_capi.h:2171 */ - public interface HideOverlay_callback extends Callback { - int apply(long ulOverlayHandle); - }; - /** native declaration : headers\openvr_capi.h:2172 */ - public interface IsOverlayVisible_callback extends Callback { - byte apply(long ulOverlayHandle); - }; - /** native declaration : headers\openvr_capi.h:2173 */ - 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:2174 */ - public interface PollNextOverlayEvent_callback extends Callback { - byte apply(long ulOverlayHandle, VREvent_t pEvent, int uncbVREvent); - }; - /** native declaration : headers\openvr_capi.h:2175 */ - public interface GetOverlayInputMethod_callback extends Callback { - int apply(long ulOverlayHandle, IntByReference peInputMethod); - }; - /** native declaration : headers\openvr_capi.h:2176 */ - public interface SetOverlayInputMethod_callback extends Callback { - int apply(long ulOverlayHandle, int eInputMethod); - }; - /** native declaration : headers\openvr_capi.h:2177 */ - public interface GetOverlayMouseScale_callback extends Callback { - int apply(long ulOverlayHandle, HmdVector2_t pvecMouseScale); - }; - /** native declaration : headers\openvr_capi.h:2178 */ - public interface SetOverlayMouseScale_callback extends Callback { - int apply(long ulOverlayHandle, HmdVector2_t pvecMouseScale); - }; - /** native declaration : headers\openvr_capi.h:2179 */ - public interface ComputeOverlayIntersection_callback extends Callback { - byte apply(long ulOverlayHandle, VROverlayIntersectionParams_t pParams, VROverlayIntersectionResults_t pResults); - }; - /** native declaration : headers\openvr_capi.h:2180 */ - public interface IsHoverTargetOverlay_callback extends Callback { - byte apply(long ulOverlayHandle); - }; - /** native declaration : headers\openvr_capi.h:2181 */ - public interface GetGamepadFocusOverlay_callback extends Callback { - long apply(); - }; - /** native declaration : headers\openvr_capi.h:2182 */ - public interface SetGamepadFocusOverlay_callback extends Callback { - int apply(long ulNewFocusOverlay); - }; - /** native declaration : headers\openvr_capi.h:2183 */ - public interface SetOverlayNeighbor_callback extends Callback { - int apply(int eDirection, long ulFrom, long ulTo); - }; - /** native declaration : headers\openvr_capi.h:2184 */ - public interface MoveGamepadFocusToNeighbor_callback extends Callback { - int apply(int eDirection, long ulFrom); - }; - /** native declaration : headers\openvr_capi.h:2185 */ - public interface SetOverlayDualAnalogTransform_callback extends Callback { - int apply(long ulOverlay, int eWhich, HmdVector2_t vCenter, float fRadius); - }; - /** native declaration : headers\openvr_capi.h:2186 */ - public interface GetOverlayDualAnalogTransform_callback extends Callback { - int apply(long ulOverlay, int eWhich, HmdVector2_t pvCenter, FloatByReference pfRadius); - }; - /** native declaration : headers\openvr_capi.h:2187 */ - public interface SetOverlayTexture_callback extends Callback { - int apply(long ulOverlayHandle, Texture_t pTexture); - }; - /** native declaration : headers\openvr_capi.h:2188 */ - public interface ClearOverlayTexture_callback extends Callback { - int apply(long ulOverlayHandle); - }; - /** native declaration : headers\openvr_capi.h:2189 */ - public interface SetOverlayRaw_callback extends Callback { - int apply(long ulOverlayHandle, Pointer pvBuffer, int unWidth, int unHeight, int unDepth); - }; - /** native declaration : headers\openvr_capi.h:2190 */ - public interface SetOverlayFromFile_callback extends Callback { - int apply(long ulOverlayHandle, Pointer pchFilePath); - }; - /** native declaration : headers\openvr_capi.h:2191 */ - 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:2192 */ - public interface ReleaseNativeOverlayHandle_callback extends Callback { - int apply(long ulOverlayHandle, Pointer pNativeTextureHandle); - }; - /** native declaration : headers\openvr_capi.h:2193 */ - public interface GetOverlayTextureSize_callback extends Callback { - int apply(long ulOverlayHandle, IntByReference pWidth, IntByReference pHeight); - }; - /** native declaration : headers\openvr_capi.h:2194 */ - public interface CreateDashboardOverlay_callback extends Callback { - int apply(Pointer pchOverlayKey, Pointer pchOverlayFriendlyName, LongByReference pMainHandle, LongByReference pThumbnailHandle); - }; - /** native declaration : headers\openvr_capi.h:2195 */ - public interface IsDashboardVisible_callback extends Callback { - byte apply(); - }; - /** native declaration : headers\openvr_capi.h:2196 */ - public interface IsActiveDashboardOverlay_callback extends Callback { - byte apply(long ulOverlayHandle); - }; - /** native declaration : headers\openvr_capi.h:2197 */ - public interface SetDashboardOverlaySceneProcess_callback extends Callback { - int apply(long ulOverlayHandle, int unProcessId); - }; - /** native declaration : headers\openvr_capi.h:2198 */ - public interface GetDashboardOverlaySceneProcess_callback extends Callback { - int apply(long ulOverlayHandle, IntByReference punProcessId); - }; - /** native declaration : headers\openvr_capi.h:2199 */ - public interface ShowDashboard_callback extends Callback { - void apply(Pointer pchOverlayToShow); - }; - /** native declaration : headers\openvr_capi.h:2200 */ - public interface GetPrimaryDashboardDevice_callback extends Callback { - int apply(); - }; - /** native declaration : headers\openvr_capi.h:2201 */ - 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:2202 */ - 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:2203 */ - public interface GetKeyboardText_callback extends Callback { - int apply(Pointer pchText, int cchText); - }; - /** native declaration : headers\openvr_capi.h:2204 */ - public interface HideKeyboard_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:2205 */ - public interface SetKeyboardTransformAbsolute_callback extends Callback { - void apply(int eTrackingOrigin, HmdMatrix34_t pmatTrackingOriginToKeyboardTransform); - }; - /** native declaration : headers\openvr_capi.h:2206 */ - public interface SetKeyboardPositionForOverlay_callback extends Callback { - void apply(long ulOverlayHandle, com.jme3.system.jopenvr.HmdRect2_t.ByValue avoidRect); - }; - /** native declaration : headers\openvr_capi.h:2207 */ - public interface SetOverlayIntersectionMask_callback extends Callback { - int apply(long ulOverlayHandle, VROverlayIntersectionMaskPrimitive_t pMaskPrimitives, int unNumMaskPrimitives, int unPrimitiveSize); - }; - /** native declaration : headers\openvr_capi.h:2208 */ - public interface GetOverlayFlags_callback extends Callback { - int apply(long ulOverlayHandle, IntByReference pFlags); - }; - /** native declaration : headers\openvr_capi.h:2209 */ - public interface ShowMessageOverlay_callback extends Callback { - int apply(Pointer pchText, Pointer pchCaption, Pointer pchButton0Text, Pointer pchButton1Text, Pointer pchButton2Text, Pointer pchButton3Text); - }; - /** native declaration : headers\openvr_capi.h:2210 */ - public interface CloseMessageOverlay_callback extends Callback { - void apply(); - }; - public VR_IVROverlay_FnTable() { - super(); - } - @Override - 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", "IsHoverTargetOverlay", "GetGamepadFocusOverlay", "SetGamepadFocusOverlay", "SetOverlayNeighbor", "MoveGamepadFocusToNeighbor", "SetOverlayDualAnalogTransform", "GetOverlayDualAnalogTransform", "SetOverlayTexture", "ClearOverlayTexture", "SetOverlayRaw", "SetOverlayFromFile", "GetOverlayTexture", "ReleaseNativeOverlayHandle", "GetOverlayTextureSize", "CreateDashboardOverlay", "IsDashboardVisible", "IsActiveDashboardOverlay", "SetDashboardOverlaySceneProcess", "GetDashboardOverlaySceneProcess", "ShowDashboard", "GetPrimaryDashboardDevice", "ShowKeyboard", "ShowKeyboardForOverlay", "GetKeyboardText", "HideKeyboard", "SetKeyboardTransformAbsolute", "SetKeyboardPositionForOverlay", "SetOverlayIntersectionMask", "GetOverlayFlags", "ShowMessageOverlay", "CloseMessageOverlay"); - } - 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 3d448c307e..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRRenderModels_FnTable.java +++ /dev/null @@ -1,146 +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:2251
- * 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 : GetComponentStateForDevicePath_callback* */ - public VR_IVRRenderModels_FnTable.GetComponentStateForDevicePath_callback GetComponentStateForDevicePath; - /** 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:2232 */ - public interface LoadRenderModel_Async_callback extends Callback { - int apply(Pointer pchRenderModelName, PointerByReference ppRenderModel); - }; - /** native declaration : headers\openvr_capi.h:2233 */ - public interface FreeRenderModel_callback extends Callback { - void apply(RenderModel_t pRenderModel); - }; - /** native declaration : headers\openvr_capi.h:2234 */ - public interface LoadTexture_Async_callback extends Callback { - int apply(int textureId, PointerByReference ppTexture); - }; - /** native declaration : headers\openvr_capi.h:2235 */ - public interface FreeTexture_callback extends Callback { - void apply(RenderModel_TextureMap_t pTexture); - }; - /** native declaration : headers\openvr_capi.h:2236 */ - public interface LoadTextureD3D11_Async_callback extends Callback { - int apply(int textureId, Pointer pD3D11Device, PointerByReference ppD3D11Texture2D); - }; - /** native declaration : headers\openvr_capi.h:2237 */ - public interface LoadIntoTextureD3D11_Async_callback extends Callback { - int apply(int textureId, Pointer pDstTexture); - }; - /** native declaration : headers\openvr_capi.h:2238 */ - public interface FreeTextureD3D11_callback extends Callback { - void apply(Pointer pD3D11Texture2D); - }; - /** native declaration : headers\openvr_capi.h:2239 */ - public interface GetRenderModelName_callback extends Callback { - int apply(int unRenderModelIndex, Pointer pchRenderModelName, int unRenderModelNameLen); - }; - /** native declaration : headers\openvr_capi.h:2240 */ - public interface GetRenderModelCount_callback extends Callback { - int apply(); - }; - /** native declaration : headers\openvr_capi.h:2241 */ - public interface GetComponentCount_callback extends Callback { - int apply(Pointer pchRenderModelName); - }; - /** native declaration : headers\openvr_capi.h:2242 */ - public interface GetComponentName_callback extends Callback { - int apply(Pointer pchRenderModelName, int unComponentIndex, Pointer pchComponentName, int unComponentNameLen); - }; - /** native declaration : headers\openvr_capi.h:2243 */ - public interface GetComponentButtonMask_callback extends Callback { - long apply(Pointer pchRenderModelName, Pointer pchComponentName); - }; - /** native declaration : headers\openvr_capi.h:2244 */ - public interface GetComponentRenderModelName_callback extends Callback { - int apply(Pointer pchRenderModelName, Pointer pchComponentName, Pointer pchComponentRenderModelName, int unComponentRenderModelNameLen); - }; - /** native declaration : headers\openvr_capi.h:2245 */ - public interface GetComponentStateForDevicePath_callback extends Callback { - byte apply(Pointer pchRenderModelName, Pointer pchComponentName, long devicePath, RenderModel_ControllerMode_State_t pState, RenderModel_ComponentState_t pComponentState); - }; - /** native declaration : headers\openvr_capi.h:2246 */ - 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:2247 */ - public interface RenderModelHasComponent_callback extends Callback { - byte apply(Pointer pchRenderModelName, Pointer pchComponentName); - }; - /** native declaration : headers\openvr_capi.h:2248 */ - public interface GetRenderModelThumbnailURL_callback extends Callback { - int apply(Pointer pchRenderModelName, Pointer pchThumbnailURL, int unThumbnailURLLen, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:2249 */ - public interface GetRenderModelOriginalPath_callback extends Callback { - int apply(Pointer pchRenderModelName, Pointer pchOriginalPath, int unOriginalPathLen, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:2250 */ - public interface GetRenderModelErrorNameFromEnum_callback extends Callback { - Pointer apply(int error); - }; - public VR_IVRRenderModels_FnTable() { - super(); - } - @Override - protected List getFieldOrder() { - return Arrays.asList("LoadRenderModel_Async", "FreeRenderModel", "LoadTexture_Async", "FreeTexture", "LoadTextureD3D11_Async", "LoadIntoTextureD3D11_Async", "FreeTextureD3D11", "GetRenderModelName", "GetRenderModelCount", "GetComponentCount", "GetComponentName", "GetComponentButtonMask", "GetComponentRenderModelName", "GetComponentStateForDevicePath", "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 1533e094c8..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRResources_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 java.util.Arrays; -import java.util.List; -/** - * native declaration : headers\openvr_capi.h:2305
- * 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:2303 */ - public interface LoadSharedResource_callback extends Callback { - int apply(Pointer pchResourceName, Pointer pchBuffer, int unBufferLen); - }; - /** native declaration : headers\openvr_capi.h:2304 */ - public interface GetResourceFullPath_callback extends Callback { - int apply(Pointer pchResourceName, Pointer pchResourceTypeDirectory, Pointer pchPathBuffer, int unBufferLen); - }; - public VR_IVRResources_FnTable() { - super(); - } - @Override - 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 058637d0d4..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRScreenshots_FnTable.java +++ /dev/null @@ -1,92 +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:2299
- * 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:2292 */ - public interface RequestScreenshot_callback extends Callback { - int apply(IntByReference pOutScreenshotHandle, int type, Pointer pchPreviewFilename, Pointer pchVRFilename); - }; - /** native declaration : headers\openvr_capi.h:2293 */ - public interface HookScreenshot_callback extends Callback { - int apply(IntByReference pSupportedTypes, int numTypes); - }; - /** native declaration : headers\openvr_capi.h:2294 */ - public interface GetScreenshotPropertyType_callback extends Callback { - int apply(int screenshotHandle, IntByReference pError); - }; - /** native declaration : headers\openvr_capi.h:2295 */ - public interface GetScreenshotPropertyFilename_callback extends Callback { - int apply(int screenshotHandle, int filenameType, Pointer pchFilename, int cchFilename, IntByReference pError); - }; - /** native declaration : headers\openvr_capi.h:2296 */ - public interface UpdateScreenshotProgress_callback extends Callback { - int apply(int screenshotHandle, float flProgress); - }; - /** native declaration : headers\openvr_capi.h:2297 */ - public interface TakeStereoScreenshot_callback extends Callback { - int apply(IntByReference pOutScreenshotHandle, Pointer pchPreviewFilename, Pointer pchVRFilename); - }; - /** native declaration : headers\openvr_capi.h:2298 */ - public interface SubmitScreenshot_callback extends Callback { - int apply(int screenshotHandle, int type, Pointer pchSourcePreviewFilename, Pointer pchSourceVRFilename); - }; - public VR_IVRScreenshots_FnTable() { - super(); - } - @Override - 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 ebbe247fb9..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRSettings_FnTable.java +++ /dev/null @@ -1,103 +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:2283
- * 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:2271 */ - public interface GetSettingsErrorNameFromEnum_callback extends Callback { - Pointer apply(int eError); - }; - /** native declaration : headers\openvr_capi.h:2272 */ - public interface Sync_callback extends Callback { - byte apply(byte bForce, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:2273 */ - public interface SetBool_callback extends Callback { - void apply(Pointer pchSection, Pointer pchSettingsKey, byte bValue, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:2274 */ - public interface SetInt32_callback extends Callback { - void apply(Pointer pchSection, Pointer pchSettingsKey, int nValue, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:2275 */ - public interface SetFloat_callback extends Callback { - void apply(Pointer pchSection, Pointer pchSettingsKey, float flValue, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:2276 */ - public interface SetString_callback extends Callback { - void apply(Pointer pchSection, Pointer pchSettingsKey, Pointer pchValue, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:2277 */ - public interface GetBool_callback extends Callback { - byte apply(Pointer pchSection, Pointer pchSettingsKey, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:2278 */ - public interface GetInt32_callback extends Callback { - int apply(Pointer pchSection, Pointer pchSettingsKey, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:2279 */ - public interface GetFloat_callback extends Callback { - float apply(Pointer pchSection, Pointer pchSettingsKey, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:2280 */ - public interface GetString_callback extends Callback { - void apply(Pointer pchSection, Pointer pchSettingsKey, Pointer pchValue, int unValueLen, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:2281 */ - public interface RemoveSection_callback extends Callback { - void apply(Pointer pchSection, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:2282 */ - public interface RemoveKeyInSection_callback extends Callback { - void apply(Pointer pchSection, Pointer pchSettingsKey, IntByReference peError); - }; - public VR_IVRSettings_FnTable() { - super(); - } - @Override - 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_IVRSpatialAnchors_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRSpatialAnchors_FnTable.java deleted file mode 100644 index 3b28c8da19..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRSpatialAnchors_FnTable.java +++ /dev/null @@ -1,68 +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:2373
- * 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_IVRSpatialAnchors_FnTable extends Structure { - /** C type : CreateSpatialAnchorFromDescriptor_callback* */ - public VR_IVRSpatialAnchors_FnTable.CreateSpatialAnchorFromDescriptor_callback CreateSpatialAnchorFromDescriptor; - /** C type : CreateSpatialAnchorFromPose_callback* */ - public VR_IVRSpatialAnchors_FnTable.CreateSpatialAnchorFromPose_callback CreateSpatialAnchorFromPose; - /** C type : GetSpatialAnchorPose_callback* */ - public VR_IVRSpatialAnchors_FnTable.GetSpatialAnchorPose_callback GetSpatialAnchorPose; - /** C type : GetSpatialAnchorDescriptor_callback* */ - public VR_IVRSpatialAnchors_FnTable.GetSpatialAnchorDescriptor_callback GetSpatialAnchorDescriptor; - /** native declaration : headers\openvr_capi.h:2369 */ - public interface CreateSpatialAnchorFromDescriptor_callback extends Callback { - int apply(Pointer pchDescriptor, IntByReference pHandleOut); - }; - /** native declaration : headers\openvr_capi.h:2370 */ - public interface CreateSpatialAnchorFromPose_callback extends Callback { - int apply(int unDeviceIndex, int eOrigin, SpatialAnchorPose_t pPose, IntByReference pHandleOut); - }; - /** native declaration : headers\openvr_capi.h:2371 */ - public interface GetSpatialAnchorPose_callback extends Callback { - int apply(int unHandle, int eOrigin, SpatialAnchorPose_t pPoseOut); - }; - /** native declaration : headers\openvr_capi.h:2372 */ - public interface GetSpatialAnchorDescriptor_callback extends Callback { - int apply(int unHandle, Pointer pchDescriptorOut, IntByReference punDescriptorBufferLenInOut); - }; - public VR_IVRSpatialAnchors_FnTable() { - super(); - } - @Override - protected List getFieldOrder() { - return Arrays.asList("CreateSpatialAnchorFromDescriptor", "CreateSpatialAnchorFromPose", "GetSpatialAnchorPose", "GetSpatialAnchorDescriptor"); - } - /** - * @param CreateSpatialAnchorFromDescriptor C type : CreateSpatialAnchorFromDescriptor_callback*
- * @param CreateSpatialAnchorFromPose C type : CreateSpatialAnchorFromPose_callback*
- * @param GetSpatialAnchorPose C type : GetSpatialAnchorPose_callback*
- * @param GetSpatialAnchorDescriptor C type : GetSpatialAnchorDescriptor_callback* - */ - public VR_IVRSpatialAnchors_FnTable(VR_IVRSpatialAnchors_FnTable.CreateSpatialAnchorFromDescriptor_callback CreateSpatialAnchorFromDescriptor, VR_IVRSpatialAnchors_FnTable.CreateSpatialAnchorFromPose_callback CreateSpatialAnchorFromPose, VR_IVRSpatialAnchors_FnTable.GetSpatialAnchorPose_callback GetSpatialAnchorPose, VR_IVRSpatialAnchors_FnTable.GetSpatialAnchorDescriptor_callback GetSpatialAnchorDescriptor) { - super(); - this.CreateSpatialAnchorFromDescriptor = CreateSpatialAnchorFromDescriptor; - this.CreateSpatialAnchorFromPose = CreateSpatialAnchorFromPose; - this.GetSpatialAnchorPose = GetSpatialAnchorPose; - this.GetSpatialAnchorDescriptor = GetSpatialAnchorDescriptor; - } - public VR_IVRSpatialAnchors_FnTable(Pointer peer) { - super(peer); - } - public static class ByReference extends VR_IVRSpatialAnchors_FnTable implements Structure.ByReference { - - }; - public static class ByValue extends VR_IVRSpatialAnchors_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 8257d23a4f..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRSystem_FnTable.java +++ /dev/null @@ -1,317 +0,0 @@ -package com.jme3.system.jopenvr; -import com.jme3.system.jopenvr.JOpenVRLibrary.VkInstance_T; -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:1799
- * 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 : GetArrayTrackedDeviceProperty_callback* */ - public VR_IVRSystem_FnTable.GetArrayTrackedDeviceProperty_callback GetArrayTrackedDeviceProperty; - /** 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 : IsInputAvailable_callback* */ - public VR_IVRSystem_FnTable.IsInputAvailable_callback IsInputAvailable; - /** C type : IsSteamVRDrawingControllers_callback* */ - public VR_IVRSystem_FnTable.IsSteamVRDrawingControllers_callback IsSteamVRDrawingControllers; - /** C type : ShouldApplicationPause_callback* */ - public VR_IVRSystem_FnTable.ShouldApplicationPause_callback ShouldApplicationPause; - /** C type : ShouldApplicationReduceRenderingWork_callback* */ - public VR_IVRSystem_FnTable.ShouldApplicationReduceRenderingWork_callback ShouldApplicationReduceRenderingWork; - /** 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:1752 */ - public interface GetRecommendedRenderTargetSize_callback extends Callback { - void apply(IntByReference pnWidth, IntByReference pnHeight); - }; - /** native declaration : headers\openvr_capi.h:1753 */ - 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:1754 */ - public interface GetProjectionRaw_callback extends Callback { - void apply(int eEye, FloatByReference pfLeft, FloatByReference pfRight, FloatByReference pfTop, FloatByReference pfBottom); - }; - /** native declaration : headers\openvr_capi.h:1755 */ - public interface ComputeDistortion_callback extends Callback { - byte apply(int eEye, float fU, float fV, DistortionCoordinates_t pDistortionCoordinates); - }; - /** native declaration : headers\openvr_capi.h:1756 */ - public interface GetEyeToHeadTransform_callback extends Callback { - HmdMatrix34_t.ByValue apply(int eEye); - }; - /** native declaration : headers\openvr_capi.h:1757 */ - public interface GetTimeSinceLastVsync_callback extends Callback { - byte apply(FloatByReference pfSecondsSinceLastVsync, LongByReference pulFrameCounter); - }; - /** native declaration : headers\openvr_capi.h:1758 */ - public interface GetD3D9AdapterIndex_callback extends Callback { - int apply(); - }; - /** native declaration : headers\openvr_capi.h:1759 */ - public interface GetDXGIOutputInfo_callback extends Callback { - void apply(IntByReference pnAdapterIndex); - }; - /** native declaration : headers\openvr_capi.h:1760 */ - public interface GetOutputDevice_callback extends Callback { - void apply(LongByReference pnDevice, int textureType, VkInstance_T pInstance); - }; - /** native declaration : headers\openvr_capi.h:1761 */ - public interface IsDisplayOnDesktop_callback extends Callback { - byte apply(); - }; - /** native declaration : headers\openvr_capi.h:1762 */ - public interface SetDisplayVisibility_callback extends Callback { - byte apply(byte bIsVisibleOnDesktop); - }; - /** native declaration : headers\openvr_capi.h:1763 */ - public interface GetDeviceToAbsoluteTrackingPose_callback extends Callback { - void apply(int eOrigin, float fPredictedSecondsToPhotonsFromNow, TrackedDevicePose_t pTrackedDevicePoseArray, int unTrackedDevicePoseArrayCount); - }; - /** native declaration : headers\openvr_capi.h:1764 */ - public interface ResetSeatedZeroPose_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:1765 */ - public interface GetSeatedZeroPoseToStandingAbsoluteTrackingPose_callback extends Callback { - HmdMatrix34_t.ByValue apply(); - }; - /** native declaration : headers\openvr_capi.h:1766 */ - public interface GetRawZeroPoseToStandingAbsoluteTrackingPose_callback extends Callback { - HmdMatrix34_t.ByValue apply(); - }; - /** native declaration : headers\openvr_capi.h:1767 */ - public interface GetSortedTrackedDeviceIndicesOfClass_callback extends Callback { - int apply(int eTrackedDeviceClass, IntByReference punTrackedDeviceIndexArray, int unTrackedDeviceIndexArrayCount, int unRelativeToTrackedDeviceIndex); - }; - /** native declaration : headers\openvr_capi.h:1768 */ - public interface GetTrackedDeviceActivityLevel_callback extends Callback { - int apply(int unDeviceId); - }; - /** native declaration : headers\openvr_capi.h:1769 */ - public interface ApplyTransform_callback extends Callback { - void apply(TrackedDevicePose_t pOutputPose, TrackedDevicePose_t pTrackedDevicePose, HmdMatrix34_t pTransform); - }; - /** native declaration : headers\openvr_capi.h:1770 */ - public interface GetTrackedDeviceIndexForControllerRole_callback extends Callback { - int apply(int unDeviceType); - }; - /** native declaration : headers\openvr_capi.h:1771 */ - public interface GetControllerRoleForTrackedDeviceIndex_callback extends Callback { - int apply(int unDeviceIndex); - }; - /** native declaration : headers\openvr_capi.h:1772 */ - public interface GetTrackedDeviceClass_callback extends Callback { - int apply(int unDeviceIndex); - }; - /** native declaration : headers\openvr_capi.h:1773 */ - public interface IsTrackedDeviceConnected_callback extends Callback { - byte apply(int unDeviceIndex); - }; - /** native declaration : headers\openvr_capi.h:1774 */ - public interface GetBoolTrackedDeviceProperty_callback extends Callback { - byte apply(int unDeviceIndex, int prop, IntByReference pError); - }; - /** native declaration : headers\openvr_capi.h:1775 */ - public interface GetFloatTrackedDeviceProperty_callback extends Callback { - float apply(int unDeviceIndex, int prop, IntByReference pError); - }; - /** native declaration : headers\openvr_capi.h:1776 */ - public interface GetInt32TrackedDeviceProperty_callback extends Callback { - int apply(int unDeviceIndex, int prop, IntByReference pError); - }; - /** native declaration : headers\openvr_capi.h:1777 */ - public interface GetUint64TrackedDeviceProperty_callback extends Callback { - long apply(int unDeviceIndex, int prop, IntByReference pError); - }; - /** native declaration : headers\openvr_capi.h:1778 */ - public interface GetMatrix34TrackedDeviceProperty_callback extends Callback { - HmdMatrix34_t.ByValue apply(int unDeviceIndex, int prop, IntByReference pError); - }; - /** native declaration : headers\openvr_capi.h:1779 */ - public interface GetArrayTrackedDeviceProperty_callback extends Callback { - int apply(int unDeviceIndex, int prop, int propType, Pointer pBuffer, int unBufferSize, IntByReference pError); - }; - /** native declaration : headers\openvr_capi.h:1780 */ - public interface GetStringTrackedDeviceProperty_callback extends Callback { - int apply(int unDeviceIndex, int prop, Pointer pchValue, int unBufferSize, IntByReference pError); - }; - /** native declaration : headers\openvr_capi.h:1781 */ - public interface GetPropErrorNameFromEnum_callback extends Callback { - Pointer apply(int error); - }; - /** native declaration : headers\openvr_capi.h:1782 */ - public interface PollNextEvent_callback extends Callback { - byte apply(VREvent_t pEvent, int uncbVREvent); - }; - /** native declaration : headers\openvr_capi.h:1783 */ - public interface PollNextEventWithPose_callback extends Callback { - byte apply(int eOrigin, VREvent_t pEvent, int uncbVREvent, TrackedDevicePose_t pTrackedDevicePose); - }; - /** native declaration : headers\openvr_capi.h:1784 */ - public interface GetEventTypeNameFromEnum_callback extends Callback { - Pointer apply(int eType); - }; - /** native declaration : headers\openvr_capi.h:1785 */ - public interface GetHiddenAreaMesh_callback extends Callback { - com.jme3.system.jopenvr.HiddenAreaMesh_t.ByValue apply(int eEye, int type); - }; - /** native declaration : headers\openvr_capi.h:1786 */ - public interface GetControllerState_callback extends Callback { - byte apply(int unControllerDeviceIndex, VRControllerState_t pControllerState, int unControllerStateSize); - }; - /** native declaration : headers\openvr_capi.h:1787 */ - 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:1788 */ - public interface TriggerHapticPulse_callback extends Callback { - void apply(int unControllerDeviceIndex, int unAxisId, short usDurationMicroSec); - }; - /** native declaration : headers\openvr_capi.h:1789 */ - public interface GetButtonIdNameFromEnum_callback extends Callback { - Pointer apply(int eButtonId); - }; - /** native declaration : headers\openvr_capi.h:1790 */ - public interface GetControllerAxisTypeNameFromEnum_callback extends Callback { - Pointer apply(int eAxisType); - }; - /** native declaration : headers\openvr_capi.h:1791 */ - public interface IsInputAvailable_callback extends Callback { - byte apply(); - }; - /** native declaration : headers\openvr_capi.h:1792 */ - public interface IsSteamVRDrawingControllers_callback extends Callback { - byte apply(); - }; - /** native declaration : headers\openvr_capi.h:1793 */ - public interface ShouldApplicationPause_callback extends Callback { - byte apply(); - }; - /** native declaration : headers\openvr_capi.h:1794 */ - public interface ShouldApplicationReduceRenderingWork_callback extends Callback { - byte apply(); - }; - /** native declaration : headers\openvr_capi.h:1795 */ - public interface DriverDebugRequest_callback extends Callback { - int apply(int unDeviceIndex, Pointer pchRequest, Pointer pchResponseBuffer, int unResponseBufferSize); - }; - /** native declaration : headers\openvr_capi.h:1796 */ - public interface PerformFirmwareUpdate_callback extends Callback { - int apply(int unDeviceIndex); - }; - /** native declaration : headers\openvr_capi.h:1797 */ - public interface AcknowledgeQuit_Exiting_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:1798 */ - public interface AcknowledgeQuit_UserPrompt_callback extends Callback { - void apply(); - }; - public VR_IVRSystem_FnTable() { - super(); - } - @Override - 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", "GetArrayTrackedDeviceProperty", "GetStringTrackedDeviceProperty", "GetPropErrorNameFromEnum", "PollNextEvent", "PollNextEventWithPose", "GetEventTypeNameFromEnum", "GetHiddenAreaMesh", "GetControllerState", "GetControllerStateWithPose", "TriggerHapticPulse", "GetButtonIdNameFromEnum", "GetControllerAxisTypeNameFromEnum", "IsInputAvailable", "IsSteamVRDrawingControllers", "ShouldApplicationPause", "ShouldApplicationReduceRenderingWork", "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 42ba86816b..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRTrackedCamera_FnTable.java +++ /dev/null @@ -1,105 +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:1833
- * 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:1821 */ - public interface GetCameraErrorNameFromEnum_callback extends Callback { - Pointer apply(int eCameraError); - }; - /** native declaration : headers\openvr_capi.h:1822 */ - public interface HasCamera_callback extends Callback { - int apply(int nDeviceIndex, Pointer pHasCamera); - }; - /** native declaration : headers\openvr_capi.h:1823 */ - public interface GetCameraFrameSize_callback extends Callback { - int apply(int nDeviceIndex, int eFrameType, IntByReference pnWidth, IntByReference pnHeight, IntByReference pnFrameBufferSize); - }; - /** native declaration : headers\openvr_capi.h:1824 */ - public interface GetCameraIntrinsics_callback extends Callback { - int apply(int nDeviceIndex, int eFrameType, HmdVector2_t pFocalLength, HmdVector2_t pCenter); - }; - /** native declaration : headers\openvr_capi.h:1825 */ - 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:1826 */ - public interface AcquireVideoStreamingService_callback extends Callback { - int apply(int nDeviceIndex, LongByReference pHandle); - }; - /** native declaration : headers\openvr_capi.h:1827 */ - public interface ReleaseVideoStreamingService_callback extends Callback { - int apply(long hTrackedCamera); - }; - /** native declaration : headers\openvr_capi.h:1828 */ - 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:1829 */ - 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:1830 */ - 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:1831 */ - 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:1832 */ - public interface ReleaseVideoStreamTextureGL_callback extends Callback { - int apply(long hTrackedCamera, int glTextureId); - }; - public VR_IVRTrackedCamera_FnTable() { - super(); - } - @Override - 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/lwjgl/LwjglContextVR.java b/jme3-vr/src/main/java/com/jme3/system/lwjgl/LwjglContextVR.java deleted file mode 100644 index 0ec3f7498a..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/lwjgl/LwjglContextVR.java +++ /dev/null @@ -1,302 +0,0 @@ -package com.jme3.system.lwjgl; - -/* - * Copyright (c) 2009-2023 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. - */ -import com.jme3.input.lwjgl.GlfwJoystickInput; -import com.jme3.input.lwjgl.GlfwKeyInputVR; -import com.jme3.input.lwjgl.GlfwMouseInputVR; -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.*; -import com.jme3.system.*; - -import org.lwjgl.glfw.GLFW; -import org.lwjgl.opengl.ARBDebugOutput; -import org.lwjgl.opengl.ARBFramebufferObject; -import org.lwjgl.opengl.EXTFramebufferMultisample; -import org.lwjgl.opengl.GLCapabilities; - -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.logging.Level; -import java.util.logging.Logger; - -import static org.lwjgl.opengl.GL.createCapabilities; -import static org.lwjgl.opengl.GL11.glGetInteger; - -/** - * A VR oriented LWJGL implementation of a graphics context. - * @author reden - phr00t - https://github.com/phr00t - * @author Julien Seinturier - (c) 2016 - JOrigin project - http:/www.jorigin.org - */ -public abstract class LwjglContextVR implements JmeContext { - - private static final Logger logger = Logger.getLogger(LwjglContextVR.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 GlfwKeyInputVR keyInput; - protected GlfwMouseInputVR mouseInput; - protected GlfwJoystickInput joyInput; - protected Timer timer; - protected SystemListener listener; - - /** - * Accesses the listener that receives events related to this context. - * - * @return the pre-existing instance - */ - @Override - public SystemListener getSystemListener() { - return listener; - } - - @Override - 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: GLFW {2}", - new Object[]{Integer.toString(org.lwjgl.Version.VERSION_MAJOR), Thread.currentThread().getName(), GLFW.glfwGetVersionString()}); - } - - protected int determineMaxSamples() { - // If we already have a valid context, determine samples using current context. - logger.log(Level.SEVERE, "glfwExtensionSupported(\"GL_ARB_framebuffer_object\"): "+GLFW.glfwExtensionSupported("GL_ARB_framebuffer_object")); - logger.log(Level.SEVERE, "glfwExtensionSupported(\"GL_EXT_framebuffer_multisample\"): "+GLFW.glfwExtensionSupported("GL_ARB_framebuffer_object")); - - if (GLFW.glfwExtensionSupported("GL_ARB_framebuffer_object")) { - return glGetInteger(ARBFramebufferObject.GL_MAX_SAMPLES); - } else if (GLFW.glfwExtensionSupported("GL_EXT_framebuffer_multisample")) { - return glGetInteger(EXTFramebufferMultisample.GL_MAX_SAMPLES_EXT); - } - - return Integer.MAX_VALUE; - } - - protected void loadNatives() { - if (JmeSystem.isLowPermissions()) { - return; - } - - if (NativeLibraryLoader.isUsingNativeBullet()) { - NativeLibraryLoader.loadNativeLibrary(NativeLibraries.BulletJme.getName(), true); - } - } - - /** - * Check if the display is a retina display. - * @return true if the display is a retina display and false otherwise. - */ - public boolean isRetinaDisplay() { - return GLFW.glfwGetVersionString().contains("retina"); - } - - protected int getNumSamplesToUse() { - int samples = 0; - if (settings.getSamples() > 1) { - samples = settings.getSamples(); - final int supportedSamples = determineMaxSamples(); - 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() { - final GLCapabilities capabilities = createCapabilities(settings.getRenderer().equals(AppSettings.LWJGL_OPENGL32)); - - if (!capabilities.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_OPENGL32)) { - GL gl = new LwjglGL(); - GLExt glext = new LwjglGLExt(); - GLFbo glfbo; - - if (capabilities.OpenGL30) { - glfbo = new LwjglGLFboGL3(); - } else { - glfbo = new LwjglGLFboEXT(); - } - - if (settings.isGraphicsDebug()) { - gl = (GL) GLDebug.createProxy(gl, gl, GL.class, GL2.class, GL3.class, GL4.class); - glext = (GLExt) GLDebug.createProxy(gl, glext, GLExt.class); - glfbo = (GLFbo) GLDebug.createProxy(gl, glfbo, GLFbo.class); - } - - if (settings.isGraphicsTiming()) { - 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.isGraphicsTrace()) { - 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 (capabilities.GL_ARB_debug_output && settings.isGraphicsDebug()) { - ARBDebugOutput.glDebugMessageCallbackARB(new LwjglGLDebugOutputHandler(), 0); - } - - 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(); - } - renderable.set(true); - } - - /** - * Context internal destroy. - */ - public void internalDestroy() { - renderer = null; - timer = null; - renderable.set(false); - synchronized (createdLock) { - created.set(false); - createdLock.notifyAll(); - } - } - - /** - * Context internal create. - */ - public void internalCreate() { - synchronized (createdLock) { - created.set(true); - createdLock.notifyAll(); - } - - initContextFirstTime(); - } - - /** - * Create the context. - */ - public void create() { - create(false); - } - - /** - * Destroy the context. - */ - public void destroy() { - destroy(false); - } - - /** - * - * @param createdVal - */ - protected void waitFor(boolean createdVal) { - synchronized (createdLock) { - while (created.get() != createdVal) { - try { - createdLock.wait(); - } catch (InterruptedException ignored) { - } - } - } - } - - @Override - public boolean isCreated() { - return created.get(); - } - - @Override - public boolean isRenderable() { - return renderable.get(); - } - - @Override - public void setSettings(AppSettings settings) { - this.settings.copyFrom(settings); - } - - @Override - public AppSettings getSettings() { - return settings; - } - - @Override - public Renderer getRenderer() { - return renderer; - } - - @Override - public Timer getTimer() { - return timer; - } - -} diff --git a/jme3-vr/src/main/java/com/jme3/system/lwjgl/LwjglDisplayVR.java b/jme3-vr/src/main/java/com/jme3/system/lwjgl/LwjglDisplayVR.java deleted file mode 100644 index d311219b29..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/lwjgl/LwjglDisplayVR.java +++ /dev/null @@ -1,68 +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.opencl.Context; -import com.jme3.system.Displays; - -/** - * A VR oriented LWJGL display. - * @author Daniel Johansson - * @author reden - phr00t - https://github.com/phr00t - * @author Julien Seinturier - (c) 2016 - JOrigin project - http:/www.jorigin.org - */ -public class LwjglDisplayVR extends LwjglWindowVR { - - /** - * Create a new VR oriented LWJGL display. - */ - public LwjglDisplayVR() { - super(Type.Display); - } - - @Override - public Context getOpenCLContext() { - return null; - } - - @Override - public Displays getDisplays() { - // TODO Auto-generated method stub - return null; - } - - @Override - public int getPrimaryDisplay() { - // TODO Auto-generated method stub - return 0; - } -} diff --git a/jme3-vr/src/main/java/com/jme3/system/lwjgl/LwjglOffscreenBufferVR.java b/jme3-vr/src/main/java/com/jme3/system/lwjgl/LwjglOffscreenBufferVR.java deleted file mode 100644 index 234d36d8de..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/lwjgl/LwjglOffscreenBufferVR.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.jme3.system.lwjgl; - -/* - * 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. - */ - -import com.jme3.system.JmeContext; - -/** - * A VR oriented LWJGL offscreen buffer. - * @author Daniel Johansson - * @author reden - phr00t - https://github.com/phr00t - * @author Julien Seinturier - (c) 2016 - JOrigin project - http:/www.jorigin.org - */ -public class LwjglOffscreenBufferVR extends LwjglWindow { - /** - * Create a new VR oriented LWJGL offscreen buffer. - */ - public LwjglOffscreenBufferVR() { - super(JmeContext.Type.OffscreenSurface); - } -} diff --git a/jme3-vr/src/main/java/com/jme3/system/lwjgl/LwjglWindowVR.java b/jme3-vr/src/main/java/com/jme3/system/lwjgl/LwjglWindowVR.java deleted file mode 100644 index 5c21cd6e92..0000000000 --- a/jme3-vr/src/main/java/com/jme3/system/lwjgl/LwjglWindowVR.java +++ /dev/null @@ -1,621 +0,0 @@ -package com.jme3.system.lwjgl; - -/* - * Copyright (c) 2009-2023 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. - */ - -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.GlfwJoystickInput; -import com.jme3.input.lwjgl.GlfwKeyInputVR; -import com.jme3.input.lwjgl.GlfwMouseInputVR; -import com.jme3.system.AppSettings; -import com.jme3.system.JmeContext; -import com.jme3.system.JmeSystem; -import com.jme3.system.NanoTimer; - -import org.lwjgl.glfw.*; - -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.lwjgl.Version; - -import static org.lwjgl.glfw.GLFW.*; -import static org.lwjgl.opengl.GL11.GL_FALSE; -import static org.lwjgl.system.MemoryUtil.NULL; - -/** - * A wrapper class over the GLFW framework in LWJGL 3. - * - * @author Daniel Johansson - * @author reden - phr00t - https://github.com/phr00t - * @author Julien Seinturier - (c) 2016 - JOrigin project - http:/www.jorigin.org - */ -public abstract class LwjglWindowVR extends LwjglContextVR implements Runnable { - - private static final Logger LOGGER = Logger.getLogger(LwjglWindowVR.class.getName()); - - protected AtomicBoolean needClose = new AtomicBoolean(false); - protected final AtomicBoolean needRestart = new AtomicBoolean(false); - protected boolean wasActive = false; - protected boolean autoFlush = true; - protected boolean allowSwapBuffers = false; - private long window = NULL; - private final JmeContext.Type type; - private int frameRateLimit = -1; - private double frameSleepTime; - - private GLFWErrorCallback errorCallback; - private GLFWWindowSizeCallback windowSizeCallback; - private GLFWWindowFocusCallback windowFocusCallback; - private Thread mainThread; - - // reusable arrays for GLFW calls - final private int width[] = new int[1]; - final private int height[] = new int[1]; - - /** - * Create a new wrapper class over the GLFW framework in LWJGL 3. - * @param type the {@link com.jme3.system.JmeContext.Type type} of the display. - */ - public LwjglWindowVR(final JmeContext.Type type) { - if (!JmeContext.Type.Display.equals(type) && !JmeContext.Type.OffscreenSurface.equals(type) && !JmeContext.Type.Canvas.equals(type)) { - throw new IllegalArgumentException("Unsupported type '" + type.name() + "' provided"); - } - - this.type = type; - } - - /** - * @return Type.Display or Type.Canvas - */ - @Override - public JmeContext.Type getType() { - return type; - } - - /** - * Set the title if it's a windowed display - * - * @param title the title to set - */ - @Override - public void setTitle(final String title) { - if (created.get() && window != NULL) { - glfwSetWindowTitle(window, title); - } - } - - /** - * Restart if it's a windowed or full-screen display. - */ - @Override - public void restart() { - if (created.get()) { - needRestart.set(true); - } else { - LOGGER.warning("Display is not created, cannot restart window."); - } - } - - /** - * Apply the settings, changing resolution, etc. - * - * @param settings the settings to apply when creating the context. - */ - protected void createContext(final AppSettings settings) { - glfwSetErrorCallback(errorCallback = new GLFWErrorCallback() { - @Override - public void invoke(int error, long description) { - final String message = GLFWErrorCallback.getDescription(description); - listener.handleError(message, new Exception(message)); - } - }); - - if ( glfwInit() == false ) { - throw new IllegalStateException("Unable to initialize GLFW"); - } - - glfwDefaultWindowHints(); - - // just use defaults, which should provide the best compatibility - /*if (settings.getRenderer().equals(AppSettings.LWJGL_OPENGL3)) { - glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); - glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GLFW_FALSE); - glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); - glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2); - } else { - glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2); - glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0); - }*/ - - if (settings.getBoolean("RendererDebug")) { - glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GLFW_TRUE); - } - - if (settings.isGammaCorrection()) { - glfwWindowHint(GLFW_SRGB_CAPABLE, GLFW_TRUE); - } - - glfwWindowHint(GLFW_VISIBLE, GL_FALSE); - glfwWindowHint(GLFW_RESIZABLE, settings.isResizable() ? GLFW_TRUE : GLFW_FALSE); - glfwWindowHint(GLFW_DOUBLEBUFFER, GLFW_TRUE); - glfwWindowHint(GLFW_DEPTH_BITS, settings.getDepthBits()); - glfwWindowHint(GLFW_STENCIL_BITS, settings.getStencilBits()); - glfwWindowHint(GLFW_SAMPLES, settings.getSamples()); - glfwWindowHint(GLFW_STEREO, settings.useStereo3D() ? GLFW_TRUE : GLFW_FALSE); - glfwWindowHint(GLFW_REFRESH_RATE, settings.getFrequency()); - - if (settings.getBitsPerPixel() == 24) { - glfwWindowHint(GLFW_RED_BITS, 8); - glfwWindowHint(GLFW_GREEN_BITS, 8); - glfwWindowHint(GLFW_BLUE_BITS, 8); - } else if (settings.getBitsPerPixel() == 16) { - glfwWindowHint(GLFW_RED_BITS, 5); - glfwWindowHint(GLFW_GREEN_BITS, 6); - glfwWindowHint(GLFW_BLUE_BITS, 5); - } - - glfwWindowHint(GLFW_ALPHA_BITS, settings.getAlphaBits()); - - // TODO: Add support for monitor selection - long monitor = NULL; - - if (settings.isFullscreen()) { - monitor = glfwGetPrimaryMonitor(); - } - - final GLFWVidMode videoMode = glfwGetVideoMode(glfwGetPrimaryMonitor()); - - if (settings.getWidth() <= 0 || settings.getHeight() <= 0) { - settings.setResolution(videoMode.width(), videoMode.height()); - } - - window = glfwCreateWindow(settings.getWidth(), settings.getHeight(), settings.getTitle(), monitor, NULL); - - if (window == NULL) { - throw new RuntimeException("Failed to create the GLFW window"); - } - - glfwSetWindowFocusCallback(window, windowFocusCallback = new GLFWWindowFocusCallback() { - - @Override - public void invoke(long window, boolean focused) { - if (wasActive != focused) { - if (wasActive == false) { - listener.gainFocus(); - timer.reset(); - wasActive = true; - } else { - listener.loseFocus(); - wasActive = false; - } - } - } - }); - - // Center the window - if( Type.Display.equals(type) ) { - if (!settings.isFullscreen()) { - glfwSetWindowPos(window, - (videoMode.width() - settings.getWidth()) / 2, - (videoMode.height() - settings.getHeight()) / 2); - } - } - - // Make the OpenGL context current - glfwMakeContextCurrent(window); - - // Enable vsync - if (settings.isVSync()) { - glfwSwapInterval(1); - } else { - glfwSwapInterval(0); - } - - // Make the window visible - if (Type.Display.equals(type)) { - glfwShowWindow(window); - glfwFocusWindow(window); - } - - // Add a resize callback which delegates to the listener - glfwSetWindowSizeCallback(window, windowSizeCallback = new GLFWWindowSizeCallback() { - @Override - public void invoke(final long window, final int width, final int height) { - settings.setResolution(width, height); - listener.reshape(width, height); - } - }); - - allowSwapBuffers = settings.isSwapBuffers(); - - // TODO: When GLFW 3.2 is released and included in LWJGL 3.x then we should hopefully be able to set the window icon. - } - - /** - * Destroy the context. - */ - protected void destroyContext() { - try { - if (renderer != null) { - renderer.cleanup(); - } - - if (errorCallback != null) { - errorCallback.free(); - errorCallback = null; - } - - if (windowSizeCallback != null) { - windowSizeCallback.free(); - windowSizeCallback = null; - } - - if (windowFocusCallback != null) { - windowFocusCallback.free(); - windowFocusCallback = null; - } - - if (window != NULL) { - glfwDestroyWindow(window); - window = NULL; - } - } catch (Exception ex) { - listener.handleError("Failed to destroy context", ex); - } - } - - @Override - public void create(boolean waitFor) { - if (created.get()) { - LOGGER.warning("create() called when display is already created!"); - return; - } - - mainThread = Thread.currentThread(); - run(); - } - - /** - * 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() { - @Override - 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(); - } - } - }); - } - - loadNatives(); - timer = new NanoTimer(); - - // 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 (window != NULL) { - glfwDestroyWindow(window); - window = NULL; - } - } 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; - } - - /** - * execute one iteration of the render loop in the OpenGL thread - */ - protected void runLoop() { - // If a restart is required, lets recreate the context. - if (needRestart.getAndSet(false)) { - try { - destroyContext(); - createContext(settings); - } catch (Exception ex) { - LOGGER.log(Level.SEVERE, "Failed to set display settings!", ex); - } - - LOGGER.fine("Display restarted."); - } - - if (!created.get()) { - throw new IllegalStateException(); - } - - listener.update(); - - // All this does is call glfwSwapBuffers(). - // If the canvas is not active, there's no need to waste time - // doing that. - if (renderable.get()) { - // calls swap buffers, etc. - try { - if (allowSwapBuffers && autoFlush) { - glfwSwapBuffers(window); - } - } catch (Throwable ex) { - listener.handleError("Error while swapping buffers", ex); - } - } - - // Subclasses just call GLObjectManager. Clean up objects here. - // It is safe ... for now. - if (renderer != null) { - renderer.postFrame(); - } - - if (autoFlush) { - if (frameRateLimit != getSettings().getFrameRate()) { - setFrameRateLimit(getSettings().getFrameRate()); - } - } else if (frameRateLimit != 20) { - setFrameRateLimit(20); - } - - // If software frame rate limiting has been asked for, lets calculate sleep time based on a base value calculated - // from 1000 / frameRateLimit in milliseconds subtracting the time it has taken to render last frame. - // This gives an approximate limit within 3 fps of the given frame rate limit. - if (frameRateLimit > 0) { - final double sleep = frameSleepTime - (timer.getTimePerFrame() / 1000.0); - final long sleepMillis = (long) sleep; - final int additionalNanos = (int) ((sleep - sleepMillis) * 1000000.0); - - if (sleepMillis >= 0 && additionalNanos >= 0) { - try { - Thread.sleep(sleepMillis, additionalNanos); - } catch (InterruptedException ignored) { - } - } - } - - glfwPollEvents(); - } - - private void setFrameRateLimit(int frameRateLimit) { - this.frameRateLimit = frameRateLimit; - frameSleepTime = 1000.0 / this.frameRateLimit; - } - - /** - * De-initialize in the OpenGL thread. - */ - - protected void deinitInThread() { - listener.destroy(); - - destroyContext(); - super.internalDestroy(); - - LOGGER.fine("Display destroyed."); - } - - @Override - public void run() { - if (listener == null) { - throw new IllegalStateException("SystemListener is not set on context!" - + "Must set with JmeContext.setSystemListener()."); - } - - LOGGER.log(Level.FINE, "Using LWJGL {0}", Version.getVersion()); - - if (!initInThread()) { - LOGGER.log(Level.SEVERE, "Display initialization failed. Cannot continue."); - return; - } - - while (true) { - - runLoop(); - - if (needClose.get()) { - break; - } - - if (glfwWindowShouldClose(window) == true) { - listener.requestClose(false); - } - } - - deinitInThread(); - } - - @Override - public JoyInput getJoyInput() { - if (joyInput == null) { - joyInput = new GlfwJoystickInput(); - } - return joyInput; - } - - @Override - public MouseInput getMouseInput() { - if (mouseInput == null) { - mouseInput = new GlfwMouseInputVR(this); - } - return mouseInput; - } - - @Override - public KeyInput getKeyInput() { - if (keyInput == null) { - keyInput = new GlfwKeyInputVR(this); - } - - return keyInput; - } - - @Override - public TouchInput getTouchInput() { - return null; - } - - @Override - public void setAutoFlushFrames(boolean enabled) { - this.autoFlush = enabled; - } - - @Override - public void destroy(boolean waitFor) { - needClose.set(true); - if (mainThread == Thread.currentThread()) { - // Ignore waitFor. - return; - } - - if (waitFor) { - waitFor(false); - } - } - - /** - * Get the window handle. - * @return the window handle as an internal GLFW identifier. - */ - public long getWindowHandle() { - return window; - } - - /** - * Returns the height of the framebuffer. - * - * @return the height (in pixels) - */ - @Override - public int getFramebufferHeight() { - glfwGetFramebufferSize(window, width, height); - int result = height[0]; - return result; - } - - /** - * Returns the width of the framebuffer. - * - * @return the width (in pixels) - */ - @Override - public int getFramebufferWidth() { - glfwGetFramebufferSize(window, width, height); - int result = width[0]; - return result; - } - - /** - * Returns the screen X coordinate of the left edge of the content area. - * - * @return the screen X coordinate - */ - @Override - public int getWindowXPosition() { - glfwGetWindowPos(window, width, height); - int result = width[0]; - return result; - } - - /** - * Returns the screen Y coordinate of the top edge of the content area. - * - * @return the screen Y coordinate - */ - @Override - public int getWindowYPosition() { - glfwGetWindowPos(window, width, height); - int result = height[0]; - return result; - } - - // TODO: Implement support for window icon when GLFW supports it. - /* - 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-vr/src/main/java/com/jme3/util/VRGUIPositioningMode.java b/jme3-vr/src/main/java/com/jme3/util/VRGUIPositioningMode.java deleted file mode 100644 index 7d6f38960e..0000000000 --- a/jme3-vr/src/main/java/com/jme3/util/VRGUIPositioningMode.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.jme3.util; - -/** - * An enumeration that describes the GUI display positioning modes. - * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr - * - * @deprecated The jme3-vr module is deprecated and will be removed in a future version (as it only supports OpenVR). - * For new Virtual Reality projects, use user libraries that provide OpenXR support. - * See Virtual Reality JME wiki section - * for more information. - */ -@Deprecated -public enum VRGUIPositioningMode { - MANUAL, - AUTO_CAM_ALL, - AUTO_CAM_ALL_SKIP_PITCH, - AUTO_OBSERVER_POS_CAM_ROTATION, - AUTO_OBSERVER_ALL, - AUTO_OBSERVER_ALL_CAMHEIGHT -} diff --git a/jme3-vr/src/main/java/com/jme3/util/VRGuiManager.java b/jme3-vr/src/main/java/com/jme3/util/VRGuiManager.java deleted file mode 100644 index 61033e7ab6..0000000000 --- a/jme3-vr/src/main/java/com/jme3/util/VRGuiManager.java +++ /dev/null @@ -1,472 +0,0 @@ -package com.jme3.util; - -import com.jme3.app.VREnvironment; -import com.jme3.material.Material; -import com.jme3.material.RenderState.BlendMode; -import com.jme3.math.ColorRGBA; -import com.jme3.math.Matrix3f; -import com.jme3.math.Quaternion; -import com.jme3.math.Vector2f; -import com.jme3.math.Vector3f; -import com.jme3.renderer.Camera; -import com.jme3.renderer.ViewPort; -import com.jme3.renderer.queue.RenderQueue.Bucket; -import com.jme3.scene.Spatial; -import com.jme3.scene.Geometry; -import com.jme3.scene.Node; -import com.jme3.scene.shape.CenterQuad; -import com.jme3.system.AppSettings; -import com.jme3.texture.FrameBuffer; -import com.jme3.texture.Image.Format; -import com.jme3.texture.Texture; -import com.jme3.texture.Texture2D; -import java.awt.GraphicsEnvironment; -import java.util.Iterator; - -/** - * A class dedicated to the management and the display of a Graphical User Interface (GUI) within a VR environment. - * @author reden - phr00t - https://github.com/phr00t - * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr - * - * @deprecated The jme3-vr module is deprecated and will be removed in a future version (as it only supports OpenVR). - * For new Virtual Reality projects, use user libraries that provide OpenXR support. - * See Virtual Reality JME wiki section - * for more information. - */ -@Deprecated -public class VRGuiManager { - private Camera camLeft, camRight; - private float guiDistance = 1.5f; - private float guiScale = 1f; - private float guiPositioningElastic; - - private VRGUIPositioningMode posMode = VRGUIPositioningMode.AUTO_CAM_ALL; - - private final Matrix3f orient = new Matrix3f(); - private Vector2f screenSize; - protected boolean wantsReposition; - - private Vector2f ratio; - - private final Vector3f EoldPos = new Vector3f(); - - private final Quaternion EoldDir = new Quaternion(); - - private final Vector3f look = new Vector3f(); - private final Vector3f left = new Vector3f(); - private final Vector3f temppos = new Vector3f(); - private final Vector3f up = new Vector3f(); - - private boolean useCurvedSurface = false; - private boolean overdraw = false; - private Geometry guiQuad; - private Node guiQuadNode; - private ViewPort offView; - private Texture2D guiTexture; - - private final Quaternion tempq = new Quaternion(); - - private VREnvironment environment = null; - - /** - * Create a new GUI manager attached to the given app state. - * @param environment the VR environment to which this manager is attached to. - */ - public VRGuiManager(VREnvironment environment){ - this.environment = environment; - } - - public boolean isWantsReposition() { - return wantsReposition; - } - - public void setWantsReposition(boolean wantsReposition) { - this.wantsReposition = wantsReposition; - } - - /** - * - * Makes auto GUI positioning happen not immediately, but like an - * elastic connected to the headset. Setting to 0 disables (default) - * Higher settings make it track the headset quicker. - * - * @param elastic amount of elasticity - */ - public void setPositioningElasticity(float elastic) { - guiPositioningElastic = elastic; - } - - public float getPositioningElasticity() { - return guiPositioningElastic; - } - - /** - * Get the GUI {@link VRGUIPositioningMode positioning mode}. - * @return the GUI {@link VRGUIPositioningMode positioning mode}. - * @see #setPositioningMode(VRGUIPositioningMode) - */ - public VRGUIPositioningMode getPositioningMode() { - return posMode; - } - - /** - * Set the GUI {@link VRGUIPositioningMode positioning mode}. - * @param mode the GUI {@link VRGUIPositioningMode positioning mode}. - * @see #getPositioningMode() - */ - public void setPositioningMode(VRGUIPositioningMode mode) { - posMode = mode; - } - - /** - * Get the GUI canvas size. This method return the size in pixels of the GUI available area within the VR view. - * @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 ) { - screenSize = new Vector2f(); - environment.getVRHardware().getRenderSize(screenSize); - screenSize.multLocal(environment.getVRViewManager().getResolutionMuliplier()); - } else { - AppSettings as = environment.getApplication().getContext().getSettings(); - screenSize = new Vector2f(as.getWidth(), as.getHeight()); - } - } - return screenSize; - } else { - throw new IllegalStateException("VR GUI manager underlying environment is not attached to any application."); - } - } else { - throw new IllegalStateException("VR GUI manager is not attached to any environment."); - } - } - - /** - * Get the ratio between the {@link #getCanvasSize() GUI canvas size} and the application main windows (if available) or the screen size. - * @return the ratio between the {@link #getCanvasSize() GUI canvas size} and the application main windows (if available). - * @see #getCanvasSize() - */ - public Vector2f getCanvasToWindowRatio() { - if (environment != null){ - - if (environment.getApplication() != null){ - if( ratio == null ) { - ratio = new Vector2f(); - Vector2f canvas = getCanvasSize(); - int width = Integer.min(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode().getWidth(), - environment.getApplication().getContext().getSettings().getWidth()); - int height = Integer.min(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode().getHeight(), - environment.getApplication().getContext().getSettings().getHeight()); - ratio.x = Float.max(1f, canvas.x / width); - 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."); - } - } else { - throw new IllegalStateException("VR GUI manager is not attached to any environment."); - } - } - - /** - * Inform this manager that it has to position the GUI. - */ - public void positionGui() { - wantsReposition = true; - } - - /** - * Position the GUI to the given location. - * @param pos the position of the GUI. - * @param dir the rotation of the GUI. - * @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); - dir.mult(guiPos, guiPos); - guiPos.x += pos.x; - guiPos.y += pos.y + environment.getVRHeightAdjustment(); - guiPos.z += pos.z; - if( guiPositioningElastic > 0f && posMode != VRGUIPositioningMode.MANUAL ) { - // mix pos & dir with current pos & dir - guiPos.interpolateLocal(EoldPos, guiPos, Float.min(1f, tpf * guiPositioningElastic)); - EoldPos.set(guiPos); - } - } else { - throw new IllegalStateException("VR GUI manager is not attached to any environment."); - } - } - - /** - * Update the GUI geometric state. This method should be called after GUI modification. - */ - public void updateGuiQuadGeometricState() { - guiQuadNode.updateGeometricState(); - } - - /** - * Position the GUI without delay. - * @param tpf the time per frame. - */ - public void positionGuiNow(float tpf) { - if (environment != null){ - wantsReposition = false; - if( environment.isInVR() == false ){ - return; - } - - guiQuadNode.setLocalScale(guiDistance * guiScale * 4f, 4f * guiDistance * guiScale, 1f); - - switch( posMode ) { - case MANUAL: - case AUTO_CAM_ALL_SKIP_PITCH: - case AUTO_CAM_ALL: - if( camLeft != null && camRight != null ) { - // get middle point - temppos.set(camLeft.getLocation()).interpolateLocal(camRight.getLocation(), 0.5f); - positionTo(temppos, camLeft.getRotation(), tpf); - } - rotateScreenTo(camLeft.getRotation(), tpf); - - break; - case AUTO_OBSERVER_POS_CAM_ROTATION: - Object obs = environment.getObserver(); - if( obs != null ) { - if( obs instanceof Camera ) { - positionTo(((Camera)obs).getLocation(), camLeft.getRotation(), tpf); - } else { - positionTo(((Spatial)obs).getWorldTranslation(), camLeft.getRotation(), tpf); - } - } - rotateScreenTo(camLeft.getRotation(), tpf); - - break; - case AUTO_OBSERVER_ALL: - case AUTO_OBSERVER_ALL_CAMHEIGHT: - obs = environment.getObserver(); - if( obs != null ) { - Quaternion q; - if( obs instanceof Camera ) { - q = ((Camera)obs).getRotation(); - temppos.set(((Camera)obs).getLocation()); - } else { - q = ((Spatial)obs).getWorldRotation(); - temppos.set(((Spatial)obs).getWorldTranslation()); - } - if( posMode == VRGUIPositioningMode.AUTO_OBSERVER_ALL_CAMHEIGHT ) { - temppos.y = camLeft.getLocation().y; - } - positionTo(temppos, q, tpf); - rotateScreenTo(q, tpf); - - } - break; - } - } else { - throw new IllegalStateException("VR GUI manager is not attached to any environment."); - } - } - - /** - * Rotate the GUI to the given direction. - * @param dir the direction to rotate to. - * @param tpf the time per frame. - */ - private void rotateScreenTo(Quaternion dir, float tpf) { - dir.getRotationColumn(2, look).negateLocal(); - dir.getRotationColumn(0, left).negateLocal(); - orient.fromAxes(left, dir.getRotationColumn(1, up), look); - Quaternion rot = tempq.fromRotationMatrix(orient); - if( posMode == VRGUIPositioningMode.AUTO_CAM_ALL_SKIP_PITCH ){ - VRUtil.stripToYaw(rot); - } - - if( guiPositioningElastic > 0f && posMode != VRGUIPositioningMode.MANUAL ) { - // mix pos & dir with current pos & dir - EoldDir.nlerp(rot, tpf * guiPositioningElastic); - guiQuadNode.setLocalRotation(EoldDir); - } else { - guiQuadNode.setLocalRotation(rot); - } - } - - /** - * Get the GUI distance from the observer. - * @return the GUI distance from the observer. - * @see #setGuiDistance(float) - */ - public float getGuiDistance() { - return guiDistance; - } - - /** - * Set the GUI distance from the observer. - * @param newGuiDistance the GUI distance from the observer. - * @see #getGuiDistance() - */ - public void setGuiDistance(float newGuiDistance) { - guiDistance = newGuiDistance; - } - - /** - * Get the GUI scale. - * @return the GUI scale. - * @see #setGuiScale(float) - */ - public float getGUIScale(){ - return guiScale; - } - - /** - * Set the GUI scale. - * @param scale the GUI scale. - * @see #getGUIScale() - */ - public void setGuiScale(float scale) { - guiScale = scale; - } - - /** - * Adjust the GUI distance from the observer. - * This method increment / decrement the {@link #getGuiDistance() GUI distance} by the given value. - * @param adjustAmount the increment (if positive) / decrement (if negative) value of the GUI distance. - */ - public void adjustGuiDistance(float adjustAmount) { - guiDistance += adjustAmount; - } - - /** - * Set up the GUI. - * @param leftCam the left-eye camera. - * @param rightCam the right-eye camera. - * @param left the left-eye viewport. - * @param right the right-eye viewport. - */ - public void setupGui(Camera leftCam, Camera rightCam, ViewPort left, ViewPort right) { - - if (environment != null){ - if( environment.hasTraditionalGUIOverlay() ) { - camLeft = leftCam; - camRight = rightCam; - Spatial guiScene = getGuiQuad(camLeft); - left.attachScene(guiScene); - if( right != null ) right.attachScene(guiScene); - setPositioningMode(posMode); - } - } else { - throw new IllegalStateException("VR GUI manager is not attached to any environment."); - } - } - - /** - * Get if the GUI has to use curved surface. - * @return true if the GUI has to use curved surface and false otherwise. - * @see #setCurvedSurface(boolean) - */ - public boolean isCurverSurface(){ - return useCurvedSurface; - } - - /** - * Set if the GUI has to use curved surface. - * @param set true if the GUI has to use curved surface and false otherwise. - * @see #isCurverSurface() - */ - public void setCurvedSurface(boolean set) { - useCurvedSurface = set; - } - - /** - * Get if the GUI has to be displayed even if it is behind objects. - * @return true if the GUI has to use curved surface and false otherwise. - * @see #setGuiOverdraw(boolean) - */ - public boolean isGuiOverdraw(){ - return overdraw; - } - - /** - * Set if the GUI has to be displayed even if it is behind objects. - * @param set true if the GUI has to use curved surface and false otherwise. - * @see #isGuiOverdraw() - */ - public void setGuiOverdraw(boolean set) { - overdraw = set; - } - - /** - * Create a GUI quad for the given camera. - * @param sourceCam the camera - * @return a GUI quad for the given camera. - */ - private Spatial getGuiQuad(Camera sourceCam){ - if (environment != null){ - - if (environment.getApplication() != null){ - if( guiQuadNode == null ) { - Vector2f guiCanvasSize = getCanvasSize(); - Camera offCamera = sourceCam.clone(); - offCamera.setParallelProjection(true); - offCamera.setLocation(Vector3f.ZERO); - offCamera.lookAt(Vector3f.UNIT_Z, Vector3f.UNIT_Y); - - offView = environment.getApplication().getRenderManager().createPreView("GUI View", offCamera); - offView.setClearFlags(true, true, true); - offView.setBackgroundColor(ColorRGBA.BlackNoAlpha); - - // create offscreen framebuffer - FrameBuffer offBuffer = new FrameBuffer((int)guiCanvasSize.x, (int)guiCanvasSize.y, 1); - - //setup framebuffer's texture - guiTexture = new Texture2D((int)guiCanvasSize.x, (int)guiCanvasSize.y, Format.RGBA8); - guiTexture.setMinFilter(Texture.MinFilter.BilinearNoMipMaps); - guiTexture.setMagFilter(Texture.MagFilter.Bilinear); - - //setup framebuffer to use texture - offBuffer.setDepthBuffer(Format.Depth); - offBuffer.setColorTexture(guiTexture); - - //set viewport to render to offscreen framebuffer - offView.setOutputFrameBuffer(offBuffer); - - // setup framebuffer's scene - Iterator spatialIter = environment.getApplication().getGuiViewPort().getScenes().iterator(); - while(spatialIter.hasNext()){ - offView.attachScene(spatialIter.next()); - } - - if( useCurvedSurface ) { - guiQuad = (Geometry)environment.getApplication().getAssetManager().loadModel("Common/Util/gui_mesh.j3o"); - } else { - guiQuad = new Geometry("guiQuad", new CenterQuad(1f, 1f)); - } - - Material mat = new Material(environment.getApplication().getAssetManager(), "Common/MatDefs/VR/GuiOverlay.j3md"); - mat.getAdditionalRenderState().setDepthTest(!overdraw); - mat.getAdditionalRenderState().setBlendMode(BlendMode.Alpha); - mat.getAdditionalRenderState().setDepthWrite(false); - mat.setTexture("ColorMap", guiTexture); - guiQuad.setQueueBucket(Bucket.Translucent); - guiQuad.setMaterial(mat); - - guiQuadNode = new Node("gui-quad-node"); - guiQuadNode.setQueueBucket(Bucket.Translucent); - guiQuadNode.attachChild(guiQuad); - } - return guiQuadNode; - } else { - throw new IllegalStateException("VR GUI manager underlying environment is not attached to any application."); - } - } else { - throw new IllegalStateException("VR GUI manager is not attached to any environment."); - } - } -} diff --git a/jme3-vr/src/main/java/com/jme3/util/VRUtil.java b/jme3-vr/src/main/java/com/jme3/util/VRUtil.java deleted file mode 100644 index ffff964527..0000000000 --- a/jme3-vr/src/main/java/com/jme3/util/VRUtil.java +++ /dev/null @@ -1,106 +0,0 @@ -package com.jme3.util; - -import com.jme3.math.FastMath; -import com.jme3.math.Matrix4f; -import com.jme3.math.Quaternion; - - -import java.util.concurrent.TimeUnit; - -/** - * - * @author Julien Seinturier - COMEX SA - http://www.seinturier.fr - * - * @deprecated The jme3-vr module is deprecated and will be removed in a future version (as it only supports OpenVR). - * For new Virtual Reality projects, use user libraries that provide OpenXR support. - * See Virtual Reality JME wiki section - * for more information. - */ -@Deprecated -public class VRUtil { - - private static final long SLEEP_PRECISION = TimeUnit.MILLISECONDS.toNanos(4); - private static final long SPIN_YIELD_PRECISION = TimeUnit.MILLISECONDS.toNanos(2); - - /** - * A private constructor to inhibit instantiation of this class. - */ - private VRUtil() { - } - - public static void sleepNanos(long nanoDuration) { - final long end = System.nanoTime() + nanoDuration; - long timeLeft = nanoDuration; - do { - try { - if (timeLeft > SLEEP_PRECISION) { - Thread.sleep(1); - } else if (timeLeft > SPIN_YIELD_PRECISION) { - Thread.sleep(0); - } - } catch(Exception e) { } - timeLeft = end - System.nanoTime(); - } while (timeLeft > 0); - } - - - - - public static void convertMatrix4toQuat(Matrix4f in, Quaternion out) { - // convert rotation matrix to quat - out.fromRotationMatrix(in.m00, in.m01, in.m02, in.m10, in.m11, in.m12, in.m20, in.m21, in.m22); - // flip the pitch - out.set(-out.getX(), out.getY(), -out.getZ(), out.getW()); - } - - public static Quaternion FastFullAngles(Quaternion use, float yaw, float pitch, float roll) { - float angle; - float sinRoll, sinPitch, sinYaw, cosRoll, cosPitch, cosYaw; - angle = roll * 0.5f; - sinPitch = (float)Math.sin(angle); - cosPitch = (float)Math.cos(angle); - angle = yaw * 0.5f; - sinRoll = (float)Math.sin(angle); - cosRoll = (float)Math.cos(angle); - angle = pitch * 0.5f; - sinYaw = (float)Math.sin(angle); - cosYaw = (float)Math.cos(angle); - - // variables used to reduce multiplication calls. - float cosRollXcosPitch = cosRoll * cosPitch; - float sinRollXsinPitch = sinRoll * sinPitch; - float cosRollXsinPitch = cosRoll * sinPitch; - float sinRollXcosPitch = sinRoll * cosPitch; - - use.set((cosRollXcosPitch * sinYaw + sinRollXsinPitch * cosYaw), - (sinRollXcosPitch * cosYaw + cosRollXsinPitch * sinYaw), - (cosRollXsinPitch * cosYaw - sinRollXcosPitch * sinYaw), - (cosRollXcosPitch * cosYaw - sinRollXsinPitch * sinYaw)); - - return use; - } - - public static Quaternion stripToYaw(Quaternion q) { - float yaw; - float w = q.getW(); - float x = q.getX(); - float y = q.getY(); - float z = q.getZ(); - float sqx = x*x; - float sqy = y*y; - float sqz = z*z; - float sqw = w*w; - float unit = sqx + sqy + sqz + sqw; // if normalized is one, otherwise - // is correction factor - float test = x * y + z * w; - if (test > 0.499 * unit) { // singularity at north pole - yaw = 2 * FastMath.atan2(x, w); - } else if (test < -0.499 * unit) { // singularity at south pole - yaw = -2 * FastMath.atan2(x, w); - } else { - yaw = FastMath.atan2(2 * y * w - 2 * x * z, sqx - sqy - sqz + sqw); // roll or heading - } - FastFullAngles(q, yaw, 0f, 0f); - return q; - } -} diff --git a/jme3-vr/src/main/java/test/TestInitHmd.java b/jme3-vr/src/main/java/test/TestInitHmd.java deleted file mode 100644 index a15ea732d1..0000000000 --- a/jme3-vr/src/main/java/test/TestInitHmd.java +++ /dev/null @@ -1,59 +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 test; - -import com.jme3.app.VREnvironment; -import com.jme3.input.vr.openvr.OpenVR; -import com.jme3.system.AppSettings; - -/** - * Testing OpenVR environment. - * @author Rickard (neph1 @ github) - */ -public class TestInitHmd { - - public static void main(String... args){ - testInitHmd(); - } - - public static void testInitHmd(){ - VREnvironment environment = new VREnvironment(new AppSettings(true)); - environment.initialize(); - OpenVR openVr = (OpenVR) environment.getVRHardware(); - System.out.println(openVr.getName()); - - openVr.updatePose(); - - openVr.destroy(); - - } -} \ No newline at end of file diff --git a/jme3-vr/src/main/resources/Common/MatDefs/VR/CartoonSSAO.frag b/jme3-vr/src/main/resources/Common/MatDefs/VR/CartoonSSAO.frag deleted file mode 100644 index 5d121019fc..0000000000 --- a/jme3-vr/src/main/resources/Common/MatDefs/VR/CartoonSSAO.frag +++ /dev/null @@ -1,109 +0,0 @@ -//#define FRAGMENT_SHADER -#import "Common/ShaderLib/GLSLCompat.glsllib" - -uniform vec2 g_ResolutionInverse; -uniform vec2 m_FrustumNearFar; -uniform sampler2D m_Texture; -uniform sampler2D m_Normals; -uniform sampler2D m_DepthTexture; -uniform vec3 m_FrustumCorner; -uniform float m_Distance; - -varying vec2 texCoord; - -#define m_Scale 3.15 -#define m_Bias 0.025 -#define m_SampleRadius 200.0 - -vec4 fetchNormalDepth(vec2 tc){ - vec4 nd; - nd.xyz = texture2D(m_Normals, tc).rgb; - nd.w = 150.0 * texture2D(m_DepthTexture, tc).r; - return nd; -} - -vec3 getPosition(in vec2 uv){ - float depth= (2.0 * m_FrustumNearFar.x) / (m_FrustumNearFar.y + m_FrustumNearFar.x - texture2D(m_DepthTexture,uv).r * (m_FrustumNearFar.y-m_FrustumNearFar.x)); -#ifdef INSTANCING - float x = mix(-m_FrustumCorner.x, m_FrustumCorner.x, (uv.x - (uv.x > 0.5 ? 0.5 : 0.0)) * 2.0); -#else - float x = mix(-m_FrustumCorner.x, m_FrustumCorner.x, uv.x); -#endif - float y = mix(-m_FrustumCorner.y, m_FrustumCorner.y, uv.y); - return depth* vec3(x, y, m_FrustumCorner.z); -} - -vec3 getPosition(in vec2 uv, in float indepth){ - float depth= (2.0 * m_FrustumNearFar.x) / (m_FrustumNearFar.y + m_FrustumNearFar.x - indepth * (m_FrustumNearFar.y-m_FrustumNearFar.x)); -#ifdef INSTANCING - float x = mix(-m_FrustumCorner.x, m_FrustumCorner.x, (uv.x - (uv.x > 0.5 ? 0.5 : 0.0)) * 2.0); -#else - float x = mix(-m_FrustumCorner.x, m_FrustumCorner.x, uv.x); -#endif - float y = mix(-m_FrustumCorner.y, m_FrustumCorner.y, uv.y); - return depth* vec3(x, y, m_FrustumCorner.z); -} - -float doAmbientOcclusion(in vec2 tc, in vec3 pos, in vec3 norm){ - vec3 diff = getPosition(tc)- pos; - float d = length(diff) * m_Scale; - vec3 v = normalize(diff); - return step(0.00002,d)*max(0.0, dot(norm, v) - m_Bias) * ( 1.0/(1.0 + d) ) * smoothstep(0.00002,0.0027,d); -} - -void main(){ - float result; - - float firstdepth = texture2D(m_DepthTexture,texCoord).r; - vec4 color = texture2D(m_Texture, texCoord); - - if( firstdepth == 1.0 ) { - gl_FragColor = color; - return; - } - - vec3 position = getPosition(texCoord, firstdepth); - vec3 normal = texture2D(m_Normals, texCoord).xyz * 2.0 - 1.0; - - vec2 rad = m_SampleRadius * g_ResolutionInverse / max(16.0, position.z); - - float ao = doAmbientOcclusion(texCoord + vec2( rad.x, rad.y), position, normal); - ao += doAmbientOcclusion(texCoord + vec2(-rad.x, rad.y), position, normal); - ao += doAmbientOcclusion(texCoord + vec2( rad.x, -rad.y), position, normal); - ao += doAmbientOcclusion(texCoord + vec2(-rad.x, -rad.y), position, normal); - - ao += doAmbientOcclusion(texCoord + vec2(-rad.x, 0.0), position, normal); - ao += doAmbientOcclusion(texCoord + vec2( rad.x, 0.0), position, normal); - ao += doAmbientOcclusion(texCoord + vec2(0.0, -rad.y), position, normal); - ao += doAmbientOcclusion(texCoord + vec2(0.0, rad.y), position, normal); - - rad *= 0.7; - - ao += doAmbientOcclusion(texCoord + vec2(-rad.x, -rad.y), position, normal); - ao += doAmbientOcclusion(texCoord + vec2( rad.x, -rad.y), position, normal); - ao += doAmbientOcclusion(texCoord + vec2(-rad.x, rad.y), position, normal); - ao += doAmbientOcclusion(texCoord + vec2( rad.x, rad.y), position, normal); - - result = 1.0 - clamp(ao * 0.4 - position.z * m_Distance * 2.5, 0.0, 0.6); - -#ifndef NO_OUTLINE - // ok, done with ambient occlusion, do cartoon edge - - vec2 mv = 0.5 * g_ResolutionInverse; - - vec4 n1 = fetchNormalDepth(texCoord + vec2(-mv.x, -mv.y)); - vec4 n2 = fetchNormalDepth(texCoord + vec2( mv.x, mv.y)); - vec4 n3 = fetchNormalDepth(texCoord + vec2(-mv.x, mv.y)); - vec4 n4 = fetchNormalDepth(texCoord + vec2( mv.x, -mv.y)); - - // Work out how much the normal and depth values are changing. - vec4 diagonalDelta = abs(n1 - n2) + abs(n3 - n4); - - float normalDelta = dot(diagonalDelta.xyz, vec3(1.0)); - float totalDelta = (diagonalDelta.w + normalDelta * 0.4) - position.z * m_Distance; - - gl_FragColor = color * vec4(result, result, result, 1.0) * (1.0 - clamp(totalDelta, 0.0, 1.0)); -#else - gl_FragColor = color * vec4(result, result, result, 1.0); -#endif -} diff --git a/jme3-vr/src/main/resources/Common/MatDefs/VR/CartoonSSAO.j3md b/jme3-vr/src/main/resources/Common/MatDefs/VR/CartoonSSAO.j3md deleted file mode 100644 index 7772941ce5..0000000000 --- a/jme3-vr/src/main/resources/Common/MatDefs/VR/CartoonSSAO.j3md +++ /dev/null @@ -1,50 +0,0 @@ -MaterialDef CartoonSSAO { - - MaterialParameters { - Int BoundDrawBuffer - Int NumSamples - Int NumSamplesDepth - Texture2D DepthTexture - Texture2D Texture - Texture2D Normals - Vector3 FrustumCorner - Float Distance - Boolean disableOutline - Boolean useInstancing - Vector2 FrustumNearFar - } - - Technique { - VertexShader GLSL300 GLSL150: Common/MatDefs/Post/Post15.vert - FragmentShader GLSL300 GLSL150: Common/MatDefs/VR/CartoonSSAO.frag - - WorldParameters { - WorldViewProjectionMatrix - WorldViewMatrix - ResolutionInverse - } - - Defines { - BOUND_DRAW_BUFFER: BoundDrawBuffer - NO_OUTLINE : disableOutline - INSTANCING : useInstancing - } - } - - Technique { - VertexShader GLSL300 GLSL150 GLSL100: Common/MatDefs/Post/Post.vert - FragmentShader GLSL300 GLSL150 GLSL100: Common/MatDefs/VR/CartoonSSAO.frag - - WorldParameters { - WorldViewProjectionMatrix - WorldViewMatrix - ResolutionInverse - } - - Defines { - BOUND_DRAW_BUFFER: BoundDrawBuffer - NO_OUTLINE : disableOutline - INSTANCING : useInstancing - } - } -} diff --git a/jme3-vr/src/main/resources/Common/MatDefs/VR/GuiOverlay.frag b/jme3-vr/src/main/resources/Common/MatDefs/VR/GuiOverlay.frag deleted file mode 100644 index 555ef3eb49..0000000000 --- a/jme3-vr/src/main/resources/Common/MatDefs/VR/GuiOverlay.frag +++ /dev/null @@ -1,10 +0,0 @@ -#import "Common/ShaderLib/GLSLCompat.glsllib" - -uniform sampler2D m_ColorMap; - -varying vec2 texCoord1; - -void main(){ - gl_FragColor = texture2D(m_ColorMap, texCoord1); - gl_FragColor.a *= 12.0 / (1.0 + gl_FragColor.a * 11.0 ); -} \ No newline at end of file diff --git a/jme3-vr/src/main/resources/Common/MatDefs/VR/GuiOverlay.j3md b/jme3-vr/src/main/resources/Common/MatDefs/VR/GuiOverlay.j3md deleted file mode 100644 index 427627732b..0000000000 --- a/jme3-vr/src/main/resources/Common/MatDefs/VR/GuiOverlay.j3md +++ /dev/null @@ -1,41 +0,0 @@ -MaterialDef GuiOverlay { - - MaterialParameters { - Int BoundDrawBuffer - Texture2D ColorMap - - // For VR instancing - Matrix4 RightEyeViewProjectionMatrix - } - - Technique { - VertexShader GLSL300 GLSL150: Common/MatDefs/VR/GuiOverlay15.vert - FragmentShader GLSL300 GLSL150: Common/MatDefs/VR/GuiOverlay15.frag - - WorldParameters { - WorldViewProjectionMatrix - ViewProjectionMatrix // needed for VR instancing - } - - Defines { - BOUND_DRAW_BUFFER: BoundDrawBuffer - INSTANCING : RightEyeViewProjectionMatrix // For VR instancing - } - } - - Technique { - VertexShader GLSL300 GLSL150 GLSL100: Common/MatDefs/VR/GuiOverlay.vert - FragmentShader GLSL300 GLSL150 GLSL100: Common/MatDefs/VR/GuiOverlay.frag - - WorldParameters { - WorldViewProjectionMatrix - ViewProjectionMatrix // needed for VR instancing - } - - Defines { - BOUND_DRAW_BUFFER: BoundDrawBuffer - INSTANCING : RightEyeViewProjectionMatrix // For VR instancing - } - } - -} \ No newline at end of file diff --git a/jme3-vr/src/main/resources/Common/MatDefs/VR/GuiOverlay.vert b/jme3-vr/src/main/resources/Common/MatDefs/VR/GuiOverlay.vert deleted file mode 100644 index 8b05071961..0000000000 --- a/jme3-vr/src/main/resources/Common/MatDefs/VR/GuiOverlay.vert +++ /dev/null @@ -1,12 +0,0 @@ -// import the following for VR instancing -#import "Common/ShaderLib/InstanceVR.glsllib" - -attribute vec3 inPosition; -attribute vec2 inTexCoord; -varying vec2 texCoord1; - -void main(){ - texCoord1 = inTexCoord; - vec4 modelSpacePos = vec4(inPosition, 1.0); - gl_Position = TransformWorldViewProjectionVR(modelSpacePos); -} \ No newline at end of file diff --git a/jme3-vr/src/main/resources/Common/MatDefs/VR/GuiOverlay15.frag b/jme3-vr/src/main/resources/Common/MatDefs/VR/GuiOverlay15.frag deleted file mode 100644 index efaca8436c..0000000000 --- a/jme3-vr/src/main/resources/Common/MatDefs/VR/GuiOverlay15.frag +++ /dev/null @@ -1,13 +0,0 @@ -//#define FRAGMENT_SHADER -#import "Common/ShaderLib/GLSLCompat.glsllib" - -uniform sampler2D m_ColorMap; - -in vec2 texCoord1; - -out vec4 outColor; - -void main(){ - outColor = texture2D(m_ColorMap, texCoord1); - outColor.a *= 12.0 / (1.0 + outColor.a * 11.0 ); -} \ No newline at end of file diff --git a/jme3-vr/src/main/resources/Common/MatDefs/VR/GuiOverlay15.vert b/jme3-vr/src/main/resources/Common/MatDefs/VR/GuiOverlay15.vert deleted file mode 100644 index cb505d5cfe..0000000000 --- a/jme3-vr/src/main/resources/Common/MatDefs/VR/GuiOverlay15.vert +++ /dev/null @@ -1,14 +0,0 @@ -// import the following for VR instancing -//#define VERTEX_SHADER -#import "Common/ShaderLib/GLSLCompat.glsllib" -#import "Common/ShaderLib/InstanceVR.glsllib" - -in vec3 inPosition; -in vec2 inTexCoord; -out vec2 texCoord1; - -void main(){ - texCoord1 = inTexCoord; - vec4 modelSpacePos = vec4(inPosition, 1.0); - gl_Position = TransformWorldViewProjectionVR(modelSpacePos); -} \ No newline at end of file diff --git a/jme3-vr/src/main/resources/Common/MatDefs/VR/OpenVR.frag b/jme3-vr/src/main/resources/Common/MatDefs/VR/OpenVR.frag deleted file mode 100644 index 9d61ca057e..0000000000 --- a/jme3-vr/src/main/resources/Common/MatDefs/VR/OpenVR.frag +++ /dev/null @@ -1,22 +0,0 @@ -#import "Common/ShaderLib/GLSLCompat.glsllib" -uniform sampler2D m_Texture; - -varying vec2 UVred; -varying vec2 UVgreen; -varying vec2 UVblue; - -void main() { - // performance & FOV experiment by removing bounds check - //float fBoundsCheck = ( (dot( vec2( lessThan( UVgreen.xy, vec2(0.05, 0.05)) ), vec2(1.0, 1.0))+dot( vec2( greaterThan( UVgreen.xy, vec2( 0.95, 0.95)) ), vec2(1.0, 1.0))) ); - // - //if( fBoundsCheck > 1.0 ) { - // gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - //} else { - - float red = texture2D(m_Texture, UVred).x; - float green = texture2D(m_Texture, UVgreen).y; - float blue = texture2D(m_Texture, UVblue).z; - gl_FragColor = vec4( red, green, blue, 1.0 ); - - //} -} diff --git a/jme3-vr/src/main/resources/Common/MatDefs/VR/OpenVR.j3md b/jme3-vr/src/main/resources/Common/MatDefs/VR/OpenVR.j3md deleted file mode 100644 index c4385c91c0..0000000000 --- a/jme3-vr/src/main/resources/Common/MatDefs/VR/OpenVR.j3md +++ /dev/null @@ -1,36 +0,0 @@ -MaterialDef OpenVR { - MaterialParameters { - Int BoundDrawBuffer - Int NumSamples - Texture2D Texture - - Vector2 inUVred - Vector2 inUVblue - Vector2 inUVgreen - } - - Technique { - VertexShader GLSL300 GLSL150: Common/MatDefs/VR/OpenVR15.vert - FragmentShader GLSL300 GLSL150: Common/MatDefs/VR/OpenVR15.frag - - WorldParameters { - } - - Defines { - BOUND_DRAW_BUFFER: BoundDrawBuffer - } - - } - - Technique { - VertexShader GLSL300 GLSL150 GLSL100: Common/MatDefs/VR/OpenVR.vert - FragmentShader GLSL300 GLSL150 GLSL100: Common/MatDefs/VR/OpenVR.frag - - WorldParameters { - } - - Defines { - BOUND_DRAW_BUFFER: BoundDrawBuffer - } - } -} \ No newline at end of file diff --git a/jme3-vr/src/main/resources/Common/MatDefs/VR/OpenVR.vert b/jme3-vr/src/main/resources/Common/MatDefs/VR/OpenVR.vert deleted file mode 100644 index 734a097e29..0000000000 --- a/jme3-vr/src/main/resources/Common/MatDefs/VR/OpenVR.vert +++ /dev/null @@ -1,17 +0,0 @@ -#import "Common/ShaderLib/GLSLCompat.glsllib" -attribute vec4 inPosition; - -attribute vec2 inTexCoord; // m_inUVred -attribute vec2 inTexCoord2; // m_inUVgreen -attribute vec2 inTexCoord3; // m_inUVblue - -varying vec2 UVred; -varying vec2 UVgreen; -varying vec2 UVblue; - -void main() { - gl_Position = inPosition; - UVred = inTexCoord; - UVgreen = inTexCoord2; - UVblue = inTexCoord3; -} \ No newline at end of file diff --git a/jme3-vr/src/main/resources/Common/MatDefs/VR/OpenVR15.frag b/jme3-vr/src/main/resources/Common/MatDefs/VR/OpenVR15.frag deleted file mode 100644 index 20d195c490..0000000000 --- a/jme3-vr/src/main/resources/Common/MatDefs/VR/OpenVR15.frag +++ /dev/null @@ -1,24 +0,0 @@ -#import "Common/ShaderLib/GLSLCompat.glsllib" -uniform sampler2D m_Texture; - -in vec2 UVred; -in vec2 UVgreen; -in vec2 UVblue; - -out vec4 outColor; - -void main() { - // performance & FOV improvement by removing bounds check - //float fBoundsCheck = ( (dot( vec2( lessThan( UVgreen.xy, vec2(0.05, 0.05)) ), vec2(1.0, 1.0))+dot( vec2( greaterThan( UVgreen.xy, vec2( 0.95, 0.95)) ), vec2(1.0, 1.0))) ); - // - //if( fBoundsCheck > 1.0 ) { - // gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - //} else { - - float red = texture2D(m_Texture, UVred).x; - float green = texture2D(m_Texture, UVgreen).y; - float blue = texture2D(m_Texture, UVblue).z; - outColor = vec4( red, green, blue, 1.0 ); - - //} -} diff --git a/jme3-vr/src/main/resources/Common/MatDefs/VR/OpenVR15.vert b/jme3-vr/src/main/resources/Common/MatDefs/VR/OpenVR15.vert deleted file mode 100644 index e0c17a91b1..0000000000 --- a/jme3-vr/src/main/resources/Common/MatDefs/VR/OpenVR15.vert +++ /dev/null @@ -1,17 +0,0 @@ -#import "Common/ShaderLib/GLSLCompat.glsllib" -in vec4 inPosition; - -in vec2 inTexCoord; // m_inUVred -in vec2 inTexCoord2; // m_inUVgreen -in vec2 inTexCoord3; // m_inUVblue - -out vec2 UVred; -out vec2 UVgreen; -out vec2 UVblue; - -void main() { - gl_Position = inPosition; - UVred = inTexCoord; - UVgreen = inTexCoord2; - UVblue = inTexCoord3; -} \ No newline at end of file diff --git a/jme3-vr/src/main/resources/Common/MatDefs/VR/PostShadowFilter.frag b/jme3-vr/src/main/resources/Common/MatDefs/VR/PostShadowFilter.frag deleted file mode 100644 index c940462d8a..0000000000 --- a/jme3-vr/src/main/resources/Common/MatDefs/VR/PostShadowFilter.frag +++ /dev/null @@ -1,184 +0,0 @@ -#import "Common/ShaderLib/GLSLCompat.glsllib" -#import "Common/ShaderLib/MultiSample.glsllib" -#import "Common/ShaderLib/Shadows.glsllib" - - -uniform COLORTEXTURE m_Texture; -uniform DEPTHTEXTURE m_DepthTexture; -uniform mat4 m_ViewProjectionMatrixInverse; -uniform vec4 m_ViewProjectionMatrixRow2; - -#ifdef INSTANCING - uniform mat4 m_ViewProjectionMatrixInverseRight; - uniform vec4 m_ViewProjectionMatrixRow2Right; -#endif - -in vec2 texCoord; -out vec4 outFragColor; - -const mat4 biasMat = mat4(0.5, 0.0, 0.0, 0.0, - 0.0, 0.5, 0.0, 0.0, - 0.0, 0.0, 0.5, 0.0, - 0.5, 0.5, 0.5, 1.0); - -uniform mat4 m_LightViewProjectionMatrix0; -uniform mat4 m_LightViewProjectionMatrix1; -uniform mat4 m_LightViewProjectionMatrix2; -uniform mat4 m_LightViewProjectionMatrix3; - -uniform vec2 g_ResolutionInverse; - -#ifdef POINTLIGHT - uniform vec3 m_LightPos; - uniform mat4 m_LightViewProjectionMatrix4; - uniform mat4 m_LightViewProjectionMatrix5; -#else - uniform vec3 m_LightDir; - #ifndef PSSM - uniform vec3 m_LightPos; - #endif -#endif - -#ifdef FADE -uniform vec2 m_FadeInfo; -#endif - -vec3 getPosition(in float depth, in vec2 uv){ - #ifdef INSTANCING - vec4 pos; - mat4 usemat; - uv.x *= 2.0; - if( uv.x > 1.0 ) { - // right eye - uv.x -= 1.0; - usemat = m_ViewProjectionMatrixInverseRight; - } else { - // left eye - usemat = m_ViewProjectionMatrixInverse; - } - pos = vec4(uv, depth, 1.0) * 2.0 - 1.0; - pos = usemat * pos; - #else - vec4 pos = vec4(uv, depth, 1.0) * 2.0 - 1.0; - pos = m_ViewProjectionMatrixInverse * pos; - #endif - return pos.xyz / pos.w; -} - -#ifndef BACKFACE_SHADOWS - vec3 approximateNormal(in float depth,in vec4 worldPos,in vec2 texCoord, in int numSample){ - float step = g_ResolutionInverse.x ; - float stepy = g_ResolutionInverse.y ; - float depth1 = fetchTextureSample(m_DepthTexture,texCoord + vec2(-step,stepy),numSample).r; - float depth2 = fetchTextureSample(m_DepthTexture,texCoord + vec2(step,stepy),numSample).r; - vec3 v1, v2; - vec4 worldPos1 = vec4(getPosition(depth1,texCoord + vec2(-step,stepy)),1.0); - vec4 worldPos2 = vec4(getPosition(depth2,texCoord + vec2(step,stepy)),1.0); - - v1 = normalize((worldPos1 - worldPos)).xyz; - v2 = normalize((worldPos2 - worldPos)).xyz; - return normalize(cross(v2, v1)); - - } -#endif - -vec4 main_multiSample(in int numSample){ - float depth = fetchTextureSample(m_DepthTexture,texCoord,numSample).r;//getDepth(m_DepthTexture,texCoord).r; - vec4 color = fetchTextureSample(m_Texture,texCoord,numSample); - - //Discard shadow computation on the sky - if(depth == 1.0){ - return color; - } - - // get the vertex in world space - vec4 worldPos = vec4(getPosition(depth,texCoord),1.0); - - - vec3 lightDir; - #ifdef PSSM - lightDir = m_LightDir; - #else - lightDir = worldPos.xyz - m_LightPos; - #endif - - #ifndef BACKFACE_SHADOWS - vec3 normal = approximateNormal(depth, worldPos, texCoord, numSample); - float ndotl = dot(normal, lightDir); - if(ndotl > 0.0){ - return color; - } - #endif - - #if (!defined(POINTLIGHT) && !defined(PSSM)) - if( dot(m_LightDir,lightDir)<0){ - return color; - } - #endif - - // populate the light view matrices array and convert vertex to light viewProj space - vec4 projCoord0 = biasMat * m_LightViewProjectionMatrix0 * worldPos; - vec4 projCoord1 = biasMat * m_LightViewProjectionMatrix1 * worldPos; - vec4 projCoord2 = biasMat * m_LightViewProjectionMatrix2 * worldPos; - vec4 projCoord3 = biasMat * m_LightViewProjectionMatrix3 * worldPos; - #ifdef POINTLIGHT - vec4 projCoord4 = biasMat * m_LightViewProjectionMatrix4 * worldPos; - vec4 projCoord5 = biasMat * m_LightViewProjectionMatrix5 * worldPos; - #endif - - float shadow = 1.0; - - #if defined(PSSM) || defined(FADE) - #ifdef INSTANCING - vec4 useMat = (texCoord.x > 0.5 ? m_ViewProjectionMatrixRow2Right : m_ViewProjectionMatrixRow2); - float shadowPosition = useMat.x * worldPos.x + useMat.y * worldPos.y + useMat.z * worldPos.z + useMat.w; - #else - float shadowPosition = m_ViewProjectionMatrixRow2.x * worldPos.x + m_ViewProjectionMatrixRow2.y * worldPos.y + m_ViewProjectionMatrixRow2.z * worldPos.z + m_ViewProjectionMatrixRow2.w; - #endif - #endif - - #ifdef POINTLIGHT - shadow = getPointLightShadows(worldPos, m_LightPos, - m_ShadowMap0,m_ShadowMap1,m_ShadowMap2,m_ShadowMap3,m_ShadowMap4,m_ShadowMap5, - projCoord0, projCoord1, projCoord2, projCoord3, projCoord4, projCoord5); - #else - #ifdef PSSM - shadow = getDirectionalLightShadows(m_Splits, shadowPosition, - m_ShadowMap0,m_ShadowMap1,m_ShadowMap2,m_ShadowMap3, - projCoord0, projCoord1, projCoord2, projCoord3); - #else - //spotlight - shadow = getSpotLightShadows(m_ShadowMap0,projCoord0); - #endif - #endif - - - #ifdef FADE - shadow = clamp(max(0.0,mix(shadow, 1.0 ,(shadowPosition - m_FadeInfo.x) * m_FadeInfo.y)),0.0,1.0); - #endif - - shadow= shadow * m_ShadowIntensity + (1.0 - m_ShadowIntensity); - return color * vec4(shadow, shadow, shadow, 1.0); -} - -void main(){ - - #if !defined( RENDER_SHADOWS ) - outFragColor = fetchTextureSample(m_Texture,texCoord,0); - return; - #endif - - #ifdef RESOLVE_MS - vec4 color = vec4(0.0); - for (int i = 0; i < m_NumSamples; i++){ - color += main_multiSample(i); - } - outFragColor = color / m_NumSamples; - #else - outFragColor = main_multiSample(0); - #endif - -} - - - diff --git a/jme3-vr/src/main/resources/Common/MatDefs/VR/PostShadowFilter.j3md b/jme3-vr/src/main/resources/Common/MatDefs/VR/PostShadowFilter.j3md deleted file mode 100644 index f85a94b047..0000000000 --- a/jme3-vr/src/main/resources/Common/MatDefs/VR/PostShadowFilter.j3md +++ /dev/null @@ -1,102 +0,0 @@ -MaterialDef Post Shadow { - - MaterialParameters { - Int BoundDrawBuffer - Int FilterMode - Boolean HardwareShadows - - Texture2D ShadowMap0 - Texture2D ShadowMap1 - Texture2D ShadowMap2 - Texture2D ShadowMap3 - //pointLights - Texture2D ShadowMap4 - Texture2D ShadowMap5 - - Float ShadowIntensity - Vector4 Splits - Vector2 FadeInfo - - Matrix4 LightViewProjectionMatrix0 - Matrix4 LightViewProjectionMatrix1 - Matrix4 LightViewProjectionMatrix2 - Matrix4 LightViewProjectionMatrix3 - //pointLight - Matrix4 LightViewProjectionMatrix4 - Matrix4 LightViewProjectionMatrix5 - Vector3 LightPos - Vector3 LightDir - - Float PCFEdge - - Float ShadowMapSize - - Matrix4 ViewProjectionMatrixInverse - Vector4 ViewProjectionMatrixRow2 - - Int NumSamples - Int NumSamplesDepth - Texture2D Texture - Texture2D DepthTexture - - // is VR instancing? - Matrix4 ViewProjectionMatrixInverseRight - Vector4 ViewProjectionMatrixRow2Right - - Boolean BackfaceShadows: true - } - - Technique { - VertexShader GLSL300 GLSL150: Common/MatDefs/VR/PostShadowFilter.vert - FragmentShader GLSL300 GLSL150: Common/MatDefs/VR/PostShadowFilter.frag - - WorldParameters { - ResolutionInverse - } - - Defines { - BOUND_DRAW_BUFFER: BoundDrawBuffer - RESOLVE_MS : NumSamples - RESOLVE_DEPTH_MS : NumSamplesDepth - HARDWARE_SHADOWS : HardwareShadows - FILTER_MODE : FilterMode - PCFEDGE : PCFEdge - SHADOWMAP_SIZE : ShadowMapSize - FADE : FadeInfo - PSSM : Splits - POINTLIGHT : LightViewProjectionMatrix5 - //if no shadow map don't render shadows - RENDER_SHADOWS : ShadowMap0 - INSTANCING : ViewProjectionMatrixInverseRight - BACKFACE_SHADOWS : BackfaceShadows - } - - } - - Technique { - VertexShader GLSL300 GLSL150 GLSL100: Common/MatDefs/Shadow/PostShadowFilter.vert - FragmentShader GLSL300 GLSL150 GLSL100: Common/MatDefs/Shadow/PostShadowFilter.frag - - WorldParameters { - ResolutionInverse - } - - Defines { - BOUND_DRAW_BUFFER: BoundDrawBuffer - HARDWARE_SHADOWS : HardwareShadows - FILTER_MODE : FilterMode - PCFEDGE : PCFEdge - SHADOWMAP_SIZE : ShadowMapSize - FADE : FadeInfo - PSSM : Splits - POINTLIGHT : LightViewProjectionMatrix5 - INSTANCING : ViewProjectionMatrixInverseRight - BACKFACE_SHADOWS : BackfaceShadows - } - - } - - - - -} \ No newline at end of file diff --git a/jme3-vr/src/main/resources/Common/MatDefs/VR/PostShadowFilter.vert b/jme3-vr/src/main/resources/Common/MatDefs/VR/PostShadowFilter.vert deleted file mode 100644 index d8ffbbfcb9..0000000000 --- a/jme3-vr/src/main/resources/Common/MatDefs/VR/PostShadowFilter.vert +++ /dev/null @@ -1,11 +0,0 @@ -//#define VERTEX_SHADER -#import "Common/ShaderLib/GLSLCompat.glsllib" - -attribute vec4 inPosition; -attribute vec2 inTexCoord; -varying vec2 texCoord; - -void main() { - gl_Position = vec4(inPosition.xy * 2.0 - 1.0, 0.0, 1.0); - texCoord = inTexCoord; -} \ No newline at end of file diff --git a/jme3-vr/src/main/resources/Common/MatDefs/VR/Unshaded.frag b/jme3-vr/src/main/resources/Common/MatDefs/VR/Unshaded.frag deleted file mode 100644 index 14217abc4a..0000000000 --- a/jme3-vr/src/main/resources/Common/MatDefs/VR/Unshaded.frag +++ /dev/null @@ -1,21 +0,0 @@ -//#define FRAGMENT_SHADER -#import "Common/ShaderLib/GLSLCompat.glsllib" - -uniform vec4 m_Color; -uniform sampler2D m_ColorMap; - -varying vec2 texCoord1; - -void main(){ - vec4 color = vec4(1.0); - - #ifdef HAS_COLORMAP - color *= texture2D(m_ColorMap, texCoord1); - #endif - - #ifdef HAS_COLOR - color *= m_Color; - #endif - - gl_FragColor = color; -} \ No newline at end of file diff --git a/jme3-vr/src/main/resources/Common/MatDefs/VR/Unshaded.j3md b/jme3-vr/src/main/resources/Common/MatDefs/VR/Unshaded.j3md deleted file mode 100644 index 13a9cf2b5e..0000000000 --- a/jme3-vr/src/main/resources/Common/MatDefs/VR/Unshaded.j3md +++ /dev/null @@ -1,48 +0,0 @@ -MaterialDef Unshaded { - - MaterialParameters { - Int BoundDrawBuffer - Texture2D ColorMap - Color Color (Color) - - // For VR instancing - Matrix4 RightEyeViewProjectionMatrix - } - - Technique { - VertexShader GLSL300 GLSL150: Common/MatDefs/VR/Unshaded.vert - FragmentShader GLSL300 GLSL150: Common/MatDefs/VR/Unshaded.frag - - WorldParameters { - WorldViewProjectionMatrix - ViewProjectionMatrix // needed for VR instancing - ViewMatrix - } - - Defines { - BOUND_DRAW_BUFFER: BoundDrawBuffer - INSTANCING : RightEyeViewProjectionMatrix // For VR instancing - HAS_COLORMAP : ColorMap - HAS_COLOR : Color - } - } - - Technique { - VertexShader GLSL300 GLSL150 GLSL100: Common/MatDefs/VR/Unshaded.vert - FragmentShader GLSL300 GLSL150 GLSL100: Common/MatDefs/VR/Unshaded.frag - - WorldParameters { - WorldViewProjectionMatrix - ViewProjectionMatrix // needed for VR instancing - ViewMatrix - } - - Defines { - BOUND_DRAW_BUFFER: BoundDrawBuffer - INSTANCING : RightEyeViewProjectionMatrix // For VR instancing - HAS_COLORMAP : ColorMap - HAS_COLOR : Color - } - } - -} \ No newline at end of file diff --git a/jme3-vr/src/main/resources/Common/MatDefs/VR/Unshaded.vert b/jme3-vr/src/main/resources/Common/MatDefs/VR/Unshaded.vert deleted file mode 100644 index 6e72b10e7f..0000000000 --- a/jme3-vr/src/main/resources/Common/MatDefs/VR/Unshaded.vert +++ /dev/null @@ -1,27 +0,0 @@ -//#define VERTEX_SHADER -#import "Common/ShaderLib/GLSLCompat.glsllib" - -// import the following for VR instancing -#import "Common/ShaderLib/InstanceVR.glsllib" - -attribute vec3 inPosition; - -#if defined(HAS_COLORMAP) || (defined(HAS_LIGHTMAP) && !defined(SEPARATE_TEXCOORD)) - #define NEED_TEXCOORD1 -#endif - -attribute vec2 inTexCoord; -attribute vec4 inColor; - -varying vec2 texCoord1; - -void main(){ - #ifdef NEED_TEXCOORD1 - texCoord1 = inTexCoord; - #endif - - vec4 modelSpacePos = vec4(inPosition, 1.0); - - // use the following transform function for VR instancing - gl_Position = TransformWorldViewProjectionVR(modelSpacePos); -} \ No newline at end of file diff --git a/jme3-vr/src/main/resources/Common/MatDefs/VR/normal.frag b/jme3-vr/src/main/resources/Common/MatDefs/VR/normal.frag deleted file mode 100644 index 16d32cedcd..0000000000 --- a/jme3-vr/src/main/resources/Common/MatDefs/VR/normal.frag +++ /dev/null @@ -1,9 +0,0 @@ -//#define FRAGMENT_SHADER -#import "Common/ShaderLib/GLSLCompat.glsllib" - -varying vec3 normal; - -void main(void) -{ - gl_FragColor = vec4(normal.xy* 0.5 + 0.5,-normal.z* 0.5 + 0.5, 1.0); -} diff --git a/jme3-vr/src/main/resources/Common/MatDefs/VR/normal.vert b/jme3-vr/src/main/resources/Common/MatDefs/VR/normal.vert deleted file mode 100644 index 3f590101f5..0000000000 --- a/jme3-vr/src/main/resources/Common/MatDefs/VR/normal.vert +++ /dev/null @@ -1,19 +0,0 @@ -//#define VERTEX_SHADER -#import "Common/ShaderLib/GLSLCompat.glsllib" - -// import the following for VR instancing -#import "Common/ShaderLib/InstanceVR.glsllib" - -attribute vec3 inPosition; -attribute vec3 inNormal; - -varying vec3 normal; - -void main(void) -{ - vec4 modelSpacePos = vec4(inPosition, 1.0); - normal = normalize(TransformNormal(inNormal)); - - // use the following transform function for VR instancing - gl_Position = TransformWorldViewProjectionVR(modelSpacePos); -} \ No newline at end of file diff --git a/jme3-vr/src/main/resources/Common/ShaderLib/InstanceVR.glsllib b/jme3-vr/src/main/resources/Common/ShaderLib/InstanceVR.glsllib deleted file mode 100644 index 99629173f9..0000000000 --- a/jme3-vr/src/main/resources/Common/ShaderLib/InstanceVR.glsllib +++ /dev/null @@ -1,126 +0,0 @@ -// Instancing GLSL library. Modified for VR use. -// -// When the INSTANCING define is set in the shader, -// all global matrices are replaced with "instanced" versions. -// One exception is g_NormalMatrix which becomes unusable, -// instead the function ApplyNormalTransform is used to transform -// the normal and tangent vectors into world view space. - -// The world matrix and normal transform quaternion need to be passed -// as vertex attributes "inWorldMatrix" and "inNormalRotationQuaternion" -// respectively. -// The VertexBuffers for those two attributes -// need to be configured into instanced mode (VertexBuffer.setInstanced(true)). -// - inWorldMatrix should have 12 * numInstances floats. -// - inNormalRotationQuaternion should have 4 * numInstances. -// Thus, instancing data occupies 4 vertex attributes (16 / 4 = 4). -// -// The GL_ARB_draw_instanced and GL_ARB_instanced_arrays extensions -// are required (OGL 3.3). - -#if defined INSTANCING - -uniform mat4 g_ViewProjectionMatrix; -uniform mat4 g_ViewMatrix; -uniform mat4 m_RightEyeViewProjectionMatrix; - -// World Matrix + Normal Rotation Quaternion. -// The World Matrix is the top 3 rows - -// since the bottom row is always 0,0,0,1 for this transform. -// The bottom row is the transpose of the inverse of WorldView Transform -// as a quaternion. i.e. g_NormalMatrix converted to a quaternion. -// -// Using a quaternion instead of a matrix here allows saving approximately -// 2 vertex attributes which now can be used for additional per-vertex data. -attribute mat4 inInstanceData; - -// Extract the world matrix out of the instance data, leaving out the -// quaternion at the end. -mat4 worldMatrix = mat4(vec4(inInstanceData[0].xyz, 0.0), - vec4(inInstanceData[1].xyz, 0.0), - vec4(inInstanceData[2].xyz, 0.0), - vec4(inInstanceData[3].xyz, 1.0)); - -vec4 TransformWorld(vec4 position) -{ - return (worldMatrix * position); -} - -vec4 TransformWorldView(vec4 position) -{ - return g_ViewMatrix * TransformWorld(position); -} - -vec4 TransformWorldViewProjection(vec4 position) -{ - return g_ViewProjectionMatrix * TransformWorld(position); -} - -// VR specific variables -const float EyeOffsetScale[2] = float[](-0.5, 0.5); -const vec4 EyeClipEdge[2] = vec4[](vec4(-1.0,0.0,0.0,1.0), vec4(1.0,0.0,0.0,1.0)); -out float gl_ClipDistance[1]; -in int gl_InstanceID; - -vec4 TransformWorldViewProjectionVR(vec4 position) -{ - vec4 clipPos = (gl_InstanceID == 0 ? g_ViewProjectionMatrix : m_RightEyeViewProjectionMatrix) * TransformWorld(position); - gl_ClipDistance[0] = dot(clipPos, EyeClipEdge[gl_InstanceID]); - clipPos.x *= 0.5; // shrink to half of the screen - clipPos.x += EyeOffsetScale[gl_InstanceID] * clipPos.w; // scoot left or right. - return clipPos; -} - -vec3 TransformNormal(vec3 vec) -{ - vec4 quat = vec4(inInstanceData[0].w, inInstanceData[1].w, - inInstanceData[2].w, inInstanceData[3].w); - - vec3 worldNormal = vec + vec3(2.0) * cross(cross(vec, quat.xyz) + vec3(quat.w) * vec, quat.xyz); - - return (g_ViewMatrix * vec4(worldNormal, 0.0)).xyz; -} - -// Prevent user from using g_** matrices which will have invalid data in this case. -#define g_WorldMatrix use_TransformWorld_not_gWorldMatrix -#define g_WorldViewMatrix use_TransformWorldView_not_gWorldMatrix -#define g_WorldViewProjectionMatrix use_TransformWorldViewProjectionVR_not_gWorldViewProjectionMatrix -#define g_NormalMatrix use_TransformNormal_not_gNormalMatrix - -#else - -uniform mat4 g_WorldMatrix; -uniform mat4 g_WorldViewMatrix; -uniform mat4 g_WorldViewProjectionMatrix; -uniform mat3 g_NormalMatrix; -uniform mat3 g_WorldNormalMatrix; - -vec4 TransformWorld(vec4 position) -{ - return g_WorldMatrix * position; -} - -vec4 TransformWorldView(vec4 position) -{ - return g_WorldViewMatrix * position; -} - -vec4 TransformWorldViewProjection(vec4 position) -{ - return g_WorldViewProjectionMatrix * position; -} - -vec4 TransformWorldViewProjectionVR(vec4 position) -{ - return g_WorldViewProjectionMatrix * position; -} - -vec3 TransformNormal(vec3 normal) { - return g_NormalMatrix * normal; -} - -vec3 TransformWorldNormal(vec3 normal) { - return normalize(g_WorldNormalMatrix * normal); -} - -#endif \ No newline at end of file diff --git a/jme3-vr/src/main/resources/Common/Util/gui_mesh.j3o b/jme3-vr/src/main/resources/Common/Util/gui_mesh.j3o deleted file mode 100644 index 728a706020..0000000000 Binary files a/jme3-vr/src/main/resources/Common/Util/gui_mesh.j3o and /dev/null differ diff --git a/jme3-vr/src/main/resources/Common/Util/gui_mesh.j3odata b/jme3-vr/src/main/resources/Common/Util/gui_mesh.j3odata deleted file mode 100644 index c5df9acd61..0000000000 --- a/jme3-vr/src/main/resources/Common/Util/gui_mesh.j3odata +++ /dev/null @@ -1,3 +0,0 @@ -# -#Thu Oct 01 10:33:02 EDT 2015 -ORIGINAL_PATH=Models/gui_mesh.obj diff --git a/jme3-vr/src/main/resources/Common/Util/mouse.png b/jme3-vr/src/main/resources/Common/Util/mouse.png deleted file mode 100644 index 8ca6edbe1e..0000000000 Binary files a/jme3-vr/src/main/resources/Common/Util/mouse.png and /dev/null differ diff --git a/jme3-vr/src/main/resources/darwin/libopenvr_api.dylib b/jme3-vr/src/main/resources/darwin/libopenvr_api.dylib deleted file mode 100644 index b3da84f1ef..0000000000 Binary files a/jme3-vr/src/main/resources/darwin/libopenvr_api.dylib and /dev/null differ diff --git a/jme3-vr/src/main/resources/darwin/libopenvr_api.dylib.dSYM/Contents/Info.plist b/jme3-vr/src/main/resources/darwin/libopenvr_api.dylib.dSYM/Contents/Info.plist deleted file mode 100644 index 60ac3d69bc..0000000000 --- a/jme3-vr/src/main/resources/darwin/libopenvr_api.dylib.dSYM/Contents/Info.plist +++ /dev/null @@ -1,20 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleIdentifier - com.apple.xcode.dsym.libopenvr_api.dylib - CFBundleInfoDictionaryVersion - 6.0 - CFBundlePackageType - dSYM - CFBundleSignature - ???? - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - - diff --git a/jme3-vr/src/main/resources/darwin/libopenvr_api.dylib.dSYM/Contents/Resources/DWARF/libopenvr_api.dylib b/jme3-vr/src/main/resources/darwin/libopenvr_api.dylib.dSYM/Contents/Resources/DWARF/libopenvr_api.dylib deleted file mode 100644 index 8ca6951d9d..0000000000 Binary files a/jme3-vr/src/main/resources/darwin/libopenvr_api.dylib.dSYM/Contents/Resources/DWARF/libopenvr_api.dylib and /dev/null differ diff --git a/jme3-vr/src/main/resources/linux-x86-64/libopenvr_api.so b/jme3-vr/src/main/resources/linux-x86-64/libopenvr_api.so deleted file mode 100644 index eafad11ec6..0000000000 Binary files a/jme3-vr/src/main/resources/linux-x86-64/libopenvr_api.so and /dev/null differ diff --git a/jme3-vr/src/main/resources/linux-x86-64/libopenvr_api.so.dbg b/jme3-vr/src/main/resources/linux-x86-64/libopenvr_api.so.dbg deleted file mode 100644 index 877c284088..0000000000 Binary files a/jme3-vr/src/main/resources/linux-x86-64/libopenvr_api.so.dbg and /dev/null differ diff --git a/jme3-vr/src/main/resources/linux-x86/libopenvr_api.so b/jme3-vr/src/main/resources/linux-x86/libopenvr_api.so deleted file mode 100644 index a250545083..0000000000 Binary files a/jme3-vr/src/main/resources/linux-x86/libopenvr_api.so and /dev/null differ diff --git a/jme3-vr/src/main/resources/linux-x86/libopenvr_api.so.dbg b/jme3-vr/src/main/resources/linux-x86/libopenvr_api.so.dbg deleted file mode 100644 index a26ac1c1f9..0000000000 Binary files a/jme3-vr/src/main/resources/linux-x86/libopenvr_api.so.dbg and /dev/null differ diff --git a/jme3-vr/src/main/resources/win32-x86-64/LICENSE.txt b/jme3-vr/src/main/resources/win32-x86-64/LICENSE.txt deleted file mode 100644 index ee83337d7f..0000000000 --- a/jme3-vr/src/main/resources/win32-x86-64/LICENSE.txt +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2015, Valve Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this -list of conditions and the following disclaimer. - -2. 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. - -3. Neither the name of the copyright holder 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 HOLDER 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. diff --git a/jme3-vr/src/main/resources/win32-x86-64/Qt5Core.dll b/jme3-vr/src/main/resources/win32-x86-64/Qt5Core.dll deleted file mode 100644 index b1a4a24e73..0000000000 Binary files a/jme3-vr/src/main/resources/win32-x86-64/Qt5Core.dll and /dev/null differ diff --git a/jme3-vr/src/main/resources/win32-x86-64/Qt5Gui.dll b/jme3-vr/src/main/resources/win32-x86-64/Qt5Gui.dll deleted file mode 100644 index 9be46e08a0..0000000000 Binary files a/jme3-vr/src/main/resources/win32-x86-64/Qt5Gui.dll and /dev/null differ diff --git a/jme3-vr/src/main/resources/win32-x86-64/Qt5Widgets.dll b/jme3-vr/src/main/resources/win32-x86-64/Qt5Widgets.dll deleted file mode 100644 index a70f8c84ce..0000000000 Binary files a/jme3-vr/src/main/resources/win32-x86-64/Qt5Widgets.dll and /dev/null differ diff --git a/jme3-vr/src/main/resources/win32-x86-64/SDL2.dll b/jme3-vr/src/main/resources/win32-x86-64/SDL2.dll deleted file mode 100644 index a65b22ce9d..0000000000 Binary files a/jme3-vr/src/main/resources/win32-x86-64/SDL2.dll and /dev/null differ diff --git a/jme3-vr/src/main/resources/win32-x86-64/d3dcompiler_47.dll b/jme3-vr/src/main/resources/win32-x86-64/d3dcompiler_47.dll deleted file mode 100644 index 4f3fc16106..0000000000 Binary files a/jme3-vr/src/main/resources/win32-x86-64/d3dcompiler_47.dll and /dev/null differ diff --git a/jme3-vr/src/main/resources/win32-x86-64/functionality.dll b/jme3-vr/src/main/resources/win32-x86-64/functionality.dll deleted file mode 100644 index c25975aaeb..0000000000 Binary files a/jme3-vr/src/main/resources/win32-x86-64/functionality.dll and /dev/null differ diff --git a/jme3-vr/src/main/resources/win32-x86-64/glew32.dll b/jme3-vr/src/main/resources/win32-x86-64/glew32.dll deleted file mode 100644 index a6cc6fd17f..0000000000 Binary files a/jme3-vr/src/main/resources/win32-x86-64/glew32.dll and /dev/null differ diff --git a/jme3-vr/src/main/resources/win32-x86-64/msvcp120.dll b/jme3-vr/src/main/resources/win32-x86-64/msvcp120.dll deleted file mode 100644 index 4ea1efa734..0000000000 Binary files a/jme3-vr/src/main/resources/win32-x86-64/msvcp120.dll and /dev/null differ diff --git a/jme3-vr/src/main/resources/win32-x86-64/msvcr120.dll b/jme3-vr/src/main/resources/win32-x86-64/msvcr120.dll deleted file mode 100644 index d711c92232..0000000000 Binary files a/jme3-vr/src/main/resources/win32-x86-64/msvcr120.dll and /dev/null differ diff --git a/jme3-vr/src/main/resources/win32-x86-64/opencv_calib3d2410.dll b/jme3-vr/src/main/resources/win32-x86-64/opencv_calib3d2410.dll deleted file mode 100644 index af147e0d1f..0000000000 Binary files a/jme3-vr/src/main/resources/win32-x86-64/opencv_calib3d2410.dll and /dev/null differ diff --git a/jme3-vr/src/main/resources/win32-x86-64/opencv_core2410.dll b/jme3-vr/src/main/resources/win32-x86-64/opencv_core2410.dll deleted file mode 100644 index d3a98f26a6..0000000000 Binary files a/jme3-vr/src/main/resources/win32-x86-64/opencv_core2410.dll and /dev/null differ diff --git a/jme3-vr/src/main/resources/win32-x86-64/opencv_features2d2410.dll b/jme3-vr/src/main/resources/win32-x86-64/opencv_features2d2410.dll deleted file mode 100644 index bb0d3c635b..0000000000 Binary files a/jme3-vr/src/main/resources/win32-x86-64/opencv_features2d2410.dll and /dev/null differ diff --git a/jme3-vr/src/main/resources/win32-x86-64/opencv_flann2410.dll b/jme3-vr/src/main/resources/win32-x86-64/opencv_flann2410.dll deleted file mode 100644 index d8e465a8e1..0000000000 Binary files a/jme3-vr/src/main/resources/win32-x86-64/opencv_flann2410.dll and /dev/null differ diff --git a/jme3-vr/src/main/resources/win32-x86-64/opencv_highgui2410.dll b/jme3-vr/src/main/resources/win32-x86-64/opencv_highgui2410.dll deleted file mode 100644 index cd28635211..0000000000 Binary files a/jme3-vr/src/main/resources/win32-x86-64/opencv_highgui2410.dll and /dev/null differ diff --git a/jme3-vr/src/main/resources/win32-x86-64/opencv_imgproc2410.dll b/jme3-vr/src/main/resources/win32-x86-64/opencv_imgproc2410.dll deleted file mode 100644 index 548567b613..0000000000 Binary files a/jme3-vr/src/main/resources/win32-x86-64/opencv_imgproc2410.dll and /dev/null differ diff --git a/jme3-vr/src/main/resources/win32-x86-64/openvr_api.dll b/jme3-vr/src/main/resources/win32-x86-64/openvr_api.dll deleted file mode 100644 index 5767d725f4..0000000000 Binary files a/jme3-vr/src/main/resources/win32-x86-64/openvr_api.dll and /dev/null differ diff --git a/jme3-vr/src/main/resources/win32-x86-64/openvr_api.pdb b/jme3-vr/src/main/resources/win32-x86-64/openvr_api.pdb deleted file mode 100644 index 082d4780d9..0000000000 Binary files a/jme3-vr/src/main/resources/win32-x86-64/openvr_api.pdb and /dev/null differ diff --git a/jme3-vr/src/main/resources/win32-x86-64/osg100-osg.dll b/jme3-vr/src/main/resources/win32-x86-64/osg100-osg.dll deleted file mode 100644 index cab66c897e..0000000000 Binary files a/jme3-vr/src/main/resources/win32-x86-64/osg100-osg.dll and /dev/null differ diff --git a/jme3-vr/src/main/resources/win32-x86-64/osg100-osgDB.dll b/jme3-vr/src/main/resources/win32-x86-64/osg100-osgDB.dll deleted file mode 100644 index 1ad86ca487..0000000000 Binary files a/jme3-vr/src/main/resources/win32-x86-64/osg100-osgDB.dll and /dev/null differ diff --git a/jme3-vr/src/main/resources/win32-x86-64/osg100-osgGA.dll b/jme3-vr/src/main/resources/win32-x86-64/osg100-osgGA.dll deleted file mode 100644 index 32643f05ee..0000000000 Binary files a/jme3-vr/src/main/resources/win32-x86-64/osg100-osgGA.dll and /dev/null differ diff --git a/jme3-vr/src/main/resources/win32-x86-64/osg100-osgText.dll b/jme3-vr/src/main/resources/win32-x86-64/osg100-osgText.dll deleted file mode 100644 index 9b8bdd7e4a..0000000000 Binary files a/jme3-vr/src/main/resources/win32-x86-64/osg100-osgText.dll and /dev/null differ diff --git a/jme3-vr/src/main/resources/win32-x86-64/osg100-osgUtil.dll b/jme3-vr/src/main/resources/win32-x86-64/osg100-osgUtil.dll deleted file mode 100644 index 75f620864c..0000000000 Binary files a/jme3-vr/src/main/resources/win32-x86-64/osg100-osgUtil.dll and /dev/null differ diff --git a/jme3-vr/src/main/resources/win32-x86-64/osg100-osgViewer.dll b/jme3-vr/src/main/resources/win32-x86-64/osg100-osgViewer.dll deleted file mode 100644 index eab07f1976..0000000000 Binary files a/jme3-vr/src/main/resources/win32-x86-64/osg100-osgViewer.dll and /dev/null differ diff --git a/jme3-vr/src/main/resources/win32-x86-64/osgdb_deprecated_osg.dll b/jme3-vr/src/main/resources/win32-x86-64/osgdb_deprecated_osg.dll deleted file mode 100644 index 1b7c8cc042..0000000000 Binary files a/jme3-vr/src/main/resources/win32-x86-64/osgdb_deprecated_osg.dll and /dev/null differ diff --git a/jme3-vr/src/main/resources/win32-x86-64/osgdb_osg.dll b/jme3-vr/src/main/resources/win32-x86-64/osgdb_osg.dll deleted file mode 100644 index a391446554..0000000000 Binary files a/jme3-vr/src/main/resources/win32-x86-64/osgdb_osg.dll and /dev/null differ diff --git a/jme3-vr/src/main/resources/win32-x86-64/osvrAnalysisPluginKit.dll b/jme3-vr/src/main/resources/win32-x86-64/osvrAnalysisPluginKit.dll deleted file mode 100644 index 1652fb9515..0000000000 Binary files a/jme3-vr/src/main/resources/win32-x86-64/osvrAnalysisPluginKit.dll and /dev/null differ diff --git a/jme3-vr/src/main/resources/win32-x86-64/osvrClient.dll b/jme3-vr/src/main/resources/win32-x86-64/osvrClient.dll deleted file mode 100644 index 43c9eeb85d..0000000000 Binary files a/jme3-vr/src/main/resources/win32-x86-64/osvrClient.dll and /dev/null differ diff --git a/jme3-vr/src/main/resources/win32-x86-64/osvrClientKit.dll b/jme3-vr/src/main/resources/win32-x86-64/osvrClientKit.dll deleted file mode 100644 index 4de48879c4..0000000000 Binary files a/jme3-vr/src/main/resources/win32-x86-64/osvrClientKit.dll and /dev/null differ diff --git a/jme3-vr/src/main/resources/win32-x86-64/osvrCommon.dll b/jme3-vr/src/main/resources/win32-x86-64/osvrCommon.dll deleted file mode 100644 index 474abf024a..0000000000 Binary files a/jme3-vr/src/main/resources/win32-x86-64/osvrCommon.dll and /dev/null differ diff --git a/jme3-vr/src/main/resources/win32-x86-64/osvrConnection.dll b/jme3-vr/src/main/resources/win32-x86-64/osvrConnection.dll deleted file mode 100644 index b4aec55ce0..0000000000 Binary files a/jme3-vr/src/main/resources/win32-x86-64/osvrConnection.dll and /dev/null differ diff --git a/jme3-vr/src/main/resources/win32-x86-64/osvrJointClientKit.dll b/jme3-vr/src/main/resources/win32-x86-64/osvrJointClientKit.dll deleted file mode 100644 index 9e8a8cc655..0000000000 Binary files a/jme3-vr/src/main/resources/win32-x86-64/osvrJointClientKit.dll and /dev/null differ diff --git a/jme3-vr/src/main/resources/win32-x86-64/osvrPluginHost.dll b/jme3-vr/src/main/resources/win32-x86-64/osvrPluginHost.dll deleted file mode 100644 index c39715e28f..0000000000 Binary files a/jme3-vr/src/main/resources/win32-x86-64/osvrPluginHost.dll and /dev/null differ diff --git a/jme3-vr/src/main/resources/win32-x86-64/osvrPluginKit.dll b/jme3-vr/src/main/resources/win32-x86-64/osvrPluginKit.dll deleted file mode 100644 index c0009b682d..0000000000 Binary files a/jme3-vr/src/main/resources/win32-x86-64/osvrPluginKit.dll and /dev/null differ diff --git a/jme3-vr/src/main/resources/win32-x86-64/osvrRenderManager.dll b/jme3-vr/src/main/resources/win32-x86-64/osvrRenderManager.dll deleted file mode 100644 index f97df681e8..0000000000 Binary files a/jme3-vr/src/main/resources/win32-x86-64/osvrRenderManager.dll and /dev/null differ diff --git a/jme3-vr/src/main/resources/win32-x86-64/osvrServer.dll b/jme3-vr/src/main/resources/win32-x86-64/osvrServer.dll deleted file mode 100644 index 9d925ac03a..0000000000 Binary files a/jme3-vr/src/main/resources/win32-x86-64/osvrServer.dll and /dev/null differ diff --git a/jme3-vr/src/main/resources/win32-x86-64/osvrUSBSerial.dll b/jme3-vr/src/main/resources/win32-x86-64/osvrUSBSerial.dll deleted file mode 100644 index b81542225f..0000000000 Binary files a/jme3-vr/src/main/resources/win32-x86-64/osvrUSBSerial.dll and /dev/null differ diff --git a/jme3-vr/src/main/resources/win32-x86-64/osvrUtil.dll b/jme3-vr/src/main/resources/win32-x86-64/osvrUtil.dll deleted file mode 100644 index 417c04d462..0000000000 Binary files a/jme3-vr/src/main/resources/win32-x86-64/osvrUtil.dll and /dev/null differ diff --git a/jme3-vr/src/main/resources/win32-x86-64/osvrVRPNServer.dll b/jme3-vr/src/main/resources/win32-x86-64/osvrVRPNServer.dll deleted file mode 100644 index 0720deb3d9..0000000000 Binary files a/jme3-vr/src/main/resources/win32-x86-64/osvrVRPNServer.dll and /dev/null differ diff --git a/jme3-vr/src/main/resources/win32-x86-64/ot20-OpenThreads.dll b/jme3-vr/src/main/resources/win32-x86-64/ot20-OpenThreads.dll deleted file mode 100644 index a50ba7d58b..0000000000 Binary files a/jme3-vr/src/main/resources/win32-x86-64/ot20-OpenThreads.dll and /dev/null differ diff --git a/jme3-vr/src/main/resources/win32-x86/openvr_api.dll b/jme3-vr/src/main/resources/win32-x86/openvr_api.dll deleted file mode 100644 index 83ead53b82..0000000000 Binary files a/jme3-vr/src/main/resources/win32-x86/openvr_api.dll and /dev/null differ diff --git a/jme3-vr/src/main/resources/win32-x86/openvr_api.pdb b/jme3-vr/src/main/resources/win32-x86/openvr_api.pdb deleted file mode 100644 index a7bb091e62..0000000000 Binary files a/jme3-vr/src/main/resources/win32-x86/openvr_api.pdb and /dev/null differ