diff --git a/jme3-vr/src/main/java/com/jme3/app/VRApplication.java b/jme3-vr/src/main/java/com/jme3/app/VRApplication.java index 050a66239..1b5f9f74b 100644 --- a/jme3-vr/src/main/java/com/jme3/app/VRApplication.java +++ b/jme3-vr/src/main/java/com/jme3/app/VRApplication.java @@ -38,6 +38,7 @@ 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; @@ -62,13 +63,13 @@ import java.util.logging.Logger; import jmevr.util.VRViewManager; import jmevr.util.VRGuiManager; import jmevr.util.VRGuiManager.POSITIONING_MODE; -import jopenvr.JOpenVRLibrary; +import jmevr.util.VRMouseManager; import org.lwjgl.system.Platform; /** - * A JMonkey application dedicated to Virtual Reality. An application that use VR devices (HTC vive, ...) has to extends this one. + * A JMonkey application dedicated to Virtual Reality. An application that use VR devices (HTC vive, ...) has to extends this one.
* @author reden - phr00t - https://github.com/phr00t * @author Julien Seinturier - (c) 2016 - JOrigin project - http:/www.jorigin.org */ @@ -80,23 +81,23 @@ public abstract class VRApplication implements Application, SystemListener { /** * The default FOV. */ - public static float DEFAULT_FOV = 108f; + public float DEFAULT_FOV = 108f; /** * The default aspect ratio. */ - public static float DEFAULT_ASPECT = 1f; + public float DEFAULT_ASPECT = 1f; /** * Is the application is based on OSVR (default is false). */ - public static boolean CONSTRUCT_WITH_OSVR = false; + public boolean CONSTRUCT_WITH_OSVR = false; /** * Is the application has not to start within VR mode (default is false). */ - public static boolean DISABLE_VR = false; + public boolean DISABLE_VR = false; /** * VR application configuration parameters. @@ -166,13 +167,23 @@ public abstract class VRApplication implements Application, SystemListener { FORCE_DISABLE_MSAA } - private static String OS; - private static VRAPI VRhardware; - private static Camera dummyCam; - private static VRViewManager VRviewmanager; - private static VRApplication mainApp; - private static Spatial observer; - private static boolean VRSupportedOS, forceVR, disableSwapBuffers = true, tryOpenGL3 = true, seated, nogui, instanceVR, forceDisableMSAA; + private VRAPI VRhardware = null; + private VRGuiManager guiManager = null; + private VRMouseManager mouseManager = null; + private VRViewManager 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; @@ -202,29 +213,119 @@ public abstract class VRApplication implements Application, SystemListener { private float fFar = 1000f, fNear = 1f; private int xWin = 1280, yWin = 720; - //private static float distanceOfOptimization = 0f; + private float resMult = 1f; - private static float resMult = 1f; + private boolean useCompositor = true, compositorOS; + private final String RESET_HMD = "ResetHMD"; - private static boolean useCompositor = true, compositorOS; - private final String RESET_HMD = "ResetHMD"; + /** + * Create a new VR application and attach the given {@link AppState app states}.
+ * The application scene is made of a {@link #getRootNode() root node} that holds the scene spatials + * and a {@link #getGuiNode() GUI node} that is the root of the Graphical user interface. + * @param initialStates the {@link AppState app states} to attach to the application. + */ + public VRApplication(AppState... initialStates) { + this(); + + if (initialStates != null) { + for (AppState a : initialStates) { + if (a != null) { + stateManager.attach(a); + } + } + } + } + + /** + * Create a new VR application.
+ * The application scene is made of a {@link #getRootNode() root node} that holds the scene spatials + * and a {@link #getGuiNode() GUI node} that is the root of the Graphical user interface. + */ + public VRApplication() { + super(); + + rootNode = new Node("root"); + guiNode = new Node("guiNode"); + + guiNode.setQueueBucket(Bucket.Gui); + guiNode.setCullHint(CullHint.Never); + dummyCam = new Camera(); + + initStateManager(); + + // Create the GUI manager. + guiManager = new VRGuiManager(this); + + // Create a new view manager. + viewmanager = new VRViewManager(this); + + // Create a new mouse manager. + mouseManager = new VRMouseManager(this); + + // we are going to use OpenVR now, not the Oculus Rift + // OpenVR does support the Rift + OS = System.getProperty("os.name", "generic").toLowerCase(Locale.ENGLISH); + VRSupportedOS = !OS.contains("nux") && System.getProperty("sun.arch.data.model").equalsIgnoreCase("64"); //for the moment, linux/unix causes crashes, 64-bit only + compositorOS = OS.contains("indows"); + + if( !VRSupportedOS ) { + logger.warning("Non-supported OS: " + OS + ", architecture: " + System.getProperty("sun.arch.data.model")); + } else if( DISABLE_VR ) { + logger.warning("VR disabled via code."); + } else if( VRSupportedOS && DISABLE_VR == false ) { + if( CONSTRUCT_WITH_OSVR ) { + logger.config("Initializing OSVR..."); + VRhardware = new OSVR(this); + } else { + logger.config("Initializing OpenVR..."); + VRhardware = new OpenVR(this); + } + if( VRhardware.initialize() ) { + setPauseOnLostFocus(false); + } + } + } - // no longer using LwjglCanvas, and this sometimes broke the graphics settings - /*static { - if( VR_IsHmdPresent() != 0 ) { - System.setProperty("sun.java2d.opengl", "True"); - } - } */ + /** + * Get the VR underlying hardware. + * @return the VR underlying hardware. + */ + public VRAPI getVRHardware() { + return VRhardware; + } /** - * Get the distance of optimization. - * @return the distance of optimization. + * Get the VR dedicated input. + * @return the VR dedicated input. */ - /* - public static float getOptimizationDistance() { - return distanceOfOptimization; + public VRInputAPI getVRinput() { + if( VRhardware == null ) return null; + return VRhardware.getVRinput(); + } + + /** + * Get the VR view manager. + * @return the VR view manager. + */ + public VRViewManager 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 VRMouseManager getVRMouseManager(){ + return mouseManager; } - */ /** * Set the frustrum values for the application. @@ -252,7 +353,7 @@ public abstract class VRApplication implements Application, SystemListener { */ public void setResolutionMultiplier(float val) { resMult = val; - if( VRviewmanager != null ) VRviewmanager.setResolutionMultiplier(resMult); + if( viewmanager != null ) viewmanager.setResolutionMultiplier(resMult); } @@ -260,7 +361,7 @@ public abstract class VRApplication implements Application, SystemListener { * Is the SteamVR compositor is active. * @return true if the SteamVR compositor is active and false otherwise. */ - public static boolean compositorAllowed() { + public boolean compositorAllowed() { return useCompositor && compositorOS; } @@ -268,7 +369,7 @@ public abstract class VRApplication implements Application, SystemListener { * Get if the system currently support VR. * @return true if the system currently support VR and false otherwise. */ - public static boolean isOSVRSupported() { + public boolean isOSVRSupported() { return VRSupportedOS; } @@ -284,67 +385,9 @@ public abstract class VRApplication implements Application, SystemListener { * @param renderManager the {@link RenderManager render manager}. */ public void simpleRender(RenderManager renderManager) { - PreNormalCaching.resetCache(); + PreNormalCaching.resetCache(isInVR()); } - - - - - - /** - * Create a new VR application and attach the given {@link AppState app states}. - * @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. - */ - public VRApplication() { - super(); - initStateManager(); - - rootNode = new Node("root"); - guiNode = new Node("guiNode"); - guiNode.setQueueBucket(Bucket.Gui); - guiNode.setCullHint(CullHint.Never); - dummyCam = new Camera(); - mainApp = this; - - // we are going to use OpenVR now, not the Oculus Rift - // OpenVR does support the Rift - OS = System.getProperty("os.name", "generic").toLowerCase(Locale.ENGLISH); - VRSupportedOS = !OS.contains("nux") && System.getProperty("sun.arch.data.model").equalsIgnoreCase("64"); //for the moment, linux/unix causes crashes, 64-bit only - compositorOS = OS.contains("indows"); - - if( !VRSupportedOS ) { - logger.warning("Non-supported OS: " + OS + ", architecture: " + System.getProperty("sun.arch.data.model")); - } else if( DISABLE_VR ) { - logger.warning("VR disabled via code."); - } else if( VRSupportedOS && DISABLE_VR == false ) { - if( CONSTRUCT_WITH_OSVR ) { - logger.config("Initializing OSVR..."); - VRhardware = new OSVR(); - } else { - logger.config("Initializing OpenVR..."); - VRhardware = new OpenVR(); - } - if( VRhardware.initialize() ) { - setPauseOnLostFocus(false); - } - } - } /* we do NOT want to get & modify the distortion scene camera, so @@ -352,7 +395,7 @@ public abstract class VRApplication implements Application, SystemListener { */ @Override public Camera getCamera() { - if( isInVR() && VRviewmanager != null && VRviewmanager.getCamLeft() != null ) { + if( isInVR() && viewmanager != null && viewmanager.getCamLeft() != null ) { return dummyCam; } return cam; @@ -763,10 +806,10 @@ public abstract class VRApplication implements Application, SystemListener { public void preconfigureVRApp(PreconfigParameter parm, boolean value) { switch( parm ) { case SET_GUI_OVERDRAW: - VRGuiManager._enableGuiOverdraw(value); + guiManager._enableGuiOverdraw(value); break; case SET_GUI_CURVED_SURFACE: - VRGuiManager._enableCurvedSuface(value); + guiManager._enableCurvedSuface(value); break; case FORCE_VR_MODE: forceVR = value; @@ -775,7 +818,7 @@ public abstract class VRApplication implements Application, SystemListener { // VRViewManager._setCustomDistortion(value); // break; case USE_VR_COMPOSITOR: - VRApplication.useCompositor = value; + useCompositor = value; if( value == false ) disableSwapBuffers = false; break; case FLIP_EYES: @@ -786,7 +829,7 @@ public abstract class VRApplication implements Application, SystemListener { instanceVR = value; break; case ENABLE_MIRROR_WINDOW: - if( VRApplication.useCompositor == false ) { + if( useCompositor == false ) { disableSwapBuffers = false; } else disableSwapBuffers = !value; break; @@ -813,7 +856,7 @@ public abstract class VRApplication implements Application, SystemListener { * @param isSeated true if designed for sitting, false for standing/roomscale * @see #isSeatedExperience() */ - public static void setSeatedExperience(boolean isSeated) { + public void setSeatedExperience(boolean isSeated) { seated = isSeated; if( VRhardware instanceof OpenVR ) { if( VRhardware.getCompositor() == null ) return; @@ -830,32 +873,23 @@ public abstract class VRApplication implements Application, SystemListener { * @return true if the application is configured as a seated experience and false otherwise. * @see #setSeatedExperience(boolean) */ - public static boolean isSeatedExperience() { + public boolean isSeatedExperience() { return seated; } /** * Reset headset pose if seating experience. */ - public static void resetSeatedPose(){ + public void resetSeatedPose(){ if( VRSupportedOS == false || isSeatedExperience() == false ) return; VRhardware.reset(); } - /** - * Get the VR dedicated input. - * @return the VR dedicated input. - */ - public static VRInputAPI getVRinput() { - if( VRhardware == null ) return null; - return VRhardware.getVRinput(); - } - /** * Check if the rendering is instanced (see Geometry instancing). * @return true if the rendering is instanced and false otherwise. */ - public static boolean isInstanceVRRendering() { + public boolean isInstanceVRRendering() { return instanceVR && isInVR(); } @@ -863,7 +897,7 @@ public abstract class VRApplication implements Application, SystemListener { * Check if the VR mode is enabled. * @return true if the VR mode is enabled and false otherwise. */ - public static boolean isInVR() { + public boolean isInVR() { return DISABLE_VR == false && (forceVR || VRSupportedOS && VRhardware != null && VRhardware.isInitialized()); } @@ -871,20 +905,12 @@ public abstract class VRApplication implements Application, SystemListener { * Move filters from the main scene into the eye's. * This removes filters from the main scene. */ - public static void moveScreenProcessingToVR() { + public void moveScreenProcessingToVR() { if( isInVR() ) { - VRviewmanager.moveScreenProcessingToEyes(); + viewmanager.moveScreenProcessingToEyes(); } } - /** - * Get the VR underlying hardware. - * @return the VR underlying hardware. - */ - public static VRAPI getVRHardware() { - return VRhardware; - } - /** * Get the GUI node from the application. * @return the GUI node from the application. @@ -905,7 +931,7 @@ public abstract class VRApplication implements Application, SystemListener { * Check if the application has a GUI overlay attached. * @return true if the application has a GUI overlay attached and false otherwise. */ - public static boolean hasTraditionalGUIOverlay() { + public boolean hasTraditionalGUIOverlay() { return !nogui; } @@ -915,9 +941,9 @@ public abstract class VRApplication implements Application, SystemListener { * @return the scene observer. * @see #setObserver(Spatial) */ - public static Object getObserver() { + public Object getObserver() { if( observer == null ) { - return mainApp.getCamera(); + return getCamera(); } return observer; } @@ -926,16 +952,8 @@ public abstract class VRApplication implements Application, SystemListener { * Set the scene observer. The VR headset will be linked to it. If no observer is set, the VR headset is linked to the the application {@link #getCamera() camera}. * @param observer the scene observer. */ - public static void setObserver(Spatial observer) { - VRApplication.observer = observer; - } - - /** - * Get the VR view manager. - * @return the VR view manager. - */ - public static VRViewManager getVRViewManager() { - return VRviewmanager; + public void setObserver(Spatial observer) { + this.observer = observer; } /* @@ -949,16 +967,16 @@ public abstract class VRApplication implements Application, SystemListener { * @return the observer final rotation within the scene. * @see #getFinalObserverPosition() */ - public static Quaternion getFinalObserverRotation() { - if( VRviewmanager == null ) { - if( VRApplication.observer == null ) { - return mainApp.getCamera().getRotation(); - } else return VRApplication.observer.getWorldRotation(); + public Quaternion getFinalObserverRotation() { + if( viewmanager == null ) { + if( observer == null ) { + return getCamera().getRotation(); + } else return observer.getWorldRotation(); } - if( VRApplication.observer == null ) { + if( observer == null ) { tempq.set(dummyCam.getRotation()); } else { - tempq.set(VRApplication.observer.getWorldRotation()); + tempq.set(observer.getWorldRotation()); } return tempq.multLocal(VRhardware.getOrientation()); } @@ -968,19 +986,19 @@ public abstract class VRApplication implements Application, SystemListener { * @return the observer position. * @see #getFinalObserverRotation() */ - public static Vector3f getFinalObserverPosition() { - if( VRviewmanager == null ) { - if( VRApplication.observer == null ) { - return mainApp.getCamera().getLocation(); - } else return VRApplication.observer.getWorldTranslation(); + public Vector3f getFinalObserverPosition() { + if( viewmanager == null ) { + if( observer == null ) { + return getCamera().getLocation(); + } else return observer.getWorldTranslation(); } Vector3f pos = VRhardware.getPosition(); - if( VRApplication.observer == null ) { + if( observer == null ) { dummyCam.getRotation().mult(pos, pos); return pos.addLocal(dummyCam.getLocation()); } else { - VRApplication.observer.getWorldRotation().mult(pos, pos); - return pos.addLocal(VRApplication.observer.getWorldTranslation()); + observer.getWorldRotation().mult(pos, pos); + return pos.addLocal(observer.getWorldTranslation()); } } @@ -989,8 +1007,8 @@ public abstract class VRApplication implements Application, SystemListener { * @param amount the VR headset height from the ground. * @see #getVRHeightAdjustment() */ - public static void setVRHeightAdjustment(float amount) { - if( VRviewmanager != null ) VRviewmanager.setHeightAdjustment(amount); + public void setVRHeightAdjustment(float amount) { + if( viewmanager != null ) viewmanager.setHeightAdjustment(amount); } /** @@ -998,8 +1016,8 @@ public abstract class VRApplication implements Application, SystemListener { * @return the VR headset height from the ground. * @see #setVRHeightAdjustment(float) */ - public static float getVRHeightAdjustment() { - if( VRviewmanager != null ) return VRviewmanager.getHeightAdjustment(); + public float getVRHeightAdjustment() { + if( viewmanager != null ) return viewmanager.getHeightAdjustment(); return 0f; } @@ -1008,9 +1026,9 @@ public abstract class VRApplication implements Application, SystemListener { * @return the VR headset left viewport. * @see #getRightViewPort() */ - public static ViewPort getLeftViewPort() { - if( VRviewmanager == null ) return mainApp.getViewPort(); - return VRviewmanager.getViewPortLeft(); + public ViewPort getLeftViewPort() { + if( viewmanager == null ) return getViewPort(); + return viewmanager.getViewPortLeft(); } /** @@ -1018,9 +1036,9 @@ public abstract class VRApplication implements Application, SystemListener { * @return the VR headset right viewport. * @see #getLeftViewPort() */ - public static ViewPort getRightViewPort() { - if( VRviewmanager == null ) return mainApp.getViewPort(); - return VRviewmanager.getViewPortRight(); + public ViewPort getRightViewPort() { + if( viewmanager == null ) return getViewPort(); + return viewmanager.getViewPortRight(); } @@ -1028,22 +1046,15 @@ public abstract class VRApplication implements Application, SystemListener { * Set the background color for both left and right view ports. * @param clr the background color. */ - public static void setBackgroundColors(ColorRGBA clr) { - if( VRviewmanager == null ) { - mainApp.getViewPort().setBackgroundColor(clr); - } else if( VRviewmanager.getViewPortLeft() != null ) { - VRviewmanager.getViewPortLeft().setBackgroundColor(clr); - if( VRviewmanager.getViewPortRight() != null ) VRviewmanager.getViewPortRight().setBackgroundColor(clr); + public void setBackgroundColors(ColorRGBA clr) { + if( viewmanager == null ) { + getViewPort().setBackgroundColor(clr); + } else if( viewmanager.getViewPortLeft() != null ) { + viewmanager.getViewPortLeft().setBackgroundColor(clr); + if( viewmanager.getViewPortRight() != null ) viewmanager.getViewPortRight().setBackgroundColor(clr); } } - /** - * Get the instance of VR application that is currently running. - * @return the instance of VR application that is currently running. - */ - public static VRApplication getMainVRApp() { - return mainApp; - } /** * Runs tasks enqueued via {@link #enqueue(Callable)} @@ -1094,34 +1105,36 @@ public abstract class VRApplication implements Application, SystemListener { // 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()); + } + + // Updates scene and gui states. rootNode.updateLogicalState(tpf); guiNode.updateLogicalState(tpf); rootNode.updateGeometricState(); - if( VRApplication.isInVR() == false || VRGuiManager.getPositioningMode() == POSITIONING_MODE.MANUAL ) { + if( isInVR() == false || guiManager.getPositioningMode() == POSITIONING_MODE.MANUAL ) { // only update geometric state here if GUI is in manual mode, or not in VR // it will get updated automatically in the viewmanager update otherwise guiNode.updateGeometricState(); } - // render states - stateManager.render(renderManager); - - // update VR pose & cameras - if( VRviewmanager != null ) { - VRviewmanager.update(tpf); - } else if( VRApplication.observer != null ) { - getCamera().setFrame(VRApplication.observer.getWorldTranslation(), VRApplication.observer.getWorldRotation()); - } - renderManager.render(tpf, context.isRenderable()); simpleRender(renderManager); stateManager.postRender(); // update compositor? - if( VRviewmanager != null ) { - VRviewmanager.sendTextures(); + if( viewmanager != null ) { + viewmanager.sendTextures(); } } @@ -1270,6 +1283,9 @@ public abstract class VRApplication implements Application, SystemListener { @Override public void initialize() { + + logger.config("Initialize VR application."); + initialize_internal(); cam.setFrustumFar(fFar); cam.setFrustumNear(fNear); @@ -1278,8 +1294,8 @@ public abstract class VRApplication implements Application, SystemListener { if( VRhardware != null ) { VRhardware.initVRCompositor(compositorAllowed()); } - VRviewmanager = new VRViewManager(this); - VRviewmanager.setResolutionMultiplier(resMult); + viewmanager = new VRViewManager(this); + viewmanager.setResolutionMultiplier(resMult); inputManager.addMapping(RESET_HMD, new KeyTrigger(KeyInput.KEY_F9)); setLostFocusBehavior(LostFocusBehavior.Disabled); } else { @@ -1287,25 +1303,25 @@ public abstract class VRApplication implements Application, SystemListener { guiViewPort.attachScene(guiNode); } - if( VRviewmanager != null ) { - VRviewmanager.initialize(this); + if( viewmanager != null ) { + viewmanager.initialize(); } simpleInitApp(); // any filters created, move them now - if( VRviewmanager != null ) { - VRviewmanager.moveScreenProcessingToEyes(); + if( viewmanager != null ) { + viewmanager.moveScreenProcessingToEyes(); // print out camera information if( isInVR() ) { logger.info("VR Initialization Information"); - if( VRviewmanager.getCamLeft() != null ){ - logger.info("camLeft: " + VRviewmanager.getCamLeft().toString()); + if( viewmanager.getCamLeft() != null ){ + logger.info("camLeft: " + viewmanager.getCamLeft().toString()); } - if( VRviewmanager.getCamRight() != null ){ - logger.info("camRight: " + VRviewmanager.getCamRight().toString()); + if( viewmanager.getCamRight() != null ){ + logger.info("camRight: " + viewmanager.getCamRight().toString()); } } } diff --git a/jme3-vr/src/main/java/com/jme3/input/lwjgl/GlfwMouseInputVR.java b/jme3-vr/src/main/java/com/jme3/input/lwjgl/GlfwMouseInputVR.java index 22ac434c7..e1060666a 100644 --- a/jme3-vr/src/main/java/com/jme3/input/lwjgl/GlfwMouseInputVR.java +++ b/jme3-vr/src/main/java/com/jme3/input/lwjgl/GlfwMouseInputVR.java @@ -242,7 +242,6 @@ public class GlfwMouseInputVR implements MouseInput { return; } - //FIXME: Needs LWJGL 3.1.0 cursorPosCallback.free(); scrollCallback.free(); mouseButtonCallback.free(); diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/OSVR.java b/jme3-vr/src/main/java/com/jme3/input/vr/OSVR.java index 72e1cffab..47ed23327 100644 --- a/jme3-vr/src/main/java/com/jme3/input/vr/OSVR.java +++ b/jme3-vr/src/main/java/com/jme3/input/vr/OSVR.java @@ -9,6 +9,7 @@ https://github.com/sensics/OSVR-RenderManager/blob/master/examples/RenderManager */ package com.jme3.input.vr; +import com.jme3.app.VRApplication; import com.jme3.math.Matrix4f; import com.jme3.math.Quaternion; import com.jme3.math.Vector2f; @@ -19,6 +20,7 @@ import com.ochafik.lang.jnaerator.runtime.NativeSizeByReference; import com.sun.jna.Pointer; import com.sun.jna.ptr.PointerByReference; import java.nio.FloatBuffer; +import java.util.logging.Logger; import osvrclientkit.OsvrClientKitLibrary; import osvrdisplay.OsvrDisplayLibrary; @@ -39,6 +41,8 @@ import osvrrendermanageropengl.OsvrRenderManagerOpenGLLibrary; */ public class OSVR implements VRAPI { + private static final Logger logger = Logger.getLogger(OSVR.class.getName()); + /** * The first viewer index. */ @@ -106,6 +110,16 @@ public class OSVR implements VRAPI { boolean initSuccess = false; boolean flipEyes = false; + private VRApplication application = null; + + /** + * Create a new OSVR system attached to the given application. + * @param application the application to which the input is attached. + */ + public OSVR(VRApplication application){ + this.application = application; + } + /** * Access to the underlying OSVR structures. * @param leftView the left viewport. @@ -130,9 +144,12 @@ public class OSVR implements VRAPI { @Override public boolean initialize() { + + logger.config("Initialize OSVR system."); + hmdPose.setAutoSynch(false); context = OsvrClientKitLibrary.osvrClientInit(defaultJString, 0); - VRinput = new OSVRInput(); + VRinput = new OSVRInput(application); initSuccess = context != null && VRinput.init(); if( initSuccess ) { PointerByReference grabDisplay = new PointerByReference(); @@ -444,4 +461,9 @@ public class OSVR implements VRAPI { return HmdType.OSVR; } + @Override + public VRApplication getApplication() { + return application; + } + } diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/OSVRInput.java b/jme3-vr/src/main/java/com/jme3/input/vr/OSVRInput.java index ff86ac8fa..ecdd774a9 100644 --- a/jme3-vr/src/main/java/com/jme3/input/vr/OSVRInput.java +++ b/jme3-vr/src/main/java/com/jme3/input/vr/OSVRInput.java @@ -5,6 +5,8 @@ */ package com.jme3.input.vr; +import java.util.logging.Logger; + import com.jme3.app.VRApplication; import com.jme3.math.Quaternion; import com.jme3.math.Vector2f; @@ -32,6 +34,8 @@ import osvrtimevalue.OSVR_TimeValue; */ public class OSVRInput implements VRInputAPI { + private static final Logger logger = Logger.getLogger(OSVRInput.class.getName()); + // position example: https://github.com/OSVR/OSVR-Core/blob/master/examples/clients/TrackerState.c // button example: https://github.com/OSVR/OSVR-Core/blob/master/examples/clients/ButtonCallback.c // analog example: https://github.com/OSVR/OSVR-Core/blob/master/examples/clients/AnalogCallback.c @@ -59,6 +63,8 @@ public class OSVRInput implements VRInputAPI { private static final Vector2f lastCallAxis[] = new Vector2f[16]; private static float axisMultiplier = 1f; + private VRApplication application = null; + /** * Get the system String that identifies a controller. * @param left is the controller is the left one (false if the right controller is needed). @@ -82,6 +88,16 @@ public class OSVRInput implements VRInputAPI { */ public static byte[] rightHand = { '/', 'm', 'e', '/', 'h', 'a', 'n', 'd', 's', '/', 'r', 'i', 'g', 'h', 't', (byte)0 }; + + /** + * Create a new OSVR input attached to the given application. + * @param application the application to which the input is attached. + */ + public OSVRInput(VRApplication application){ + this.application = application; + } + + @Override public boolean isButtonDown(int controllerIndex, VRInputType checkButton) { return buttonState[controllerIndex][checkButton.getValue()] != 0f; @@ -150,13 +166,15 @@ public class OSVRInput implements VRInputAPI { private OSVR_ClientInterface getInterface(byte[] str) { PointerByReference pbr = new PointerByReference(); - OsvrClientKitLibrary.osvrClientGetInterface((OsvrClientKitLibrary.OSVR_ClientContext)VRApplication.getVRHardware().getVRSystem(), str, pbr); + OsvrClientKitLibrary.osvrClientGetInterface((OsvrClientKitLibrary.OSVR_ClientContext)application.getVRHardware().getVRSystem(), str, pbr); return new OSVR_ClientInterface(pbr.getValue()); } @Override public boolean init() { + logger.config("Initialize OSVR input."); + buttonHandler = new Callback() { @SuppressWarnings("unused") public void invoke(Pointer userdata, Pointer timeval, OSVR_ButtonReport report) { @@ -284,9 +302,9 @@ public class OSVRInput implements VRInputAPI { @Override public Quaternion getFinalObserverRotation(int index) { - VRViewManager vrvm = VRApplication.getVRViewManager(); + VRViewManager vrvm = application.getVRViewManager(); if( vrvm == null || isInputDeviceTracking(index) == false ) return null; - Object obs = VRApplication.getObserver(); + Object obs = application.getObserver(); if( obs instanceof Camera ) { tempq.set(((Camera)obs).getRotation()); } else { @@ -297,9 +315,9 @@ public class OSVRInput implements VRInputAPI { @Override public Vector3f getFinalObserverPosition(int index) { - VRViewManager vrvm = VRApplication.getVRViewManager(); + VRViewManager vrvm = application.getVRViewManager(); if( vrvm == null || isInputDeviceTracking(index) == false ) return null; - Object obs = VRApplication.getObserver(); + Object obs = application.getObserver(); Vector3f pos = getPosition(index); if( obs instanceof Camera ) { ((Camera)obs).getRotation().mult(pos, pos); @@ -329,5 +347,11 @@ public class OSVRInput implements VRInputAPI { public void setAxisMultiplier(float set) { axisMultiplier = set; } + + + @Override + public VRApplication getApplication() { + return application; + } } diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/OpenVR.java b/jme3-vr/src/main/java/com/jme3/input/vr/OpenVR.java index d0de8fa54..dcde76467 100644 --- a/jme3-vr/src/main/java/com/jme3/input/vr/OpenVR.java +++ b/jme3-vr/src/main/java/com/jme3/input/vr/OpenVR.java @@ -11,6 +11,12 @@ 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.TrackedDevicePose_t; +import com.jme3.system.jopenvr.VR_IVRCompositor_FnTable; +import com.jme3.system.jopenvr.VR_IVRSystem_FnTable; import com.sun.jna.Memory; import com.sun.jna.Pointer; import java.nio.FloatBuffer; @@ -18,14 +24,9 @@ import java.nio.IntBuffer; import java.nio.LongBuffer; import java.util.Locale; import java.util.concurrent.TimeUnit; +import java.util.logging.Logger; import jmevr.util.VRUtil; -import jopenvr.HmdMatrix34_t; -import jopenvr.HmdMatrix44_t; -import jopenvr.JOpenVRLibrary; -import jopenvr.TrackedDevicePose_t; -import jopenvr.VR_IVRCompositor_FnTable; -import jopenvr.VR_IVRSystem_FnTable; /** * A class that wraps an OpenVR system. @@ -34,6 +35,8 @@ import jopenvr.VR_IVRSystem_FnTable; */ 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; @@ -74,6 +77,16 @@ public class OpenVR implements VRAPI { private static long frameCount; private static OpenVRInput VRinput; + private VRApplication application = null; + + /** + * Create a new OpenVR system attached to the given application. + * @param application the application to which the input is attached. + */ + public OpenVR(VRApplication application){ + this.application = application; + } + @Override public OpenVRInput getVRinput() { return VRinput; @@ -116,6 +129,9 @@ public class OpenVR implements VRAPI { @Override public boolean initialize() { + + logger.config("Initializing OpenVR system."); + hmdErrorStore = IntBuffer.allocate(1); vrsystemFunctions = null; JOpenVRLibrary.VR_InitInternal(hmdErrorStore, JOpenVRLibrary.EVRApplicationType.EVRApplicationType_VRApplication_Scene); @@ -155,9 +171,9 @@ public class OpenVR implements VRAPI { } // init controllers for the first time - VRinput = new OpenVRInput(); + VRinput = new OpenVRInput(application); VRinput.init(); - VRApplication.getVRinput().updateConnectedControllers(); + VRinput.updateConnectedControllers(); // init bounds & chaperone info VRBounds.init(); @@ -176,7 +192,7 @@ public class OpenVR implements VRAPI { System.out.println("OpenVR Compositor initialized OK!"); compositorFunctions.setAutoSynch(false); compositorFunctions.read(); - if( VRApplication.isSeatedExperience() ) { + if( application.isSeatedExperience() ) { compositorFunctions.SetTrackingSpace.apply(JOpenVRLibrary.ETrackingUniverseOrigin.ETrackingUniverseOrigin_TrackingUniverseSeated); } else { compositorFunctions.SetTrackingSpace.apply(JOpenVRLibrary.ETrackingUniverseOrigin.ETrackingUniverseOrigin_TrackingUniverseStanding); @@ -314,7 +330,7 @@ public class OpenVR implements VRAPI { frameCount = nowCount; vrsystemFunctions.GetDeviceToAbsoluteTrackingPose.apply( - VRApplication.isSeatedExperience()?JOpenVRLibrary.ETrackingUniverseOrigin.ETrackingUniverseOrigin_TrackingUniverseSeated: + application.isSeatedExperience()?JOpenVRLibrary.ETrackingUniverseOrigin.ETrackingUniverseOrigin_TrackingUniverseSeated: JOpenVRLibrary.ETrackingUniverseOrigin.ETrackingUniverseOrigin_TrackingUniverseStanding, fSecondsUntilPhotons, hmdTrackedDevicePoseReference, JOpenVRLibrary.k_unMaxTrackedDeviceCount); } @@ -331,7 +347,7 @@ public class OpenVR implements VRAPI { VRInput._updateConnectedControllers(); }*/ //update controllers pose information - VRApplication.getVRinput().updateControllerStates(); + application.getVRinput().updateControllerStates(); // read pose data from native for (int nDevice = 0; nDevice < JOpenVRLibrary.k_unMaxTrackedDeviceCount; ++nDevice ){ @@ -405,7 +421,7 @@ public class OpenVR implements VRAPI { @Override public Vector3f getSeatedToAbsolutePosition() { - if( VRApplication.isSeatedExperience() == false ) return Vector3f.ZERO; + if( application.isSeatedExperience() == false ) return Vector3f.ZERO; if( hmdSeatToStand == null ) { hmdSeatToStand = new Vector3f(); HmdMatrix34_t mat = vrsystemFunctions.GetSeatedZeroPoseToStandingAbsoluteTrackingPose.apply(); @@ -482,5 +498,10 @@ public class OpenVR implements VRAPI { return VRUtil.convertSteamVRMatrix3ToMatrix4f(mat, hmdPoseRightEye); } } + + @Override + public VRApplication getApplication() { + return application; + } } diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/OpenVRInput.java b/jme3-vr/src/main/java/com/jme3/input/vr/OpenVRInput.java index a7d65efd6..ab5c4e471 100644 --- a/jme3-vr/src/main/java/com/jme3/input/vr/OpenVRInput.java +++ b/jme3-vr/src/main/java/com/jme3/input/vr/OpenVRInput.java @@ -5,18 +5,20 @@ */ package com.jme3.input.vr; +import java.util.logging.Logger; + import com.jme3.app.VRApplication; 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.VRControllerState_t; +import com.jme3.system.jopenvr.VR_IVRSystem_FnTable; import jmevr.util.VRUtil; import jmevr.util.VRViewManager; -import jopenvr.JOpenVRLibrary; -import jopenvr.VRControllerState_t; -import jopenvr.VR_IVRSystem_FnTable; /* make helper functions to pull the following easily from raw data (DONE) @@ -64,32 +66,44 @@ Button press: 2, touch: 2 */ public class OpenVRInput implements VRInputAPI { - private static final VRControllerState_t[] cStates = new VRControllerState_t[JOpenVRLibrary.k_unMaxTrackedDeviceCount]; + private static final Logger logger = Logger.getLogger(OpenVRInput.class.getName()); + + private final VRControllerState_t[] cStates = new VRControllerState_t[JOpenVRLibrary.k_unMaxTrackedDeviceCount]; - private static final Quaternion[] rotStore = new Quaternion[JOpenVRLibrary.k_unMaxTrackedDeviceCount]; + private final Quaternion[] rotStore = new Quaternion[JOpenVRLibrary.k_unMaxTrackedDeviceCount]; - private static final Vector3f[] posStore = new Vector3f[JOpenVRLibrary.k_unMaxTrackedDeviceCount]; + private final Vector3f[] posStore = new Vector3f[JOpenVRLibrary.k_unMaxTrackedDeviceCount]; private static final int[] controllerIndex = new int[JOpenVRLibrary.k_unMaxTrackedDeviceCount]; - private static int controllerCount = 0; + private int controllerCount = 0; - private static final Vector2f tempAxis = new Vector2f(), temp2Axis = new Vector2f(); + private final Vector2f tempAxis = new Vector2f(), temp2Axis = new Vector2f(); - private static final Vector2f lastCallAxis[] = new Vector2f[JOpenVRLibrary.k_unMaxTrackedDeviceCount]; + private final Vector2f lastCallAxis[] = new Vector2f[JOpenVRLibrary.k_unMaxTrackedDeviceCount]; - private static final boolean needsNewVelocity[] = new boolean[JOpenVRLibrary.k_unMaxTrackedDeviceCount]; + private final boolean needsNewVelocity[] = new boolean[JOpenVRLibrary.k_unMaxTrackedDeviceCount]; - private static final boolean needsNewAngVelocity[] = new boolean[JOpenVRLibrary.k_unMaxTrackedDeviceCount]; + private final boolean needsNewAngVelocity[] = new boolean[JOpenVRLibrary.k_unMaxTrackedDeviceCount]; - private static final boolean buttonDown[][] = new boolean[JOpenVRLibrary.k_unMaxTrackedDeviceCount][16]; + private final boolean buttonDown[][] = new boolean[JOpenVRLibrary.k_unMaxTrackedDeviceCount][16]; - private static float axisMultiplier = 1f; + private float axisMultiplier = 1f; - private static final Vector3f tempVel = new Vector3f(); + private final Vector3f tempVel = new Vector3f(); - private static final Quaternion tempq = new Quaternion(); + private final Quaternion tempq = new Quaternion(); + private VRApplication application; + + /** + * Create a new OpenVR input attached to the given application. + * @param application the application to which the input is attached. + */ + public OpenVRInput(VRApplication application){ + this.application = application; + } + @Override public float getAxisMultiplier() { return axisMultiplier; @@ -229,6 +243,9 @@ public class OpenVRInput implements VRInputAPI { @Override public boolean init() { + + logger.config("Initialize OpenVR input."); + for(int i=0;itrue if this filter has to use instance rendering and false (default) otherwise. */ - public CartoonSSAO() { + 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 + * 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) { - this(); + public CartoonSSAO(float downsample, boolean instancedRendering) { + this(instancedRendering); this.downsample = downsample; } @@ -52,7 +56,7 @@ public class CartoonSSAO extends Filter{ * @param cloneFrom the original filter. */ public CartoonSSAO(CartoonSSAO cloneFrom) { - this(cloneFrom.downsample); + this(cloneFrom.downsample, cloneFrom.instancedRendering); } @Override @@ -149,7 +153,7 @@ public class CartoonSSAO extends Filter{ material.setVector2("FrustumNearFar", frustumNearFar); material.setFloat("Distance", applyDistance); if( useOutline == false ) material.setBoolean("disableOutline", true); - if( VRApplication.isInstanceVRRendering() ) material.setBoolean("useInstancing", true); + if( instancedRendering ) material.setBoolean("useInstancing", true); } } \ No newline at end of file diff --git a/jme3-vr/src/main/java/com/jme3/post/OpenVRFilter.java b/jme3-vr/src/main/java/com/jme3/post/OpenVRFilter.java index d424cb5f1..347b64f0e 100644 --- a/jme3-vr/src/main/java/com/jme3/post/OpenVRFilter.java +++ b/jme3-vr/src/main/java/com/jme3/post/OpenVRFilter.java @@ -13,12 +13,11 @@ import com.jme3.renderer.Renderer; import com.jme3.renderer.ViewPort; import com.jme3.scene.Mesh; import com.jme3.scene.VertexBuffer; +import com.jme3.system.jopenvr.DistortionCoordinates_t; +import com.jme3.system.jopenvr.JOpenVRLibrary; +import com.jme3.system.jopenvr.VR_IVRSystem_FnTable; import com.jme3.texture.FrameBuffer; -import jopenvr.DistortionCoordinates_t; -import jopenvr.JOpenVRLibrary; -import jopenvr.VR_IVRSystem_FnTable; - /** * DO NOT USE * @author phr00t @@ -29,11 +28,14 @@ public class OpenVRFilter extends Filter { private Mesh distortionMesh; + private VRApplication application = null; + /** * DO NOT USE + * @param application the VR application. */ - public OpenVRFilter() { - + public OpenVRFilter(VRApplication application) { + this.application = application; } /** @@ -104,7 +106,7 @@ public class OpenVRFilter extends Filter { verts[vertPos+2] = 0f; // z vertPos += 3; - DistortionCoordinates_t dc0 = ((VR_IVRSystem_FnTable)VRApplication.getVRHardware().getVRSystem()).ComputeDistortion.apply(JOpenVRLibrary.EVREye.EVREye_Eye_Left, u, v); + DistortionCoordinates_t dc0 = ((VR_IVRSystem_FnTable)application.getVRHardware().getVRSystem()).ComputeDistortion.apply(JOpenVRLibrary.EVREye.EVREye_Eye_Left, u, v); texcoordR[coordPos] = dc0.rfRed[0]; texcoordR[coordPos+1] = 1 - dc0.rfRed[1]; @@ -128,7 +130,7 @@ public class OpenVRFilter extends Filter { verts[vertPos+2] = 0f; // z vertPos += 3; - DistortionCoordinates_t dc0 = ((VR_IVRSystem_FnTable)VRApplication.getVRHardware().getVRSystem()).ComputeDistortion.apply(JOpenVRLibrary.EVREye.EVREye_Eye_Right, u, v); + DistortionCoordinates_t dc0 = ((VR_IVRSystem_FnTable)application.getVRHardware().getVRSystem()).ComputeDistortion.apply(JOpenVRLibrary.EVREye.EVREye_Eye_Right, u, v); texcoordR[coordPos] = dc0.rfRed[0]; texcoordR[coordPos+1] = 1 - dc0.rfRed[1]; diff --git a/jme3-vr/src/main/java/com/jme3/post/PreNormalCaching.java b/jme3-vr/src/main/java/com/jme3/post/PreNormalCaching.java index 392780e0a..94a0009ab 100644 --- a/jme3-vr/src/main/java/com/jme3/post/PreNormalCaching.java +++ b/jme3-vr/src/main/java/com/jme3/post/PreNormalCaching.java @@ -5,7 +5,6 @@ */ package com.jme3.post; -import com.jme3.app.VRApplication; import com.jme3.post.Filter.Pass; import com.jme3.renderer.Caps; import com.jme3.renderer.RenderManager; @@ -54,11 +53,12 @@ public class PreNormalCaching { renderManager.getRenderer().setFrameBuffer(viewPort.getOutputFrameBuffer()); } - /** - * - */ - public static void resetCache() { - if( VRApplication.isInVR() == false ) { + /** + * 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! diff --git a/jme3-vr/src/main/java/com/jme3/shadow/InstancedDirectionalShadowFilter.java b/jme3-vr/src/main/java/com/jme3/shadow/InstancedDirectionalShadowFilter.java index 7696b8c0d..fb688b401 100644 --- a/jme3-vr/src/main/java/com/jme3/shadow/InstancedDirectionalShadowFilter.java +++ b/jme3-vr/src/main/java/com/jme3/shadow/InstancedDirectionalShadowFilter.java @@ -6,9 +6,9 @@ package com.jme3.shadow; import com.jme3.app.VRApplication; -import com.jme3.asset.AssetManager; 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}. @@ -19,22 +19,26 @@ public class InstancedDirectionalShadowFilter extends DirectionalLightShadowFilt private final Vector4f temp4f = new Vector4f(), temp4f2 = new Vector4f(); + private VRApplication application; + /** * Create a new instanced version of the {@link DirectionalLightShadowFilterVR directional light shadow filter}. - * @param assetManager the asset manager to use. + * @param application the VR application that this filter is attached to. + * @param camera * @param shadowMapSize the size of the rendered shadowmaps (512, 1024, 2048, etc...) * @param nbSplits the number of shadow maps rendered (the more shadow maps the more quality, the less fps). + * @param instancedRendering true if this filter has to use instance rendering and false otherwise. */ - public InstancedDirectionalShadowFilter(AssetManager assetManager, int shadowMapSize, int nbSplits) { - super(assetManager, shadowMapSize, nbSplits, "Common/MatDefs/VR/PostShadowFilter.j3md"); + public InstancedDirectionalShadowFilter(VRApplication application, Camera camera, int shadowMapSize, int nbSplits, boolean instancedRendering) { + super(application.getAssetManager(), shadowMapSize, nbSplits, "Common/MatDefs/VR/PostShadowFilter.j3md"); } - + @Override protected void preFrame(float tpf) { shadowRenderer.preFrame(tpf); - if( VRApplication.isInstanceVRRendering() ) { - material.setMatrix4("ViewProjectionMatrixInverseRight", VRApplication.getVRViewManager().getCamRight().getViewProjectionMatrix().invert()); - Matrix4f m = VRApplication.getVRViewManager().getCamRight().getViewProjectionMatrix(); + if( application.isInstanceVRRendering() ) { + material.setMatrix4("ViewProjectionMatrixInverseRight", application.getVRViewManager().getCamRight().getViewProjectionMatrix().invert()); + Matrix4f m = application.getVRViewManager().getCamRight().getViewProjectionMatrix(); material.setVector4("ViewProjectionMatrixRow2Right", temp4f2.set(m.m20, m.m21, m.m22, m.m23)); } material.setMatrix4("ViewProjectionMatrixInverse", viewPort.getCamera().getViewProjectionMatrix().invert()); diff --git a/jme3-vr/src/main/java/jopenvr/AppOverrideKeys_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/AppOverrideKeys_t.java similarity index 97% rename from jme3-vr/src/main/java/jopenvr/AppOverrideKeys_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/AppOverrideKeys_t.java index a6d5da083..2cf67aee0 100644 --- a/jme3-vr/src/main/java/jopenvr/AppOverrideKeys_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/AppOverrideKeys_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/COpenVRContext.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/COpenVRContext.java similarity index 98% rename from jme3-vr/src/main/java/jopenvr/COpenVRContext.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/COpenVRContext.java index 48dcafe6c..1b8910732 100644 --- a/jme3-vr/src/main/java/jopenvr/COpenVRContext.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/COpenVRContext.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import com.sun.jna.ptr.IntByReference; diff --git a/jme3-vr/src/main/java/jopenvr/CameraVideoStreamFrameHeader_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/CameraVideoStreamFrameHeader_t.java similarity index 98% rename from jme3-vr/src/main/java/jopenvr/CameraVideoStreamFrameHeader_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/CameraVideoStreamFrameHeader_t.java index 432dce772..250d01ba7 100644 --- a/jme3-vr/src/main/java/jopenvr/CameraVideoStreamFrameHeader_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/CameraVideoStreamFrameHeader_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/Compositor_CumulativeStats.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/Compositor_CumulativeStats.java similarity index 98% rename from jme3-vr/src/main/java/jopenvr/Compositor_CumulativeStats.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/Compositor_CumulativeStats.java index 23c1df549..fea616a58 100644 --- a/jme3-vr/src/main/java/jopenvr/Compositor_CumulativeStats.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/Compositor_CumulativeStats.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/Compositor_FrameTiming.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/Compositor_FrameTiming.java similarity index 98% rename from jme3-vr/src/main/java/jopenvr/Compositor_FrameTiming.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/Compositor_FrameTiming.java index 4cf148640..484c9440c 100644 --- a/jme3-vr/src/main/java/jopenvr/Compositor_FrameTiming.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/Compositor_FrameTiming.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/Compositor_OverlaySettings.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/Compositor_OverlaySettings.java similarity index 97% rename from jme3-vr/src/main/java/jopenvr/Compositor_OverlaySettings.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/Compositor_OverlaySettings.java index 7a30351be..9571de383 100644 --- a/jme3-vr/src/main/java/jopenvr/Compositor_OverlaySettings.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/Compositor_OverlaySettings.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/DistortionCoordinates_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/DistortionCoordinates_t.java similarity index 98% rename from jme3-vr/src/main/java/jopenvr/DistortionCoordinates_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/DistortionCoordinates_t.java index 8320681b7..c7e49baaf 100644 --- a/jme3-vr/src/main/java/jopenvr/DistortionCoordinates_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/DistortionCoordinates_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/HiddenAreaMesh_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HiddenAreaMesh_t.java similarity index 86% rename from jme3-vr/src/main/java/jopenvr/HiddenAreaMesh_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/HiddenAreaMesh_t.java index 9b3811989..8e9cd4e53 100644 --- a/jme3-vr/src/main/java/jopenvr/HiddenAreaMesh_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HiddenAreaMesh_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; @@ -13,7 +13,7 @@ public class HiddenAreaMesh_t extends Structure { * const struct vr::HmdVector2_t *
* C type : HmdVector2_t* */ - public jopenvr.HmdVector2_t.ByReference pVertexData; + public com.jme3.system.jopenvr.HmdVector2_t.ByReference pVertexData; public int unTriangleCount; public HiddenAreaMesh_t() { super(); @@ -25,7 +25,7 @@ public class HiddenAreaMesh_t extends Structure { * @param pVertexData const struct vr::HmdVector2_t *
* C type : HmdVector2_t* */ - public HiddenAreaMesh_t(jopenvr.HmdVector2_t.ByReference pVertexData, int unTriangleCount) { + public HiddenAreaMesh_t(com.jme3.system.jopenvr.HmdVector2_t.ByReference pVertexData, int unTriangleCount) { super(); this.pVertexData = pVertexData; this.unTriangleCount = unTriangleCount; diff --git a/jme3-vr/src/main/java/jopenvr/HmdColor_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdColor_t.java similarity index 97% rename from jme3-vr/src/main/java/jopenvr/HmdColor_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdColor_t.java index 37cadb7fb..5a0a219af 100644 --- a/jme3-vr/src/main/java/jopenvr/HmdColor_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdColor_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/HmdMatrix34_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdMatrix34_t.java similarity index 97% rename from jme3-vr/src/main/java/jopenvr/HmdMatrix34_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdMatrix34_t.java index 4241d949d..11dc9e468 100644 --- a/jme3-vr/src/main/java/jopenvr/HmdMatrix34_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdMatrix34_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/HmdMatrix44_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdMatrix44_t.java similarity index 97% rename from jme3-vr/src/main/java/jopenvr/HmdMatrix44_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdMatrix44_t.java index b7ff205a9..494c4835d 100644 --- a/jme3-vr/src/main/java/jopenvr/HmdMatrix44_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdMatrix44_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/HmdQuad_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdQuad_t.java similarity index 97% rename from jme3-vr/src/main/java/jopenvr/HmdQuad_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdQuad_t.java index fcb994343..f7c131ed2 100644 --- a/jme3-vr/src/main/java/jopenvr/HmdQuad_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdQuad_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/HmdQuaternion_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdQuaternion_t.java similarity index 97% rename from jme3-vr/src/main/java/jopenvr/HmdQuaternion_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdQuaternion_t.java index 44e16e8e8..1f2ae2f5e 100644 --- a/jme3-vr/src/main/java/jopenvr/HmdQuaternion_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdQuaternion_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/HmdRect2_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdRect2_t.java similarity index 97% rename from jme3-vr/src/main/java/jopenvr/HmdRect2_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdRect2_t.java index 263cee18b..26719b12a 100644 --- a/jme3-vr/src/main/java/jopenvr/HmdRect2_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdRect2_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/HmdVector2_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector2_t.java similarity index 97% rename from jme3-vr/src/main/java/jopenvr/HmdVector2_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector2_t.java index 88cdaecb6..c14407bf1 100644 --- a/jme3-vr/src/main/java/jopenvr/HmdVector2_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector2_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/HmdVector3_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector3_t.java similarity index 97% rename from jme3-vr/src/main/java/jopenvr/HmdVector3_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector3_t.java index 28ed95c5a..33cbbedff 100644 --- a/jme3-vr/src/main/java/jopenvr/HmdVector3_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector3_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/HmdVector3d_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector3d_t.java similarity index 97% rename from jme3-vr/src/main/java/jopenvr/HmdVector3d_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector3d_t.java index 2a41737f4..bb0518ed1 100644 --- a/jme3-vr/src/main/java/jopenvr/HmdVector3d_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector3d_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/HmdVector4_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector4_t.java similarity index 97% rename from jme3-vr/src/main/java/jopenvr/HmdVector4_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector4_t.java index 485de30c3..09e84e2d2 100644 --- a/jme3-vr/src/main/java/jopenvr/HmdVector4_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector4_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/JOpenVRLibrary.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/JOpenVRLibrary.java similarity index 99% rename from jme3-vr/src/main/java/jopenvr/JOpenVRLibrary.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/JOpenVRLibrary.java index efbeeaa90..0d580c2ce 100644 --- a/jme3-vr/src/main/java/jopenvr/JOpenVRLibrary.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/JOpenVRLibrary.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Library; import com.sun.jna.Native; import com.sun.jna.NativeLibrary; diff --git a/jme3-vr/src/main/java/jopenvr/NotificationBitmap_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/NotificationBitmap_t.java similarity index 97% rename from jme3-vr/src/main/java/jopenvr/NotificationBitmap_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/NotificationBitmap_t.java index 92539ab2d..308ed88be 100644 --- a/jme3-vr/src/main/java/jopenvr/NotificationBitmap_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/NotificationBitmap_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/RenderModel_ComponentState_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_ComponentState_t.java similarity index 98% rename from jme3-vr/src/main/java/jopenvr/RenderModel_ComponentState_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_ComponentState_t.java index a6e119d02..d2c90aa6e 100644 --- a/jme3-vr/src/main/java/jopenvr/RenderModel_ComponentState_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_ComponentState_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/RenderModel_ControllerMode_State_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_ControllerMode_State_t.java similarity index 97% rename from jme3-vr/src/main/java/jopenvr/RenderModel_ControllerMode_State_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_ControllerMode_State_t.java index 7f7f3bc6c..fdadcb5c3 100644 --- a/jme3-vr/src/main/java/jopenvr/RenderModel_ControllerMode_State_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_ControllerMode_State_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/RenderModel_TextureMap_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_TextureMap_t.java similarity index 97% rename from jme3-vr/src/main/java/jopenvr/RenderModel_TextureMap_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_TextureMap_t.java index 382bc5c3c..7aa00dfd1 100644 --- a/jme3-vr/src/main/java/jopenvr/RenderModel_TextureMap_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_TextureMap_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/RenderModel_Vertex_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_Vertex_t.java similarity index 98% rename from jme3-vr/src/main/java/jopenvr/RenderModel_Vertex_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_Vertex_t.java index f38b36baf..a00c33b3f 100644 --- a/jme3-vr/src/main/java/jopenvr/RenderModel_Vertex_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_Vertex_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/RenderModel_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_t.java similarity index 86% rename from jme3-vr/src/main/java/jopenvr/RenderModel_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_t.java index 542c01912..343717344 100644 --- a/jme3-vr/src/main/java/jopenvr/RenderModel_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import com.sun.jna.ptr.ShortByReference; @@ -14,7 +14,7 @@ public class RenderModel_t extends Structure { * const struct vr::RenderModel_Vertex_t *
* C type : RenderModel_Vertex_t* */ - public jopenvr.RenderModel_Vertex_t.ByReference rVertexData; + public com.jme3.system.jopenvr.RenderModel_Vertex_t.ByReference rVertexData; public int unVertexCount; /** * const uint16_t *
@@ -37,7 +37,7 @@ public class RenderModel_t extends Structure { * C type : uint16_t*
* @param diffuseTextureId C type : TextureID_t */ - public RenderModel_t(jopenvr.RenderModel_Vertex_t.ByReference rVertexData, int unVertexCount, ShortByReference rIndexData, int unTriangleCount, int diffuseTextureId) { + 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; diff --git a/jme3-vr/src/main/java/jopenvr/Texture_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/Texture_t.java similarity index 98% rename from jme3-vr/src/main/java/jopenvr/Texture_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/Texture_t.java index 7cf88971c..75faa4c57 100644 --- a/jme3-vr/src/main/java/jopenvr/Texture_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/Texture_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/TrackedDevicePose_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/TrackedDevicePose_t.java similarity index 98% rename from jme3-vr/src/main/java/jopenvr/TrackedDevicePose_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/TrackedDevicePose_t.java index 26d4982a0..5de7e3d8b 100644 --- a/jme3-vr/src/main/java/jopenvr/TrackedDevicePose_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/TrackedDevicePose_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/VRControllerAxis_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRControllerAxis_t.java similarity index 97% rename from jme3-vr/src/main/java/jopenvr/VRControllerAxis_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/VRControllerAxis_t.java index 430e50f87..76db4693f 100644 --- a/jme3-vr/src/main/java/jopenvr/VRControllerAxis_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRControllerAxis_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/VRControllerState_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRControllerState_t.java similarity index 99% rename from jme3-vr/src/main/java/jopenvr/VRControllerState_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/VRControllerState_t.java index 8a8e25f37..c6275d69f 100644 --- a/jme3-vr/src/main/java/jopenvr/VRControllerState_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRControllerState_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/VREvent_ApplicationLaunch_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_ApplicationLaunch_t.java similarity index 97% rename from jme3-vr/src/main/java/jopenvr/VREvent_ApplicationLaunch_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_ApplicationLaunch_t.java index dd9785421..eebde3c33 100644 --- a/jme3-vr/src/main/java/jopenvr/VREvent_ApplicationLaunch_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_ApplicationLaunch_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/VREvent_Chaperone_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Chaperone_t.java similarity index 97% rename from jme3-vr/src/main/java/jopenvr/VREvent_Chaperone_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Chaperone_t.java index 82173a618..5b929a606 100644 --- a/jme3-vr/src/main/java/jopenvr/VREvent_Chaperone_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Chaperone_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/VREvent_Controller_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Controller_t.java similarity index 97% rename from jme3-vr/src/main/java/jopenvr/VREvent_Controller_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Controller_t.java index 28a9d80b1..d5545a2fc 100644 --- a/jme3-vr/src/main/java/jopenvr/VREvent_Controller_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Controller_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/VREvent_Data_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Data_t.java similarity index 99% rename from jme3-vr/src/main/java/jopenvr/VREvent_Data_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Data_t.java index c798ebdbc..c255b6740 100644 --- a/jme3-vr/src/main/java/jopenvr/VREvent_Data_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Data_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Union; /** diff --git a/jme3-vr/src/main/java/jopenvr/VREvent_Ipd_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Ipd_t.java similarity index 97% rename from jme3-vr/src/main/java/jopenvr/VREvent_Ipd_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Ipd_t.java index b156ad316..767c1642c 100644 --- a/jme3-vr/src/main/java/jopenvr/VREvent_Ipd_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Ipd_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/VREvent_Keyboard_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Keyboard_t.java similarity index 97% rename from jme3-vr/src/main/java/jopenvr/VREvent_Keyboard_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Keyboard_t.java index 5a6524097..8a066d43a 100644 --- a/jme3-vr/src/main/java/jopenvr/VREvent_Keyboard_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Keyboard_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/VREvent_Mouse_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Mouse_t.java similarity index 97% rename from jme3-vr/src/main/java/jopenvr/VREvent_Mouse_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Mouse_t.java index 6a828c4a5..d835cabd2 100644 --- a/jme3-vr/src/main/java/jopenvr/VREvent_Mouse_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Mouse_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/VREvent_Notification_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Notification_t.java similarity index 97% rename from jme3-vr/src/main/java/jopenvr/VREvent_Notification_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Notification_t.java index 1b742ffd3..bb238bd33 100644 --- a/jme3-vr/src/main/java/jopenvr/VREvent_Notification_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Notification_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/VREvent_Overlay_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Overlay_t.java similarity index 97% rename from jme3-vr/src/main/java/jopenvr/VREvent_Overlay_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Overlay_t.java index a6f87c401..c22092b93 100644 --- a/jme3-vr/src/main/java/jopenvr/VREvent_Overlay_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Overlay_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/VREvent_PerformanceTest_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_PerformanceTest_t.java similarity index 97% rename from jme3-vr/src/main/java/jopenvr/VREvent_PerformanceTest_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_PerformanceTest_t.java index 53a3c3e6e..9749e0446 100644 --- a/jme3-vr/src/main/java/jopenvr/VREvent_PerformanceTest_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_PerformanceTest_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/VREvent_Process_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Process_t.java similarity index 97% rename from jme3-vr/src/main/java/jopenvr/VREvent_Process_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Process_t.java index 9ec273b1d..bdae72571 100644 --- a/jme3-vr/src/main/java/jopenvr/VREvent_Process_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Process_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/VREvent_Reserved_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Reserved_t.java similarity index 97% rename from jme3-vr/src/main/java/jopenvr/VREvent_Reserved_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Reserved_t.java index 969de7e54..a3b046f08 100644 --- a/jme3-vr/src/main/java/jopenvr/VREvent_Reserved_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Reserved_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/VREvent_ScreenshotProgress_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_ScreenshotProgress_t.java similarity index 97% rename from jme3-vr/src/main/java/jopenvr/VREvent_ScreenshotProgress_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_ScreenshotProgress_t.java index b80dd4fd4..0d7eb534e 100644 --- a/jme3-vr/src/main/java/jopenvr/VREvent_ScreenshotProgress_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_ScreenshotProgress_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/VREvent_Screenshot_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Screenshot_t.java similarity index 97% rename from jme3-vr/src/main/java/jopenvr/VREvent_Screenshot_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Screenshot_t.java index 9f0ac401a..71a5d75e1 100644 --- a/jme3-vr/src/main/java/jopenvr/VREvent_Screenshot_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Screenshot_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/VREvent_Scroll_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Scroll_t.java similarity index 97% rename from jme3-vr/src/main/java/jopenvr/VREvent_Scroll_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Scroll_t.java index 085596999..77e02ddf3 100644 --- a/jme3-vr/src/main/java/jopenvr/VREvent_Scroll_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Scroll_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/VREvent_SeatedZeroPoseReset_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_SeatedZeroPoseReset_t.java similarity index 97% rename from jme3-vr/src/main/java/jopenvr/VREvent_SeatedZeroPoseReset_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_SeatedZeroPoseReset_t.java index 9978bd346..e9592e403 100644 --- a/jme3-vr/src/main/java/jopenvr/VREvent_SeatedZeroPoseReset_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_SeatedZeroPoseReset_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/VREvent_Status_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Status_t.java similarity index 97% rename from jme3-vr/src/main/java/jopenvr/VREvent_Status_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Status_t.java index b580b0d61..24fda3c39 100644 --- a/jme3-vr/src/main/java/jopenvr/VREvent_Status_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Status_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/VREvent_TouchPadMove_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_TouchPadMove_t.java similarity index 98% rename from jme3-vr/src/main/java/jopenvr/VREvent_TouchPadMove_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_TouchPadMove_t.java index ea673e56e..9cb195da4 100644 --- a/jme3-vr/src/main/java/jopenvr/VREvent_TouchPadMove_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_TouchPadMove_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/VREvent_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_t.java similarity index 98% rename from jme3-vr/src/main/java/jopenvr/VREvent_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_t.java index 4c69e5f42..508a8c0e4 100644 --- a/jme3-vr/src/main/java/jopenvr/VREvent_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/VROverlayIntersectionParams_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VROverlayIntersectionParams_t.java similarity index 98% rename from jme3-vr/src/main/java/jopenvr/VROverlayIntersectionParams_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/VROverlayIntersectionParams_t.java index d6d0ff83d..c8d724149 100644 --- a/jme3-vr/src/main/java/jopenvr/VROverlayIntersectionParams_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VROverlayIntersectionParams_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/VROverlayIntersectionResults_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VROverlayIntersectionResults_t.java similarity index 98% rename from jme3-vr/src/main/java/jopenvr/VROverlayIntersectionResults_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/VROverlayIntersectionResults_t.java index 2fa8f3077..a91bd5cd8 100644 --- a/jme3-vr/src/main/java/jopenvr/VROverlayIntersectionResults_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VROverlayIntersectionResults_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/VRTextureBounds_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRTextureBounds_t.java similarity index 97% rename from jme3-vr/src/main/java/jopenvr/VRTextureBounds_t.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/VRTextureBounds_t.java index d50186d83..15f4eb621 100644 --- a/jme3-vr/src/main/java/jopenvr/VRTextureBounds_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRTextureBounds_t.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; diff --git a/jme3-vr/src/main/java/jopenvr/VR_IVRApplications_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRApplications_FnTable.java similarity index 99% rename from jme3-vr/src/main/java/jopenvr/VR_IVRApplications_FnTable.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRApplications_FnTable.java index de1d65f0c..cc56a15a1 100644 --- a/jme3-vr/src/main/java/jopenvr/VR_IVRApplications_FnTable.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRApplications_FnTable.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Callback; import com.sun.jna.Pointer; import com.sun.jna.Structure; diff --git a/jme3-vr/src/main/java/jopenvr/VR_IVRChaperoneSetup_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRChaperoneSetup_FnTable.java similarity index 99% rename from jme3-vr/src/main/java/jopenvr/VR_IVRChaperoneSetup_FnTable.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRChaperoneSetup_FnTable.java index 9dd5c7ec3..7df0628bf 100644 --- a/jme3-vr/src/main/java/jopenvr/VR_IVRChaperoneSetup_FnTable.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRChaperoneSetup_FnTable.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Callback; import com.sun.jna.Pointer; import com.sun.jna.Structure; diff --git a/jme3-vr/src/main/java/jopenvr/VR_IVRChaperone_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRChaperone_FnTable.java similarity index 99% rename from jme3-vr/src/main/java/jopenvr/VR_IVRChaperone_FnTable.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRChaperone_FnTable.java index bb0c52ba6..fce17b3ca 100644 --- a/jme3-vr/src/main/java/jopenvr/VR_IVRChaperone_FnTable.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRChaperone_FnTable.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Callback; import com.sun.jna.Pointer; import com.sun.jna.Structure; diff --git a/jme3-vr/src/main/java/jopenvr/VR_IVRCompositor_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRCompositor_FnTable.java similarity index 99% rename from jme3-vr/src/main/java/jopenvr/VR_IVRCompositor_FnTable.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRCompositor_FnTable.java index 58465080d..3832513a9 100644 --- a/jme3-vr/src/main/java/jopenvr/VR_IVRCompositor_FnTable.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRCompositor_FnTable.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Callback; import com.sun.jna.Pointer; import com.sun.jna.Structure; diff --git a/jme3-vr/src/main/java/jopenvr/VR_IVRExtendedDisplay_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRExtendedDisplay_FnTable.java similarity index 98% rename from jme3-vr/src/main/java/jopenvr/VR_IVRExtendedDisplay_FnTable.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRExtendedDisplay_FnTable.java index 0b2a58f3a..80b8c5eb1 100644 --- a/jme3-vr/src/main/java/jopenvr/VR_IVRExtendedDisplay_FnTable.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRExtendedDisplay_FnTable.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Callback; import com.sun.jna.Pointer; import com.sun.jna.Structure; diff --git a/jme3-vr/src/main/java/jopenvr/VR_IVRNotifications_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRNotifications_FnTable.java similarity index 98% rename from jme3-vr/src/main/java/jopenvr/VR_IVRNotifications_FnTable.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRNotifications_FnTable.java index 2c2c3c9a4..9bcd761d2 100644 --- a/jme3-vr/src/main/java/jopenvr/VR_IVRNotifications_FnTable.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRNotifications_FnTable.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Callback; import com.sun.jna.Pointer; import com.sun.jna.Structure; diff --git a/jme3-vr/src/main/java/jopenvr/VR_IVROverlay_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVROverlay_FnTable.java similarity index 99% rename from jme3-vr/src/main/java/jopenvr/VR_IVROverlay_FnTable.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVROverlay_FnTable.java index 20602d6ab..c1c62b171 100644 --- a/jme3-vr/src/main/java/jopenvr/VR_IVROverlay_FnTable.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVROverlay_FnTable.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Callback; import com.sun.jna.Pointer; import com.sun.jna.Structure; @@ -369,7 +369,7 @@ public class VR_IVROverlay_FnTable extends Structure { void apply(int eTrackingOrigin, HmdMatrix34_t pmatTrackingOriginToKeyboardTransform); }; public interface SetKeyboardPositionForOverlay_callback extends Callback { - void apply(long ulOverlayHandle, jopenvr.HmdRect2_t.ByValue avoidRect); + void apply(long ulOverlayHandle, com.jme3.system.jopenvr.HmdRect2_t.ByValue avoidRect); }; public VR_IVROverlay_FnTable() { super(); diff --git a/jme3-vr/src/main/java/jopenvr/VR_IVRRenderModels_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRRenderModels_FnTable.java similarity index 99% rename from jme3-vr/src/main/java/jopenvr/VR_IVRRenderModels_FnTable.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRRenderModels_FnTable.java index 669d35a50..10c0c879b 100644 --- a/jme3-vr/src/main/java/jopenvr/VR_IVRRenderModels_FnTable.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRRenderModels_FnTable.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Callback; import com.sun.jna.Pointer; import com.sun.jna.Structure; diff --git a/jme3-vr/src/main/java/jopenvr/VR_IVRResources_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRResources_FnTable.java similarity index 98% rename from jme3-vr/src/main/java/jopenvr/VR_IVRResources_FnTable.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRResources_FnTable.java index 1b4ce444d..11fa0fddc 100644 --- a/jme3-vr/src/main/java/jopenvr/VR_IVRResources_FnTable.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRResources_FnTable.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Callback; import com.sun.jna.Pointer; import com.sun.jna.Structure; diff --git a/jme3-vr/src/main/java/jopenvr/VR_IVRScreenshots_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRScreenshots_FnTable.java similarity index 99% rename from jme3-vr/src/main/java/jopenvr/VR_IVRScreenshots_FnTable.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRScreenshots_FnTable.java index 691f59c46..4fbca0057 100644 --- a/jme3-vr/src/main/java/jopenvr/VR_IVRScreenshots_FnTable.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRScreenshots_FnTable.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Callback; import com.sun.jna.Pointer; import com.sun.jna.Structure; diff --git a/jme3-vr/src/main/java/jopenvr/VR_IVRSettings_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRSettings_FnTable.java similarity index 99% rename from jme3-vr/src/main/java/jopenvr/VR_IVRSettings_FnTable.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRSettings_FnTable.java index e329c3b6b..4506a27d9 100644 --- a/jme3-vr/src/main/java/jopenvr/VR_IVRSettings_FnTable.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRSettings_FnTable.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Callback; import com.sun.jna.Pointer; import com.sun.jna.Structure; diff --git a/jme3-vr/src/main/java/jopenvr/VR_IVRSystem_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRSystem_FnTable.java similarity index 98% rename from jme3-vr/src/main/java/jopenvr/VR_IVRSystem_FnTable.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRSystem_FnTable.java index 6b04410db..4e275d9cc 100644 --- a/jme3-vr/src/main/java/jopenvr/VR_IVRSystem_FnTable.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRSystem_FnTable.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Callback; import com.sun.jna.Pointer; import com.sun.jna.Structure; @@ -31,7 +31,7 @@ public class VR_IVRSystem_FnTable extends Structure { /** C type : GetD3D9AdapterIndex_callback* */ public VR_IVRSystem_FnTable.GetD3D9AdapterIndex_callback GetD3D9AdapterIndex; /** C type : GetDXGIOutputInfo_callback* */ - public jopenvr.VR_IVRExtendedDisplay_FnTable.GetDXGIOutputInfo_callback GetDXGIOutputInfo; + public com.jme3.system.jopenvr.VR_IVRExtendedDisplay_FnTable.GetDXGIOutputInfo_callback GetDXGIOutputInfo; /** C type : IsDisplayOnDesktop_callback* */ public VR_IVRSystem_FnTable.IsDisplayOnDesktop_callback IsDisplayOnDesktop; /** C type : SetDisplayVisibility_callback* */ @@ -159,13 +159,13 @@ public class VR_IVRSystem_FnTable extends Structure { void apply(IntBuffer pnWidth, IntBuffer pnHeight); }; public interface GetProjectionMatrix_callback extends Callback { - jopenvr.HmdMatrix44_t.ByValue apply(int eEye, float fNearZ, float fFarZ, int eProjType); + com.jme3.system.jopenvr.HmdMatrix44_t.ByValue apply(int eEye, float fNearZ, float fFarZ, int eProjType); }; public interface GetProjectionRaw_callback extends Callback { void apply(int eEye, FloatByReference pfLeft, FloatByReference pfRight, FloatByReference pfTop, FloatByReference pfBottom); }; public interface ComputeDistortion_callback extends Callback { - jopenvr.DistortionCoordinates_t.ByValue apply(int eEye, float fU, float fV); + com.jme3.system.jopenvr.DistortionCoordinates_t.ByValue apply(int eEye, float fU, float fV); }; public interface GetEyeToHeadTransform_callback extends Callback { HmdMatrix34_t.ByValue apply(int eEye); @@ -292,7 +292,7 @@ public class VR_IVRSystem_FnTable extends Structure { Pointer apply(int eType); }; public interface GetHiddenAreaMesh_callback extends Callback { - jopenvr.HiddenAreaMesh_t.ByValue apply(int eEye); + com.jme3.system.jopenvr.HiddenAreaMesh_t.ByValue apply(int eEye); }; public interface GetControllerState_callback extends Callback { byte apply(int unControllerDeviceIndex, VRControllerState_t pControllerState); diff --git a/jme3-vr/src/main/java/jopenvr/VR_IVRTrackedCamera_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRTrackedCamera_FnTable.java similarity index 99% rename from jme3-vr/src/main/java/jopenvr/VR_IVRTrackedCamera_FnTable.java rename to jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRTrackedCamera_FnTable.java index c6d7253da..d9247f41e 100644 --- a/jme3-vr/src/main/java/jopenvr/VR_IVRTrackedCamera_FnTable.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRTrackedCamera_FnTable.java @@ -1,4 +1,4 @@ -package jopenvr; +package com.jme3.system.jopenvr; import com.sun.jna.Callback; import com.sun.jna.Pointer; import com.sun.jna.Structure; 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 index 3efa0d150..dfe19e906 100644 --- a/jme3-vr/src/main/java/com/jme3/system/lwjgl/LwjglContextVR.java +++ b/jme3-vr/src/main/java/com/jme3/system/lwjgl/LwjglContextVR.java @@ -44,6 +44,7 @@ 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; @@ -189,12 +190,10 @@ public abstract class LwjglContextVR implements JmeContext { throw new UnsupportedOperationException("Unsupported renderer: " + settings.getRenderer()); } - //FIXME: Needs LWJGL 3.1.0 - /* if (capabilities.GL_ARB_debug_output && settings.getBoolean("GraphicsDebug")) { ARBDebugOutput.glDebugMessageCallbackARB(new LwjglGLDebugOutputHandler(), 0); } - */ + renderer.setMainFrameBufferSrgb(settings.isGammaCorrection()); renderer.setLinearizeSrgbImages(settings.isGammaCorrection()); 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 index 4c8b91624..3918aeda6 100644 --- a/jme3-vr/src/main/java/com/jme3/system/lwjgl/LwjglWindowVR.java +++ b/jme3-vr/src/main/java/com/jme3/system/lwjgl/LwjglWindowVR.java @@ -245,8 +245,7 @@ public abstract class LwjglWindowVR extends LwjglContextVR implements Runnable { if (Type.Display.equals(type)) { glfwShowWindow(window); - //FIXME: Needs LGJGL 3.1.0 - //glfwFocusWindow(window); + glfwFocusWindow(window); } // Add a resize callback which delegates to the listener diff --git a/jme3-vr/src/main/java/jmevr/util/MeshUtil.java b/jme3-vr/src/main/java/jmevr/util/MeshUtil.java index 246f51938..986952b38 100644 --- a/jme3-vr/src/main/java/jmevr/util/MeshUtil.java +++ b/jme3-vr/src/main/java/jmevr/util/MeshUtil.java @@ -7,10 +7,9 @@ package jmevr.util; import com.jme3.app.VRApplication; import com.jme3.scene.Mesh; import com.jme3.scene.VertexBuffer; - -import jopenvr.DistortionCoordinates_t; -import jopenvr.JOpenVRLibrary; -import jopenvr.VR_IVRSystem_FnTable; +import com.jme3.system.jopenvr.DistortionCoordinates_t; +import com.jme3.system.jopenvr.JOpenVRLibrary; +import com.jme3.system.jopenvr.VR_IVRSystem_FnTable; /** * @@ -18,7 +17,7 @@ import jopenvr.VR_IVRSystem_FnTable; */ public class MeshUtil { - public static Mesh setupDistortionMesh(int eye) { + public static Mesh setupDistortionMesh(int eye, VRApplication application) { Mesh distortionMesh = new Mesh(); float m_iLensGridSegmentCountH = 43, m_iLensGridSegmentCountV = 43; @@ -46,7 +45,7 @@ public class MeshUtil { vertPos += 3; DistortionCoordinates_t dc0; - if( VRApplication.getVRHardware().getVRSystem() == null ) { + if( application.getVRHardware().getVRSystem() == null ) { // default to no distortion texcoordR[coordPos] = u; texcoordR[coordPos + 1] = 1 - v; @@ -55,7 +54,7 @@ public class MeshUtil { texcoordB[coordPos] = u; texcoordB[coordPos + 1] = 1 - v; } else { - dc0 = ((VR_IVRSystem_FnTable)VRApplication.getVRHardware().getVRSystem()).ComputeDistortion.apply(eye, u, v); + dc0 = ((VR_IVRSystem_FnTable)application.getVRHardware().getVRSystem()).ComputeDistortion.apply(eye, u, v); texcoordR[coordPos] = dc0.rfRed[0]; texcoordR[coordPos + 1] = 1 - dc0.rfRed[1]; diff --git a/jme3-vr/src/main/java/jmevr/util/VRGuiManager.java b/jme3-vr/src/main/java/jmevr/util/VRGuiManager.java index 33281e7d7..7d8ed7b48 100644 --- a/jme3-vr/src/main/java/jmevr/util/VRGuiManager.java +++ b/jme3-vr/src/main/java/jmevr/util/VRGuiManager.java @@ -36,14 +36,32 @@ public class VRGuiManager { MANUAL, AUTO_CAM_ALL, AUTO_CAM_ALL_SKIP_PITCH, AUTO_OBSERVER_POS_CAM_ROTATION, AUTO_OBSERVER_ALL, AUTO_OBSERVER_ALL_CAMHEIGHT } - private static Camera camLeft, camRight; - private static float guiDistance = 1.5f, guiScale = 1f, guiPositioningElastic; - private static POSITIONING_MODE posMode = POSITIONING_MODE.AUTO_CAM_ALL; + private Camera camLeft, camRight; + private float guiDistance = 1.5f, guiScale = 1f, guiPositioningElastic; + private POSITIONING_MODE posMode = POSITIONING_MODE.AUTO_CAM_ALL; - private static final Matrix3f orient = new Matrix3f(); - private static Vector2f screenSize; - protected static boolean wantsReposition; + private final Matrix3f orient = new Matrix3f(); + private Vector2f screenSize; + protected boolean wantsReposition; + private VRApplication application = null; + + /** + * Create a new GUI manager attached to the given application. + * @param application the VR application that this manager is attached to. + */ + public VRGuiManager(VRApplication application){ + this.application = application; + } + + /** + * Get the VR application to which this GUI manager is attached. + * @return the VR application to which this GUI manager is attached. + */ + public VRApplication getApplication(){ + return application; + } + /** * * Makes auto GUI positioning happen not immediately, but like an @@ -52,63 +70,64 @@ public class VRGuiManager { * * @param elastic amount of elasticity */ - public static void setPositioningElasticity(float elastic) { + public void setPositioningElasticity(float elastic) { guiPositioningElastic = elastic; } - public static float getPositioningElasticity() { + public float getPositioningElasticity() { return guiPositioningElastic; } - public static void setPositioningMode(POSITIONING_MODE mode) { + public void setPositioningMode(POSITIONING_MODE mode) { posMode = mode; } - public static Vector2f getCanvasSize() { + public Vector2f getCanvasSize() { if( screenSize == null ) { - if( VRApplication.isInVR() && VRApplication.getVRHardware() != null ) { + if( application.isInVR() && application.getVRHardware() != null ) { screenSize = new Vector2f(); - VRApplication.getVRHardware().getRenderSize(screenSize); - screenSize.multLocal(VRApplication.getVRViewManager().getResolutionMuliplier()); + application.getVRHardware().getRenderSize(screenSize); + screenSize.multLocal(application.getVRViewManager().getResolutionMuliplier()); } else { - AppSettings as = VRApplication.getMainVRApp().getContext().getSettings(); + AppSettings as = application.getContext().getSettings(); screenSize = new Vector2f(as.getWidth(), as.getHeight()); } } return screenSize; } - private static Vector2f ratio; - public static Vector2f getCanvasToWindowRatio() { + private Vector2f ratio; + + public Vector2f getCanvasToWindowRatio() { if( ratio == null ) { ratio = new Vector2f(); Vector2f canvas = getCanvasSize(); int width = Integer.min(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode().getWidth(), - VRApplication.getMainVRApp().getContext().getSettings().getWidth()); + application.getContext().getSettings().getWidth()); int height = Integer.min(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode().getHeight(), - VRApplication.getMainVRApp().getContext().getSettings().getHeight()); + application.getContext().getSettings().getHeight()); ratio.x = Float.max(1f, canvas.x / width); ratio.y = Float.max(1f, canvas.y / height); } return ratio; } - public static POSITIONING_MODE getPositioningMode() { + public POSITIONING_MODE getPositioningMode() { return posMode; } - public static void positionGui() { + public void positionGui() { wantsReposition = true; } - private static final Vector3f EoldPos = new Vector3f(); - private static final Quaternion EoldDir = new Quaternion(); - private static void positionTo(Vector3f pos, Quaternion dir, float tpf) { + private final Vector3f EoldPos = new Vector3f(); + private final Quaternion EoldDir = new Quaternion(); + private void positionTo(Vector3f pos, Quaternion dir, float tpf) { Vector3f guiPos = guiQuadNode.getLocalTranslation(); guiPos.set(0f, 0f, guiDistance); dir.mult(guiPos, guiPos); guiPos.x += pos.x; - guiPos.y += pos.y + VRApplication.getVRHeightAdjustment(); + guiPos.y += pos.y + application.getVRHeightAdjustment(); guiPos.z += pos.z; if( guiPositioningElastic > 0f && posMode != POSITIONING_MODE.MANUAL ) { // mix pos & dir with current pos & dir @@ -117,14 +136,15 @@ public class VRGuiManager { } } - protected static void updateGuiQuadGeometricState() { + protected void updateGuiQuadGeometricState() { guiQuadNode.updateGeometricState(); } - protected static void positionGuiNow(float tpf) { + protected void positionGuiNow(float tpf) { wantsReposition = false; - if( VRApplication.isInVR() == false ) return; + if( application.isInVR() == false ) return; guiQuadNode.setLocalScale(guiDistance * guiScale * 4f, 4f * guiDistance * guiScale, 1f); + switch( posMode ) { case MANUAL: case AUTO_CAM_ALL_SKIP_PITCH: @@ -135,9 +155,10 @@ public class VRGuiManager { positionTo(temppos, camLeft.getRotation(), tpf); } rotateScreenTo(camLeft.getRotation(), tpf); + break; case AUTO_OBSERVER_POS_CAM_ROTATION: - Object obs = VRApplication.getObserver(); + Object obs = application.getObserver(); if( obs != null ) { if( obs instanceof Camera ) { positionTo(((Camera)obs).getLocation(), camLeft.getRotation(), tpf); @@ -146,10 +167,11 @@ public class VRGuiManager { } } rotateScreenTo(camLeft.getRotation(), tpf); + break; case AUTO_OBSERVER_ALL: case AUTO_OBSERVER_ALL_CAMHEIGHT: - obs = VRApplication.getObserver(); + obs = application.getObserver(); if( obs != null ) { Quaternion q; if( obs instanceof Camera ) { @@ -164,14 +186,19 @@ public class VRGuiManager { } positionTo(temppos, q, tpf); rotateScreenTo(q, tpf); + } break; + } + + } - private static final Vector3f look = new Vector3f(), left = new Vector3f(), temppos = new Vector3f(), up = new Vector3f(); - private static final Quaternion tempq = new Quaternion(); - private static void rotateScreenTo(Quaternion dir, float tpf) { + private final Vector3f look = new Vector3f(), left = new Vector3f(), temppos = new Vector3f(), up = new Vector3f(); + private final Quaternion tempq = new Quaternion(); + + 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); @@ -186,24 +213,24 @@ public class VRGuiManager { } } - public static void setGuiDistance(float newGuiDistance) { + public void setGuiDistance(float newGuiDistance) { guiDistance = newGuiDistance; } - public static void setGuiScale(float scale) { + public void setGuiScale(float scale) { guiScale = scale; } - public static float getGuiDistance() { + public float getGuiDistance() { return guiDistance; } - public static void adjustGuiDistance(float adjustAmount) { + public void adjustGuiDistance(float adjustAmount) { guiDistance += adjustAmount; } - protected static void setupGui(Camera leftcam, Camera rightcam, ViewPort left, ViewPort right) { - if( VRApplication.hasTraditionalGUIOverlay() ) { + protected void setupGui(Camera leftcam, Camera rightcam, ViewPort left, ViewPort right) { + if( application.hasTraditionalGUIOverlay() ) { camLeft = leftcam; camRight = rightcam; Spatial guiScene = getGuiQuad(camLeft); @@ -216,32 +243,31 @@ public class VRGuiManager { /* do not use, set by preconfigure routine in VRApplication */ - public static void _enableCurvedSuface(boolean set) { + public void _enableCurvedSuface(boolean set) { useCurvedSurface = set; } /* do not use, set by preconfigure routine in VRApplication */ - public static void _enableGuiOverdraw(boolean set) { + public void _enableGuiOverdraw(boolean set) { overdraw = set; } - private static boolean useCurvedSurface = false, overdraw = false; - private static Geometry guiQuad; - private static Node guiQuadNode; - private static ViewPort offView; - private static Texture2D guiTexture; - private static Spatial getGuiQuad(Camera sourceCam){ + private boolean useCurvedSurface = false, overdraw = false; + private Geometry guiQuad; + private Node guiQuadNode; + private ViewPort offView; + private Texture2D guiTexture; + private Spatial getGuiQuad(Camera sourceCam){ if( guiQuadNode == null ) { - VRApplication sourceApp = VRApplication.getMainVRApp(); Vector2f guiCanvasSize = getCanvasSize(); Camera offCamera = sourceCam.clone(); offCamera.setParallelProjection(true); offCamera.setLocation(Vector3f.ZERO); offCamera.lookAt(Vector3f.UNIT_Z, Vector3f.UNIT_Y); - offView = sourceApp.getRenderManager().createPreView("GUI View", offCamera); + offView = application.getRenderManager().createPreView("GUI View", offCamera); offView.setClearFlags(true, true, true); offView.setBackgroundColor(ColorRGBA.BlackNoAlpha); @@ -261,15 +287,15 @@ public class VRGuiManager { offView.setOutputFrameBuffer(offBuffer); // setup framebuffer's scene - offView.attachScene(sourceApp.getGuiNode()); + offView.attachScene(application.getGuiNode()); if( useCurvedSurface ) { - guiQuad = (Geometry)VRApplication.getMainVRApp().getAssetManager().loadModel("jmevr/util/gui_mesh.j3o"); + guiQuad = (Geometry)application.getAssetManager().loadModel("Common/Util/gui_mesh.j3o"); } else { guiQuad = new Geometry("guiQuad", new CenterQuad(1f, 1f)); } - Material mat = new Material(sourceApp.getAssetManager(), "Common/MatDefs/VR/GuiOverlay.j3md"); + Material mat = new Material(application.getAssetManager(), "Common/MatDefs/VR/GuiOverlay.j3md"); mat.getAdditionalRenderState().setDepthTest(!overdraw); mat.getAdditionalRenderState().setBlendMode(BlendMode.Alpha); mat.getAdditionalRenderState().setDepthWrite(false); diff --git a/jme3-vr/src/main/java/jmevr/util/VRMouseManager.java b/jme3-vr/src/main/java/jmevr/util/VRMouseManager.java index df31c70ee..56d509ca4 100644 --- a/jme3-vr/src/main/java/jmevr/util/VRMouseManager.java +++ b/jme3-vr/src/main/java/jmevr/util/VRMouseManager.java @@ -5,6 +5,8 @@ */ package jmevr.util; +import java.util.logging.Logger; + import com.jme3.app.VRApplication; import com.jme3.input.MouseInput; import com.jme3.input.controls.AnalogListener; @@ -24,81 +26,110 @@ import com.jme3.ui.Picture; */ public class VRMouseManager { - private static final int AVERAGE_AMNT = 4; - private static int avgCounter; - - private static Picture mouseImage; - private static int recentCenterCount = 0; - private static final Vector2f cursorPos = new Vector2f(); - private static float ySize, sensitivity = 8f, acceleration = 2f; - private static final float[] lastXmv = new float[AVERAGE_AMNT], lastYmv = new float[AVERAGE_AMNT]; - private static boolean thumbstickMode; - private static float moveScale = 1f; - - private static float avg(float[] arr) { + private static final Logger logger = Logger.getLogger(VRMouseManager.class.getName()); + + private VRApplication application = null; + + private final int AVERAGE_AMNT = 4; + private int avgCounter; + + private Picture mouseImage; + private int recentCenterCount = 0; + private final Vector2f cursorPos = new Vector2f(); + private float ySize, sensitivity = 8f, acceleration = 2f; + private final float[] lastXmv = new float[AVERAGE_AMNT], lastYmv = new float[AVERAGE_AMNT]; + private boolean thumbstickMode; + private float moveScale = 1f; + + private float avg(float[] arr) { float amt = 0f; for(float f : arr) amt += f; return amt / arr.length; } - protected static void init() { + public VRMouseManager(VRApplication application){ + this.application = application; + } + + /** + * Get the VR application to which this mouse manager is attached. + * @return the VR application to which this mouse manager is attached. + */ + public VRApplication getApplication(){ + return application; + } + + protected void init() { + + logger.config("Initializing VR mouse manager."); + // load default mouseimage mouseImage = new Picture("mouse"); - setImage("jmevr/util/mouse.png"); + setImage("Common/Util/mouse.png"); // hide default cursor by making it invisible - MouseInput mi = VRApplication.getMainVRApp().getContext().getMouseInput(); + MouseInput mi = application.getContext().getMouseInput(); if( mi instanceof GlfwMouseInputVR ){ ((GlfwMouseInputVR)mi).hideActiveCursor(); } centerMouse(); } - public static void setThumbstickMode(boolean set) { + public void setThumbstickMode(boolean set) { thumbstickMode = set; } - public static boolean isThumbstickMode() { + public boolean isThumbstickMode() { return thumbstickMode; } - public static void setSpeed(float sensitivity, float acceleration) { - VRMouseManager.sensitivity = sensitivity; - VRMouseManager.acceleration = acceleration; + public void setSpeed(float sensitivity, float acceleration) { + this.sensitivity = sensitivity; + this.acceleration = acceleration; } - public static float getSpeedSensitivity() { + public float getSpeedSensitivity() { return sensitivity; } - public static float getSpeedAcceleration() { + public float getSpeedAcceleration() { return acceleration; } - public static void setMouseMoveScale(float set) { + public void setMouseMoveScale(float set) { moveScale = set; } - public static void setImage(String texture) { - if( VRApplication.isInVR() == false ) return; - Texture tex = VRApplication.getMainVRApp().getAssetManager().loadTexture(texture); - mouseImage.setTexture(VRApplication.getMainVRApp().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); + public void setImage(String texture) { + if( application.isInVR() == false ){ + Texture tex = application.getAssetManager().loadTexture(texture); + mouseImage.setTexture(application.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 = application.getAssetManager().loadTexture(texture); + mouseImage.setTexture(application.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); + } + } - public static void updateAnalogAsMouse(int inputIndex, AnalogListener mouseListener, String mouseXName, String mouseYName, float tpf) { + public void updateAnalogAsMouse(int inputIndex, AnalogListener mouseListener, String mouseXName, String mouseYName, float tpf) { // got a tracked controller to use as the "mouse" - if( VRApplication.isInVR() == false || - VRApplication.getVRinput() == null || - VRApplication.getVRinput().isInputDeviceTracking(inputIndex) == false ) return; + if( application.isInVR() == false || + application.getVRinput() == null || + application.getVRinput().isInputDeviceTracking(inputIndex) == false ) return; Vector2f tpDelta; if( thumbstickMode ) { - tpDelta = VRApplication.getVRinput().getAxis(inputIndex, VRInputType.ViveTrackpadAxis); + tpDelta = application.getVRinput().getAxis(inputIndex, VRInputType.ViveTrackpadAxis); } else { - tpDelta = VRApplication.getVRinput().getAxisDeltaSinceLastCall(inputIndex, VRInputType.ViveTrackpadAxis); + tpDelta = application.getVRinput().getAxisDeltaSinceLastCall(inputIndex, VRInputType.ViveTrackpadAxis); } float Xamount = (float)Math.pow(Math.abs(tpDelta.x) * sensitivity, acceleration); float Yamount = (float)Math.pow(Math.abs(tpDelta.y) * sensitivity, acceleration); @@ -109,13 +140,13 @@ public class VRMouseManager { 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( VRApplication.getMainVRApp().getInputManager().isCursorVisible() ) { + if( application.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 = VRGuiManager.getCanvasSize(); + Vector2f maxsize = application.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; @@ -123,39 +154,39 @@ public class VRMouseManager { } } - public static Vector2f getCursorPosition() { - if( VRApplication.isInVR() ) { + public Vector2f getCursorPosition() { + if( application.isInVR() ) { return cursorPos; } - return VRApplication.getMainVRApp().getInputManager().getCursorPosition(); + return application.getInputManager().getCursorPosition(); } - public static void centerMouse() { + public void centerMouse() { // set mouse in center of the screen if newly added - Vector2f size = VRGuiManager.getCanvasSize(); - MouseInput mi = VRApplication.getMainVRApp().getContext().getMouseInput(); - AppSettings as = VRApplication.getMainVRApp().getContext().getSettings(); + Vector2f size = application.getVRGUIManager().getCanvasSize(); + MouseInput mi = application.getContext().getMouseInput(); + AppSettings as = application.getContext().getSettings(); if( mi instanceof GlfwMouseInputVR ) ((GlfwMouseInputVR)mi).setCursorPosition((int)(as.getWidth() / 2f), (int)(as.getHeight() / 2f)); - if( VRApplication.isInVR() ) { + if( application.isInVR() ) { cursorPos.x = size.x / 2f; cursorPos.y = size.y / 2f; recentCenterCount = 2; } } - protected static void update(float tpf) { + protected void update(float tpf) { // if we are showing the cursor, add our picture as it - VRApplication vrapp = VRApplication.getMainVRApp(); - if( vrapp.getInputManager().isCursorVisible() ) { + + if( application.getInputManager().isCursorVisible() ) { if( mouseImage.getParent() == null ) { - VRApplication.getMainVRApp().getGuiNode().attachChild(mouseImage); + application.getGuiNode().attachChild(mouseImage); centerMouse(); // the "real" mouse pointer should stay hidden - org.lwjgl.glfw.GLFW.glfwSetInputMode(((LwjglWindowVR)VRApplication.getMainVRApp().getContext()).getWindowHandle(), + org.lwjgl.glfw.GLFW.glfwSetInputMode(((LwjglWindowVR)application.getContext()).getWindowHandle(), org.lwjgl.glfw.GLFW.GLFW_CURSOR, org.lwjgl.glfw.GLFW.GLFW_CURSOR_DISABLED); } // handle mouse movements, which may be in addition to (or exclusive from) tracked movement - MouseInput mi = VRApplication.getMainVRApp().getContext().getMouseInput(); + MouseInput mi = application.getContext().getMouseInput(); if( mi instanceof GlfwMouseInputVR ) { if( recentCenterCount <= 0 ) { //Vector2f winratio = VRGuiManager.getCanvasToWindowRatio(); @@ -163,14 +194,16 @@ public class VRMouseManager { cursorPos.y += ((GlfwMouseInputVR)mi).getLastDeltaY();// * winratio.y; if( cursorPos.x < 0f ) cursorPos.x = 0f; if( cursorPos.y < 0f ) cursorPos.y = 0f; - if( cursorPos.x > VRGuiManager.getCanvasSize().x ) cursorPos.x = VRGuiManager.getCanvasSize().x; - if( cursorPos.y > VRGuiManager.getCanvasSize().y ) cursorPos.y = VRGuiManager.getCanvasSize().y; + if( cursorPos.x > application.getVRGUIManager().getCanvasSize().x ) cursorPos.x = application.getVRGUIManager().getCanvasSize().x; + if( cursorPos.y > application.getVRGUIManager().getCanvasSize().y ) cursorPos.y = application.getVRGUIManager().getCanvasSize().y; } else recentCenterCount--; ((GlfwMouseInputVR)mi).clearDeltas(); } // ok, update the cursor graphic position Vector2f currentPos = getCursorPosition(); - mouseImage.setLocalTranslation(currentPos.x, currentPos.y - ySize, VRGuiManager.getGuiDistance() + 1f); + mouseImage.setLocalTranslation(currentPos.x, currentPos.y - ySize, application.getVRGUIManager().getGuiDistance() + 1f); + mouseImage.updateGeometricState(); + } else if( mouseImage.getParent() != null ) { mouseImage.removeFromParent(); } diff --git a/jme3-vr/src/main/java/jmevr/util/VRUtil.java b/jme3-vr/src/main/java/jmevr/util/VRUtil.java index a77a76b17..819baa04b 100644 --- a/jme3-vr/src/main/java/jmevr/util/VRUtil.java +++ b/jme3-vr/src/main/java/jmevr/util/VRUtil.java @@ -7,9 +7,10 @@ package jmevr.util; import com.jme3.math.FastMath; import com.jme3.math.Matrix4f; import com.jme3.math.Quaternion; +import com.jme3.system.jopenvr.HmdMatrix34_t; +import com.jme3.system.jopenvr.HmdMatrix44_t; + import java.util.concurrent.TimeUnit; -import jopenvr.HmdMatrix34_t; -import jopenvr.HmdMatrix44_t; /** * diff --git a/jme3-vr/src/main/java/jmevr/util/VRViewManager.java b/jme3-vr/src/main/java/jmevr/util/VRViewManager.java index 6cd3fb052..510d12601 100644 --- a/jme3-vr/src/main/java/jmevr/util/VRViewManager.java +++ b/jme3-vr/src/main/java/jmevr/util/VRViewManager.java @@ -28,6 +28,9 @@ import com.jme3.scene.Node; import com.jme3.scene.Spatial; import com.jme3.shadow.DirectionalLightShadowFilter; import com.jme3.shadow.VRDirectionalLightShadowRenderer; +import com.jme3.system.jopenvr.JOpenVRLibrary; +import com.jme3.system.jopenvr.Texture_t; +import com.jme3.system.jopenvr.VRTextureBounds_t; import com.jme3.system.lwjgl.LwjglWindow; import com.jme3.texture.FrameBuffer; import com.jme3.texture.Image; @@ -37,13 +40,9 @@ import com.jme3.ui.Picture; import com.sun.jna.Pointer; import com.sun.jna.ptr.PointerByReference; -import static com.jme3.app.VRApplication.isInVR; - import java.awt.GraphicsEnvironment; +import java.util.logging.Logger; -import jopenvr.JOpenVRLibrary; -import jopenvr.Texture_t; -import jopenvr.VRTextureBounds_t; import osvrrendermanageropengl.OSVR_RenderBufferOpenGL; import osvrrendermanageropengl.OSVR_ViewportDescription; import osvrrendermanageropengl.OsvrRenderManagerOpenGLLibrary; @@ -54,6 +53,8 @@ import osvrrendermanageropengl.OsvrRenderManagerOpenGLLibrary; */ public class VRViewManager { + private static final Logger logger = Logger.getLogger(VRViewManager.class.getName()); + private final VRApplication app; private Camera camLeft,camRight; private ViewPort viewPortLeft, viewPortRight; @@ -112,7 +113,7 @@ public class VRViewManager { private void initTextureSubmitStructs() { texTypeLeft = new Texture_t(); texTypeRight = new Texture_t(); - if( VRApplication.getVRHardware() instanceof OpenVR ) { + if( app.getVRHardware() instanceof OpenVR ) { texBoundsLeft = new VRTextureBounds_t(); texBoundsRight = new VRTextureBounds_t(); // left eye @@ -146,7 +147,7 @@ public class VRViewManager { texTypeRight.setAutoRead(false); texTypeRight.setAutoWrite(false); texTypeRight.handle = -1; - } else if( VRApplication.getVRHardware() instanceof OSVR ) { + } else if( app.getVRHardware() instanceof OSVR ) { // must be OSVR osvr_renderBuffer = new OSVR_RenderBufferOpenGL.ByValue[2]; osvr_renderBuffer[OSVR.EYE_LEFT] = new OSVR_RenderBufferOpenGL.ByValue(); @@ -182,16 +183,16 @@ public class VRViewManager { private void registerOSVRBuffer(OSVR_RenderBufferOpenGL.ByValue buf) { OsvrRenderManagerOpenGLLibrary.osvrRenderManagerStartRegisterRenderBuffers(grabRBS); OsvrRenderManagerOpenGLLibrary.osvrRenderManagerRegisterRenderBufferOpenGL(grabRBS.getValue(), buf); - OsvrRenderManagerOpenGLLibrary.osvrRenderManagerFinishRegisterRenderBuffers(((OSVR)VRApplication.getVRHardware()).getCompositor(), grabRBS.getValue(), (byte)0); + OsvrRenderManagerOpenGLLibrary.osvrRenderManagerFinishRegisterRenderBuffers(((OSVR)app.getVRHardware()).getCompositor(), grabRBS.getValue(), (byte)0); } public void sendTextures() { - if( isInVR() ) { - VRAPI api = VRApplication.getVRHardware(); + if( app.isInVR() ) { + VRAPI api = app.getVRHardware(); if( api.getCompositor() != null ) { // using the compositor... int errl = 0, errr = 0; - if( VRApplication.isInstanceVRRendering() ) { + if( app.isInstanceVRRendering() ) { if( texTypeLeft.handle == -1 || texTypeLeft.handle != getFullTexId() ) { texTypeLeft.handle = getFullTexId(); if( texTypeLeft.handle != -1 ) { @@ -268,32 +269,36 @@ public class VRViewManager { return viewPortRight; } - public void initialize(VRApplication app) { + public void initialize() { + + logger.config("Initializing VR view manager."); + initTextureSubmitStructs(); setupCamerasAndViews(); setupVRScene(); moveScreenProcessingToEyes(); - if( VRApplication.hasTraditionalGUIOverlay() ) { - VRMouseManager.init(); + if( app.hasTraditionalGUIOverlay() ) { + + app.getVRMouseManager().init(); + // update the pose to position the gui correctly on start update(0f); - VRGuiManager.positionGui(); + app.getVRGUIManager().positionGui(); } // if we are OSVR, our primary mirror window needs to be the same size as the render manager's output... - if( VRApplication.getVRHardware() instanceof OSVR ) { + if( app.getVRHardware() instanceof OSVR ) { int origWidth = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode().getWidth(); int origHeight = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode().getHeight(); - long window = ((LwjglWindow)VRApplication.getMainVRApp().getContext()).getWindowHandle(); + long window = ((LwjglWindow)app.getContext()).getWindowHandle(); Vector2f windowSize = new Vector2f(); - ((OSVR)VRApplication.getVRHardware()).getRenderSize(windowSize); + ((OSVR)app.getVRHardware()).getRenderSize(windowSize); windowSize.x = Math.max(windowSize.x * 2f, camLeft.getWidth()); org.lwjgl.glfw.GLFW.glfwSetWindowSize(window, (int)windowSize.x, (int)windowSize.y); - VRApplication.getMainVRApp().getContext().getSettings().setResolution((int)windowSize.x, (int)windowSize.y); - VRApplication.getMainVRApp().reshape((int)windowSize.x, (int)windowSize.y); + app.getContext().getSettings().setResolution((int)windowSize.x, (int)windowSize.y); + app.reshape((int)windowSize.x, (int)windowSize.y); org.lwjgl.glfw.GLFW.glfwSetWindowPos(window, origWidth - (int)windowSize.x, 32); - //FIXME: Need to update LWJGL - //org.lwjgl.glfw.GLFW.glfwFocusWindow(window); + org.lwjgl.glfw.GLFW.glfwFocusWindow(window); org.lwjgl.glfw.GLFW.glfwSetCursorPos(window, origWidth / 2.0, origHeight / 2.0); } @@ -310,7 +315,7 @@ public class VRViewManager { private void prepareCameraSize(Camera cam, float xMult) { Vector2f size = new Vector2f(); - VRAPI vrhmd = VRApplication.getVRHardware(); + VRAPI vrhmd = app.getVRHardware(); if( vrhmd == null ) { size.x = 1280f; @@ -326,7 +331,7 @@ public class VRViewManager { size.y = app.getContext().getSettings().getHeight(); } - if( VRApplication.isInstanceVRRendering() ) size.x *= 2f; + if( app.isInstanceVRRendering() ) size.x *= 2f; // other adjustments size.x *= xMult; @@ -341,7 +346,7 @@ public class VRViewManager { */ private void setupVRScene(){ // no special scene to setup if we are doing instancing - if( VRApplication.isInstanceVRRendering() ) { + if( app.isInstanceVRRendering() ) { // distortion has to be done with compositor here... we want only one pass on our end! if( app.getContext().getSettings().isSwapBuffers() ) { setupMirrorBuffers(app.getCamera(), dualEyeTex, true); @@ -359,17 +364,17 @@ public class VRViewManager { app.getViewPort().detachScene(app.getGuiNode()); // only setup distortion scene if compositor isn't running (or using custom mesh distortion option) - if( VRApplication.getVRHardware().getCompositor() == null ) { + if( app.getVRHardware().getCompositor() == null ) { Node distortionScene = new Node(); Material leftMat = new Material(app.getAssetManager(), "Common/MatDefs/VR/OpenVR.j3md"); leftMat.setTexture("Texture", leftEyeTex); - Geometry leftEye = new Geometry("box", MeshUtil.setupDistortionMesh(JOpenVRLibrary.EVREye.EVREye_Eye_Left)); + Geometry leftEye = new Geometry("box", MeshUtil.setupDistortionMesh(JOpenVRLibrary.EVREye.EVREye_Eye_Left, app)); leftEye.setMaterial(leftMat); distortionScene.attachChild(leftEye); Material rightMat = new Material(app.getAssetManager(), "Common/MatDefs/VR/OpenVR.j3md"); rightMat.setTexture("Texture", rightEyeTex); - Geometry rightEye = new Geometry("box", MeshUtil.setupDistortionMesh(JOpenVRLibrary.EVREye.EVREye_Eye_Right)); + Geometry rightEye = new Geometry("box", MeshUtil.setupDistortionMesh(JOpenVRLibrary.EVREye.EVREye_Eye_Right, app)); rightEye.setMaterial(rightMat); distortionScene.attachChild(rightEye); @@ -394,7 +399,7 @@ public class VRViewManager { public void update(float tpf) { // grab the observer - Object obs = VRApplication.getObserver(); + Object obs = app.getObserver(); Quaternion objRot; Vector3f objPos; if( obs instanceof Camera ) { @@ -405,7 +410,7 @@ public class VRViewManager { objPos = ((Spatial)obs).getWorldTranslation(); } // grab the hardware handle - VRAPI dev = VRApplication.getVRHardware(); + VRAPI dev = app.getVRHardware(); if( dev != null ) { // update the HMD's position & orientation dev.updatePose(); @@ -424,14 +429,14 @@ public class VRViewManager { camRight.setFrame(objPos, objRot); } - if( VRApplication.hasTraditionalGUIOverlay() ) { + if( app.hasTraditionalGUIOverlay() ) { // update the mouse? - VRMouseManager.update(tpf); + app.getVRMouseManager().update(tpf); // update GUI position? - if( VRGuiManager.wantsReposition || VRGuiManager.getPositioningMode() != VRGuiManager.POSITIONING_MODE.MANUAL ) { - VRGuiManager.positionGuiNow(tpf); - VRGuiManager.updateGuiQuadGeometricState(); + if( app.getVRGUIManager().wantsReposition || app.getVRGUIManager().getPositioningMode() != VRGuiManager.POSITIONING_MODE.MANUAL ) { + app.getVRGUIManager().positionGuiNow(tpf); + app.getVRGUIManager().updateGuiQuadGeometricState(); } } } @@ -449,8 +454,8 @@ public class VRViewManager { */ public void moveScreenProcessingToEyes() { if( viewPortRight == null ) return; - syncScreenProcessing(VRApplication.getMainVRApp().getViewPort()); - VRApplication.getMainVRApp().getViewPort().clearProcessors(); + syncScreenProcessing(app.getViewPort()); + app.getViewPort().clearProcessors(); } /* @@ -521,14 +526,14 @@ public class VRViewManager { float fNear = origCam.getFrustumNear(); // if we are using OSVR get the eye info here - if( VRApplication.getVRHardware() instanceof OSVR ) { - ((OSVR)VRApplication.getVRHardware()).getEyeInfo(); + if( app.getVRHardware() instanceof OSVR ) { + ((OSVR)app.getVRHardware()).getEyeInfo(); } // restore frustrum on distortion scene cam, if needed - if( VRApplication.isInstanceVRRendering() ) { + if( app.isInstanceVRRendering() ) { camLeft = origCam; - } else if( VRApplication.compositorAllowed() == false ) { + } else if( app.compositorAllowed() == false ) { origCam.setFrustumFar(100f); origCam.setFrustumNear(1f); camLeft = origCam.clone(); @@ -537,38 +542,38 @@ public class VRViewManager { camLeft = origCam.clone(); } - camLeft.setFrustumPerspective(VRApplication.DEFAULT_FOV, VRApplication.DEFAULT_ASPECT, fNear, fFar); + camLeft.setFrustumPerspective(app.DEFAULT_FOV, app.DEFAULT_ASPECT, fNear, fFar); prepareCameraSize(camLeft, 1f); - if( VRApplication.getVRHardware() != null ) camLeft.setProjectionMatrix(VRApplication.getVRHardware().getHMDMatrixProjectionLeftEye(camLeft)); + if( app.getVRHardware() != null ) camLeft.setProjectionMatrix(app.getVRHardware().getHMDMatrixProjectionLeftEye(camLeft)); //org.lwjgl.opengl.GL11.glEnable(org.lwjgl.opengl.GL30.GL_FRAMEBUFFER_SRGB); - if( VRApplication.isInstanceVRRendering() == false ) { + if( app.isInstanceVRRendering() == false ) { viewPortLeft = setupViewBuffers(camLeft, LEFT_VIEW_NAME); camRight = camLeft.clone(); - if( VRApplication.getVRHardware() != null ) camRight.setProjectionMatrix(VRApplication.getVRHardware().getHMDMatrixProjectionRightEye(camRight)); + if( app.getVRHardware() != null ) camRight.setProjectionMatrix(app.getVRHardware().getHMDMatrixProjectionRightEye(camRight)); viewPortRight = setupViewBuffers(camRight, RIGHT_VIEW_NAME); } else { viewPortLeft = app.getViewPort(); - viewPortLeft.attachScene(VRApplication.getMainVRApp().getRootNode()); + viewPortLeft.attachScene(app.getRootNode()); camRight = camLeft.clone(); - if( VRApplication.getVRHardware() != null ) camRight.setProjectionMatrix(VRApplication.getVRHardware().getHMDMatrixProjectionRightEye(camRight)); + if( app.getVRHardware() != null ) camRight.setProjectionMatrix(app.getVRHardware().getHMDMatrixProjectionRightEye(camRight)); org.lwjgl.opengl.GL11.glEnable(org.lwjgl.opengl.GL30.GL_CLIP_DISTANCE0); - //FIXME: Fix with JMonkey next release + //FIXME: [jme-vr] Fix with JMonkey next release //RenderManager._VRInstancing_RightCamProjection = camRight.getViewProjectionMatrix(); setupFinalFullTexture(app.getViewPort().getCamera()); } // setup gui - VRGuiManager.setupGui(camLeft, camRight, viewPortLeft, viewPortRight); + app.getVRGUIManager().setupGui(camLeft, camRight, viewPortLeft, viewPortRight); - if( VRApplication.getVRHardware() != null ) { + if( app.getVRHardware() != null ) { // call these to cache the results internally - VRApplication.getVRHardware().getHMDMatrixPoseLeftEye(); - VRApplication.getVRHardware().getHMDMatrixPoseRightEye(); + app.getVRHardware().getHMDMatrixPoseLeftEye(); + app.getVRHardware().getHMDMatrixPoseRightEye(); } } @@ -588,9 +593,11 @@ public class VRViewManager { } pic.setQueueBucket(Bucket.Opaque); pic.setTexture(app.getAssetManager(), (Texture2D)tex, false); - pic.updateGeometricState(); viewPort.attachScene(pic); viewPort.setOutputFrameBuffer(null); + + pic.updateGeometricState(); + return viewPort; } diff --git a/jme3-vr/src/main/java/jmevr/util/gui_mesh.j3o b/jme3-vr/src/main/resources/Common/Util/gui_mesh.j3o similarity index 100% rename from jme3-vr/src/main/java/jmevr/util/gui_mesh.j3o rename to jme3-vr/src/main/resources/Common/Util/gui_mesh.j3o diff --git a/jme3-vr/src/main/java/jmevr/util/gui_mesh.j3odata b/jme3-vr/src/main/resources/Common/Util/gui_mesh.j3odata similarity index 100% rename from jme3-vr/src/main/java/jmevr/util/gui_mesh.j3odata rename to jme3-vr/src/main/resources/Common/Util/gui_mesh.j3odata diff --git a/jme3-vr/src/main/java/jmevr/util/mouse.png b/jme3-vr/src/main/resources/Common/Util/mouse.png similarity index 100% rename from jme3-vr/src/main/java/jmevr/util/mouse.png rename to jme3-vr/src/main/resources/Common/Util/mouse.png