>();
+ private Timer timer = new NanoTimer();
+ private boolean paused = false, inputEnabled = true;
+ private InputManager inputManager;
+ private RenderManager renderManager;
+ private ViewPort viewPort;
+ private ViewPort guiViewPort;
+ private AssetManager assetManager;
+ private Renderer renderer;
+ private Listener listener;
+ private MouseInput mouseInput;
+ private KeyInput keyInput;
+ private JoyInput joyInput;
+ private TouchInput touchInput;
+
+ protected Node guiNode, rootNode;
+
+ private float fFar = 1000f, fNear = 1f;
+ private int xWin = 1280, yWin = 720;
+
+ //private static float distanceOfOptimization = 0f;
+
+ private static float resMult = 1f;
+
+ private static boolean useCompositor = true, compositorOS;
+ private final String RESET_HMD = "ResetHMD";
+
+ // no longer using LwjglCanvas, and this sometimes broke the graphics settings
+ /*static {
+ if( VR_IsHmdPresent() != 0 ) {
+ System.setProperty("sun.java2d.opengl", "True");
+ }
+ } */
+
+ /**
+ * Get the distance of optimization.
+ * @return the distance of optimization.
+ */
+ /*
+ public static float getOptimizationDistance() {
+ return distanceOfOptimization;
+ }
+ */
+
+ /**
+ * Set the frustrum values for the application.
+ * @param near the frustrum near value.
+ * @param far the frustrum far value.
+ */
+ public void setFrustrumNearFar(float near, float far) {
+ fNear = near;
+ fFar = far;
+ }
+
+ /**
+ * Set the mirror window size in pixel.
+ * @param width the width of the mirror window in pixel.
+ * @param height the height of the mirror window in pixel.
+ */
+ public void setMirrorWindowSize(int width, int height) {
+ xWin = width;
+ yWin = height;
+ }
+
+ /**
+ * Set the resolution multiplier.
+ * @param val the resolution multiplier.
+ */
+ public void setResolutionMultiplier(float val) {
+ resMult = val;
+ if( VRviewmanager != null ) VRviewmanager.setResolutionMultiplier(resMult);
+ }
+
+
+ /**
+ * Is the SteamVR compositor is active.
+ * @return true
if the SteamVR compositor is active and false
otherwise.
+ */
+ public static boolean compositorAllowed() {
+ return useCompositor && compositorOS;
+ }
+
+ /**
+ * Get if the system currently support VR.
+ * @return true
if the system currently support VR and false
otherwise.
+ */
+ public static boolean isOSVRSupported() {
+ return VRSupportedOS;
+ }
+
+ /**
+ * Simple update of the application, this method should contains {@link #getRootNode() root node} updates.
+ * This method is called by the {@link #update() update()} method and should not be called manually.
+ * @param tpf the application time.
+ */
+ public void simpleUpdate(float tpf) { }
+
+ /**
+ * Rendering callback of the application. This method is called by the {@link #update() update()} method and should not be called manually.
+ * @param renderManager the {@link RenderManager render manager}.
+ */
+ public void simpleRender(RenderManager renderManager) {
+ PreNormalCaching.resetCache();
+ }
+
+
+
+
+
+
+ /**
+ * 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
+ return the left viewport camera instead if we are in VR mode
+ */
+ @Override
+ public Camera getCamera() {
+ if( isInVR() && VRviewmanager != null && VRviewmanager.getCamLeft() != null ) {
+ return dummyCam;
+ }
+ return cam;
+ }
+
+ /**
+ * Get the application internal camera.
+ * @return the application internal camera.
+ * @see #getCamera()
+ */
+ public Camera getBaseCamera() {
+ return cam;
+ }
+
+
+ @Override
+ public JmeContext getContext(){
+ return context;
+ }
+
+ @Override
+ public AssetManager getAssetManager(){
+ return assetManager;
+ }
+
+ @Override
+ public InputManager getInputManager(){
+ return inputManager;
+ }
+
+ @Override
+ public AppStateManager getStateManager() {
+ return stateManager;
+ }
+
+ @Override
+ public RenderManager getRenderManager() {
+ return renderManager;
+ }
+
+ @Override
+ public Renderer getRenderer(){
+ return renderer;
+ }
+
+ @Override
+ public AudioRenderer getAudioRenderer() {
+ return audioRenderer;
+ }
+
+ @Override
+ public Listener getListener() {
+ return listener;
+ }
+
+ @Override
+ public Timer getTimer(){
+ return timer;
+ }
+
+ /**
+ * Handle the error given in parameters by creating a log entry and a dialog window. Internal use only.
+ */
+ public void handleError(String errMsg, Throwable t){
+ // Print error to log.
+ logger.log(Level.SEVERE, errMsg, t);
+ // Display error message on screen if not in headless mode
+ if (context.getType() != JmeContext.Type.Headless) {
+ if (t != null) {
+ JmeSystem.showErrorDialog(errMsg + "\n" + t.getClass().getSimpleName() +
+ (t.getMessage() != null ? ": " + t.getMessage() : ""));
+ } else {
+ JmeSystem.showErrorDialog(errMsg);
+ }
+ }
+
+ stop(); // stop the application
+ }
+
+
+ /**
+ * Force the focus gain for the application. Internal use only.
+ */
+ public void gainFocus(){
+ if (lostFocusBehavior != LostFocusBehavior.Disabled) {
+ if (lostFocusBehavior == LostFocusBehavior.PauseOnLostFocus) {
+ paused = false;
+ }
+ context.setAutoFlushFrames(true);
+ if (inputManager != null) {
+ inputManager.reset();
+ }
+ }
+ }
+
+ /**
+ * Force the focus lost for the application. Internal use only.
+ */
+ public void loseFocus(){
+ if (lostFocusBehavior != LostFocusBehavior.Disabled){
+ if (lostFocusBehavior == LostFocusBehavior.PauseOnLostFocus) {
+ paused = true;
+ }
+ context.setAutoFlushFrames(false);
+ }
+ }
+
+ /**
+ * Reshape the display window. Internal use only.
+ */
+ public void reshape(int w, int h){
+ if (renderManager != null) {
+ renderManager.notifyReshape(w, h);
+ }
+ }
+
+ /**
+ * Request the application to close. Internal use only.
+ */
+ public void requestClose(boolean esc){
+ context.destroy(false);
+ }
+
+ /**
+ * Set the {@link AppSettings display settings} to define the display created.
+ *
+ * Examples of display parameters include display frame {@link AppSettings#getWidth() width} and {@link AppSettings#getHeight() height},
+ * pixel {@link AppSettings#getBitsPerPixel() color bit depth}, {@link AppSettings#getDepthBits() z-buffer bits}, {@link AppSettings#getSamples() anti-aliasing samples}, {@link AppSettings#getFrequency() update frequency}, ...
+ * If this method is called while the application is already running, then
+ * {@link #restart() } must be called to apply the settings to the display.
+ *
+ * @param settings The settings to set.
+ */
+ public void setSettings(AppSettings settings){
+ this.settings = settings;
+ if (context != null && settings.useInput() != inputEnabled){
+ // may need to create or destroy input based
+ // on settings change
+ inputEnabled = !inputEnabled;
+ if (inputEnabled){
+ initInput();
+ }else{
+ destroyInput();
+ }
+ }else{
+ inputEnabled = settings.useInput();
+ }
+ }
+
+ /**
+ * Sets the {@link Timer} implementation that will be used for calculating
+ * frame times.
+ * By default, Application will use the Timer as returned by the current {@link JmeContext} implementation.
+ * @param timer the timer to use.
+ */
+ public void setTimer(Timer timer){
+ this.timer = timer;
+
+ if (timer != null) {
+ timer.reset();
+ }
+
+ if (renderManager != null) {
+ renderManager.setTimer(timer);
+ }
+ }
+
+
+ /**
+ * Determine the application's behavior when unfocused.
+ * @return The lost focus behavior of the application.
+ */
+ public LostFocusBehavior getLostFocusBehavior() {
+ return lostFocusBehavior;
+ }
+
+ /**
+ * Change the application's behavior when unfocused. By default, the application will
+ * {@link LostFocusBehavior#ThrottleOnLostFocus throttle the update loop}
+ * so as to not take 100% CPU usage when it is not in focus, e.g.
+ * alt-tabbed, minimized, or obstructed by another window.
+ *
+ * @param lostFocusBehavior The new {@link LostFocusBehavior lost focus behavior} to use.
+ */
+ public void setLostFocusBehavior(LostFocusBehavior lostFocusBehavior) {
+ this.lostFocusBehavior = lostFocusBehavior;
+ }
+
+ /**
+ * Get if the application has to pause then it lost the focus.
+ * @return true
if pause on lost focus is enabled, false
otherwise.
+ * @see #getLostFocusBehavior()
+ */
+ public boolean isPauseOnLostFocus() {
+ return getLostFocusBehavior() == LostFocusBehavior.PauseOnLostFocus;
+ }
+
+ /**
+ * Enable or disable pause on lost focus.
+ *
+ * By default, pause on lost focus is enabled.
+ * If enabled, the application will stop updating
+ * when it loses focus or becomes inactive (e.g. alt-tab).
+ * For online or real-time applications, this might not be preferable,
+ * so this feature should be set to disabled. For other applications,
+ * it is best to keep it on so that CPU usage is not used when
+ * not necessary.
+ *
+ * @param pauseOnLostFocus true
to enable pause on lost focus, false
+ * otherwise.
+ *
+ * @see #setLostFocusBehavior(com.jme3.app.LostFocusBehavior)
+ */
+ public void setPauseOnLostFocus(boolean pauseOnLostFocus) {
+ if (pauseOnLostFocus) {
+ setLostFocusBehavior(LostFocusBehavior.PauseOnLostFocus);
+ } else {
+ setLostFocusBehavior(LostFocusBehavior.Disabled);
+ }
+ }
+
+ @Override
+ public void start() {
+ // set some default settings in-case
+ // settings dialog is not shown
+ boolean loadSettings = false;
+ if (settings == null) {
+ setSettings(new AppSettings(true));
+ loadSettings = true;
+ }
+
+ GraphicsDevice defDev = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
+
+ if( isInVR() && !compositorAllowed() ) {
+ // "easy extended" mode
+ // TO-DO: JFrame was removed in LWJGL 3, need to use new GLFW library to pick "monitor" display of VR device
+ // first, find the VR device
+ GraphicsDevice VRdev = null;
+ GraphicsDevice[] devs = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();
+ // pick the display that isn't the default one
+ for(GraphicsDevice gd : devs) {
+ if( gd != defDev ) {
+ VRdev = gd;
+ break;
+ }
+ }
+ // did we get the VR device?
+ if( VRdev != null ) {
+ // set properties for VR acceleration
+ try {
+ java.awt.DisplayMode useDM = null;
+ int max = 0;
+ for(java.awt.DisplayMode dm : VRdev.getDisplayModes()) {
+ int check = dm.getHeight() + dm.getWidth() + dm.getRefreshRate() + dm.getBitDepth();
+ if( check > max ) {
+ max = check;
+ useDM = dm;
+ }
+ }
+ // create a window for the VR device
+ settings.setWidth(useDM.getWidth());
+ settings.setHeight(useDM.getHeight());
+ settings.setBitsPerPixel(useDM.getBitDepth());
+ settings.setFrequency(useDM.getRefreshRate());
+ settings.setSwapBuffers(true);
+ settings.setVSync(true); // allow vsync on this display
+ setSettings(settings);
+ //VRdev.setFullScreenWindow(VRwindow);
+ // make sure we are in the right display mode
+ if( VRdev.getDisplayMode().equals(useDM) == false ) {
+ VRdev.setDisplayMode(useDM);
+ }
+ // make a blank cursor to hide it
+ //BufferedImage cursorImg = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
+ //Cursor blankCursor = Toolkit.getDefaultToolkit().createCustomCursor(cursorImg, new Point(0, 0), "blank cursor");
+ //VRwindow.setCursor(blankCursor);
+ //jmeCanvas.getCanvas().setCursor(blankCursor);
+ //VRwindow.pack();
+ //VRwindow.setVisible(true);
+ //startCanvas();
+ return;
+ } catch(Exception e) {
+
+ }
+ }
+ }
+
+ if( !isInVR() ) {
+ // not in VR, show settings dialog
+ if( Platform.get() != Platform.MACOSX ) {
+ if (!JmeSystem.showSettingsDialog(settings, loadSettings)) {
+ return;
+ }
+ } else {
+ // GLFW workaround on macs
+ settings.setFrequency(defDev.getDisplayMode().getRefreshRate());
+ settings.setDepthBits(24);
+ settings.setVSync(true);
+ // try and read resolution from file in local dir
+ File resfile = new File("resolution.txt");
+ if( resfile.exists() ) {
+ try {
+ BufferedReader br = new BufferedReader(new FileReader(resfile));
+ settings.setWidth(Integer.parseInt(br.readLine()));
+ settings.setHeight(Integer.parseInt(br.readLine()));
+ try {
+ settings.setFullscreen(br.readLine().toLowerCase(Locale.ENGLISH).contains("full"));
+ } catch(Exception e) {
+ settings.setFullscreen(false);
+ }
+ br.close();
+ } catch(Exception e) {
+ settings.setWidth(1280);
+ settings.setHeight(720);
+ }
+ } else {
+ settings.setWidth(1280);
+ settings.setHeight(720);
+ settings.setFullscreen(false);
+ }
+ settings.setResizable(false);
+ }
+ settings.setSwapBuffers(true);
+ } else {
+ // use basic mirroring window, skip settings window
+ settings.setWidth(xWin);
+ settings.setHeight(yWin);
+ settings.setBitsPerPixel(24);
+ settings.setFrameRate(0); // never sleep in main loop
+ settings.setFrequency(VRhardware.getDisplayFrequency());
+ settings.setFullscreen(false);
+ settings.setVSync(false); // stop vsyncing on primary monitor!
+ settings.setSwapBuffers(!disableSwapBuffers || VRhardware instanceof OSVR);
+ settings.setTitle("Put Headset On Now: " + settings.getTitle());
+ settings.setResizable(true);
+ }
+
+ if( forceDisableMSAA ) {
+ // disable multisampling, which is more likely to break things than be useful
+ settings.setSamples(1);
+ }
+
+ // set opengl mode
+ if( tryOpenGL3 ) {
+ settings.setRenderer(AppSettings.LWJGL_OPENGL3);
+ } else {
+ settings.setRenderer(AppSettings.LWJGL_OPENGL2);
+ }
+
+ setSettings(settings);
+ start(JmeContext.Type.Display, false);
+
+ // disable annoying warnings about GUI stuff being updated, which is normal behavior
+ // for late GUI placement for VR purposes
+ Logger.getLogger("com.jme3").setLevel(Level.SEVERE);
+ }
+
+ /**
+ * Starts the application in {@link com.jme3.system.JmeContext.Type#Display display} mode.
+ * @param waitFor if true
, the method will wait until the application is started.
+ * @see #start(com.jme3.system.JmeContext.Type, boolean)
+ */
+ public void start(boolean waitFor){
+ start(JmeContext.Type.Display, waitFor);
+ }
+
+ /**
+ * Starts the application.
+ * Creating a rendering context and executing the main loop in a separate thread.
+ * @param contextType the {@link com.jme3.system.JmeContext.Type type} of the context to create.
+ * @param waitFor if true
, the method will wait until the application is started.
+ * @throws IllegalArgumentException if the context type is not supported.
+ */
+ public void start(JmeContext.Type contextType, boolean waitFor){
+ if (context != null && context.isCreated()){
+ logger.warning("start() called when application already created!");
+ return;
+ }
+
+ if (settings == null){
+ settings = new AppSettings(true);
+ }
+
+ logger.log(Level.FINE, "Starting application: {0}", getClass().getName());
+
+ // Create VR decicated context
+ if (contextType == Type.Display){
+ context = new LwjglDisplayVR();
+ context.setSettings(settings);
+ } else if (contextType == Type.OffscreenSurface){
+ context = new LwjglOffscreenBufferVR();
+ context.setSettings(settings);
+ } else {
+ logger.severe("Unsupported context type \""+contextType+"\". Supported are \"Display\" and \"OffscreenSurface\"");
+ throw new IllegalArgumentException("Unsupported context type \""+contextType+"\". Supported are \"Display\" and \"OffscreenSurface\"");
+ }
+
+ context.setSystemListener(this);
+ context.create(waitFor);
+ }
+
+ /**
+ * Set VR application {@link PreconfigParameter specific parameter}.
+ * If making changes to default values, this must be called before the VRApplication starts
+ * @param parm the parameter to set.
+ * @param value the value of the parameter.
+ */
+ public void preconfigureVRApp(PreconfigParameter parm, boolean value) {
+ switch( parm ) {
+ case SET_GUI_OVERDRAW:
+ VRGuiManager._enableGuiOverdraw(value);
+ break;
+ case SET_GUI_CURVED_SURFACE:
+ VRGuiManager._enableCurvedSuface(value);
+ break;
+ case FORCE_VR_MODE:
+ forceVR = value;
+ break;
+ //case USE_CUSTOM_DISTORTION: //deprecated, always using a render manager
+ // VRViewManager._setCustomDistortion(value);
+ // break;
+ case USE_VR_COMPOSITOR:
+ VRApplication.useCompositor = value;
+ if( value == false ) disableSwapBuffers = false;
+ break;
+ case FLIP_EYES:
+ if( VRhardware == null ) return;
+ VRhardware._setFlipEyes(value);
+ break;
+ case INSTANCE_VR_RENDERING:
+ instanceVR = value;
+ break;
+ case ENABLE_MIRROR_WINDOW:
+ if( VRApplication.useCompositor == false ) {
+ disableSwapBuffers = false;
+ } else disableSwapBuffers = !value;
+ break;
+ case PREFER_OPENGL3:
+ tryOpenGL3 = value;
+ break;
+ case DISABLE_VR:
+ DISABLE_VR = value;
+ break;
+ case NO_GUI:
+ nogui = value;
+ break;
+ case SEATED_EXPERIENCE:
+ seated = value;
+ break;
+ case FORCE_DISABLE_MSAA:
+ forceDisableMSAA = value;
+ break;
+ }
+ }
+
+ /**
+ * Can be used to change seated experience during runtime.
+ * @param isSeated true
if designed for sitting, false
for standing/roomscale
+ * @see #isSeatedExperience()
+ */
+ public static void setSeatedExperience(boolean isSeated) {
+ seated = isSeated;
+ if( VRhardware instanceof OpenVR ) {
+ if( VRhardware.getCompositor() == null ) return;
+ if( seated ) {
+ ((OpenVR)VRhardware).getCompositor().SetTrackingSpace.apply(JOpenVRLibrary.ETrackingUniverseOrigin.ETrackingUniverseOrigin_TrackingUniverseSeated);
+ } else {
+ ((OpenVR)VRhardware).getCompositor().SetTrackingSpace.apply(JOpenVRLibrary.ETrackingUniverseOrigin.ETrackingUniverseOrigin_TrackingUniverseStanding);
+ }
+ }
+ }
+
+ /**
+ * Check if the application is configured as a seated experience.
+ * @return true
if the application is configured as a seated experience and false
otherwise.
+ * @see #setSeatedExperience(boolean)
+ */
+ public static boolean isSeatedExperience() {
+ return seated;
+ }
+
+ /**
+ * Reset headset pose if seating experience.
+ */
+ public static 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() {
+ return instanceVR && isInVR();
+ }
+
+ /**
+ * Check if the VR mode is enabled.
+ * @return true
if the VR mode is enabled and false
otherwise.
+ */
+ public static boolean isInVR() {
+ return DISABLE_VR == false && (forceVR || VRSupportedOS && VRhardware != null && VRhardware.isInitialized());
+ }
+
+ /**
+ * Move filters from the main scene into the eye's.
+ * This removes filters from the main scene.
+ */
+ public static void moveScreenProcessingToVR() {
+ if( isInVR() ) {
+ VRviewmanager.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.
+ */
+ public Node getGuiNode(){
+ return guiNode;
+ }
+
+ /**
+ * Get the root node of the application.
+ * @return the root node of the application.
+ */
+ public Node getRootNode() {
+ return rootNode;
+ }
+
+ /**
+ * Check if the application has a GUI overlay attached.
+ * @return true
if the application has a GUI overlay attached and false
otherwise.
+ */
+ public static boolean hasTraditionalGUIOverlay() {
+ return !nogui;
+ }
+
+
+ /**
+ * Get the scene observer. If no observer has been set, this method return the application {@link #getCamera() camera}.
+ * @return the scene observer.
+ * @see #setObserver(Spatial)
+ */
+ public static Object getObserver() {
+ if( observer == null ) {
+ return mainApp.getCamera();
+ }
+ return observer;
+ }
+
+ /**
+ * Set the scene observer. The VR headset will be linked to it. If no observer is set, the VR headset is linked to the the application {@link #getCamera() camera}.
+ * @param observer the scene observer.
+ */
+ public static void setObserver(Spatial observer) {
+ VRApplication.observer = observer;
+ }
+
+ /**
+ * Get the VR view manager.
+ * @return the VR view manager.
+ */
+ public static VRViewManager getVRViewManager() {
+ return VRviewmanager;
+ }
+
+ /*
+ where is the headset pointing, after all rotations are combined?
+ depends on observer rotation, if any
+ */
+ private static Quaternion tempq = new Quaternion();
+
+ /**
+ * Get the observer final rotation within the scene.
+ * @return the observer final rotation within the scene.
+ * @see #getFinalObserverPosition()
+ */
+ public static Quaternion getFinalObserverRotation() {
+ if( VRviewmanager == null ) {
+ if( VRApplication.observer == null ) {
+ return mainApp.getCamera().getRotation();
+ } else return VRApplication.observer.getWorldRotation();
+ }
+ if( VRApplication.observer == null ) {
+ tempq.set(dummyCam.getRotation());
+ } else {
+ tempq.set(VRApplication.observer.getWorldRotation());
+ }
+ return tempq.multLocal(VRhardware.getOrientation());
+ }
+
+ /**
+ * Get the observer final position within the scene.
+ * @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();
+ }
+ Vector3f pos = VRhardware.getPosition();
+ if( VRApplication.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());
+ }
+ }
+
+ /**
+ * Set the VR headset height from the ground.
+ * @param amount the VR headset height from the ground.
+ * @see #getVRHeightAdjustment()
+ */
+ public static void setVRHeightAdjustment(float amount) {
+ if( VRviewmanager != null ) VRviewmanager.setHeightAdjustment(amount);
+ }
+
+ /**
+ * Get the VR headset height from the ground.
+ * @return the VR headset height from the ground.
+ * @see #setVRHeightAdjustment(float)
+ */
+ public static float getVRHeightAdjustment() {
+ if( VRviewmanager != null ) return VRviewmanager.getHeightAdjustment();
+ return 0f;
+ }
+
+ /**
+ * Get the VR headset left viewport.
+ * @return the VR headset left viewport.
+ * @see #getRightViewPort()
+ */
+ public static ViewPort getLeftViewPort() {
+ if( VRviewmanager == null ) return mainApp.getViewPort();
+ return VRviewmanager.getViewPortLeft();
+ }
+
+ /**
+ * Get the VR headset right viewport.
+ * @return the VR headset right viewport.
+ * @see #getLeftViewPort()
+ */
+ public static ViewPort getRightViewPort() {
+ if( VRviewmanager == null ) return mainApp.getViewPort();
+ return VRviewmanager.getViewPortRight();
+ }
+
+
+ /**
+ * 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);
+ }
+ }
+
+ /**
+ * 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)}
+ */
+ protected void runQueuedTasks() {
+ AppTask> task;
+ while( (task = taskQueue.poll()) != null ) {
+ if (!task.isCancelled()) {
+ task.invoke();
+ }
+ }
+ }
+
+ @Override
+ public void update() {
+ // Make sure the audio renderer is available to callables
+ AudioContext.setAudioRenderer(audioRenderer);
+
+ runQueuedTasks();
+
+ if (speed != 0 && !paused) {
+
+ timer.update();
+
+ if (inputEnabled){
+ inputManager.update(timer.getTimePerFrame());
+ }
+
+ if (audioRenderer != null){
+ audioRenderer.update(timer.getTimePerFrame());
+ }
+ }
+
+ if (speed == 0 || paused) {
+ try {
+ Thread.sleep(50); // throttle the CPU when paused
+ } catch (InterruptedException ex) {
+ Logger.getLogger(SimpleApplication.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ return;
+ }
+
+ float tpf = timer.getTimePerFrame() * speed;
+
+ // update states
+ stateManager.update(tpf);
+
+ // simple update and root node
+ simpleUpdate(tpf);
+
+ rootNode.updateLogicalState(tpf);
+ guiNode.updateLogicalState(tpf);
+
+ rootNode.updateGeometricState();
+
+ if( VRApplication.isInVR() == false || VRGuiManager.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();
+ }
+ }
+
+ private void initAssetManager(){
+ URL assetCfgUrl = null;
+
+ if (settings != null){
+ String assetCfg = settings.getString("AssetConfigURL");
+ if (assetCfg != null){
+ try {
+ assetCfgUrl = new URL(assetCfg);
+ } catch (MalformedURLException ex) {
+ }
+ if (assetCfgUrl == null) {
+ assetCfgUrl = LegacyApplication.class.getClassLoader().getResource(assetCfg);
+ if (assetCfgUrl == null) {
+ logger.log(Level.SEVERE, "Unable to access AssetConfigURL in asset config:{0}", assetCfg);
+ return;
+ }
+ }
+ }
+ }
+ if (assetCfgUrl == null) {
+ assetCfgUrl = JmeSystem.getPlatformAssetConfigURL();
+ }
+ if (assetManager == null){
+ assetManager = JmeSystem.newAssetManager(assetCfgUrl);
+ logger.config("Created asset manager from "+assetCfgUrl);
+ }
+ }
+
+
+ private void initDisplay(){
+ // aquire important objects
+ // from the context
+ settings = context.getSettings();
+
+ // Only reset the timer if a user has not already provided one
+ if (timer == null) {
+ timer = context.getTimer();
+ }
+
+ renderer = context.getRenderer();
+ }
+
+ private void initAudio(){
+ if (settings.getAudioRenderer() != null && context.getType() != JmeContext.Type.Headless){
+ audioRenderer = JmeSystem.newAudioRenderer(settings);
+ audioRenderer.initialize();
+ AudioContext.setAudioRenderer(audioRenderer);
+
+ listener = new Listener();
+ audioRenderer.setListener(listener);
+ }
+ }
+
+ /**
+ * Creates the camera to use for rendering. Default values are perspective
+ * projection with 45° field of view, with near and far values 1 and 1000
+ * units respectively.
+ */
+ private void initCamera(){
+ cam = new Camera(settings.getWidth(), settings.getHeight());
+
+ cam.setFrustumPerspective(45f, (float)cam.getWidth() / cam.getHeight(), 1f, 1000f);
+ cam.setLocation(new Vector3f(0f, 0f, 10f));
+ cam.lookAt(new Vector3f(0f, 0f, 0f), Vector3f.UNIT_Y);
+
+ renderManager = new RenderManager(renderer);
+ //Remy - 09/14/2010 setted the timer in the renderManager
+ renderManager.setTimer(timer);
+
+ viewPort = renderManager.createMainView("Default", cam);
+ viewPort.setClearFlags(true, true, true);
+
+ // Create a new cam for the gui
+ Camera guiCam = new Camera(settings.getWidth(), settings.getHeight());
+ guiViewPort = renderManager.createPostView("Gui Default", guiCam);
+ guiViewPort.setClearFlags(false, false, false);
+ }
+
+ /**
+ * Initializes mouse and keyboard input. Also
+ * initializes joystick input if joysticks are enabled in the
+ * AppSettings.
+ */
+ private void initInput(){
+ mouseInput = context.getMouseInput();
+ if (mouseInput != null)
+ mouseInput.initialize();
+
+ keyInput = context.getKeyInput();
+ if (keyInput != null)
+ keyInput.initialize();
+
+ touchInput = context.getTouchInput();
+ if (touchInput != null)
+ touchInput.initialize();
+
+ if (!settings.getBoolean("DisableJoysticks")){
+ joyInput = context.getJoyInput();
+ if (joyInput != null)
+ joyInput.initialize();
+ }
+
+ inputManager = new InputManager(mouseInput, keyInput, joyInput, touchInput);
+ }
+
+ private void initStateManager(){
+ stateManager = new AppStateManager(this);
+
+ // Always register a ResetStatsState to make sure
+ // that the stats are cleared every frame
+ stateManager.attach(new ResetStatsState());
+ }
+
+ /**
+ * Do not call manually.
+ * Callback from ContextListener.
+ *
+ * Initializes the Application
, by creating a display and
+ * default camera. If display settings are not specified, a default
+ * 640x480 display is created. Default values are used for the camera;
+ * perspective projection with 45° field of view, with near
+ * and far values 1 and 1000 units respectively.
+ */
+ private void initialize_internal(){
+ if (assetManager == null){
+ initAssetManager();
+ }
+
+ initDisplay();
+ initCamera();
+
+ if (inputEnabled){
+ initInput();
+ }
+ initAudio();
+
+ // update timer so that the next delta is not too large
+// timer.update();
+ timer.reset();
+
+ // user code here..
+ }
+
+ @Override
+ public void initialize() {
+ initialize_internal();
+ cam.setFrustumFar(fFar);
+ cam.setFrustumNear(fNear);
+ dummyCam = cam.clone();
+ if( isInVR() ) {
+ if( VRhardware != null ) {
+ VRhardware.initVRCompositor(compositorAllowed());
+ }
+ VRviewmanager = new VRViewManager(this);
+ VRviewmanager.setResolutionMultiplier(resMult);
+ inputManager.addMapping(RESET_HMD, new KeyTrigger(KeyInput.KEY_F9));
+ setLostFocusBehavior(LostFocusBehavior.Disabled);
+ } else {
+ viewPort.attachScene(rootNode);
+ guiViewPort.attachScene(guiNode);
+ }
+
+ if( VRviewmanager != null ) {
+ VRviewmanager.initialize(this);
+ }
+
+ simpleInitApp();
+
+ // any filters created, move them now
+ if( VRviewmanager != null ) {
+ VRviewmanager.moveScreenProcessingToEyes();
+
+ // print out camera information
+ if( isInVR() ) {
+ logger.info("VR Initialization Information");
+ if( VRviewmanager.getCamLeft() != null ){
+ logger.info("camLeft: " + VRviewmanager.getCamLeft().toString());
+ }
+
+ if( VRviewmanager.getCamRight() != null ){
+ logger.info("camRight: " + VRviewmanager.getCamRight().toString());
+ }
+ }
+ }
+ }
+
+ /**
+ * Initialize the application. This method has to be overridden by implementations.
+ */
+ public abstract void simpleInitApp();
+
+ /**
+ * Destroy the application (release all resources).
+ */
+ public void destroy() {
+ if( VRhardware != null ) {
+ VRhardware.destroy();
+ VRhardware = null;
+ }
+ DISABLE_VR = true;
+ stateManager.cleanup();
+
+ destroyInput();
+ if (audioRenderer != null)
+ audioRenderer.cleanup();
+
+ timer.reset();
+ Runtime.getRuntime().exit(0);
+ }
+
+ protected void destroyInput(){
+ if (mouseInput != null)
+ mouseInput.destroy();
+
+ if (keyInput != null)
+ keyInput.destroy();
+
+ if (joyInput != null)
+ joyInput.destroy();
+
+ if (touchInput != null)
+ touchInput.destroy();
+
+ inputManager = null;
+ }
+
+ @Override
+ public ViewPort getGuiViewPort() {
+ return guiViewPort;
+ }
+
+ @Override
+ public ViewPort getViewPort() {
+ return viewPort;
+ }
+
+ @Override
+ public Future enqueue(Callable callable) {
+ AppTask task = new AppTask(callable);
+ taskQueue.add(task);
+ return task;
+ }
+
+ /**
+ * Enqueues a runnable object to execute in the jME3
+ * rendering thread.
+ *
+ * Runnables are executed right at the beginning of the main loop.
+ * They are executed even if the application is currently paused
+ * or out of focus.
+ *
+ * @param runnable The runnable to run in the main jME3 thread
+ */
+ public void enqueue(Runnable runnable){
+ enqueue(new RunnableWrapper(runnable));
+ }
+
+ private class RunnableWrapper implements Callable{
+ private final Runnable runnable;
+
+ public RunnableWrapper(Runnable runnable){
+ this.runnable = runnable;
+ }
+
+ @Override
+ public Object call(){
+ runnable.run();
+ return null;
+ }
+
+ }
+
+ /**
+ * Requests the context to close, shutting down the main loop
+ * and making necessary cleanup operations.
+ *
+ * Same as calling stop(false)
+ *
+ * @see #stop(boolean)
+ */
+ @Override
+ public void stop(){
+ stop(false);
+ }
+
+ /**
+ * Requests the context to close, shutting down the main loop
+ * and making necessary cleanup operations.
+ * After the application has stopped, it cannot be used anymore.
+ */
+ @Override
+ public void stop(boolean waitFor){
+ logger.log(Level.FINE, "Closing application: {0}", getClass().getName());
+ context.destroy(waitFor);
+ }
+
+ /**
+ * Restarts the context, applying any changed settings.
+ *
+ * Changes to the {@link AppSettings} of this Application are not
+ * applied immediately; calling this method forces the context
+ * to restart, applying the new settings.
+ */
+ @Override
+ public void restart(){
+ context.setSettings(settings);
+ context.restart();
+ }
+
+ /**
+ * Sets an AppProfiler hook that will be called back for
+ * specific steps within a single update frame. Value defaults
+ * to null.
+ */
+
+ public void setAppProfiler(AppProfiler prof) {
+ return;
+ }
+
+ /**
+ * Returns the current AppProfiler hook, or null if none is set.
+ */
+ public AppProfiler getAppProfiler() {
+ return null;
+ }
+}
\ No newline at end of file
diff --git a/jme3-vr/src/main/java/com/jme3/input/lwjgl/GlfwKeyInputVR.java b/jme3-vr/src/main/java/com/jme3/input/lwjgl/GlfwKeyInputVR.java
new file mode 100644
index 000000000..900d8b676
--- /dev/null
+++ b/jme3-vr/src/main/java/com/jme3/input/lwjgl/GlfwKeyInputVR.java
@@ -0,0 +1,142 @@
+package com.jme3.input.lwjgl;
+
+/*
+ * Copyright (c) 2009-2012 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import com.jme3.input.KeyInput;
+import com.jme3.input.RawInputListener;
+import com.jme3.input.event.KeyInputEvent;
+import com.jme3.system.lwjgl.LwjglWindowVR;
+
+import org.lwjgl.glfw.GLFWKeyCallback;
+
+import java.util.LinkedList;
+import java.util.Queue;
+import java.util.logging.Logger;
+
+import static org.lwjgl.glfw.GLFW.*;
+
+/**
+ * A key input that wraps GLFW underlying components.
+ * @author reden - phr00t - https://github.com/phr00t
+ * @author Julien Seinturier - (c) 2016 - JOrigin project - http:/www.jorigin.org
+ *
+ */
+public class GlfwKeyInputVR implements KeyInput {
+
+ private static final Logger logger = Logger.getLogger(GlfwKeyInput.class.getName());
+
+ private LwjglWindowVR context;
+ private RawInputListener listener;
+ private boolean initialized, shift_pressed;
+ private GLFWKeyCallback keyCallback;
+ private Queue keyInputEvents = new LinkedList();
+
+ /**
+ * Create a new input attached to the given {@link LwjglWindowVR context}.
+ * @param context the context to attach to this input.
+ */
+ public GlfwKeyInputVR(LwjglWindowVR context) {
+ this.context = context;
+ }
+
+ public void initialize() {
+ if (!context.isRenderable()) {
+ return;
+ }
+
+ glfwSetKeyCallback(context.getWindowHandle(), keyCallback = new GLFWKeyCallback() {
+ @Override
+ public void invoke(long window, int key, int scancode, int action, int mods) {
+ scancode = GlfwKeyMap.toJmeKeyCode(key);
+ if( key == GLFW_KEY_LEFT_SHIFT || key == GLFW_KEY_RIGHT_SHIFT ) {
+ shift_pressed = (action == GLFW_PRESS);
+ } else if( key >= 'A' && key <= 'Z' && !shift_pressed ) {
+ key += 32; // make lowercase
+ } else if( key >= 'a' && key <= 'z' && shift_pressed ) {
+ key -= 32; // make uppercase
+ }
+ final KeyInputEvent evt = new KeyInputEvent(scancode, (char) key, GLFW_PRESS == action, GLFW_REPEAT == action);
+ evt.setTime(getInputTimeNanos());
+ keyInputEvents.add(evt);
+ }
+ });
+
+ glfwSetInputMode(context.getWindowHandle(), GLFW_STICKY_KEYS, 1);
+
+ initialized = true;
+ logger.fine("Keyboard created.");
+ }
+
+ /**
+ * Get the key count.
+ * @return the key count.
+ */
+ public int getKeyCount() {
+ // This might not be correct
+ return GLFW_KEY_LAST - GLFW_KEY_SPACE;
+ }
+
+ public void update() {
+ if (!context.isRenderable()) {
+ return;
+ }
+
+ while (!keyInputEvents.isEmpty()) {
+ listener.onKeyEvent(keyInputEvents.poll());
+ }
+ }
+
+ public void destroy() {
+ if (!context.isRenderable()) {
+ return;
+ }
+
+ //FIXME: Needs LWJGL 3.1.0
+ //keyCallback.free();
+ keyCallback.release();
+
+ logger.fine("Keyboard destroyed.");
+ }
+
+ public boolean isInitialized() {
+ return initialized;
+ }
+
+ public void setInputListener(RawInputListener listener) {
+ this.listener = listener;
+ }
+
+ public long getInputTimeNanos() {
+ return (long) (glfwGetTime() * 1000000000);
+ }
+}
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
new file mode 100644
index 000000000..22759db29
--- /dev/null
+++ b/jme3-vr/src/main/java/com/jme3/input/lwjgl/GlfwMouseInputVR.java
@@ -0,0 +1,334 @@
+package com.jme3.input.lwjgl;
+
+/*
+ * Copyright (c) 2009-2012 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import com.jme3.cursors.plugins.JmeCursor;
+import com.jme3.input.MouseInput;
+import com.jme3.input.RawInputListener;
+import com.jme3.input.event.MouseButtonEvent;
+import com.jme3.input.event.MouseMotionEvent;
+import com.jme3.system.lwjgl.LwjglWindowVR;
+import com.jme3.util.BufferUtils;
+
+import org.lwjgl.glfw.GLFWCursorPosCallback;
+import org.lwjgl.glfw.GLFWMouseButtonCallback;
+import org.lwjgl.glfw.GLFWScrollCallback;
+
+import java.nio.ByteBuffer;
+import java.nio.IntBuffer;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.Map;
+import java.util.Queue;
+import java.util.logging.Logger;
+
+import static org.lwjgl.glfw.GLFW.*;
+import org.lwjgl.glfw.GLFWImage;
+import org.lwjgl.system.MemoryUtil;
+
+/**
+ * Captures mouse input using GLFW callbacks. It then temporarily stores these in event queues which are processed in the
+ * {@link #update()} method. Due to some of the GLFW button id's there is a conversion method in this class which will
+ * convert the GLFW left, middle and right mouse button to JME3 left, middle and right button codes.
+ * This class support modifications dedicated to VR rendering.
+ * @author Daniel Johansson (dannyjo)
+ * @author reden - phr00t - https://github.com/phr00t
+ * @author Julien Seinturier - (c) 2016 - JOrigin project - http:/www.jorigin.org
+ */
+public class GlfwMouseInputVR implements MouseInput {
+
+ private static final Logger logger = Logger.getLogger(GlfwMouseInputVR.class.getName());
+
+ private static final int WHEEL_SCALE = 120;
+
+ private LwjglWindowVR context;
+ private RawInputListener listener;
+ private boolean cursorVisible = true;
+ private int mouseX, xDelta;
+ private int mouseY, yDelta;
+ private int mouseWheel;
+ private boolean initialized;
+ private GLFWCursorPosCallback cursorPosCallback;
+ private GLFWScrollCallback scrollCallback;
+ private GLFWMouseButtonCallback mouseButtonCallback;
+ private Queue mouseMotionEvents = new LinkedList();
+ private Queue mouseButtonEvents = new LinkedList();
+
+ private Map jmeToGlfwCursorMap = new HashMap();
+
+ /**
+ * Create a new mouse input attached to the given {@link LwjglWindowVR context}.
+ * @param context the context to which to attach the input.
+ */
+ public GlfwMouseInputVR(LwjglWindowVR context) {
+ this.context = context;
+ }
+
+ private void onCursorPos(long window, double xpos, double ypos) {
+ int x = (int) Math.round(xpos);
+ int y = context.getSettings().getHeight() - (int) Math.round(ypos);
+
+ if (mouseX == 0) {
+ mouseX = x;
+ }
+
+ if (mouseY == 0) {
+ mouseY = y;
+ }
+
+ xDelta = x - mouseX;
+ yDelta = y - mouseY;
+ mouseX = x;
+ mouseY = y;
+
+ if (xDelta != 0 || yDelta != 0) {
+ final MouseMotionEvent mouseMotionEvent = new MouseMotionEvent(x, y, xDelta, yDelta, mouseWheel, 0);
+ mouseMotionEvent.setTime(getInputTimeNanos());
+ mouseMotionEvents.add(mouseMotionEvent);
+ }
+ }
+
+ private void onWheelScroll(long window, double xOffset, double yOffset) {
+ mouseWheel += yOffset;
+
+ final MouseMotionEvent mouseMotionEvent = new MouseMotionEvent(mouseX, mouseY, 0, 0, mouseWheel, (int) Math.round(yOffset));
+ mouseMotionEvent.setTime(getInputTimeNanos());
+ mouseMotionEvents.add(mouseMotionEvent);
+ }
+ private void onMouseButton(final long window, final int button, final int action, final int mods) {
+ final MouseButtonEvent mouseButtonEvent = new MouseButtonEvent(convertButton(button), action == GLFW_PRESS, mouseX, mouseY);
+ mouseButtonEvent.setTime(getInputTimeNanos());
+ mouseButtonEvents.add(mouseButtonEvent);
+ }
+
+ public void initialize() {
+ glfwSetCursorPosCallback(context.getWindowHandle(), cursorPosCallback = new GLFWCursorPosCallback() {
+ @Override
+ public void invoke(long window, double xpos, double ypos) {
+ onCursorPos(window, xpos, ypos);
+ }
+ });
+
+ glfwSetScrollCallback(context.getWindowHandle(), scrollCallback = new GLFWScrollCallback() {
+ @Override
+ public void invoke(final long window, final double xOffset, final double yOffset) {
+ onWheelScroll(window, xOffset, yOffset * WHEEL_SCALE);
+ }
+ });
+
+ glfwSetMouseButtonCallback(context.getWindowHandle(), mouseButtonCallback = new GLFWMouseButtonCallback() {
+ @Override
+ public void invoke(final long window, final int button, final int action, final int mods) {
+ onMouseButton(window, button, action, mods);
+ }
+ });
+
+ setCursorVisible(cursorVisible);
+ logger.fine("Mouse created.");
+ initialized = true;
+ }
+
+ /**
+ * Set the position of the cursor on the display.
+ * @param x the x position of the cursor (pixel).
+ * @param y the y position of the cursor (pixel).
+ */
+ public void setCursorPosition(int x, int y) {
+ if (!context.isRenderable()) {
+ return;
+ }
+
+ glfwSetCursorPos(context.getWindowHandle(), x, y);
+ }
+
+ /**
+ * Hide the active cursor within the display.
+ */
+ public void hideActiveCursor() {
+ if (!context.isRenderable()) {
+ return;
+ }
+
+ if (cursorVisible) {
+ glfwSetInputMode(context.getWindowHandle(), GLFW_CURSOR, GLFW_CURSOR_HIDDEN);
+ }
+ }
+
+ /**
+ * Get the last delta in x (pixel).
+ * @return the last delta in x (pixel).
+ * @see #getLastDeltaY()
+ */
+ public int getLastDeltaX() {
+ return xDelta;
+ }
+
+ /**
+ * Get the last delta in y (pixel).
+ * @return the last delta in y (pixel).
+ * @see #getLastDeltaX()
+ */
+ public int getLastDeltaY() {
+ return yDelta;
+ }
+
+ /**
+ * Clear the last x and y deltas.
+ * @see #getLastDeltaX()
+ * @see #getLastDeltaY()
+ */
+ public void clearDeltas() {
+ xDelta = 0;
+ yDelta = 0;
+ }
+
+ /**
+ * Check if the input is initialized.
+ * @return true
if the input is initialized and false
otherwise.
+ */
+ public boolean isInitialized() {
+ return initialized;
+ }
+
+ @Override
+ public int getButtonCount() {
+ return GLFW_MOUSE_BUTTON_LAST + 1;
+ }
+
+ @Override
+ public void update() {
+ while (!mouseMotionEvents.isEmpty()) {
+ listener.onMouseMotionEvent(mouseMotionEvents.poll());
+ }
+
+ while (!mouseButtonEvents.isEmpty()) {
+ listener.onMouseButtonEvent(mouseButtonEvents.poll());
+ }
+ }
+
+ @Override
+ public void destroy() {
+ if (!context.isRenderable()) {
+ return;
+ }
+
+ cursorPosCallback.release();
+ scrollCallback.release();
+ mouseButtonCallback.release();
+
+ //FIXME: Needs LWJGL 3.1.0
+ //cursorPosCallback.free();
+ //scrollCallback.free();
+ //mouseButtonCallback.free();
+
+ for (long glfwCursor : jmeToGlfwCursorMap.values()) {
+ glfwDestroyCursor(glfwCursor);
+ }
+
+ logger.fine("Mouse destroyed.");
+ }
+
+ @Override
+ public void setCursorVisible(boolean visible) {
+ cursorVisible = visible;
+
+ if (!context.isRenderable()) {
+ return;
+ }
+
+ if (cursorVisible) {
+ glfwSetInputMode(context.getWindowHandle(), GLFW_CURSOR, GLFW_CURSOR_NORMAL);
+ } else {
+ glfwSetInputMode(context.getWindowHandle(), GLFW_CURSOR, GLFW_CURSOR_DISABLED);
+ }
+ }
+
+ @Override
+ public void setInputListener(RawInputListener listener) {
+ this.listener = listener;
+ }
+
+ @Override
+ public long getInputTimeNanos() {
+ return (long) (glfwGetTime() * 1000000000);
+ }
+
+ private long createGlfwCursor(JmeCursor jmeCursor) {
+ GLFWImage glfwImage = new GLFWImage(BufferUtils.createByteBuffer(GLFWImage.SIZEOF));
+
+ // TODO: currently animated cursors are not supported
+ IntBuffer imageData = jmeCursor.getImagesData();
+ ByteBuffer buf = BufferUtils.createByteBuffer(imageData.capacity() * 4);
+ buf.asIntBuffer().put(imageData);
+
+ glfwImage.set(jmeCursor.getWidth(), jmeCursor.getHeight(), buf);
+
+ return glfwCreateCursor(glfwImage, jmeCursor.getXHotSpot(), jmeCursor.getYHotSpot());
+ }
+
+ public void setNativeCursor(JmeCursor jmeCursor) {
+ if (jmeCursor != null) {
+ Long glfwCursor = jmeToGlfwCursorMap.get(jmeCursor);
+
+ if (glfwCursor == null) {
+ glfwCursor = createGlfwCursor(jmeCursor);
+ jmeToGlfwCursorMap.put(jmeCursor, glfwCursor);
+ }
+
+ glfwSetCursor(context.getWindowHandle(), glfwCursor);
+ } else {
+ glfwSetCursor(context.getWindowHandle(), MemoryUtil.NULL);
+ }
+ }
+
+ /**
+ * Simply converts the GLFW button code to a JME button code. If there is no
+ * match it just returns the GLFW button code. Bear in mind GLFW supports 8
+ * different mouse buttons.
+ *
+ * @param glfwButton the raw GLFW button index.
+ * @return the mapped {@link MouseInput} button id.
+ */
+ private int convertButton(final int glfwButton) {
+ switch (glfwButton) {
+ case GLFW_MOUSE_BUTTON_LEFT:
+ return MouseInput.BUTTON_LEFT;
+ case GLFW_MOUSE_BUTTON_MIDDLE:
+ return MouseInput.BUTTON_MIDDLE;
+ case GLFW_MOUSE_BUTTON_RIGHT:
+ return MouseInput.BUTTON_RIGHT;
+ default:
+ return glfwButton;
+ }
+ }
+}
diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/HmdType.java b/jme3-vr/src/main/java/com/jme3/input/vr/HmdType.java
new file mode 100644
index 000000000..044a032ef
--- /dev/null
+++ b/jme3-vr/src/main/java/com/jme3/input/vr/HmdType.java
@@ -0,0 +1,64 @@
+package com.jme3.input.vr;
+
+/**
+ * The type of VR Head Mounted Device (HMD)
+ * @author reden - phr00t - https://github.com/phr00t
+ * @author Julien Seinturier - (c) 2016 - JOrigin project - http:/www.jorigin.org
+ */
+public enum HmdType {
+
+ /**
+ * HTC vive Head Mounted Device (HMD).
+ */
+ HTC_VIVE,
+
+ /**
+ * Occulus Rift Head Mounted Device (HMD).
+ */
+ OCULUS_RIFT,
+
+ /**
+ * OSVR generic Head Mounted Device (HMD).
+ */
+ OSVR,
+
+ /**
+ * FOVE Head Mounted Device (HMD).
+ */
+ FOVE,
+
+ /**
+ * STARVR Head Mounted Device (HMD).
+ */
+ STARVR,
+
+ /**
+ * GameFace Head Mounted Device (HMD).
+ */
+ GAMEFACE,
+
+ /**
+ * PlayStation VR (formely Morpheus) Head Mounted Device (HMD).
+ */
+ MORPHEUS,
+
+ /**
+ * Samsung GearVR Head Mounted Device (HMD).
+ */
+ GEARVR,
+
+ /**
+ * a null Head Mounted Device (HMD).
+ */
+ NULL,
+
+ /**
+ * a none Head Mounted Device (HMD).
+ */
+ NONE,
+
+ /**
+ * a not referenced Head Mounted Device (HMD).
+ */
+ OTHER
+}
\ No newline at end of file
diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/OSVR.java b/jme3-vr/src/main/java/com/jme3/input/vr/OSVR.java
new file mode 100644
index 000000000..f5305a64d
--- /dev/null
+++ b/jme3-vr/src/main/java/com/jme3/input/vr/OSVR.java
@@ -0,0 +1,447 @@
+/*
+
+https://github.com/sensics/OSVR-RenderManager/blob/master/examples/RenderManagerOpenGLCAPIExample.cpp
+
+- JVM crashes often.. placing breakpoints during initialization clears it up most of the time (WHY!?)
+ - OSVR is just unstable.. any way to improve things?
+- render manager looks good, but left eye seems stretched
+
+ */
+package com.jme3.input.vr;
+
+import com.jme3.math.Matrix4f;
+import com.jme3.math.Quaternion;
+import com.jme3.math.Vector2f;
+import com.jme3.math.Vector3f;
+import com.jme3.renderer.Camera;
+import com.ochafik.lang.jnaerator.runtime.NativeSize;
+import com.ochafik.lang.jnaerator.runtime.NativeSizeByReference;
+import com.sun.jna.Pointer;
+import com.sun.jna.ptr.PointerByReference;
+import java.nio.FloatBuffer;
+
+import osvrclientkit.OsvrClientKitLibrary;
+import osvrdisplay.OsvrDisplayLibrary;
+import osvrdisplay.OsvrDisplayLibrary.OSVR_DisplayConfig;
+import osvrmatrixconventions.OSVR_Pose3;
+
+import osvrrendermanageropengl.OSVR_OpenResultsOpenGL;
+import osvrrendermanageropengl.OSVR_RenderBufferOpenGL;
+import osvrrendermanageropengl.OSVR_RenderInfoOpenGL;
+import osvrrendermanageropengl.OSVR_RenderParams;
+import osvrrendermanageropengl.OSVR_ViewportDescription;
+import osvrrendermanageropengl.OsvrRenderManagerOpenGLLibrary;
+
+/**
+ * A class that wraps an OSVR system.
+ * @author reden - phr00t - https://github.com/phr00t
+ * @author Julien Seinturier - (c) 2016 - JOrigin project - http:/www.jorigin.org
+ */
+public class OSVR implements VRAPI {
+
+ /**
+ * The first viewer index.
+ */
+ public static final int FIRST_VIEWER = 0;
+
+ /**
+ * The left eye index.
+ */
+ public static final int EYE_LEFT = 0;
+
+ /**
+ * The right eye index.
+ */
+ public static final int EYE_RIGHT = 1;
+
+ /**
+ * The size of the left eye.
+ */
+ public static final NativeSize EYE_LEFT_SIZE = new NativeSize(EYE_LEFT);
+
+ /**
+ * The size of the right eye.
+ */
+ public static final NativeSize EYE_RIGHT_SIZE = new NativeSize(EYE_RIGHT);
+
+ /**
+ * The default J String.
+ */
+ public static byte[] defaultJString = { 'j', (byte)0 };
+
+ /**
+ * The default OpenGL String.
+ */
+ public static byte[] OpenGLString = { 'O', 'p', 'e', 'n', 'G', 'L', (byte)0 };
+
+ private final Matrix4f[] eyeMatrix = new Matrix4f[2];
+
+ private PointerByReference grabRM;
+ private PointerByReference grabRMOGL;
+ private PointerByReference grabRIC;
+
+ OSVR_RenderParams.ByValue renderParams;
+ OsvrClientKitLibrary.OSVR_ClientContext context;
+ osvrrendermanageropengl.OSVR_GraphicsLibraryOpenGL.ByValue graphicsLibrary;
+ Pointer renderManager, renderManagerOpenGL, renderInfoCollection, registerBufferState;
+ OSVRInput VRinput;
+ NativeSize numRenderInfo;
+ NativeSizeByReference grabNumInfo = new NativeSizeByReference();
+ OSVR_RenderInfoOpenGL.ByValue eyeLeftInfo, eyeRightInfo;
+ Matrix4f hmdPoseLeftEye;
+ Matrix4f hmdPoseRightEye;
+ Vector3f hmdPoseLeftEyeVec, hmdPoseRightEyeVec, hmdSeatToStand;
+ OSVR_DisplayConfig displayConfig;
+ OSVR_Pose3 hmdPose = new OSVR_Pose3();
+ Vector3f storePos = new Vector3f();
+ Quaternion storeRot = new Quaternion();
+ PointerByReference presentState = new PointerByReference();
+ OSVR_OpenResultsOpenGL openResults = new OSVR_OpenResultsOpenGL();
+
+ long glfwContext;
+ long renderManagerContext;
+ long wglGLFW;
+ long wglRM;
+
+ boolean initSuccess = false;
+ boolean flipEyes = false;
+
+ /**
+ * Access to the underlying OSVR structures.
+ * @param leftView the left viewport.
+ * @param rightView the right viewport.
+ * @param leftBuffer the left buffer.
+ * @param rightBuffer the right buffer.
+ * @return true
if the structure are accessible and false
otherwise.
+ */
+ public boolean handleRenderBufferPresent(OSVR_ViewportDescription.ByValue leftView, OSVR_ViewportDescription.ByValue rightView,
+ OSVR_RenderBufferOpenGL.ByValue leftBuffer, OSVR_RenderBufferOpenGL.ByValue rightBuffer) {
+ if( eyeLeftInfo == null || eyeRightInfo == null ) return false;
+ byte retval;
+ OsvrRenderManagerOpenGLLibrary.osvrRenderManagerStartPresentRenderBuffers(presentState);
+ getEyeInfo();
+ OsvrRenderManagerOpenGLLibrary.osvrRenderManagerPresentRenderBufferOpenGL(presentState.getValue(), leftBuffer, eyeLeftInfo, leftView);
+ OsvrRenderManagerOpenGLLibrary.osvrRenderManagerPresentRenderBufferOpenGL(presentState.getValue(), rightBuffer, eyeRightInfo, rightView);
+ retval = OsvrRenderManagerOpenGLLibrary.osvrRenderManagerFinishPresentRenderBuffers(renderManager, presentState.getValue(), renderParams, (byte)0);
+ return retval == 0; // only check the last error, since if something errored above, the last call won't work & all calls will log to syserr
+ }
+
+
+
+ @Override
+ public boolean initialize() {
+ hmdPose.setAutoSynch(false);
+ context = OsvrClientKitLibrary.osvrClientInit(defaultJString, 0);
+ VRinput = new OSVRInput();
+ initSuccess = context != null && VRinput.init();
+ if( initSuccess ) {
+ PointerByReference grabDisplay = new PointerByReference();
+ byte retval = OsvrDisplayLibrary.osvrClientGetDisplay(context, grabDisplay);
+ if( retval != 0 ) {
+ System.out.println("OSVR Get Display Error: " + retval);
+ initSuccess = false;
+ return false;
+ }
+ displayConfig = new OSVR_DisplayConfig(grabDisplay.getValue());
+ System.out.println("Waiting for the display to fully start up, including receiving initial pose update...");
+ int i = 400;
+ while (OsvrDisplayLibrary.osvrClientCheckDisplayStartup(displayConfig) != 0) {
+ if( i-- < 0 ) {
+ System.out.println("Couldn't get display startup update in time, continuing anyway...");
+ break;
+ }
+ OsvrClientKitLibrary.osvrClientUpdate(context);
+ try {
+ Thread.sleep(5);
+ } catch(Exception e) { }
+ }
+ System.out.println("OK, display startup status is good!");
+ }
+ return initSuccess;
+ }
+
+
+ /**
+ * Grab the current GLFW context.
+ */
+ public void grabGLFWContext() {
+ // get current conext
+ wglGLFW = org.lwjgl.opengl.WGL.wglGetCurrentContext();
+ glfwContext = org.lwjgl.glfw.GLFW.glfwGetCurrentContext();
+ }
+
+ /**
+ * Enable context sharing.
+ * @return true
if the context is successfully shared and false
otherwise.
+ */
+ public boolean shareContext() {
+ if( org.lwjgl.opengl.WGL.wglShareLists(wglRM, wglGLFW) == 0) {
+ System.out.println("Context sharing success!");
+ return true;
+ } else {
+ System.out.println("Context sharing problem...");
+ return false;
+ }
+ }
+
+ @Override
+ public boolean initVRCompositor(boolean allowed) {
+ if( !allowed || renderManager != null ) return false;
+ grabGLFWContext();
+ graphicsLibrary = new osvrrendermanageropengl.OSVR_GraphicsLibraryOpenGL.ByValue();
+ graphicsLibrary.toolkit = null;
+ graphicsLibrary.setAutoSynch(false);
+ grabRM = new PointerByReference(); grabRMOGL = new PointerByReference();
+ byte retval = OsvrRenderManagerOpenGLLibrary.osvrCreateRenderManagerOpenGL(context, OpenGLString, graphicsLibrary, grabRM, grabRMOGL);
+ if( retval == 0 ) {
+ renderManager = grabRM.getValue(); renderManagerOpenGL = grabRMOGL.getValue();
+ if( renderManager == null || renderManagerOpenGL == null ) {
+ System.out.println("Render Manager Created NULL, error!");
+ return false;
+ }
+ openResults.setAutoSynch(false);
+ retval = OsvrRenderManagerOpenGLLibrary.osvrRenderManagerOpenDisplayOpenGL(renderManager, openResults);
+ if( retval == 0 ) {
+ wglRM = org.lwjgl.opengl.WGL.wglGetCurrentContext();
+ renderManagerContext = org.lwjgl.glfw.GLFW.glfwGetCurrentContext();
+ shareContext();
+ OsvrClientKitLibrary.osvrClientUpdate(context);
+ renderParams = new OSVR_RenderParams.ByValue();
+ renderParams.setAutoSynch(false);
+ OsvrRenderManagerOpenGLLibrary.osvrRenderManagerGetDefaultRenderParams(renderParams);
+ grabRIC = new PointerByReference();
+ retval = OsvrRenderManagerOpenGLLibrary.osvrRenderManagerGetRenderInfoCollection(renderManager, renderParams, grabRIC);
+ if( retval == 0 ) {
+ renderInfoCollection = grabRIC.getValue();
+ OsvrRenderManagerOpenGLLibrary.osvrRenderManagerGetNumRenderInfoInCollection(renderInfoCollection, grabNumInfo);
+ numRenderInfo = grabNumInfo.getValue();
+ eyeLeftInfo = new OSVR_RenderInfoOpenGL.ByValue();
+ eyeRightInfo = new OSVR_RenderInfoOpenGL.ByValue();
+ eyeLeftInfo.setAutoSynch(false);
+ eyeRightInfo.setAutoSynch(false);
+ return true;
+ }
+ OsvrRenderManagerOpenGLLibrary.osvrDestroyRenderManager(renderManager);
+ System.out.println("OSVR Render Manager Info Collection Error: " + retval);
+ return false;
+ }
+ OsvrRenderManagerOpenGLLibrary.osvrDestroyRenderManager(renderManager);
+ System.out.println("OSVR Open Render Manager Display Error: " + retval);
+ return false;
+ }
+ System.out.println("OSVR Create Render Manager Error: " + retval);
+ return false;
+ }
+
+ @Override
+ public OsvrClientKitLibrary.OSVR_ClientContext getVRSystem() {
+ return context;
+ }
+
+ @Override
+ public Pointer getCompositor() {
+ return renderManager;
+ }
+
+ @Override
+ public String getName() {
+ return "OSVR";
+ }
+
+ @Override
+ public VRInputAPI getVRinput() {
+ return VRinput;
+ }
+
+ @Override
+ public void _setFlipEyes(boolean set) {
+ flipEyes = set;
+ }
+
+ @Override
+ public void printLatencyInfoToConsole(boolean set) {
+
+ }
+
+ @Override
+ public int getDisplayFrequency() {
+ return 60; //debug display frequency
+ }
+
+ @Override
+ public void destroy() {
+ if( renderManager != null ) OsvrRenderManagerOpenGLLibrary.osvrDestroyRenderManager(renderManager);
+ if( displayConfig != null ) OsvrDisplayLibrary.osvrClientFreeDisplay(displayConfig);
+ }
+
+ @Override
+ public boolean isInitialized() {
+ return initSuccess;
+ }
+
+ @Override
+ public void reset() {
+ // TODO: no native OSVR reset function
+ // may need to take current position and negate it from future values
+ }
+
+ @Override
+ public void getRenderSize(Vector2f store) {
+ if( eyeLeftInfo == null || eyeLeftInfo.viewport.width == 0.0 ) {
+ store.x = 1280f; store.y = 720f;
+ } else {
+ store.x = (float)eyeLeftInfo.viewport.width;
+ store.y = (float)eyeLeftInfo.viewport.height;
+ }
+ }
+
+ /**
+ * Read and update the eye info from the underlying OSVR system.
+ */
+ public void getEyeInfo() {
+ OsvrRenderManagerOpenGLLibrary.osvrRenderManagerGetRenderInfoFromCollectionOpenGL(renderInfoCollection, EYE_LEFT_SIZE, eyeLeftInfo);
+ OsvrRenderManagerOpenGLLibrary.osvrRenderManagerGetRenderInfoFromCollectionOpenGL(renderInfoCollection, EYE_RIGHT_SIZE, eyeRightInfo);
+ eyeLeftInfo.read(); eyeRightInfo.read();
+ }
+/*
+ @Override
+ public float getFOV(int dir) {
+ return 105f; //default FOV
+ }
+*/
+ @Override
+ public float getInterpupillaryDistance() {
+ return 0.065f; //default IPD
+ }
+
+ @Override
+ public Quaternion getOrientation() {
+ storeRot.set((float)-hmdPose.rotation.data[1],
+ (float)hmdPose.rotation.data[2],
+ (float)-hmdPose.rotation.data[3],
+ (float)hmdPose.rotation.data[0]);
+ if( storeRot.equals(Quaternion.ZERO) ) storeRot.set(Quaternion.DIRECTION_Z);
+ return storeRot;
+ }
+
+ @Override
+ public Vector3f getPosition() {
+ storePos.x = (float)-hmdPose.translation.data[0];
+ storePos.y = (float)hmdPose.translation.data[1];
+ storePos.z = (float)-hmdPose.translation.data[2];
+ return storePos;
+ }
+
+ @Override
+ public void getPositionAndOrientation(Vector3f storePos, Quaternion storeRot) {
+ storePos.x = (float)-hmdPose.translation.data[0];
+ storePos.y = (float)hmdPose.translation.data[1];
+ storePos.z = (float)-hmdPose.translation.data[2];
+ storeRot.set((float)-hmdPose.rotation.data[1],
+ (float)hmdPose.rotation.data[2],
+ (float)-hmdPose.rotation.data[3],
+ (float)hmdPose.rotation.data[0]);
+ if( storeRot.equals(Quaternion.ZERO) ) storeRot.set(Quaternion.DIRECTION_Z);
+ }
+
+ @Override
+ public void updatePose() {
+ if( context == null || displayConfig == null ) return;
+ OsvrClientKitLibrary.osvrClientUpdate(context);
+ OsvrDisplayLibrary.osvrClientGetViewerPose(displayConfig, FIRST_VIEWER, hmdPose.getPointer());
+ VRinput.updateControllerStates();
+ hmdPose.read();
+ }
+
+ @Override
+ public Matrix4f getHMDMatrixProjectionLeftEye(Camera cam) {
+ if( eyeLeftInfo == null ) return cam.getProjectionMatrix();
+ if( eyeMatrix[EYE_LEFT] == null ) {
+ FloatBuffer tfb = FloatBuffer.allocate(16);
+ osvrdisplay.OsvrDisplayLibrary.osvrClientGetViewerEyeSurfaceProjectionMatrixf(displayConfig, 0, (byte)EYE_LEFT, 0, cam.getFrustumNear(), cam.getFrustumFar(), (short)0, tfb);
+ eyeMatrix[EYE_LEFT] = new Matrix4f();
+ eyeMatrix[EYE_LEFT].set(tfb.get(0), tfb.get(4), tfb.get(8), tfb.get(12),
+ tfb.get(1), tfb.get(5), tfb.get(9), tfb.get(13),
+ tfb.get(2), tfb.get(6), tfb.get(10), tfb.get(14),
+ tfb.get(3), tfb.get(7), tfb.get(11), tfb.get(15));
+ }
+ return eyeMatrix[EYE_LEFT];
+ }
+
+ @Override
+ public Matrix4f getHMDMatrixProjectionRightEye(Camera cam) {
+ if( eyeRightInfo == null ) return cam.getProjectionMatrix();
+ if( eyeMatrix[EYE_RIGHT] == null ) {
+ FloatBuffer tfb = FloatBuffer.allocate(16);
+ osvrdisplay.OsvrDisplayLibrary.osvrClientGetViewerEyeSurfaceProjectionMatrixf(displayConfig, 0, (byte)EYE_RIGHT, 0, cam.getFrustumNear(), cam.getFrustumFar(), (short)0, tfb);
+ eyeMatrix[EYE_RIGHT] = new Matrix4f();
+ eyeMatrix[EYE_RIGHT].set(tfb.get(0), tfb.get(4), tfb.get(8), tfb.get(12),
+ tfb.get(1), tfb.get(5), tfb.get(9), tfb.get(13),
+ tfb.get(2), tfb.get(6), tfb.get(10), tfb.get(14),
+ tfb.get(3), tfb.get(7), tfb.get(11), tfb.get(15));
+ }
+ return eyeMatrix[EYE_RIGHT];
+ }
+
+ @Override
+ public Vector3f getHMDVectorPoseLeftEye() {
+ if( hmdPoseLeftEyeVec == null ) {
+ hmdPoseLeftEyeVec = new Vector3f();
+ hmdPoseLeftEyeVec.x = 0.065f * -0.5f;
+ if( flipEyes == false ) hmdPoseLeftEyeVec.x *= -1f; // it seems these need flipping
+ }
+ return hmdPoseLeftEyeVec;
+ }
+
+ @Override
+ public Vector3f getHMDVectorPoseRightEye() {
+ if( hmdPoseRightEyeVec == null ) {
+ hmdPoseRightEyeVec = new Vector3f();
+ hmdPoseRightEyeVec.x = 0.065f * 0.5f;
+ if( flipEyes == false ) hmdPoseRightEyeVec.x *= -1f; // it seems these need flipping
+ }
+ return hmdPoseRightEyeVec;
+ }
+
+ @Override
+ public Vector3f getSeatedToAbsolutePosition() {
+ return Vector3f.ZERO;
+ }
+
+ @Override
+ public Matrix4f getHMDMatrixPoseLeftEye() {
+ // not actually used internally...
+ /*if( hmdPoseLeftEye != null ) {
+ return hmdPoseLeftEye;
+ } else {
+ FloatBuffer mat = FloatBuffer.allocate(16);
+ OsvrDisplayLibrary.osvrClientGetViewerEyeViewMatrixf(displayConfig, FIRST_VIEWER, (byte)EYE_LEFT,
+ (short)(OsvrMatrixConventionsLibrary.OSVR_MatrixVectorFlags.OSVR_MATRIX_COLVECTORS |
+ OsvrMatrixConventionsLibrary.OSVR_MatrixOrderingFlags.OSVR_MATRIX_COLMAJOR), tempfb);
+ hmdPoseLeftEye = new Matrix4f(tempfb.array());
+ return hmdPoseLeftEye;
+ }*/
+ return null;
+ }
+
+ @Override
+ public Matrix4f getHMDMatrixPoseRightEye() {
+ // not actually used internally...
+ /*if( hmdPoseRightEye != null ) {
+ return hmdPoseRightEye;
+ } else {
+ OsvrDisplayLibrary.osvrClientGetViewerEyeViewMatrixf(displayConfig, FIRST_VIEWER, (byte)EYE_RIGHT,
+ (short)(OsvrMatrixConventionsLibrary.OSVR_MatrixVectorFlags.OSVR_MATRIX_COLVECTORS |
+ OsvrMatrixConventionsLibrary.OSVR_MatrixOrderingFlags.OSVR_MATRIX_COLMAJOR), tempfb);
+ hmdPoseRightEye = new Matrix4f(tempfb.array());
+ return hmdPoseRightEye;
+ }*/
+ return null;
+ }
+
+ @Override
+ public HmdType getType() {
+ return HmdType.OSVR;
+ }
+
+}
diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/OSVRInput.java b/jme3-vr/src/main/java/com/jme3/input/vr/OSVRInput.java
new file mode 100644
index 000000000..ff86ac8fa
--- /dev/null
+++ b/jme3-vr/src/main/java/com/jme3/input/vr/OSVRInput.java
@@ -0,0 +1,333 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.jme3.input.vr;
+
+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.sun.jna.Callback;
+import com.sun.jna.Pointer;
+import com.sun.jna.ptr.PointerByReference;
+
+import jmevr.util.VRViewManager;
+
+import osvrclientkit.OsvrClientKitLibrary;
+import osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface;
+import osvrclientreporttypes.OSVR_AnalogReport;
+import osvrclientreporttypes.OSVR_ButtonReport;
+import osvrclientreporttypes.OSVR_Pose3;
+import osvrinterface.OsvrInterfaceLibrary;
+import osvrtimevalue.OSVR_TimeValue;
+
+/**
+ * A class that wraps an OSVR input.
+ * @author reden - phr00t - https://github.com/phr00t
+ * @author Julien Seinturier - (c) 2016 - JOrigin project - http:/www.jorigin.org
+ */
+public class OSVRInput implements VRInputAPI {
+
+ // position example: https://github.com/OSVR/OSVR-Core/blob/master/examples/clients/TrackerState.c
+ // button example: https://github.com/OSVR/OSVR-Core/blob/master/examples/clients/ButtonCallback.c
+ // analog example: https://github.com/OSVR/OSVR-Core/blob/master/examples/clients/AnalogCallback.c
+
+ private static final int ANALOG_COUNT = 3, BUTTON_COUNT = 7, CHANNEL_COUNT = 3;
+
+ OSVR_ClientInterface[][] buttons;
+ OSVR_ClientInterface[][][] analogs;
+ OSVR_ClientInterface[] hands;
+
+ OSVR_Pose3[] handState;
+ Callback buttonHandler, analogHandler;
+ OSVR_TimeValue tv = new OSVR_TimeValue();
+ boolean[] isHandTracked = new boolean[2];
+
+ private float[][][] analogState;
+ private float[][] buttonState;
+
+ private final Quaternion tempq = new Quaternion();
+ private final Vector3f tempv = new Vector3f();
+ private final Vector2f temp2 = new Vector2f();
+ private final boolean[][] buttonDown = new boolean[16][16];
+
+ private static final Vector2f temp2Axis = new Vector2f();
+ private static final Vector2f lastCallAxis[] = new Vector2f[16];
+ private static float axisMultiplier = 1f;
+
+ /**
+ * Get the system String that identifies a controller.
+ * @param left is the controller is the left one (false
if the right controller is needed).
+ * @param index the index of the controller.
+ * @return the system String that identifies the controller.
+ */
+ public static byte[] getButtonString(boolean left, byte index) {
+ if( left ) {
+ return new byte[] { '/', 'c', 'o', 'n', 't', 'r', 'o', 'l', 'l', 'e', 'r', '/', 'l', 'e', 'f', 't', '/', index, (byte)0 };
+ }
+ return new byte[] { '/', 'c', 'o', 'n', 't', 'r', 'o', 'l', 'l', 'e', 'r', '/', 'r', 'i', 'g', 'h', 't', '/', index, (byte)0 };
+ }
+
+ /**
+ * The left hand system String.
+ */
+ public static byte[] leftHand = { '/', 'm', 'e', '/', 'h', 'a', 'n', 'd', 's', '/', 'l', 'e', 'f', 't', (byte)0 };
+
+ /**
+ * The right hand system String.
+ */
+ public static byte[] rightHand = { '/', 'm', 'e', '/', 'h', 'a', 'n', 'd', 's', '/', 'r', 'i', 'g', 'h', 't', (byte)0 };
+
+ @Override
+ public boolean isButtonDown(int controllerIndex, VRInputType checkButton) {
+ return buttonState[controllerIndex][checkButton.getValue()] != 0f;
+ }
+
+ @Override
+ public boolean wasButtonPressedSinceLastCall(int controllerIndex, VRInputType checkButton) {
+ boolean buttonDownNow = isButtonDown(controllerIndex, checkButton);
+ int checkButtonValue = checkButton.getValue();
+ boolean retval = buttonDownNow == true && buttonDown[controllerIndex][checkButtonValue] == false;
+ buttonDown[controllerIndex][checkButtonValue] = buttonDownNow;
+ return retval;
+ }
+
+ @Override
+ public void resetInputSinceLastCall() {
+ for(int i=0;iOpenVR system.
+ * @author reden - phr00t - https://github.com/phr00t
+ * @author Julien Seinturier - (c) 2016 - JOrigin project - http:/www.jorigin.org
+ */
+public class OpenVR implements VRAPI {
+
+ private static VR_IVRCompositor_FnTable compositorFunctions;
+ private static VR_IVRSystem_FnTable vrsystemFunctions;
+
+ private static boolean initSuccess = false;
+ private static boolean flipEyes = false;
+
+ private static IntBuffer hmdDisplayFrequency;
+ private static TrackedDevicePose_t.ByReference hmdTrackedDevicePoseReference;
+ protected static TrackedDevicePose_t[] hmdTrackedDevicePoses;
+
+ protected static IntBuffer hmdErrorStore;
+
+ private static final Quaternion rotStore = new Quaternion();
+ private static final Vector3f posStore = new Vector3f();
+
+ private static FloatBuffer tlastVsync;
+
+ /**
+ * The actual frame count.
+ */
+ public static LongBuffer _tframeCount;
+
+ // for debugging latency
+ private int frames = 0;
+
+ protected static Matrix4f[] poseMatrices;
+
+ private static final Matrix4f hmdPose = Matrix4f.IDENTITY.clone();
+ private static Matrix4f hmdProjectionLeftEye;
+ private static Matrix4f hmdProjectionRightEye;
+ private static Matrix4f hmdPoseLeftEye;
+ private static Matrix4f hmdPoseRightEye;
+
+ private static Vector3f hmdPoseLeftEyeVec, hmdPoseRightEyeVec, hmdSeatToStand;
+
+ private static float vsyncToPhotons;
+ private static double timePerFrame, frameCountRun;
+ private static long frameCount;
+ private static OpenVRInput VRinput;
+
+ @Override
+ public OpenVRInput getVRinput() {
+ return VRinput;
+ }
+
+ @Override
+ public VR_IVRSystem_FnTable getVRSystem() {
+ return vrsystemFunctions;
+ }
+
+ @Override
+ public VR_IVRCompositor_FnTable getCompositor() {
+ return compositorFunctions;
+ }
+
+ @Override
+ public String getName() {
+ return "OpenVR";
+ }
+
+ private static long latencyWaitTime = 0;
+
+ @Override
+ public void _setFlipEyes(boolean set) {
+ flipEyes = set;
+ }
+
+ private boolean enableDebugLatency = false;
+
+ @Override
+ public void printLatencyInfoToConsole(boolean set) {
+ enableDebugLatency = set;
+ }
+
+ @Override
+ public int getDisplayFrequency() {
+ if( hmdDisplayFrequency == null ) return 0;
+ return hmdDisplayFrequency.get(0);
+ }
+
+ @Override
+ public boolean initialize() {
+ hmdErrorStore = IntBuffer.allocate(1);
+ vrsystemFunctions = null;
+ JOpenVRLibrary.VR_InitInternal(hmdErrorStore, JOpenVRLibrary.EVRApplicationType.EVRApplicationType_VRApplication_Scene);
+ if( hmdErrorStore.get(0) == 0 ) {
+ // ok, try and get the vrsystem pointer..
+ vrsystemFunctions = new VR_IVRSystem_FnTable(JOpenVRLibrary.VR_GetGenericInterface(JOpenVRLibrary.IVRSystem_Version, hmdErrorStore));
+ }
+ if( vrsystemFunctions == null || hmdErrorStore.get(0) != 0 ) {
+ System.out.println("OpenVR Initialize Result: " + JOpenVRLibrary.VR_GetVRInitErrorAsEnglishDescription(hmdErrorStore.get(0)).getString(0));
+ return false;
+ } else {
+ System.out.println("OpenVR initialized & VR connected.");
+
+ vrsystemFunctions.setAutoSynch(false);
+ vrsystemFunctions.read();
+
+ tlastVsync = FloatBuffer.allocate(1);
+ _tframeCount = LongBuffer.allocate(1);
+
+ hmdDisplayFrequency = IntBuffer.allocate(1);
+ hmdDisplayFrequency.put( (int) JOpenVRLibrary.ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_DisplayFrequency_Float);
+ hmdTrackedDevicePoseReference = new TrackedDevicePose_t.ByReference();
+ hmdTrackedDevicePoses = (TrackedDevicePose_t[])hmdTrackedDevicePoseReference.toArray(JOpenVRLibrary.k_unMaxTrackedDeviceCount);
+ poseMatrices = new Matrix4f[JOpenVRLibrary.k_unMaxTrackedDeviceCount];
+ for(int i=0;i 0 ) VRUtil.sleepNanos(latencyWaitTime);
+
+ vrsystemFunctions.GetTimeSinceLastVsync.apply(tlastVsync, _tframeCount);
+ float fSecondsUntilPhotons = (float)timePerFrame - tlastVsync.get(0) + vsyncToPhotons;
+
+ if( enableDebugLatency ) {
+ if( frames == 10 ) {
+ System.out.println("Waited (nanos): " + Long.toString(latencyWaitTime));
+ System.out.println("Predict ahead time: " + Float.toString(fSecondsUntilPhotons));
+ }
+ frames = (frames + 1) % 60;
+ }
+
+ // handle skipping frame stuff
+ long nowCount = _tframeCount.get(0);
+ if( nowCount - frameCount > 1 ) {
+ // skipped a frame!
+ if( enableDebugLatency ) System.out.println("Frame skipped!");
+ frameCountRun = 0;
+ if( latencyWaitTime > 0 ) {
+ latencyWaitTime -= TimeUnit.MILLISECONDS.toNanos(1);
+ if( latencyWaitTime < 0 ) latencyWaitTime = 0;
+ }
+ } else if( latencyWaitTime < timePerFrame * 1000000000.0 ) {
+ // didn't skip a frame, lets try waiting longer to improve latency
+ frameCountRun++;
+ latencyWaitTime += Math.round(Math.pow(frameCountRun / 10.0, 2.0));
+ }
+
+ frameCount = nowCount;
+
+ vrsystemFunctions.GetDeviceToAbsoluteTrackingPose.apply(
+ VRApplication.isSeatedExperience()?JOpenVRLibrary.ETrackingUniverseOrigin.ETrackingUniverseOrigin_TrackingUniverseSeated:
+ JOpenVRLibrary.ETrackingUniverseOrigin.ETrackingUniverseOrigin_TrackingUniverseStanding,
+ fSecondsUntilPhotons, hmdTrackedDevicePoseReference, JOpenVRLibrary.k_unMaxTrackedDeviceCount);
+ }
+
+ // deal with controllers being plugged in and out
+ // causing an invalid memory crash... skipping for now
+ /*boolean hasEvent = false;
+ while( JOpenVRLibrary.VR_IVRSystem_PollNextEvent(OpenVR.getVRSystemInstance(), tempEvent) != 0 ) {
+ // wait until the events are clear..
+ hasEvent = true;
+ }
+ if( hasEvent ) {
+ // an event probably changed controller state
+ VRInput._updateConnectedControllers();
+ }*/
+ //update controllers pose information
+ VRApplication.getVRinput().updateControllerStates();
+
+ // read pose data from native
+ for (int nDevice = 0; nDevice < JOpenVRLibrary.k_unMaxTrackedDeviceCount; ++nDevice ){
+ hmdTrackedDevicePoses[nDevice].readField("bPoseIsValid");
+ if( hmdTrackedDevicePoses[nDevice].bPoseIsValid != 0 ){
+ hmdTrackedDevicePoses[nDevice].readField("mDeviceToAbsoluteTracking");
+ VRUtil.convertSteamVRMatrix3ToMatrix4f(hmdTrackedDevicePoses[nDevice].mDeviceToAbsoluteTracking, poseMatrices[nDevice]);
+ }
+ }
+
+ if ( hmdTrackedDevicePoses[JOpenVRLibrary.k_unTrackedDeviceIndex_Hmd].bPoseIsValid != 0 ){
+ hmdPose.set(poseMatrices[JOpenVRLibrary.k_unTrackedDeviceIndex_Hmd]);
+ } else {
+ hmdPose.set(Matrix4f.IDENTITY);
+ }
+ }
+
+ @Override
+ public Matrix4f getHMDMatrixProjectionLeftEye(Camera cam){
+ if( hmdProjectionLeftEye != null ) {
+ return hmdProjectionLeftEye;
+ } else if(vrsystemFunctions == null){
+ return cam.getProjectionMatrix();
+ } else {
+ HmdMatrix44_t mat = vrsystemFunctions.GetProjectionMatrix.apply(JOpenVRLibrary.EVREye.EVREye_Eye_Left, cam.getFrustumNear(), cam.getFrustumFar(), JOpenVRLibrary.EGraphicsAPIConvention.EGraphicsAPIConvention_API_OpenGL);
+ hmdProjectionLeftEye = new Matrix4f();
+ VRUtil.convertSteamVRMatrix4ToMatrix4f(mat, hmdProjectionLeftEye);
+ return hmdProjectionLeftEye;
+ }
+ }
+
+ @Override
+ public Matrix4f getHMDMatrixProjectionRightEye(Camera cam){
+ if( hmdProjectionRightEye != null ) {
+ return hmdProjectionRightEye;
+ } else if(vrsystemFunctions == null){
+ return cam.getProjectionMatrix();
+ } else {
+ HmdMatrix44_t mat = vrsystemFunctions.GetProjectionMatrix.apply(JOpenVRLibrary.EVREye.EVREye_Eye_Right, cam.getFrustumNear(), cam.getFrustumFar(), JOpenVRLibrary.EGraphicsAPIConvention.EGraphicsAPIConvention_API_OpenGL);
+ hmdProjectionRightEye = new Matrix4f();
+ VRUtil.convertSteamVRMatrix4ToMatrix4f(mat, hmdProjectionRightEye);
+ return hmdProjectionRightEye;
+ }
+ }
+
+ @Override
+ public Vector3f getHMDVectorPoseLeftEye() {
+ if( hmdPoseLeftEyeVec == null ) {
+ hmdPoseLeftEyeVec = getHMDMatrixPoseLeftEye().toTranslationVector();
+ // set default IPD if none or broken
+ if( hmdPoseLeftEyeVec.x <= 0.080f * -0.5f || hmdPoseLeftEyeVec.x >= 0.040f * -0.5f ) {
+ hmdPoseLeftEyeVec.x = 0.065f * -0.5f;
+ }
+ if( flipEyes == false ) hmdPoseLeftEyeVec.x *= -1f; // it seems these need flipping
+ }
+ return hmdPoseLeftEyeVec;
+ }
+
+ @Override
+ public Vector3f getHMDVectorPoseRightEye() {
+ if( hmdPoseRightEyeVec == null ) {
+ hmdPoseRightEyeVec = getHMDMatrixPoseRightEye().toTranslationVector();
+ // set default IPD if none or broken
+ if( hmdPoseRightEyeVec.x >= 0.080f * 0.5f || hmdPoseRightEyeVec.x <= 0.040f * 0.5f ) {
+ hmdPoseRightEyeVec.x = 0.065f * 0.5f;
+ }
+ if( flipEyes == false ) hmdPoseRightEyeVec.x *= -1f; // it seems these need flipping
+ }
+ return hmdPoseRightEyeVec;
+ }
+
+ @Override
+ public Vector3f getSeatedToAbsolutePosition() {
+ if( VRApplication.isSeatedExperience() == false ) return Vector3f.ZERO;
+ if( hmdSeatToStand == null ) {
+ hmdSeatToStand = new Vector3f();
+ HmdMatrix34_t mat = vrsystemFunctions.GetSeatedZeroPoseToStandingAbsoluteTrackingPose.apply();
+ Matrix4f tempmat = new Matrix4f();
+ VRUtil.convertSteamVRMatrix3ToMatrix4f(mat, tempmat);
+ tempmat.toTranslationVector(hmdSeatToStand);
+ }
+ return hmdSeatToStand;
+ }
+
+ @Override
+ public Matrix4f getHMDMatrixPoseLeftEye(){
+ if( hmdPoseLeftEye != null ) {
+ return hmdPoseLeftEye;
+ } else if(vrsystemFunctions == null) {
+ return Matrix4f.IDENTITY;
+ } else {
+ HmdMatrix34_t mat = vrsystemFunctions.GetEyeToHeadTransform.apply(JOpenVRLibrary.EVREye.EVREye_Eye_Left);
+ hmdPoseLeftEye = new Matrix4f();
+ return VRUtil.convertSteamVRMatrix3ToMatrix4f(mat, hmdPoseLeftEye);
+ }
+ }
+
+ @Override
+ public HmdType getType() {
+ if( vrsystemFunctions != null ) {
+ Pointer str1 = new Memory(128);
+ Pointer str2 = new Memory(128);
+ String completeName = "";
+ vrsystemFunctions.GetStringTrackedDeviceProperty.apply(JOpenVRLibrary.k_unTrackedDeviceIndex_Hmd,
+ JOpenVRLibrary.ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_ManufacturerName_String,
+ str1, 128, hmdErrorStore);
+ if( hmdErrorStore.get(0) == 0 ) completeName += str1.getString(0);
+ vrsystemFunctions.GetStringTrackedDeviceProperty.apply(JOpenVRLibrary.k_unTrackedDeviceIndex_Hmd,
+ JOpenVRLibrary.ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_ModelNumber_String,
+ str2, 128, hmdErrorStore);
+ if( hmdErrorStore.get(0) == 0 ) completeName += " " + str2.getString(0);
+ if( completeName.length() > 0 ) {
+ completeName = completeName.toLowerCase(Locale.ENGLISH).trim();
+ if( completeName.contains("htc") || completeName.contains("vive") ) {
+ return HmdType.HTC_VIVE;
+ } else if( completeName.contains("osvr") ) {
+ return HmdType.OSVR;
+ } else if( completeName.contains("oculus") || completeName.contains("rift") ||
+ completeName.contains("dk1") || completeName.contains("dk2") || completeName.contains("cv1") ) {
+ return HmdType.OCULUS_RIFT;
+ } else if( completeName.contains("fove") ) {
+ return HmdType.FOVE;
+ } else if( completeName.contains("game") && completeName.contains("face") ) {
+ return HmdType.GAMEFACE;
+ } else if( completeName.contains("morpheus") ) {
+ return HmdType.MORPHEUS;
+ } else if( completeName.contains("gear") ) {
+ return HmdType.GEARVR;
+ } else if( completeName.contains("star") ) {
+ return HmdType.STARVR;
+ } else if( completeName.contains("null") ) {
+ return HmdType.NULL;
+ }
+ }
+ } else return HmdType.NONE;
+ return HmdType.OTHER;
+ }
+
+ @Override
+ public Matrix4f getHMDMatrixPoseRightEye(){
+ if( hmdPoseRightEye != null ) {
+ return hmdPoseRightEye;
+ } else if(vrsystemFunctions == null) {
+ return Matrix4f.IDENTITY;
+ } else {
+ HmdMatrix34_t mat = vrsystemFunctions.GetEyeToHeadTransform.apply(JOpenVRLibrary.EVREye.EVREye_Eye_Right);
+ hmdPoseRightEye = new Matrix4f();
+ return VRUtil.convertSteamVRMatrix3ToMatrix4f(mat, hmdPoseRightEye);
+ }
+ }
+
+}
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
new file mode 100644
index 000000000..a7d65efd6
--- /dev/null
+++ b/jme3-vr/src/main/java/com/jme3/input/vr/OpenVRInput.java
@@ -0,0 +1,351 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.jme3.input.vr;
+
+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 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)
+
+trigger:
+Controller#1, Axis#0 X: 0.0, Y: 0.0
+Controller#1, Axis#1 X: 1.0, Y: 0.0
+Controller#1, Axis#2 X: 0.0, Y: 0.0
+Controller#1, Axis#3 X: 0.0, Y: 0.0
+Controller#1, Axis#4 X: 0.0, Y: 0.0
+Button press: 8589934592 (when full), touch: 8589934592
+
+touchpad (upper left):
+Controller#1, Axis#0 X: -0.6059755, Y: 0.2301706
+Controller#1, Axis#1 X: 0.0, Y: 0.0
+Controller#1, Axis#2 X: 0.0, Y: 0.0
+Controller#1, Axis#3 X: 0.0, Y: 0.0
+Controller#1, Axis#4 X: 0.0, Y: 0.0
+Button press: 4294967296 (when pressed in), touch: 4294967296
+
+grip:
+Controller#1, Axis#0 X: 0.0, Y: 0.0
+Controller#1, Axis#1 X: 0.0, Y: 0.0
+Controller#1, Axis#2 X: 0.0, Y: 0.0
+Controller#1, Axis#3 X: 0.0, Y: 0.0
+Controller#1, Axis#4 X: 0.0, Y: 0.0
+Button press: 4, touch: 4
+
+thumb:
+Controller#1, Axis#0 X: 0.0, Y: 0.0
+Controller#1, Axis#1 X: 0.0, Y: 0.0
+Controller#1, Axis#2 X: 0.0, Y: 0.0
+Controller#1, Axis#3 X: 0.0, Y: 0.0
+Controller#1, Axis#4 X: 0.0, Y: 0.0
+Button press: 2, touch: 2
+
+*/
+
+/**
+ * A class that wraps an OpenVR input.
+ * null
values will be returned if no valid pose exists, or that input device isn't available
+ * user code should check for null
values.
+ * @author reden - phr00t - https://github.com/phr00t
+ * @author Julien Seinturier - (c) 2016 - JOrigin project - http:/www.jorigin.org
+ */
+public class OpenVRInput implements VRInputAPI {
+
+ private static final VRControllerState_t[] cStates = new VRControllerState_t[JOpenVRLibrary.k_unMaxTrackedDeviceCount];
+
+ private static final Quaternion[] rotStore = new Quaternion[JOpenVRLibrary.k_unMaxTrackedDeviceCount];
+
+ private static final Vector3f[] posStore = new Vector3f[JOpenVRLibrary.k_unMaxTrackedDeviceCount];
+
+ private static final int[] controllerIndex = new int[JOpenVRLibrary.k_unMaxTrackedDeviceCount];
+
+ private static int controllerCount = 0;
+
+ private static final Vector2f tempAxis = new Vector2f(), temp2Axis = new Vector2f();
+
+ private static final Vector2f lastCallAxis[] = new Vector2f[JOpenVRLibrary.k_unMaxTrackedDeviceCount];
+
+ private static final boolean needsNewVelocity[] = new boolean[JOpenVRLibrary.k_unMaxTrackedDeviceCount];
+
+ private static final boolean needsNewAngVelocity[] = new boolean[JOpenVRLibrary.k_unMaxTrackedDeviceCount];
+
+ private static final boolean buttonDown[][] = new boolean[JOpenVRLibrary.k_unMaxTrackedDeviceCount][16];
+
+ private static float axisMultiplier = 1f;
+
+ private static final Vector3f tempVel = new Vector3f();
+
+ private static final Quaternion tempq = new Quaternion();
+
+ @Override
+ public float getAxisMultiplier() {
+ return axisMultiplier;
+ }
+
+ @Override
+ public void setAxisMultiplier(float set) {
+ axisMultiplier = set;
+ }
+
+ @Override
+ public void swapHands() {
+ if( controllerCount != 2 ) return;
+ int temp = controllerIndex[0];
+ controllerIndex[0] = controllerIndex[1];
+ controllerIndex[1] = temp;
+ }
+
+ @Override
+ public boolean isButtonDown(int controllerIndex, VRInputType checkButton) {
+ VRControllerState_t cs = cStates[OpenVRInput.controllerIndex[controllerIndex]];
+ switch( checkButton ) {
+ default:
+ return false;
+ case ViveGripButton:
+ return (cs.ulButtonPressed & 4) != 0;
+ case ViveMenuButton:
+ return (cs.ulButtonPressed & 2) != 0;
+ case ViveTrackpadAxis:
+ return (cs.ulButtonPressed & 4294967296l) != 0;
+ case ViveTriggerAxis:
+ return (cs.ulButtonPressed & 8589934592l) != 0;
+ }
+ }
+
+ @Override
+ public boolean wasButtonPressedSinceLastCall(int controllerIndex, VRInputType checkButton) {
+ boolean buttonDownNow = isButtonDown(controllerIndex, checkButton);
+ int checkButtonValue = checkButton.getValue();
+ int cIndex = OpenVRInput.controllerIndex[controllerIndex];
+ boolean retval = buttonDownNow == true && buttonDown[cIndex][checkButtonValue] == false;
+ buttonDown[cIndex][checkButtonValue] = buttonDownNow;
+ return retval;
+ }
+
+ @Override
+ public void resetInputSinceLastCall() {
+ for(int i=0;i= controllerCount ) return false;
+ return OpenVR.hmdTrackedDevicePoses[controllerIndex[index]].bPoseIsValid != 0;
+ }
+
+ @Override
+ public Quaternion getOrientation(int index) {
+ if( isInputDeviceTracking(index) == false ) return null;
+ index = controllerIndex[index];
+ VRUtil.convertMatrix4toQuat(OpenVR.poseMatrices[index], rotStore[index]);
+ return rotStore[index];
+ }
+
+ @Override
+ public Vector3f getPosition(int index) {
+ if( isInputDeviceTracking(index) == false ) return null;
+ // the hmdPose comes in rotated funny, fix that here
+ index = controllerIndex[index];
+ OpenVR.poseMatrices[index].toTranslationVector(posStore[index]);
+ posStore[index].x = -posStore[index].x;
+ posStore[index].z = -posStore[index].z;
+ return posStore[index];
+ }
+
+ @Override
+ public Quaternion getFinalObserverRotation(int index) {
+ VRViewManager vrvm = VRApplication.getVRViewManager();
+ if( vrvm == null || isInputDeviceTracking(index) == false ) return null;
+ Object obs = VRApplication.getObserver();
+ if( obs instanceof Camera ) {
+ tempq.set(((Camera)obs).getRotation());
+ } else {
+ tempq.set(((Spatial)obs).getWorldRotation());
+ }
+ return tempq.multLocal(getOrientation(index));
+ }
+
+ @Override
+ public Vector3f getFinalObserverPosition(int index) {
+ VRViewManager vrvm = VRApplication.getVRViewManager();
+ if( vrvm == null || isInputDeviceTracking(index) == false ) return null;
+ Object obs = VRApplication.getObserver();
+ Vector3f pos = getPosition(index);
+ if( obs instanceof Camera ) {
+ ((Camera)obs).getRotation().mult(pos, pos);
+ return pos.addLocal(((Camera)obs).getLocation());
+ } else {
+ ((Spatial)obs).getWorldRotation().mult(pos, pos);
+ return pos.addLocal(((Spatial)obs).getWorldTranslation());
+ }
+ }
+
+ @Override
+ public void triggerHapticPulse(int controllerIndex, float seconds) {
+ if( VRApplication.isInVR() == false || isInputDeviceTracking(controllerIndex) == false ) return;
+ // apparently only axis ID of 0 works
+ ((VR_IVRSystem_FnTable)VRApplication.getVRHardware().getVRSystem()).TriggerHapticPulse.apply(OpenVRInput.controllerIndex[controllerIndex],
+ 0, (short)Math.round(3f * seconds / 1e-3f));
+ }
+
+ @Override
+ public void updateConnectedControllers() {
+ controllerCount = 0;
+ for(int i=0;ihttp:/www.jorigin.org
+ */
+public interface VRAPI {
+
+ /**
+ * Initialize this object from a VR system. All the native bindings to underlying VR system should be done within this method.
+ * @return true
if the initialization is a success and false
otherwise.
+ */
+ public boolean initialize();
+
+ /**
+ * Initialize the VR compositor that will be used for rendering.
+ * @param allowed true
if the use of VR compositor is allowed and false
otherwise.
+ * @return true
if the initialization is a success and false
otherwise.
+ */
+ public boolean initVRCompositor(boolean allowed);
+
+ /**
+ * Get the object that wraps natively the VR system.
+ * @return the object that wraps natively the VR system.
+ */
+ public Object getVRSystem();
+
+ /**
+ * Get the object that wraps natively the VR compositor.
+ * @return the object that wraps natively the VR system.
+ */
+ public Object getCompositor();
+
+ /**
+ * Get the name of the underlying VR system.
+ * @return the name of the underlying VR system.
+ */
+ public String getName();
+
+ /**
+ * Get the input provided by the underlying VR system.
+ * @return the input provided by the underlying VR system.
+ */
+ public VRInputAPI getVRinput();
+
+ /**
+ * Do not use. Prefers the preconfigure routine from the VRApplication.
+ * @param set true
if the eyes has to be flipped and false
otherwise.
+ */
+ public void _setFlipEyes(boolean set);
+
+ /**
+ * Set if latency information has to be logged.
+ * @param set true
if latency information has to be logged and false
otherwise.
+ */
+ public void printLatencyInfoToConsole(boolean set);
+
+ /**
+ * Get the Head Mounted Device (HMD) display frequency.
+ * @return the Head Mounted DEvice (HMD) display frequency.
+ */
+ public int getDisplayFrequency();
+
+ /**
+ * Close the link with underlying VR system and free all attached resources.
+ */
+ public void destroy();
+
+ /**
+ * Check if the VR API is initialized.
+ * @return true
if the VR API is initialized and false
otherwise.
+ * @see #initialize()
+ */
+ public boolean isInitialized();
+
+ /**
+ * Reset the VR system.
+ */
+ public void reset();
+
+ /**
+ * Get the size of an Head Mounted Device (HMD) rendering area in pixels.
+ * @param store the size of an Head Mounted Device (HMD) rendering area in pixels (modified).
+ */
+ public void getRenderSize(Vector2f store);
+
+ //public float getFOV(int dir);
+
+ /**
+ * Get the Head Mounted Device (HMD) interpupilar distance in meters.
+ * @return the Head Mounted Device (HMD) interpupilar distance in meters.
+ */
+ public float getInterpupillaryDistance();
+
+ /**
+ * Get the Head Mounted Device (HMD) orientation.
+ * @return the Head Mounted Device (HMD) orientation.
+ */
+ public Quaternion getOrientation();
+
+ /**
+ * Get the Head Mounted Device (HMD) position.
+ * @return the Head Mounted Device (HMD) orientation.
+ */
+ public Vector3f getPosition();
+
+ /**
+ * Get the Head Mounted Device (HMD) position and orientation.
+ * @param storePos the Head Mounted Device (HMD) position (modified).
+ * @param storeRot the Head Mounted Device (HMD) rotation (modified).
+ */
+ public void getPositionAndOrientation(Vector3f storePos, Quaternion storeRot);
+
+ /**
+ * Update Head Mounted Device (HMD) pose internal storage. This method should be called before other calls to HMD position/orientation access.
+ */
+ public void updatePose();
+
+ /**
+ * Get the Head Mounted Device (HMD) left eye projection matrix.
+ * @param cam the camera attached to the left eye.
+ * @return the Head Mounted Device (HMD) left eye projection matrix.
+ */
+ public Matrix4f getHMDMatrixProjectionLeftEye(Camera cam);
+
+ /**
+ * Get the Head Mounted Device (HMD) right eye projection matrix.
+ * @param cam the camera attached to the right eye.
+ * @return the Head Mounted Device (HMD) right eye projection matrix.
+ */
+ public Matrix4f getHMDMatrixProjectionRightEye(Camera cam);
+
+ /**
+ * Get the Head Mounted Device (HMD) left eye pose (position of the eye from the head) as a {@link Vector3f vector}.
+ * @return the Head Mounted Device (HMD) left eye pose as a {@link Vector3f vector}.
+ */
+ public Vector3f getHMDVectorPoseLeftEye();
+
+ /**
+ * Get the Head Mounted Device (HMD) right eye pose (position of the eye from the head) as a {@link Vector3f vector}.
+ * @return the Head Mounted Device (HMD) right eye pose as a {@link Vector3f vector}.
+ */
+ public Vector3f getHMDVectorPoseRightEye();
+
+ /**
+ * Returns the transform between the view space and left eye space.
+ * Eye space is the per-eye flavor of view space that provides stereo disparity.
+ * Instead of Model * View * Projection the model is Model * View * Eye * Projection.
+ * Normally View and Eye will be multiplied together and treated as View.
+ * This matrix incorporates the user's interpupillary distance (IPD).
+ * @return the transform between the view space and eye space.
+ */
+ public Matrix4f getHMDMatrixPoseLeftEye();
+
+ /**
+ * Returns the transform between the view space and right eye space.
+ * Eye space is the per-eye flavor of view space that provides stereo disparity.
+ * Instead of Model * View * Projection the model is Model * View * Eye * Projection.
+ * Normally View and Eye will be multiplied together and treated as View.
+ * This matrix incorporates the user's interpupillary distance (IPD).
+ * @return the transform between the view space and eye space.
+ */
+ public Matrix4f getHMDMatrixPoseRightEye();
+
+ /**
+ * Get the Head Mounted Device (HMD) type.
+ * @return the Head Mounted Device (HMD) type.
+ */
+ public HmdType getType();
+
+ /**
+ * Get the seated to absolute position.
+ * @return the seated to absolute position.
+ */
+ public Vector3f getSeatedToAbsolutePosition();
+
+}
diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/VRBounds.java b/jme3-vr/src/main/java/com/jme3/input/vr/VRBounds.java
new file mode 100644
index 000000000..5e774d67c
--- /dev/null
+++ b/jme3-vr/src/main/java/com/jme3/input/vr/VRBounds.java
@@ -0,0 +1,48 @@
+package com.jme3.input.vr;
+
+import com.jme3.math.Vector2f;
+import java.nio.FloatBuffer;
+import jopenvr.JOpenVRLibrary;
+import jopenvr.VR_IVRChaperone_FnTable;
+
+/**
+ * A class that represents VR world bounds.
+ * @author reden - phr00t - https://github.com/phr00t
+ * @author Julien Seinturier - (c) 2016 - JOrigin project - http:/www.jorigin.org
+ */
+public class VRBounds {
+
+ private static VR_IVRChaperone_FnTable vrChaperone;
+ private static Vector2f playSize;
+
+ /**
+ * Initialize the VR bounds.
+ * @return true
if the initialization is a success and false
otherwise.
+ */
+ public static boolean init() {
+ if( vrChaperone == null ) {
+ vrChaperone = new VR_IVRChaperone_FnTable(JOpenVRLibrary.VR_GetGenericInterface(JOpenVRLibrary.IVRChaperone_Version, OpenVR.hmdErrorStore));
+ if( vrChaperone != null ) {
+ vrChaperone.setAutoSynch(false);
+ vrChaperone.read();
+ FloatBuffer fbX = FloatBuffer.allocate(1);
+ FloatBuffer fbZ = FloatBuffer.allocate(1);
+ vrChaperone.GetPlayAreaSize.apply(fbX, fbZ);
+ playSize = new Vector2f(fbX.get(0), fbZ.get(0));
+ return true; // init success
+ }
+ return false; // failed to init
+ }
+ return true; // already initialized
+ }
+
+ /**
+ * Get the size of the VR world.
+ * @return the size of the VR world.
+ */
+ public static Vector2f getPlaySize() {
+ return playSize;
+ }
+
+}
+
diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/VRInputAPI.java b/jme3-vr/src/main/java/com/jme3/input/vr/VRInputAPI.java
new file mode 100644
index 000000000..4b491e0af
--- /dev/null
+++ b/jme3-vr/src/main/java/com/jme3/input/vr/VRInputAPI.java
@@ -0,0 +1,188 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.jme3.input.vr;
+
+import com.jme3.math.Quaternion;
+import com.jme3.math.Vector2f;
+import com.jme3.math.Vector3f;
+
+/**
+ * An interface that represents a VR input (typically a VR device such as a controller).
+ * @author reden - phr00t - https://github.com/phr00t
+ * @author Julien Seinturier - (c) 2016 - JOrigin project - http:/www.jorigin.org
+ */
+public interface VRInputAPI {
+
+ /**
+ * Check if the given button is down (more generally if the given input type is activated).
+ * @param controllerIndex the index of the controller to check.
+ * @param checkButton the button / input to check.
+ * @return true
if the button / input is down / activated and false
otherwise.
+ */
+ public boolean isButtonDown(int controllerIndex, VRInputType checkButton);
+
+ /**
+ * Check if the given button / input from the given controller has been just pressed / activated.
+ * @param controllerIndex the index of the controller.
+ * @param checkButton the button / input to check.
+ * @return true
if the given button / input from the given controller has been just pressed / activated and false
otherwise.
+ */
+ public boolean wasButtonPressedSinceLastCall(int controllerIndex, VRInputType checkButton);
+
+ /**
+ * Reset the current activation of the inputs. After a call to this method, all input activation is considered as new activation.
+ * @see #wasButtonPressedSinceLastCall(int, VRInputType)
+ */
+ public void resetInputSinceLastCall();
+
+ /**
+ * Get the controller axis delta from the last value.
+ * @param controllerIndex the index of the controller.
+ * @param forAxis the axis.
+ * @return the controller axis delta from the last call.
+ */
+ public Vector2f getAxisDeltaSinceLastCall(int controllerIndex, VRInputType forAxis);
+
+ /**
+ * Get the controller velocity on all axes.
+ * @param controllerIndex the index of the controller.
+ * @return the controller velocity on all axes.
+ * @see #getAngularVelocity(int)
+ */
+ public Vector3f getVelocity(int controllerIndex);
+
+ /**
+ * Get the controller angular velocity on all axes.
+ * @param controllerIndex the index of the controller.
+ * @return the controller angular velocity on all axes.
+ * @see #getVelocity(int)
+ */
+ public Vector3f getAngularVelocity(int controllerIndex);
+
+ /**
+ * Get the axis value for the given input on the given controller.
+ * This value is the {@link #getAxisRaw(int, VRInputType) raw value} multiplied by the {@link #getAxisMultiplier() axis multiplier}.
+ * @param controllerIndex the index of the controller.
+ * @param forAxis the axis.
+ * @return the axis value for the given input on the given controller.
+ * @see #getAxisRaw(int, VRInputType)
+ * @see #getAxisMultiplier()
+ */
+ public Vector2f getAxis(int controllerIndex, VRInputType forAxis);
+
+ /**
+ * Get the axis value for the given input on the given controller.
+ * @param controllerIndex the index of the controller.
+ * @param forAxis the axis.
+ * @return the axis value for the given input on the given controller.
+ * @see #getAxis(int, VRInputType)
+ */
+ public Vector2f getAxisRaw(int controllerIndex, VRInputType forAxis);
+
+ /**
+ * Initialize the input.
+ * @return true
if the initialization is successful and false
otherwise.
+ */
+ public boolean init();
+
+ /**
+ * Get the number of controller attached to the VR system.
+ * @return the number of controller attached to the VR system.
+ */
+ public int getTrackedControllerCount();
+
+ /**
+ * Update the connected controllers.
+ * This method should be used just after the initialization of the input.
+ */
+ public void updateConnectedControllers();
+
+ /**
+ * Update the controller states.
+ * This method should be called before accessing any controller data.
+ */
+ public void updateControllerStates();
+
+ /**
+ * Get the native wrapping of a controller state.
+ * @param index the index of the controller.
+ * @return the native wrapping of a controller state.
+ */
+ public Object getRawControllerState(int index);
+
+ /**
+ * Swap the two hands (exchange the hands controller 1 & 2 indices).
+ */
+ public void swapHands();
+
+ /**
+ * Get the controller axis multiplier.
+ * The controller axis raw data (trackpad, trigger, ...) value is multiplied by the one given in parameter.
+ * @return the controller axis multiplier.
+ * @see #setAxisMultiplier(float)
+ */
+ public float getAxisMultiplier();
+
+ /**
+ * Set the controller axis multiplier.
+ * The controller axis raw data (trackpad, trigger, ...) value is multiplied by the one given in parameter.
+ * @param set the controller axis multiplier.
+ * @see #getAxisMultiplier()
+ */
+ public void setAxisMultiplier(float set);
+
+ //public Matrix4f getPoseForInputDevice(int index);
+
+ /**
+ * Check if the VR system has the focus and if it's not used by other process.
+ * @return true
if the VR system has the focus and false
otherwise.
+ */
+ public boolean isInputFocused();
+
+ /**
+ * Check if the input device is actually tracked (i-e if we can obtain a pose from the input).
+ * @param index the index of the controller.
+ * @return true
if the input device is actually tracked and false
otherwise.
+ */
+ public boolean isInputDeviceTracking(int index);
+
+ /**
+ * Get the orientation of the input.
+ * @param index the index of the controller.
+ * @return the orientation of the input.
+ */
+ public Quaternion getOrientation(int index);
+
+ /**
+ * Get the position of the input.
+ * @param index the index of the controller.
+ * @return the position of the input.
+ */
+ public Vector3f getPosition(int index);
+
+ /**
+ * Get where is the controller pointing, after all rotations are combined.
+ * This position should include includes observer rotation from the VR application.
+ * @param index the index of the controller.
+ * @return the rotation of the input after all positional tracking is complete.
+ */
+ public Quaternion getFinalObserverRotation(int index);
+
+ /**
+ * Get the position of the input after all positional tracking is complete.
+ * This position should include includes observer position from the VR application.
+ * @param index the index of the controller.
+ * @return the position of the input after all positional tracking is complete.
+ */
+ public Vector3f getFinalObserverPosition(int index);
+
+ /**
+ * Trigger an haptic pulse on the selected controller for the duration given in parameters (in seconds).
+ * @param controllerIndex the index of the controller.
+ * @param seconds the duration of the pulse in seconds.
+ */
+ public void triggerHapticPulse(int controllerIndex, float seconds);
+}
diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/VRInputType.java b/jme3-vr/src/main/java/com/jme3/input/vr/VRInputType.java
new file mode 100644
index 000000000..aca571f35
--- /dev/null
+++ b/jme3-vr/src/main/java/com/jme3/input/vr/VRInputType.java
@@ -0,0 +1,51 @@
+package com.jme3.input.vr;
+
+/**
+ * The type of a VR input. This enumeration enables to determine which part of the VR device is involved within input callback.
+ * @author reden - phr00t - https://github.com/phr00t
+ * @author Julien Seinturier - (c) 2016 - JOrigin project - http:/www.jorigin.org
+ *
+ */
+public enum VRInputType {
+
+ /**
+ * an HTC vive trigger axis (about Vive controller ).
+ */
+ ViveTriggerAxis(0),
+
+ /**
+ * an HTC vive trackpad axis (about Vive controller ).
+ */
+ ViveTrackpadAxis(1),
+
+ /**
+ * an HTC vive grip button (about Vive controller ).
+ */
+ ViveGripButton(2),
+
+ /**
+ * an HTC vive menu button (about Vive controller ).
+ */
+ ViveMenuButton(3);
+
+ /**
+ * The value that codes the input type.
+ */
+ private final int value;
+
+ /**
+ * Construct a new input type with the given code.
+ * @param value the code of the input type.
+ */
+ private VRInputType(int value) {
+ this.value = value;
+ }
+
+ /**
+ * Get the value (code) of the input type.
+ * @return the value (code) of the input type.
+ */
+ public int getValue() {
+ return value;
+ }
+}
\ No newline at end of file
diff --git a/jme3-vr/src/main/java/com/jme3/post/CartoonSSAO.java b/jme3-vr/src/main/java/com/jme3/post/CartoonSSAO.java
new file mode 100644
index 000000000..7b2135716
--- /dev/null
+++ b/jme3-vr/src/main/java/com/jme3/post/CartoonSSAO.java
@@ -0,0 +1,155 @@
+/*
+* To change this template, choose Tools | Templates
+* and open the template in the editor.
+*/
+package com.jme3.post;
+
+import com.jme3.app.VRApplication;
+import com.jme3.asset.AssetManager;
+import com.jme3.material.Material;
+import com.jme3.math.Vector2f;
+import com.jme3.math.Vector3f;
+import com.jme3.post.Filter;
+import com.jme3.renderer.RenderManager;
+import com.jme3.renderer.ViewPort;
+import com.jme3.renderer.queue.RenderQueue;
+import com.jme3.texture.Image.Format;
+
+/**
+ * A Cartoon Screen Space Ambient Occlusion filter with instance rendering capabilities.
+ * @author reden - phr00t - https://github.com/phr00t
+ * @author Julien Seinturier - (c) 2016 - JOrigin project - http:/www.jorigin.org
+ *
+ */
+public class CartoonSSAO extends Filter{
+ private Pass normalPass;
+ private Vector3f frustumCorner;
+ private Vector2f frustumNearFar;
+ private boolean useOutline = true;
+ private float downsample = 1f, applyDistance = 0.0005f;
+
+ RenderManager renderManager;
+ ViewPort viewPort;
+
+ /**
+ * Create a Screen Space Ambient Occlusion Filter
+ */
+ public CartoonSSAO() {
+ super("CartoonSSAO");
+ }
+
+ /**
+ * Create a Screen Space Ambient Occlusion Filter
+ * @param downsample factor to divide resolution by for filter, >1 increases speed but degrades quality
+ */
+ public CartoonSSAO(float downsample) {
+ this();
+ this.downsample = downsample;
+ }
+
+ /**
+ * Create a Screen Space Ambient Occlusion Filter from the given one (by copy).
+ * @param cloneFrom the original filter.
+ */
+ public CartoonSSAO(CartoonSSAO cloneFrom) {
+ this(cloneFrom.downsample);
+ }
+
+ @Override
+ protected boolean isRequiresDepthTexture() {
+ return true;
+ }
+
+ @Override
+ protected void postQueue(RenderQueue renderQueue) {
+ PreNormalCaching.getPreNormals(renderManager, normalPass, viewPort);
+ }
+
+ /**
+ * Set if outline has to be enabled.
+ * @param set true
if the outline has to be enabled and false
otherwise.
+ * @see #isOutlineEnabled()
+ */
+ public void setOutlineEnabled(boolean set) {
+ useOutline = set;
+ if( material != null ) {
+ if( useOutline ) {
+ material.clearParam("disableOutline");
+ } else {
+ material.setBoolean("disableOutline", true);
+ }
+ }
+ }
+
+ /**
+ * Is outline rendering is enabled.
+ * @return true
if the outline is enabled and false
otherwise.
+ * @see #setOutlineEnabled(boolean)
+ */
+ public boolean isOutlineEnabled() {
+ return useOutline;
+ }
+
+ /**
+ * Set the down sampling value.
+ * @param downsample the down sampling value.
+ * @see #getDownsampling()
+ */
+ public void setDownsampling(float downsample) {
+ this.downsample = downsample;
+ }
+
+ /**
+ * Get the down sampling value.
+ * @return the down sampling value.
+ * @see #setDownsampling(float)
+ */
+ public float getDownsampling() {
+ return this.downsample;
+ }
+
+ @Override
+ protected Material getMaterial() {
+ return material;
+ }
+
+ /**
+ * Set the distance of the material.
+ * @param dist the distance of the material.
+ */
+ public void setDistance(float dist) {
+ applyDistance = dist;
+ if( material != null ) material.setFloat("Distance", dist);
+ }
+
+ @Override
+ protected void initFilter(AssetManager manager, RenderManager renderManager, ViewPort vp, int w, int h) {
+ this.renderManager = renderManager;
+ this.viewPort = vp;
+
+ int screenWidth = Math.round(w / downsample);
+ int screenHeight = Math.round(h / downsample);
+
+ normalPass = new Pass();
+ normalPass.init(renderManager.getRenderer(), screenWidth, screenHeight, Format.RGBA8, Format.Depth);
+
+ frustumNearFar = new Vector2f();
+
+ float farY = (vp.getCamera().getFrustumTop() / vp.getCamera().getFrustumNear()) * vp.getCamera().getFrustumFar();
+ float farX = farY * ((float) screenWidth / (float) screenHeight);
+ frustumCorner = new Vector3f(farX, farY, vp.getCamera().getFrustumFar());
+ frustumNearFar.x = vp.getCamera().getFrustumNear();
+ frustumNearFar.y = vp.getCamera().getFrustumFar();
+
+ //ssao Pass
+ material = new Material(manager, "Common/MatDefs/VR/CartoonSSAO.j3md");
+ material.setTexture("Normals", normalPass.getRenderedTexture());
+
+ material.setVector3("FrustumCorner", frustumCorner);
+ material.setVector2("FrustumNearFar", frustumNearFar);
+ material.setFloat("Distance", applyDistance);
+ if( useOutline == false ) material.setBoolean("disableOutline", true);
+ if( VRApplication.isInstanceVRRendering() ) 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
new file mode 100644
index 000000000..d424cb5f1
--- /dev/null
+++ b/jme3-vr/src/main/java/com/jme3/post/OpenVRFilter.java
@@ -0,0 +1,206 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.jme3.post;
+
+import com.jme3.app.VRApplication;
+import com.jme3.asset.AssetManager;
+import com.jme3.material.Material;
+import com.jme3.post.Filter;
+import com.jme3.renderer.RenderManager;
+import com.jme3.renderer.Renderer;
+import com.jme3.renderer.ViewPort;
+import com.jme3.scene.Mesh;
+import com.jme3.scene.VertexBuffer;
+import com.jme3.texture.FrameBuffer;
+
+import jopenvr.DistortionCoordinates_t;
+import jopenvr.JOpenVRLibrary;
+import jopenvr.VR_IVRSystem_FnTable;
+
+/**
+ * DO NOT USE
+ * @author phr00t
+ * @deprecated DO NOT USE
+ */
+@Deprecated
+public class OpenVRFilter extends Filter {
+
+ private Mesh distortionMesh;
+
+ /**
+ * DO NOT USE
+ */
+ public OpenVRFilter() {
+
+ }
+
+ /**
+ * DO NOT USE
+ * @return the distortion mesh.
+ */
+ public Mesh getDistortionMesh() {
+ return distortionMesh;
+ }
+
+ @Override
+ protected void initFilter(AssetManager manager, RenderManager renderManager, ViewPort vp, int w, int h) {
+ material = new Material(manager, "Common/MatDefs/VR/OpenVR.j3md");
+ configureDistortionMesh();
+ }
+
+ @Override
+ protected Material getMaterial() {
+ return material;
+
+ }
+
+ @Override
+ protected void preFrame(float tpf) {
+ super.preFrame(tpf);
+ }
+
+ @Override
+ protected void postFrame(RenderManager renderManager, ViewPort viewPort, FrameBuffer prevFilterBuffer, FrameBuffer sceneBuffer) {
+ super.postFrame(renderManager, viewPort, prevFilterBuffer, sceneBuffer);
+ }
+
+ @Override
+ protected void postFilter(Renderer r, FrameBuffer buffer) {
+ super.postFilter(r, buffer);
+ }
+
+ /*
+ function converted from:
+ https://github.com/ValveSoftware/openvr/blob/master/samples/hellovr_opengl/hellovr_opengl_main.cpp#L1335
+ */
+ private void configureDistortionMesh() {
+ float m_iLensGridSegmentCountH = 43, m_iLensGridSegmentCountV = 43;
+
+ float w = 1f / m_iLensGridSegmentCountH - 1f;
+ float h = 1f / m_iLensGridSegmentCountV - 1f;
+
+ float u, v;
+
+ distortionMesh = new Mesh();
+ float verts[] = new float[(int)(m_iLensGridSegmentCountV * m_iLensGridSegmentCountH) * 3];
+
+ float texcoordR[] = new float[(int)(m_iLensGridSegmentCountV * m_iLensGridSegmentCountH) * 2];
+ float texcoordG[] = new float[(int)(m_iLensGridSegmentCountV * m_iLensGridSegmentCountH) * 2];
+ float texcoordB[] = new float[(int)(m_iLensGridSegmentCountV * m_iLensGridSegmentCountH) * 2];
+
+ int vertPos = 0, coordPos = 0;
+
+ //left eye distortion verts
+ float Xoffset = -1f;
+ for( int y=0; y vIndices;
+ int[] indices = new int[(int)((m_iLensGridSegmentCountV - 1) * (m_iLensGridSegmentCountH - 1)) * 6];
+ int indexPos = 0;
+ int a,b,c,d;
+
+ int offset = 0;
+ for( int y=0; yhttp:/www.jorigin.org
+ */
+public class PreNormalCaching {
+
+ private static FrameBuffer cachedPreNormals;
+ private static int lastNormalPassesCount, curCount;
+
+ /**
+ * Get pre-normals from the given rendering.
+ * @param renderManager the render manager.
+ * @param normalPass the normal pass.
+ * @param viewPort the viewport.
+ */
+ public static void getPreNormals(RenderManager renderManager, Pass normalPass, ViewPort viewPort) {
+ curCount++;
+ // do we already have a valid cache to set the framebuffer to?
+ Renderer r = renderManager.getRenderer();
+ if( cachedPreNormals != null ) {
+ r.copyFrameBuffer(cachedPreNormals, normalPass.getRenderFrameBuffer(), false);
+ } else {
+ // lets make the prenormals
+ r.setFrameBuffer(normalPass.getRenderFrameBuffer());
+ renderManager.getRenderer().clearBuffers(true, true, true);
+ if( renderManager.getRenderer().getCaps().contains(Caps.GLSL150) ) {
+ renderManager.setForcedTechnique("PreNormalPass15");
+ } else {
+ renderManager.setForcedTechnique("PreNormalPass");
+ }
+ renderManager.renderViewPortQueues(viewPort, false);
+ renderManager.setForcedTechnique(null);
+ // if we should cache this, do it now
+ if( lastNormalPassesCount > 1 ) {
+ cachedPreNormals = normalPass.getRenderFrameBuffer();
+ }
+ }
+ renderManager.getRenderer().setFrameBuffer(viewPort.getOutputFrameBuffer());
+ }
+
+ /**
+ *
+ */
+ public static void resetCache() {
+ if( VRApplication.isInVR() == false ) {
+ // only use this feature if we are NOT in VR
+ // we can't use the same normal information for another eye,
+ // because it will be different!
+ lastNormalPassesCount = curCount;
+ }
+ cachedPreNormals = null;
+ curCount = 0;
+ }
+
+}
diff --git a/jme3-vr/src/main/java/com/jme3/shadow/AbstractShadowFilterVR.java b/jme3-vr/src/main/java/com/jme3/shadow/AbstractShadowFilterVR.java
new file mode 100644
index 000000000..00ab55319
--- /dev/null
+++ b/jme3-vr/src/main/java/com/jme3/shadow/AbstractShadowFilterVR.java
@@ -0,0 +1,332 @@
+package com.jme3.shadow;
+
+/*
+ * Copyright (c) 2009-2012 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import com.jme3.asset.AssetManager;
+import com.jme3.export.JmeExporter;
+import com.jme3.export.JmeImporter;
+import com.jme3.material.Material;
+import com.jme3.material.RenderState;
+import com.jme3.math.Matrix4f;
+import com.jme3.math.Vector4f;
+import com.jme3.post.Filter;
+import com.jme3.renderer.RenderManager;
+import com.jme3.renderer.ViewPort;
+import com.jme3.renderer.queue.RenderQueue;
+import com.jme3.shadow.CompareMode;
+import com.jme3.shadow.EdgeFilteringMode;
+import com.jme3.texture.FrameBuffer;
+
+import java.io.IOException;
+
+/**
+ * Generic abstract filter that holds common implementations for the different
+ * shadow filters.
+ *
+ * @author Rémy Bouquet aka Nehon
+ * @author reden - phr00t - https://github.com/phr00t
+ * @author Julien Seinturier - (c) 2016 - JOrigin project - http:/www.jorigin.org
+ * @param the type of the underlying renderer (subclass of {@link AbstractShadowRendererVR}).
+ */
+public abstract class AbstractShadowFilterVR extends Filter {
+
+ protected T shadowRenderer;
+ protected ViewPort viewPort;
+
+ /**
+ * Abstract class constructor
+ *
+ * @param manager the application asset manager
+ * @param shadowMapSize the size of the rendered shadowmaps (512,1024,2048,
+ * etc...)
+ * @param nbShadowMaps the number of shadow maps rendered (the more shadow
+ * maps the more quality, the less fps).
+ * @param shadowRenderer the shadowRenderer to use for this Filter
+ */
+ @SuppressWarnings("all")
+ protected AbstractShadowFilterVR(AssetManager manager, int shadowMapSize, T shadowRenderer) {
+ super("Post Shadow");
+ material = new Material(manager, "Common/MatDefs/Shadow/PostShadowFilter.j3md");
+ this.shadowRenderer = shadowRenderer;
+ this.shadowRenderer.setPostShadowMaterial(material);
+
+ //this is legacy setting for shadows with backface shadows
+ this.shadowRenderer.setRenderBackFacesShadows(true);
+ }
+
+ @SuppressWarnings("all")
+ protected AbstractShadowFilterVR(AssetManager manager, int shadowMapSize, T shadowRenderer, String useMatDef) {
+ super("Post Shadow");
+ material = new Material(manager, useMatDef);
+ this.shadowRenderer = shadowRenderer;
+ this.shadowRenderer.setPostShadowMaterial(material);
+ }
+
+ @Override
+ protected Material getMaterial() {
+ return material;
+ }
+
+ @Override
+ protected boolean isRequiresDepthTexture() {
+ return true;
+ }
+
+ /**
+ * Get the {@link Material material} used by this filter.
+ * @return the {@link Material material} used by this filter.
+ */
+ public Material getShadowMaterial() {
+ return material;
+ }
+
+ Vector4f tmpv = new Vector4f();
+
+ @Override
+ protected void preFrame(float tpf) {
+ shadowRenderer.preFrame(tpf);
+ material.setMatrix4("ViewProjectionMatrixInverse", viewPort.getCamera().getViewProjectionMatrix().invert());
+ Matrix4f m = viewPort.getCamera().getViewProjectionMatrix();
+ material.setVector4("ViewProjectionMatrixRow2", tmpv.set(m.m20, m.m21, m.m22, m.m23));
+
+ }
+
+ @Override
+ protected void postQueue(RenderQueue queue) {
+ shadowRenderer.postQueue(queue);
+ if(shadowRenderer.skipPostPass){
+ //removing the shadow map so that the post pass is skipped
+ material.setTexture("ShadowMap0", null);
+ }
+ }
+
+ @Override
+ protected void postFrame(RenderManager renderManager, ViewPort viewPort, FrameBuffer prevFilterBuffer, FrameBuffer sceneBuffer) {
+ if(!shadowRenderer.skipPostPass){
+ shadowRenderer.setPostShadowParams();
+ }
+ }
+
+ @Override
+ protected void initFilter(AssetManager manager, RenderManager renderManager, ViewPort vp, int w, int h) {
+ shadowRenderer.needsfallBackMaterial = true;
+ shadowRenderer.initialize(renderManager, vp);
+ this.viewPort = vp;
+ }
+
+ /**
+ * How far the shadows are rendered in the view
+ *
+ * @see #setShadowZExtend(float zFar)
+ * @return shadowZExtend
+ */
+ public float getShadowZExtend() {
+ return shadowRenderer.getShadowZExtend();
+ }
+
+ /**
+ * Set the distance from the eye where the shadows will be rendered default
+ * value is dynamically computed to the shadow casters/receivers union bound
+ * zFar, capped to view frustum far value.
+ *
+ * @param zFar the zFar values that override the computed one
+ */
+ public void setShadowZExtend(float zFar) {
+ shadowRenderer.setShadowZExtend(zFar);
+ }
+
+ /**
+ * Define the length over which the shadow will fade out when using a
+ * shadowZextend
+ *
+ * @param length the fade length in world units
+ */
+ public void setShadowZFadeLength(float length) {
+ shadowRenderer.setShadowZFadeLength(length);
+ }
+
+ /**
+ * get the length over which the shadow will fade out when using a
+ * shadowZextend
+ *
+ * @return the fade length in world units
+ */
+ public float getShadowZFadeLength() {
+ return shadowRenderer.getShadowZFadeLength();
+ }
+
+ /**
+ * returns the shdaow intensity
+ *
+ * @see #setShadowIntensity(float shadowIntensity)
+ * @return shadowIntensity
+ */
+ public float getShadowIntensity() {
+ return shadowRenderer.getShadowIntensity();
+ }
+
+ /**
+ * Set the shadowIntensity, the value should be between 0 and 1, a 0 value
+ * gives a bright and invisible shadow, a 1 value gives a pitch black
+ * shadow, default is 0.7
+ *
+ * @param shadowIntensity the darkness of the shadow
+ */
+ final public void setShadowIntensity(float shadowIntensity) {
+ shadowRenderer.setShadowIntensity(shadowIntensity);
+ }
+
+ /**
+ * returns the edges thickness
+ *
+ * @see #setEdgesThickness(int edgesThickness)
+ * @return edgesThickness
+ */
+ public int getEdgesThickness() {
+ return shadowRenderer.getEdgesThickness();
+ }
+
+ /**
+ * Sets the shadow edges thickness. default is 1, setting it to lower values
+ * can help to reduce the jagged effect of the shadow edges
+ * @param edgesThickness the edge thickness.
+ */
+ public void setEdgesThickness(int edgesThickness) {
+ shadowRenderer.setEdgesThickness(edgesThickness);
+ }
+
+ /**
+ * isFlushQueues does nothing and is kept only for backward compatibility.
+ * @return false
+ * @deprecated does nothing and is kept only for backward compatibility.
+ */
+ @Deprecated
+ public boolean isFlushQueues() {
+ return shadowRenderer.isFlushQueues();
+ }
+
+ /**
+ * setFlushQueues does nothing now and is kept only for backward compatibility.
+ * @param flushQueues can be true
or false
.
+ * @deprecated does nothing now and is kept only for backward compatibility.
+ */
+ @Deprecated
+ public void setFlushQueues(boolean flushQueues) {}
+
+ /**
+ * Sets the shadow compare mode (see {@link CompareMode} for more info).
+ * @param compareMode the compare mode.
+ */
+ final public void setShadowCompareMode(CompareMode compareMode) {
+ shadowRenderer.setShadowCompareMode(compareMode);
+ }
+
+ /**
+ * Get the shadow compare mode.
+ *
+ * @return the shadow compare mode.
+ * @see CompareMode
+ */
+ public CompareMode getShadowCompareMode() {
+ return shadowRenderer.getShadowCompareMode();
+ }
+
+ /**
+ * Sets the filtering mode for shadow edges see {@link EdgeFilteringMode} for more info
+ * @param filterMode the filtering mode for shadow edges.
+ */
+ final public void setEdgeFilteringMode(EdgeFilteringMode filterMode) {
+ shadowRenderer.setEdgeFilteringMode(filterMode);
+ }
+
+ /**
+ *
+ * WARNING this parameter is defaulted to true
for the shadow filter. Setting it to true
, may produce edges artifacts on shadows.
+ *
+ * Set to true
if you want back faces shadows on geometries.
+ * Note that back faces shadows will be blended over dark lighten areas and may produce overly dark lighting.
+ *
+ * Setting this parameter will override this parameter for ALL materials in the scene.
+ * This also will automatically adjust the face cull mode and the PolyOffset of the pre shadow pass.
+ * You can modify them by using {@link #getPreShadowForcedRenderState()}.
+ *
+ * If you want to set it differently for each material in the scene you have to use the ShadowRenderer instead
+ * of the shadow filter.
+ *
+ * @param renderBackFacesShadows true
if back faces shadows on geometries have to be rendered and false
otherwise.
+ */
+ public void setRenderBackFacesShadows(Boolean renderBackFacesShadows) {
+ shadowRenderer.setRenderBackFacesShadows(renderBackFacesShadows);
+ }
+
+ /**
+ * Is this filter renders back faces shadows.
+ * @return true
if this filter renders back faces shadows and false
otherwise.
+ */
+ public boolean isRenderBackFacesShadows() {
+ return shadowRenderer.isRenderBackFacesShadows();
+ }
+
+ /**
+ * Get the pre-shadows pass render state.
+ * use it to adjust the RenderState parameters of the pre shadow pass.
+ * Note that this will be overridden if the preShadow technique in the material has a ForcedRenderState
+ * @return the pre shadow render state.
+ */
+ public RenderState getPreShadowForcedRenderState() {
+ return shadowRenderer.getPreShadowForcedRenderState();
+ }
+
+
+ /**
+ * Get the the edge filtering mode.
+ * @return the edge filtering mode.
+ */
+ public EdgeFilteringMode getEdgeFilteringMode() {
+ return shadowRenderer.getEdgeFilteringMode();
+ }
+
+ @Override
+ public void write(JmeExporter ex) throws IOException {
+ super.write(ex);
+ //OutputCapsule oc = ex.getCapsule(this);
+
+ }
+
+ @Override
+ public void read(JmeImporter im) throws IOException {
+ super.read(im);
+ //InputCapsule ic = im.getCapsule(this);
+
+ }
+}
diff --git a/jme3-vr/src/main/java/com/jme3/shadow/AbstractShadowRendererVR.java b/jme3-vr/src/main/java/com/jme3/shadow/AbstractShadowRendererVR.java
new file mode 100644
index 000000000..f11eb9704
--- /dev/null
+++ b/jme3-vr/src/main/java/com/jme3/shadow/AbstractShadowRendererVR.java
@@ -0,0 +1,834 @@
+package com.jme3.shadow;
+
+/*
+ * Copyright (c) 2009-2012 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import com.jme3.asset.AssetManager;
+import com.jme3.export.InputCapsule;
+import com.jme3.export.JmeExporter;
+import com.jme3.export.JmeImporter;
+import com.jme3.export.OutputCapsule;
+import com.jme3.export.Savable;
+import com.jme3.material.Material;
+import com.jme3.material.RenderState;
+import com.jme3.math.ColorRGBA;
+import com.jme3.math.Matrix4f;
+import com.jme3.math.Vector2f;
+import com.jme3.math.Vector3f;
+import com.jme3.post.SceneProcessor;
+import com.jme3.renderer.Camera;
+import com.jme3.renderer.RenderManager;
+import com.jme3.renderer.Renderer;
+import com.jme3.renderer.ViewPort;
+import com.jme3.renderer.queue.GeometryList;
+import com.jme3.renderer.queue.OpaqueComparator;
+import com.jme3.renderer.queue.RenderQueue;
+import com.jme3.renderer.queue.RenderQueue.ShadowMode;
+import com.jme3.scene.Geometry;
+import com.jme3.scene.Spatial;
+import com.jme3.scene.debug.WireFrustum;
+import com.jme3.shadow.CompareMode;
+import com.jme3.shadow.EdgeFilteringMode;
+import com.jme3.texture.FrameBuffer;
+import com.jme3.texture.Image.Format;
+import com.jme3.texture.Texture.MagFilter;
+import com.jme3.texture.Texture.MinFilter;
+import com.jme3.texture.Texture.ShadowCompareMode;
+import com.jme3.texture.Texture2D;
+import com.jme3.ui.Picture;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Abstract shadow renderer that holds commons feature to have for a shadow
+ * renderer.
+ *
+ * @author Rémy Bouquet aka Nehon
+ * @author reden - phr00t - https://github.com/phr00t
+ * @author Julien Seinturier - (c) 2016 - JOrigin project - http:/www.jorigin.org
+ */
+public abstract class AbstractShadowRendererVR implements SceneProcessor, Savable {
+
+ protected int nbShadowMaps = 1;
+ protected float shadowMapSize;
+ protected float shadowIntensity = 0.7f;
+ protected RenderManager renderManager;
+ protected ViewPort viewPort;
+ protected FrameBuffer[] shadowFB;
+ protected Texture2D[] shadowMaps;
+ protected Texture2D dummyTex;
+ protected Material preshadowMat;
+ protected Material postshadowMat;
+ protected Matrix4f[] lightViewProjectionsMatrices;
+ protected AssetManager assetManager;
+ protected boolean debug = false;
+ protected float edgesThickness = 1.0f;
+ protected EdgeFilteringMode edgeFilteringMode = EdgeFilteringMode.Bilinear;
+ protected CompareMode shadowCompareMode = CompareMode.Hardware;
+ protected Picture[] dispPic;
+ protected RenderState forcedRenderState = new RenderState();
+ protected Boolean renderBackFacesShadows;
+
+ /**
+ * true if the fallback material should be used, otherwise false
+ */
+ protected boolean needsfallBackMaterial = false;
+ /**
+ * name of the post material technique
+ */
+ protected String postTechniqueName = "PostShadow";
+ /**
+ * list of materials for post shadow queue geometries
+ */
+ protected List matCache = new ArrayList();
+ protected GeometryList lightReceivers = new GeometryList(new OpaqueComparator());
+ protected GeometryList shadowMapOccluders = new GeometryList(new OpaqueComparator());
+ private String[] shadowMapStringCache;
+ private String[] lightViewStringCache;
+ /**
+ * fade shadows at distance
+ */
+ protected float zFarOverride = 0;
+ protected Vector2f fadeInfo;
+ protected float fadeLength;
+ protected Camera frustumCam;
+ /**
+ * true to skip the post pass when there are no shadow casters
+ */
+ protected boolean skipPostPass;
+
+ /**
+ * used for serialization
+ */
+ protected AbstractShadowRendererVR(){
+ }
+
+ /**
+ * Create an abstract shadow renderer. Subclasses invoke this constructor.
+ *
+ * @param assetManager the application asset manager
+ * @param shadowMapSize the size of the rendered shadow maps (512,1024,2048,
+ * etc...)
+ * @param nbShadowMaps the number of shadow maps rendered (the more shadow
+ * maps the more quality, the fewer fps).
+ */
+ protected AbstractShadowRendererVR(AssetManager assetManager, int shadowMapSize, int nbShadowMaps) {
+
+ this.assetManager = assetManager;
+ this.nbShadowMaps = nbShadowMaps;
+ this.shadowMapSize = shadowMapSize;
+ init(assetManager, nbShadowMaps, shadowMapSize);
+
+ }
+
+ private void init(AssetManager assetManager, int nbShadowMaps, int shadowMapSize) {
+ this.postshadowMat = new Material(assetManager, "Common/MatDefs/Shadow/PostShadow.j3md");
+ shadowFB = new FrameBuffer[nbShadowMaps];
+ shadowMaps = new Texture2D[nbShadowMaps];
+ dispPic = new Picture[nbShadowMaps];
+ lightViewProjectionsMatrices = new Matrix4f[nbShadowMaps];
+ shadowMapStringCache = new String[nbShadowMaps];
+ lightViewStringCache = new String[nbShadowMaps];
+
+ //DO NOT COMMENT THIS (it prevent the OSX incomplete read buffer crash)
+ dummyTex = new Texture2D(shadowMapSize, shadowMapSize, Format.RGBA8);
+
+ preshadowMat = new Material(assetManager, "Common/MatDefs/Shadow/PreShadow.j3md");
+ postshadowMat.setFloat("ShadowMapSize", shadowMapSize);
+
+ for (int i = 0; i < nbShadowMaps; i++) {
+ lightViewProjectionsMatrices[i] = new Matrix4f();
+ shadowFB[i] = new FrameBuffer(shadowMapSize, shadowMapSize, 1);
+ shadowMaps[i] = new Texture2D(shadowMapSize, shadowMapSize, Format.Depth);
+
+ shadowFB[i].setDepthTexture(shadowMaps[i]);
+
+ //DO NOT COMMENT THIS (it prevent the OSX incomplete read buffer crash)
+ shadowFB[i].setColorTexture(dummyTex);
+ shadowMapStringCache[i] = "ShadowMap" + i;
+ lightViewStringCache[i] = "LightViewProjectionMatrix" + i;
+
+ postshadowMat.setTexture(shadowMapStringCache[i], shadowMaps[i]);
+
+ //quads for debuging purpose
+ dispPic[i] = new Picture("Picture" + i);
+ dispPic[i].setTexture(assetManager, shadowMaps[i], false);
+ }
+
+ setShadowCompareMode(shadowCompareMode);
+ setEdgeFilteringMode(edgeFilteringMode);
+ setShadowIntensity(shadowIntensity);
+ initForcedRenderState();
+ }
+
+ protected void initForcedRenderState() {
+ forcedRenderState.setFaceCullMode(RenderState.FaceCullMode.Front);
+ forcedRenderState.setColorWrite(false);
+ forcedRenderState.setDepthWrite(true);
+ forcedRenderState.setDepthTest(true);
+ }
+
+ /**
+ * set the post shadow material for this renderer
+ *
+ * @param postShadowMat
+ */
+ protected final void setPostShadowMaterial(Material postShadowMat) {
+ this.postshadowMat = postShadowMat;
+ postshadowMat.setFloat("ShadowMapSize", shadowMapSize);
+ for (int i = 0; i < nbShadowMaps; i++) {
+ postshadowMat.setTexture(shadowMapStringCache[i], shadowMaps[i]);
+ }
+ setShadowCompareMode(shadowCompareMode);
+ setEdgeFilteringMode(edgeFilteringMode);
+ setShadowIntensity(shadowIntensity);
+ }
+
+ /**
+ * Sets the filtering mode for shadow edges. See {@link EdgeFilteringMode}
+ * for more info.
+ *
+ * @param filterMode the desired filter mode (not null)
+ */
+ final public void setEdgeFilteringMode(EdgeFilteringMode filterMode) {
+ if (filterMode == null) {
+ throw new NullPointerException();
+ }
+
+ this.edgeFilteringMode = filterMode;
+ postshadowMat.setInt("FilterMode", filterMode.getMaterialParamValue());
+ postshadowMat.setFloat("PCFEdge", edgesThickness);
+ if (shadowCompareMode == CompareMode.Hardware) {
+ for (Texture2D shadowMap : shadowMaps) {
+ if (filterMode == EdgeFilteringMode.Bilinear) {
+ shadowMap.setMagFilter(MagFilter.Bilinear);
+ shadowMap.setMinFilter(MinFilter.BilinearNoMipMaps);
+ } else {
+ shadowMap.setMagFilter(MagFilter.Nearest);
+ shadowMap.setMinFilter(MinFilter.NearestNoMipMaps);
+ }
+ }
+ }
+ }
+
+ /**
+ * Get the edge filtering mode.
+ * @return the edge filtering mode.
+ */
+ public EdgeFilteringMode getEdgeFilteringMode() {
+ return edgeFilteringMode;
+ }
+
+ /**
+ * Sets the shadow compare mode. See {@link CompareMode} for more info.
+ *
+ * @param compareMode the desired compare mode (not null)
+ */
+ final public void setShadowCompareMode(CompareMode compareMode) {
+ if (compareMode == null) {
+ throw new IllegalArgumentException("Shadow compare mode cannot be null");
+ }
+
+ this.shadowCompareMode = compareMode;
+ for (Texture2D shadowMap : shadowMaps) {
+ if (compareMode == CompareMode.Hardware) {
+ shadowMap.setShadowCompareMode(ShadowCompareMode.LessOrEqual);
+ if (edgeFilteringMode == EdgeFilteringMode.Bilinear) {
+ shadowMap.setMagFilter(MagFilter.Bilinear);
+ shadowMap.setMinFilter(MinFilter.BilinearNoMipMaps);
+ } else {
+ shadowMap.setMagFilter(MagFilter.Nearest);
+ shadowMap.setMinFilter(MinFilter.NearestNoMipMaps);
+ }
+ } else {
+ shadowMap.setShadowCompareMode(ShadowCompareMode.Off);
+ shadowMap.setMagFilter(MagFilter.Nearest);
+ shadowMap.setMinFilter(MinFilter.NearestNoMipMaps);
+ }
+ }
+ postshadowMat.setBoolean("HardwareShadows", compareMode == CompareMode.Hardware);
+ }
+
+ /**
+ * returns the shadow compare mode
+ *
+ * @see CompareMode
+ * @return the shadowCompareMode
+ */
+ public CompareMode getShadowCompareMode() {
+ return shadowCompareMode;
+ }
+
+ /**
+ * debug function to create a visible frustum
+ */
+ protected Geometry createFrustum(Vector3f[] pts, int i) {
+ WireFrustum frustum = new WireFrustum(pts);
+ Geometry frustumMdl = new Geometry("f", frustum);
+ frustumMdl.setCullHint(Spatial.CullHint.Never);
+ frustumMdl.setShadowMode(ShadowMode.Off);
+ Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
+ mat.getAdditionalRenderState().setWireframe(true);
+ frustumMdl.setMaterial(mat);
+ switch (i) {
+ case 0:
+ frustumMdl.getMaterial().setColor("Color", ColorRGBA.Pink);
+ break;
+ case 1:
+ frustumMdl.getMaterial().setColor("Color", ColorRGBA.Red);
+ break;
+ case 2:
+ frustumMdl.getMaterial().setColor("Color", ColorRGBA.Green);
+ break;
+ case 3:
+ frustumMdl.getMaterial().setColor("Color", ColorRGBA.Blue);
+ break;
+ default:
+ frustumMdl.getMaterial().setColor("Color", ColorRGBA.White);
+ break;
+ }
+
+ frustumMdl.updateGeometricState();
+ return frustumMdl;
+ }
+
+ /**
+ * Initialize this shadow renderer prior to its first update.
+ *
+ * @param rm the render manager
+ * @param vp the viewport
+ */
+ public void initialize(RenderManager rm, ViewPort vp) {
+ renderManager = rm;
+ viewPort = vp;
+ postTechniqueName = "PostShadow";
+ if(zFarOverride>0 && frustumCam == null){
+ initFrustumCam();
+ }
+ }
+
+ /**
+ * delegates the initialization of the frustum cam to child renderers
+ */
+ protected abstract void initFrustumCam();
+
+ /**
+ * Test whether this shadow renderer has been initialized.
+ *
+ * @return true if initialized, otherwise false
+ */
+ public boolean isInitialized() {
+ return viewPort != null;
+ }
+
+ /**
+ * Invoked once per frame to update the shadow cams according to the light
+ * view.
+ *
+ * @param viewCam the scene cam
+ */
+ protected abstract void updateShadowCams(Camera viewCam);
+
+ /**
+ * Returns a subclass-specific geometryList containing the occluders to be
+ * rendered in the shadow map
+ *
+ * @param shadowMapIndex the index of the shadow map being rendered
+ * @param shadowMapOccluders the list of occluders
+ * @return
+ */
+ protected abstract GeometryList getOccludersToRender(int shadowMapIndex, GeometryList shadowMapOccluders);
+
+ /**
+ * return the shadow camera to use for rendering the shadow map according
+ * the given index
+ *
+ * @param shadowMapIndex the index of the shadow map being rendered
+ * @return the shadowCam
+ */
+ protected abstract Camera getShadowCam(int shadowMapIndex);
+
+ /**
+ * responsible for displaying the frustum of the shadow cam for debug
+ * purpose
+ *
+ * @param shadowMapIndex
+ */
+ protected void doDisplayFrustumDebug(int shadowMapIndex) {
+ }
+
+ @SuppressWarnings("fallthrough")
+ public void postQueue(RenderQueue rq) {
+ lightReceivers.clear();
+ skipPostPass = false;
+ if ( !checkCulling(viewPort.getCamera()) ) {
+ skipPostPass = true;
+ return;
+ }
+
+ updateShadowCams(viewPort.getCamera());
+
+ Renderer r = renderManager.getRenderer();
+ renderManager.setForcedMaterial(preshadowMat);
+ renderManager.setForcedTechnique("PreShadow");
+
+ for (int shadowMapIndex = 0; shadowMapIndex < nbShadowMaps; shadowMapIndex++) {
+
+ if (debugfrustums) {
+ doDisplayFrustumDebug(shadowMapIndex);
+ }
+ renderShadowMap(shadowMapIndex);
+
+ }
+
+ debugfrustums = false;
+
+ //restore setting for future rendering
+ r.setFrameBuffer(viewPort.getOutputFrameBuffer());
+ renderManager.setForcedMaterial(null);
+ renderManager.setForcedTechnique(null);
+ renderManager.setCamera(viewPort.getCamera(), false);
+
+ }
+
+ protected void renderShadowMap(int shadowMapIndex) {
+ shadowMapOccluders = getOccludersToRender(shadowMapIndex, shadowMapOccluders);
+ Camera shadowCam = getShadowCam(shadowMapIndex);
+
+ //saving light view projection matrix for this split
+ lightViewProjectionsMatrices[shadowMapIndex].set(shadowCam.getViewProjectionMatrix());
+ renderManager.setCamera(shadowCam, false);
+
+ renderManager.getRenderer().setFrameBuffer(shadowFB[shadowMapIndex]);
+ renderManager.getRenderer().clearBuffers(true, true, true);
+ renderManager.setForcedRenderState(forcedRenderState);
+
+ // render shadow casters to shadow map
+ viewPort.getQueue().renderShadowQueue(shadowMapOccluders, renderManager, shadowCam, true);
+ renderManager.setForcedRenderState(null);
+ }
+ boolean debugfrustums = false;
+
+ /**
+ * Force the frustum to be displayed.
+ */
+ public void displayFrustum() {
+ debugfrustums = true;
+ }
+
+ /**
+ * For debugging purposes, display depth shadow maps.
+ */
+ protected void displayShadowMap(Renderer r) {
+ Camera cam = viewPort.getCamera();
+ renderManager.setCamera(cam, true);
+ int h = cam.getHeight();
+ for (int i = 0; i < dispPic.length; i++) {
+ dispPic[i].setPosition((128 * i) + (150 + 64 * (i + 1)), h / 20f);
+ dispPic[i].setWidth(128);
+ dispPic[i].setHeight(128);
+ dispPic[i].updateGeometricState();
+ renderManager.renderGeometry(dispPic[i]);
+ }
+ renderManager.setCamera(cam, false);
+ }
+
+ /**
+ * For debugging purposes, "snapshot" the current frustum to the scene.
+ */
+ public void displayDebug() {
+ debug = true;
+ }
+
+ protected abstract void getReceivers(GeometryList lightReceivers);
+
+ public void postFrame(FrameBuffer out) {
+ if (skipPostPass) {
+ return;
+ }
+ if (debug) {
+ displayShadowMap(renderManager.getRenderer());
+ }
+
+ getReceivers(lightReceivers);
+
+ if (lightReceivers.size() != 0) {
+ //setting params to recieving geometry list
+ setMatParams(lightReceivers);
+
+ Camera cam = viewPort.getCamera();
+ //some materials in the scene does not have a post shadow technique so we're using the fall back material
+ if (needsfallBackMaterial) {
+ renderManager.setForcedMaterial(postshadowMat);
+ }
+
+ //forcing the post shadow technique and render state
+ renderManager.setForcedTechnique(postTechniqueName);
+
+ //rendering the post shadow pass
+ viewPort.getQueue().renderShadowQueue(lightReceivers, renderManager, cam, false);
+
+ //resetting renderManager settings
+ renderManager.setForcedTechnique(null);
+ renderManager.setForcedMaterial(null);
+ renderManager.setCamera(cam, false);
+
+ //clearing the params in case there are some other shadow renderers
+ clearMatParams();
+ }
+ }
+
+ /**
+ * This method is called once per frame and is responsible for clearing any
+ * material parameters that subclasses may need to clear on the post material.
+ *
+ * @param material the material that was used for the post shadow pass
+ */
+ protected abstract void clearMaterialParameters(Material material);
+
+ private void clearMatParams(){
+ for (Material mat : matCache) {
+
+ //clearing only necessary params, the others may be set by other
+ //renderers
+ //Note that j start at 1 because other shadow renderers will have
+ //at least 1 shadow map and will set it on each frame anyway.
+ for (int j = 1; j < nbShadowMaps; j++) {
+ mat.clearParam(lightViewStringCache[j]);
+ }
+ for (int j = 1; j < nbShadowMaps; j++) {
+ mat.clearParam(shadowMapStringCache[j]);
+ }
+ mat.clearParam("FadeInfo");
+ clearMaterialParameters(mat);
+ }
+ //No need to clear the postShadowMat params as the instance is locale to each renderer
+ }
+
+ /**
+ * This method is called once per frame and is responsible for setting any
+ * material parameters that subclasses may need to set on the post material.
+ *
+ * @param material the material to use for the post shadow pass
+ */
+ protected abstract void setMaterialParameters(Material material);
+
+ private void setMatParams(GeometryList l) {
+ //iteration throught all the geometries of the list to gather the materials
+
+ buildMatCache(l);
+
+ //iterating through the mat cache and setting the parameters
+ for (Material mat : matCache) {
+
+ mat.setFloat("ShadowMapSize", shadowMapSize);
+
+ for (int j = 0; j < nbShadowMaps; j++) {
+ mat.setMatrix4(lightViewStringCache[j], lightViewProjectionsMatrices[j]);
+ }
+ for (int j = 0; j < nbShadowMaps; j++) {
+ mat.setTexture(shadowMapStringCache[j], shadowMaps[j]);
+ }
+ mat.setBoolean("HardwareShadows", shadowCompareMode == CompareMode.Hardware);
+ mat.setInt("FilterMode", edgeFilteringMode.getMaterialParamValue());
+ mat.setFloat("PCFEdge", edgesThickness);
+ mat.setFloat("ShadowIntensity", shadowIntensity);
+ if (fadeInfo != null) {
+ mat.setVector2("FadeInfo", fadeInfo);
+ }
+ if(renderBackFacesShadows != null){
+ mat.setBoolean("BackfaceShadows", renderBackFacesShadows);
+ }
+
+ setMaterialParameters(mat);
+ }
+
+ //At least one material of the receiving geoms does not support the post shadow techniques
+ //so we fall back to the forced material solution (transparent shadows won't be supported for these objects)
+ if (needsfallBackMaterial) {
+ setPostShadowParams();
+ }
+
+ }
+
+ private void buildMatCache(GeometryList l) {
+ matCache.clear();
+ for (int i = 0; i < l.size(); i++) {
+ Material mat = l.get(i).getMaterial();
+ //checking if the material has the post technique and adding it to the material cache
+ if (mat.getMaterialDef().getTechniqueDefs(postTechniqueName) != null) {
+ if (!matCache.contains(mat)) {
+ matCache.add(mat);
+ }
+ } else {
+ needsfallBackMaterial = true;
+ }
+ }
+ }
+
+ /**
+ * for internal use only
+ */
+ protected void setPostShadowParams() {
+ setMaterialParameters(postshadowMat);
+ for (int j = 0; j < nbShadowMaps; j++) {
+ postshadowMat.setMatrix4(lightViewStringCache[j], lightViewProjectionsMatrices[j]);
+ postshadowMat.setTexture(shadowMapStringCache[j], shadowMaps[j]);
+ }
+ if (fadeInfo != null) {
+ postshadowMat.setVector2("FadeInfo", fadeInfo);
+ }
+ if(renderBackFacesShadows != null){
+ postshadowMat.setBoolean("BackfaceShadows", renderBackFacesShadows);
+ }
+ }
+
+ /**
+ * How far the shadows are rendered in the view
+ *
+ * @see #setShadowZExtend(float zFar)
+ * @return shadowZExtend
+ */
+ public float getShadowZExtend() {
+ return zFarOverride;
+ }
+
+ /**
+ * Set the distance from the eye where the shadows will be rendered default
+ * value is dynamically computed to the shadow casters/receivers union bound
+ * zFar, capped to view frustum far value.
+ *
+ * @param zFar the zFar values that override the computed one
+ */
+ public void setShadowZExtend(float zFar) {
+ this.zFarOverride = zFar;
+ if(zFarOverride == 0){
+ fadeInfo = null;
+ frustumCam = null;
+ }else{
+ if (fadeInfo != null) {
+ fadeInfo.set(zFarOverride - fadeLength, 1f / fadeLength);
+ }
+ if(frustumCam == null && viewPort != null){
+ initFrustumCam();
+ }
+ }
+ }
+
+ /**
+ * Define the length over which the shadow will fade out when using a
+ * shadowZextend This is useful to make dynamic shadows fade into baked
+ * shadows in the distance.
+ *
+ * @param length the fade length in world units
+ */
+ public void setShadowZFadeLength(float length) {
+ if (length == 0) {
+ fadeInfo = null;
+ fadeLength = 0;
+ postshadowMat.clearParam("FadeInfo");
+ } else {
+ if (zFarOverride == 0) {
+ fadeInfo = new Vector2f(0, 0);
+ } else {
+ fadeInfo = new Vector2f(zFarOverride - length, 1.0f / length);
+ }
+ fadeLength = length;
+ postshadowMat.setVector2("FadeInfo", fadeInfo);
+ }
+ }
+
+ /**
+ * get the length over which the shadow will fade out when using a
+ * shadowZextend
+ *
+ * @return the fade length in world units
+ */
+ public float getShadowZFadeLength() {
+ if (fadeInfo != null) {
+ return zFarOverride - fadeInfo.x;
+ }
+ return 0f;
+ }
+
+ /**
+ * returns true if the light source bounding box is in the view frustum
+ * @return
+ */
+ protected abstract boolean checkCulling(Camera viewCam);
+
+ public void preFrame(float tpf) {
+ }
+
+ public void cleanup() {
+ }
+
+ public void reshape(ViewPort vp, int w, int h) {
+ }
+
+ /**
+ * Returns the shadow intensity.
+ *
+ * @see #setShadowIntensity(float shadowIntensity)
+ * @return shadowIntensity
+ */
+ public float getShadowIntensity() {
+ return shadowIntensity;
+ }
+
+ /**
+ * Set the shadowIntensity. The value should be between 0 and 1. A 0 value
+ * gives a bright and invisible shadow, a 1 value gives a pitch black
+ * shadow. The default is 0.7
+ *
+ * @param shadowIntensity the darkness of the shadow
+ */
+ final public void setShadowIntensity(float shadowIntensity) {
+ this.shadowIntensity = shadowIntensity;
+ postshadowMat.setFloat("ShadowIntensity", shadowIntensity);
+ }
+
+ /**
+ * returns the edges thickness
+ *
+ * @see #setEdgesThickness(int edgesThickness)
+ * @return edgesThickness
+ */
+ public int getEdgesThickness() {
+ return (int) (edgesThickness * 10);
+ }
+
+ /**
+ * Sets the shadow edges thickness. default is 1, setting it to lower values
+ * can help to reduce the jagged effect of the shadow edges
+ * @param edgesThickness the shadow edges thickness.
+ */
+ public void setEdgesThickness(int edgesThickness) {
+ this.edgesThickness = Math.max(1, Math.min(edgesThickness, 10));
+ this.edgesThickness *= 0.1f;
+ postshadowMat.setFloat("PCFEdge", edgesThickness);
+ }
+
+ /**
+ * This method does nothing now and is kept only for backward compatibility.
+ * @return false
+ * @deprecated This method does nothing now and is kept only for backward compatibility.
+ */
+ @Deprecated
+ public boolean isFlushQueues() { return false; }
+
+ /**
+ * This method does nothing now and is kept only for backward compatibility.
+ * @param flushQueues any boolean.
+ * @deprecated This method does nothing now and is kept only for backward compatibility.
+ */
+ @Deprecated
+ public void setFlushQueues(boolean flushQueues) {}
+
+
+ /**
+ * Returns the pre shadows pass render state.
+ * use it to adjust the RenderState parameters of the pre shadow pass.
+ * Note that this will be overridden if the preShadow technique in the material has a ForcedRenderState
+ * @return the pre shadow render state.
+ */
+ public RenderState getPreShadowForcedRenderState() {
+ return forcedRenderState;
+ }
+
+ /**
+ * Set to true if you want back faces shadows on geometries.
+ * Note that back faces shadows will be blended over dark lighten areas and may produce overly dark lighting.
+ *
+ * Also note that setting this parameter will override this parameter for ALL materials in the scene.
+ * You can alternatively change this parameter on a single material using {@link Material#setBoolean(String, boolean)}
+ *
+ * This also will automatically adjust the faceCullMode and the PolyOffset of the pre shadow pass.
+ * You can modify them by using {@link #getPreShadowForcedRenderState()}
+ *
+ * @param renderBackFacesShadows true or false.
+ */
+ public void setRenderBackFacesShadows(Boolean renderBackFacesShadows) {
+ this.renderBackFacesShadows = renderBackFacesShadows;
+ if(renderBackFacesShadows) {
+ getPreShadowForcedRenderState().setPolyOffset(5, 3);
+ getPreShadowForcedRenderState().setFaceCullMode(RenderState.FaceCullMode.Back);
+ }else{
+ getPreShadowForcedRenderState().setPolyOffset(0, 0);
+ getPreShadowForcedRenderState().setFaceCullMode(RenderState.FaceCullMode.Front);
+ }
+ }
+
+ /**
+ * if this processor renders back faces shadows
+ * @return true if this processor renders back faces shadows
+ */
+ public boolean isRenderBackFacesShadows() {
+ return renderBackFacesShadows != null?renderBackFacesShadows:false;
+ }
+
+ /**
+ * De-serialize this instance, for example when loading from a J3O file.
+ *
+ * @param im importer (not null)
+ */
+ public void read(JmeImporter im) throws IOException {
+ InputCapsule ic = (InputCapsule) im.getCapsule(this);
+ assetManager = im.getAssetManager();
+ nbShadowMaps = ic.readInt("nbShadowMaps", 1);
+ shadowMapSize = ic.readFloat("shadowMapSize", 0f);
+ shadowIntensity = ic.readFloat("shadowIntensity", 0.7f);
+ edgeFilteringMode = ic.readEnum("edgeFilteringMode", EdgeFilteringMode.class, EdgeFilteringMode.Bilinear);
+ shadowCompareMode = ic.readEnum("shadowCompareMode", CompareMode.class, CompareMode.Hardware);
+ init(assetManager, nbShadowMaps, (int) shadowMapSize);
+ edgesThickness = ic.readFloat("edgesThickness", 1.0f);
+ postshadowMat.setFloat("PCFEdge", edgesThickness);
+
+ }
+
+ /**
+ * Serialize this instance, for example when saving to a J3O file.
+ *
+ * @param ex exporter (not null)
+ */
+ public void write(JmeExporter ex) throws IOException {
+ OutputCapsule oc = (OutputCapsule) ex.getCapsule(this);
+ oc.write(nbShadowMaps, "nbShadowMaps", 1);
+ oc.write(shadowMapSize, "shadowMapSize", 0);
+ oc.write(shadowIntensity, "shadowIntensity", 0.7f);
+ oc.write(edgeFilteringMode, "edgeFilteringMode", EdgeFilteringMode.Bilinear);
+ oc.write(shadowCompareMode, "shadowCompareMode", CompareMode.Hardware);
+ oc.write(edgesThickness, "edgesThickness", 1.0f);
+ }
+}
diff --git a/jme3-vr/src/main/java/com/jme3/shadow/DirectionalLightShadowFilterVR.java b/jme3-vr/src/main/java/com/jme3/shadow/DirectionalLightShadowFilterVR.java
new file mode 100644
index 000000000..30399999f
--- /dev/null
+++ b/jme3-vr/src/main/java/com/jme3/shadow/DirectionalLightShadowFilterVR.java
@@ -0,0 +1,167 @@
+package com.jme3.shadow;
+
+/*
+ * Copyright (c) 2009-2012 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import com.jme3.asset.AssetManager;
+import com.jme3.export.InputCapsule;
+import com.jme3.export.JmeExporter;
+import com.jme3.export.JmeImporter;
+import com.jme3.export.OutputCapsule;
+import com.jme3.light.DirectionalLight;
+import java.io.IOException;
+
+/**
+ *
+ * This Filter does basically the same as a DirectionalLightShadowRenderer
+ * except it renders the post shadow pass as a fulscreen quad pass instead of a
+ * geometry pass. It's mostly faster than PssmShadowRenderer as long as you have
+ * more than a about ten shadow recieving objects. The expense is the draw back
+ * that the shadow Recieve mode set on spatial is ignored. So basically all and
+ * only objects that render depth in the scene receive shadows. See this post
+ * for more details
+ * http://jmonkeyengine.org/groups/general-2/forum/topic/silly-question-about-shadow-rendering/#post-191599
+ *
+ * API is basically the same as the PssmShadowRenderer;
+ *
+ * @author Rémy Bouquet aka Nehon
+ * @author reden - phr00t - https://github.com/phr00t
+ * @author Julien Seinturier - (c) 2016 - JOrigin project - http:/www.jorigin.org
+ */
+public class DirectionalLightShadowFilterVR extends AbstractShadowFilterVR {
+
+ /**
+ * Creates a DirectionalLightShadowFilter Shadow Filter More info on the
+ * technique at http://http.developer.nvidia.com/GPUGems3/gpugems3_ch10.html
+ *
+ * @param assetManager the application asset manager
+ * @param shadowMapSize the size of the rendered shadowmaps (512,1024,2048,
+ * etc...)
+ * @param nbSplits the number of shadow maps rendered (the more shadow maps
+ * the more quality, the less fps).
+ */
+ public DirectionalLightShadowFilterVR(AssetManager assetManager, int shadowMapSize, int nbSplits) {
+ super(assetManager, shadowMapSize, new DirectionalLightShadowRendererVR(assetManager, shadowMapSize, nbSplits));
+ }
+
+ /**
+ * Creates a DirectionalLightShadowFilter Shadow Filter More info on the
+ * technique at http://http.developer.nvidia.com/GPUGems3/gpugems3_ch10.html .
+ * @param assetManager the application asset manager
+ * @param shadowMapSize the size of the rendered shadowmaps (512, 1024, 2048, etc...)
+ * @param nbSplits the number of shadow maps rendered (the more shadow maps the more quality, the less fps).
+ * @param useMatDef the material to attach to this filter.
+ */
+ public DirectionalLightShadowFilterVR(AssetManager assetManager, int shadowMapSize, int nbSplits, String useMatDef) {
+ super(assetManager, shadowMapSize, new DirectionalLightShadowRendererVR(assetManager, shadowMapSize, nbSplits), useMatDef);
+ }
+
+ /**
+ * return the light used to cast shadows
+ *
+ * @return the DirectionalLight
+ */
+ public DirectionalLight getLight() {
+ return shadowRenderer.getLight();
+ }
+
+ /**
+ * Sets the light to use to cast shadows
+ *
+ * @param light a DirectionalLight
+ */
+ public void setLight(DirectionalLight light) {
+ shadowRenderer.setLight(light);
+ }
+
+ /**
+ * returns the labda parameter
+ *
+ * @see #setLambda(float lambda)
+ * @return lambda
+ */
+ public float getLambda() {
+ return shadowRenderer.getLambda();
+ }
+
+ /**
+ * Adjust the repartition of the different shadow maps in the shadow extend
+ * usualy goes from 0.0 to 1.0 a low value give a more linear repartition
+ * resulting in a constant quality in the shadow over the extends, but near
+ * shadows could look very jagged a high value give a more logarithmic
+ * repartition resulting in a high quality for near shadows, but the quality
+ * quickly decrease over the extend. the default value is set to 0.65f
+ * (theoric optimal value).
+ *
+ * @param lambda the lambda value.
+ */
+ public void setLambda(float lambda) {
+ shadowRenderer.setLambda(lambda);
+ }
+
+ /**
+ * Check if stabilization is enabled.
+ * @return true
if the stabilization is enabled and false
otherwise.
+ * @see #setEnabledStabilization(boolean)
+ */
+ public boolean isEnabledStabilization() {
+ return shadowRenderer.isEnabledStabilization();
+ }
+
+ /**
+ * Enables the stabilization of the shadows's edges. (default is true
)
+ * This prevents shadows' edges to flicker when the camera moves
+ * However it can lead to some shadow quality loss in some particular scenes.
+ * @param stabilize true
if the stabilization has to be enabled and false
otherwise.
+ * @see #isEnabledStabilization()
+ */
+ public void setEnabledStabilization(boolean stabilize) {
+ shadowRenderer.setEnabledStabilization(stabilize);
+ }
+
+ @Override
+ public void write(JmeExporter ex) throws IOException {
+ super.write(ex);
+ OutputCapsule oc = ex.getCapsule(this);
+ oc.write(shadowRenderer, "shadowRenderer", null);
+
+ }
+
+ @Override
+ public void read(JmeImporter im) throws IOException {
+ super.read(im);
+ InputCapsule ic = im.getCapsule(this);
+ shadowRenderer = (DirectionalLightShadowRendererVR) ic.readSavable("shadowRenderer", null);
+ }
+}
diff --git a/jme3-vr/src/main/java/com/jme3/shadow/DirectionalLightShadowRendererVR.java b/jme3-vr/src/main/java/com/jme3/shadow/DirectionalLightShadowRendererVR.java
new file mode 100644
index 000000000..6836eb23f
--- /dev/null
+++ b/jme3-vr/src/main/java/com/jme3/shadow/DirectionalLightShadowRendererVR.java
@@ -0,0 +1,304 @@
+package com.jme3.shadow;
+
+/*
+ * Copyright (c) 2009-2012 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import com.jme3.asset.AssetManager;
+import com.jme3.export.InputCapsule;
+import com.jme3.export.JmeExporter;
+import com.jme3.export.JmeImporter;
+import com.jme3.export.OutputCapsule;
+import com.jme3.light.DirectionalLight;
+import com.jme3.material.Material;
+import com.jme3.math.ColorRGBA;
+import com.jme3.math.Vector2f;
+import com.jme3.math.Vector3f;
+import com.jme3.renderer.Camera;
+import com.jme3.renderer.queue.GeometryList;
+import com.jme3.renderer.queue.RenderQueue;
+import com.jme3.scene.Node;
+import com.jme3.scene.Spatial;
+import com.jme3.shadow.PssmShadowUtil;
+import com.jme3.shadow.ShadowUtil;
+
+import java.io.IOException;
+
+/**
+ * DirectionalLightShadowRenderer renderer use Parrallel Split Shadow Mapping
+ * technique (pssm) It splits the view frustum in several parts and compute
+ * a shadow map for each one. splits are distributed so that the closer they
+ * are from the camera, the smaller they are to maximize the resolution used of
+ * the shadow map. This result in a better quality shadow than standard
+ * shadow mapping. for more informations on this read this http://http.developer.nvidia.com/GPUGems3/gpugems3_ch10.html
+ *
+ * @author Rémy Bouquet aka Nehon
+ * @author reden - phr00t - https://github.com/phr00t
+ * @author Julien Seinturier - (c) 2016 - JOrigin project - http:/www.jorigin.org
+ */
+public class DirectionalLightShadowRendererVR extends AbstractShadowRendererVR {
+
+ protected float lambda = 0.65f;
+ protected Camera shadowCam;
+ protected ColorRGBA splits;
+ protected float[] splitsArray;
+ protected DirectionalLight light;
+ protected Vector3f[] points = new Vector3f[8];
+ //Holding the info for fading shadows in the far distance
+ private boolean stabilize = true;
+
+ /**
+ * Used for serialzation use
+ * DirectionalLightShadowRenderer#DirectionalLightShadowRenderer(AssetManager
+ * assetManager, int shadowMapSize, int nbSplits)
+ */
+ public DirectionalLightShadowRendererVR() {
+ super();
+ }
+
+ /**
+ * Create a DirectionalLightShadowRenderer More info on the technique at http://http.developer.nvidia.com/GPUGems3/gpugems3_ch10.html
+ *
+ * @param assetManager the application asset manager
+ * @param shadowMapSize the size of the rendered shadowmaps (512,1024,2048,
+ * etc...)
+ * @param nbSplits the number of shadow maps rendered (the more shadow maps
+ * the more quality, the less fps).
+ */
+ public DirectionalLightShadowRendererVR(AssetManager assetManager, int shadowMapSize, int nbSplits) {
+ super(assetManager, shadowMapSize, nbSplits);
+ init(nbSplits, shadowMapSize);
+ }
+
+ private void init(int nbSplits, int shadowMapSize) {
+ nbShadowMaps = Math.max(Math.min(nbSplits, 4), 1);
+ if (nbShadowMaps != nbSplits) {
+ throw new IllegalArgumentException("Number of splits must be between 1 and 4. Given value : " + nbSplits);
+ }
+ splits = new ColorRGBA();
+ splitsArray = new float[nbSplits + 1];
+ shadowCam = new Camera(shadowMapSize, shadowMapSize);
+ shadowCam.setParallelProjection(true);
+ for (int i = 0; i < points.length; i++) {
+ points[i] = new Vector3f();
+ }
+ }
+
+ @Override
+ protected void initFrustumCam() {
+ //nothing to do
+ }
+
+ /**
+ * return the light used to cast shadows
+ * @return the DirectionalLight
+ */
+ public DirectionalLight getLight() {
+ return light;
+ }
+
+ /**
+ * Sets the light to use to cast shadows
+ * @param light a DirectionalLight
+ */
+ public void setLight(DirectionalLight light) {
+ this.light = light;
+ }
+
+ @Override
+ protected void updateShadowCams(Camera viewCam) {
+
+ float zFar = zFarOverride;
+ if (zFar == 0) {
+ zFar = viewCam.getFrustumFar();
+ }
+
+ //We prevent computing the frustum points and splits with zeroed or negative near clip value
+ float frustumNear = Math.max(viewCam.getFrustumNear(), 0.001f);
+ ShadowUtil.updateFrustumPoints(viewCam, frustumNear, zFar, 1.0f, points);
+
+ //shadowCam.setDirection(direction);
+ shadowCam.getRotation().lookAt(light.getDirection(), shadowCam.getUp());
+ shadowCam.update();
+ shadowCam.updateViewProjection();
+
+ PssmShadowUtil.updateFrustumSplits(splitsArray, frustumNear, zFar, lambda);
+
+ // in parallel projection shadow position goe from 0 to 1
+ if(viewCam.isParallelProjection()){
+ for (int i = 0; i < nbShadowMaps; i++) {
+ splitsArray[i] = splitsArray[i]/(zFar- frustumNear);
+ }
+ }
+
+ switch (splitsArray.length) {
+ case 5:
+ splits.a = splitsArray[4];
+ case 4:
+ splits.b = splitsArray[3];
+ case 3:
+ splits.g = splitsArray[2];
+ case 2:
+ case 1:
+ splits.r = splitsArray[1];
+ break;
+ }
+
+ }
+
+ @Override
+ protected GeometryList getOccludersToRender(int shadowMapIndex, GeometryList shadowMapOccluders) {
+
+ // update frustum points based on current camera and split
+ ShadowUtil.updateFrustumPoints(viewPort.getCamera(), splitsArray[shadowMapIndex], splitsArray[shadowMapIndex + 1], 1.0f, points);
+
+ //Updating shadow cam with curent split frustra
+ if (lightReceivers.size()==0) {
+ for (Spatial scene : viewPort.getScenes()) {
+ ShadowUtil.getGeometriesInCamFrustum(scene, viewPort.getCamera(), RenderQueue.ShadowMode.Receive, lightReceivers);
+ }
+ }
+ ShadowUtil.updateShadowCamera(viewPort, lightReceivers, shadowCam, points, shadowMapOccluders, stabilize?shadowMapSize:0);
+
+ return shadowMapOccluders;
+ }
+
+ @Override
+ protected void getReceivers(GeometryList lightReceivers) {
+ if (lightReceivers.size()==0) {
+ for (Spatial scene : viewPort.getScenes()) {
+ ShadowUtil.getGeometriesInCamFrustum(scene, viewPort.getCamera(), RenderQueue.ShadowMode.Receive, lightReceivers);
+ }
+ }
+ }
+
+ @Override
+ protected Camera getShadowCam(int shadowMapIndex) {
+ return shadowCam;
+ }
+
+ @Override
+ protected void doDisplayFrustumDebug(int shadowMapIndex) {
+ ((Node) viewPort.getScenes().get(0)).attachChild(createFrustum(points, shadowMapIndex));
+ ShadowUtil.updateFrustumPoints2(shadowCam, points);
+ ((Node) viewPort.getScenes().get(0)).attachChild(createFrustum(points, shadowMapIndex));
+ }
+
+ @Override
+ protected void setMaterialParameters(Material material) {
+ material.setColor("Splits", splits);
+ material.setVector3("LightDir", light.getDirection());
+ if (fadeInfo != null) {
+ material.setVector2("FadeInfo", fadeInfo);
+ }
+ }
+
+ @Override
+ protected void clearMaterialParameters(Material material) {
+ material.clearParam("Splits");
+ material.clearParam("FadeInfo");
+ material.clearParam("LightDir");
+ }
+
+ /**
+ * returns the labda parameter see #setLambda(float lambda)
+ *
+ * @return lambda
+ */
+ public float getLambda() {
+ return lambda;
+ }
+
+ /**
+ * Adjust the repartition of the different shadow maps in the shadow extend
+ * usualy goes from 0.0 to 1.0
+ * a low value give a more linear repartition resulting in a constant quality in the shadow over the extends, but near shadows could look very jagged
+ * a high value give a more logarithmic repartition resulting in a high quality for near shadows, but the quality quickly decrease over the extend.
+ * the default value is set to 0.65f (theoric optimal value).
+ * @param lambda the lambda value.
+ */
+ public void setLambda(float lambda) {
+ this.lambda = lambda;
+ }
+
+ /**
+ * Check if the stabilization is enabled.
+ * @return true
if stabilization is enabled and false
otherwise.
+ */
+ public boolean isEnabledStabilization() {
+ return stabilize;
+ }
+
+ /**
+ * Enables the stabilization of the shadows's edges. (default is true)
+ * This prevents shadows' edges to flicker when the camera moves
+ * However it can lead to some shadow quality loss in some particular scenes.
+ * @param stabilize true
if stabilization has to be enabled and false
otherwise.
+ */
+ public void setEnabledStabilization(boolean stabilize) {
+ this.stabilize = stabilize;
+ }
+
+ @Override
+ public void read(JmeImporter im) throws IOException {
+ super.read(im);
+ InputCapsule ic = (InputCapsule) im.getCapsule(this);
+ lambda = ic.readFloat("lambda", 0.65f);
+ zFarOverride = ic.readInt("zFarOverride", 0);
+ light = (DirectionalLight) ic.readSavable("light", null);
+ fadeInfo = (Vector2f) ic.readSavable("fadeInfo", null);
+ fadeLength = ic.readFloat("fadeLength", 0f);
+ init(nbShadowMaps, (int) shadowMapSize);
+ }
+
+ @Override
+ public void write(JmeExporter ex) throws IOException {
+ super.write(ex);
+ OutputCapsule oc = (OutputCapsule) ex.getCapsule(this);
+ oc.write(lambda, "lambda", 0.65f);
+ oc.write(zFarOverride, "zFarOverride", 0);
+ oc.write(light, "light", null);
+ oc.write(fadeInfo, "fadeInfo", null);
+ oc.write(fadeLength, "fadeLength", 0f);
+ }
+
+ /**
+ * Directional light are always in the view frustum
+ * @param viewCam
+ * @return
+ */
+ @Override
+ protected boolean checkCulling(Camera viewCam) {
+ return true;
+ }
+}
diff --git a/jme3-vr/src/main/java/com/jme3/shadow/InstancedDirectionalShadowFilter.java b/jme3-vr/src/main/java/com/jme3/shadow/InstancedDirectionalShadowFilter.java
new file mode 100644
index 000000000..7696b8c0d
--- /dev/null
+++ b/jme3-vr/src/main/java/com/jme3/shadow/InstancedDirectionalShadowFilter.java
@@ -0,0 +1,44 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.jme3.shadow;
+
+import com.jme3.app.VRApplication;
+import com.jme3.asset.AssetManager;
+import com.jme3.math.Matrix4f;
+import com.jme3.math.Vector4f;
+
+/**
+ * An instanced version of the {@link DirectionalLightShadowFilterVR directional light shadow filter}.
+ * @author reden - phr00t - https://github.com/phr00t
+ * @author Julien Seinturier - (c) 2016 - JOrigin project - http:/www.jorigin.org
+ */
+public class InstancedDirectionalShadowFilter extends DirectionalLightShadowFilterVR {
+
+ private final Vector4f temp4f = new Vector4f(), temp4f2 = new Vector4f();
+
+ /**
+ * Create a new instanced version of the {@link DirectionalLightShadowFilterVR directional light shadow filter}.
+ * @param assetManager the asset manager to use.
+ * @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).
+ */
+ public InstancedDirectionalShadowFilter(AssetManager assetManager, int shadowMapSize, int nbSplits) {
+ super(assetManager, 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();
+ material.setVector4("ViewProjectionMatrixRow2Right", temp4f2.set(m.m20, m.m21, m.m22, m.m23));
+ }
+ material.setMatrix4("ViewProjectionMatrixInverse", viewPort.getCamera().getViewProjectionMatrix().invert());
+ Matrix4f m = viewPort.getCamera().getViewProjectionMatrix();
+ material.setVector4("ViewProjectionMatrixRow2", temp4f.set(m.m20, m.m21, m.m22, m.m23));
+ }
+}
diff --git a/jme3-vr/src/main/java/com/jme3/shadow/VRDirectionalLightShadowRenderer.java b/jme3-vr/src/main/java/com/jme3/shadow/VRDirectionalLightShadowRenderer.java
new file mode 100644
index 000000000..d73d6d08a
--- /dev/null
+++ b/jme3-vr/src/main/java/com/jme3/shadow/VRDirectionalLightShadowRenderer.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2009-2012 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.jme3.shadow;
+
+import com.jme3.asset.AssetManager;
+import com.jme3.shadow.DirectionalLightShadowRenderer;
+
+/**
+ * DirectionalLightShadowRenderer renderer use Parrallel Split Shadow Mapping
+ * technique (pssm) It splits the view frustum in several parts and compute
+ * a shadow map for each one. splits are distributed so that the closer they
+ * are from the camera, the smaller they are to maximize the resolution used of
+ * the shadow map. This result in a better quality shadow than standard
+ * shadow mapping. for more informations on this read this http://http.developer.nvidia.com/GPUGems3/gpugems3_ch10.html
+ *
+ * @author Rémy Bouquet aka Nehon
+ */
+public class VRDirectionalLightShadowRenderer extends DirectionalLightShadowRenderer {
+
+ /**
+ * Create a OculusDirectionalLightShadowRenderer More info on the technique at http://http.developer.nvidia.com/GPUGems3/gpugems3_ch10.html
+ *
+ * @param assetManager the application asset manager
+ * @param shadowMapSize the size of the rendered shadowmaps (512,1024,2048,
+ * etc...)
+ * @param nbSplits the number of shadow maps rendered (the more shadow maps
+ * the more quality, the less fps).
+ */
+ public VRDirectionalLightShadowRenderer(AssetManager assetManager, int shadowMapSize, int nbSplits) {
+ super(assetManager, shadowMapSize, nbSplits);
+ }
+
+ @Override
+ public VRDirectionalLightShadowRenderer clone() {
+ VRDirectionalLightShadowRenderer clone = new VRDirectionalLightShadowRenderer(assetManager, (int)shadowMapSize, nbShadowMaps);
+ clone.setEdgeFilteringMode(getEdgeFilteringMode());
+ clone.setEdgesThickness(getEdgesThickness());
+ clone.setEnabledStabilization(isEnabledStabilization());
+ clone.setLambda(getLambda());
+ clone.setLight(getLight());
+ clone.setShadowCompareMode(getShadowCompareMode());
+ clone.setShadowIntensity(getShadowIntensity());
+ clone.setShadowZExtend(getShadowZExtend());
+ clone.setShadowZFadeLength(getShadowZFadeLength());
+ return clone;
+ }
+}
diff --git a/jme3-vr/src/main/java/com/jme3/system/lwjgl/LwjglContextVR.java b/jme3-vr/src/main/java/com/jme3/system/lwjgl/LwjglContextVR.java
new file mode 100644
index 000000000..973982594
--- /dev/null
+++ b/jme3-vr/src/main/java/com/jme3/system/lwjgl/LwjglContextVR.java
@@ -0,0 +1,300 @@
+package com.jme3.system.lwjgl;
+
+/*
+ * Copyright (c) 2009-2012 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+import com.jme3.input.lwjgl.GlfwJoystickInput;
+import com.jme3.input.lwjgl.GlfwKeyInputVR;
+import com.jme3.input.lwjgl.GlfwMouseInputVR;
+import com.jme3.renderer.Renderer;
+import com.jme3.renderer.RendererException;
+import com.jme3.renderer.lwjgl.LwjglGL;
+import com.jme3.renderer.lwjgl.LwjglGLExt;
+import com.jme3.renderer.lwjgl.LwjglGLFboEXT;
+import com.jme3.renderer.lwjgl.LwjglGLFboGL3;
+import com.jme3.renderer.opengl.*;
+import com.jme3.system.*;
+
+import org.lwjgl.glfw.GLFW;
+import org.lwjgl.opengl.ARBFramebufferObject;
+import org.lwjgl.opengl.EXTFramebufferMultisample;
+import org.lwjgl.opengl.GLCapabilities;
+
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import static org.lwjgl.opengl.GL.createCapabilities;
+import static org.lwjgl.opengl.GL11.glGetInteger;
+
+/**
+ * A VR oriented LWJGL implementation of a graphics context.
+ * @author reden - phr00t - https://github.com/phr00t
+ * @author Julien Seinturier - (c) 2016 - JOrigin project - http:/www.jorigin.org
+ */
+public abstract class LwjglContextVR implements JmeContext {
+
+ private static final Logger logger = Logger.getLogger(LwjglContextVR.class.getName());
+
+ protected static final String THREAD_NAME = "jME3 Main";
+
+ protected AtomicBoolean created = new AtomicBoolean(false);
+ protected AtomicBoolean renderable = new AtomicBoolean(false);
+ protected final Object createdLock = new Object();
+
+ protected AppSettings settings = new AppSettings(true);
+ protected Renderer renderer;
+ protected GlfwKeyInputVR keyInput;
+ protected GlfwMouseInputVR mouseInput;
+ protected GlfwJoystickInput joyInput;
+ protected Timer timer;
+ protected SystemListener listener;
+
+ public void setSystemListener(SystemListener listener) {
+ this.listener = listener;
+ }
+
+ protected void printContextInitInfo() {
+ logger.log(Level.INFO, "LWJGL {0} context running on thread {1}\n"
+ + " * Graphics Adapter: GLFW {2}",
+ new Object[]{Integer.toString(org.lwjgl.Version.VERSION_MAJOR), Thread.currentThread().getName(), GLFW.glfwGetVersionString()});
+ }
+
+ protected int determineMaxSamples() {
+ // If we already have a valid context, determine samples using current context.
+ logger.log(Level.SEVERE, "glfwExtensionSupported(\"GL_ARB_framebuffer_object\"): "+GLFW.glfwExtensionSupported("GL_ARB_framebuffer_object"));
+ logger.log(Level.SEVERE, "glfwExtensionSupported(\"GL_EXT_framebuffer_multisample\"): "+GLFW.glfwExtensionSupported("GL_ARB_framebuffer_object"));
+
+ if (GLFW.glfwExtensionSupported("GL_ARB_framebuffer_object") != 0) {
+ return glGetInteger(ARBFramebufferObject.GL_MAX_SAMPLES);
+ } else if (GLFW.glfwExtensionSupported("GL_EXT_framebuffer_multisample") != 0) {
+ return glGetInteger(EXTFramebufferMultisample.GL_MAX_SAMPLES_EXT);
+ }
+
+ return Integer.MAX_VALUE;
+ }
+
+ protected void loadNatives() {
+ if (JmeSystem.isLowPermissions()) {
+ return;
+ }
+
+ if ("LWJGL".equals(settings.getAudioRenderer())) {
+ NativeLibraryLoader.loadNativeLibrary("openal-lwjgl3", true);
+ }
+
+ if (NativeLibraryLoader.isUsingNativeBullet()) {
+ NativeLibraryLoader.loadNativeLibrary("bulletjme", true);
+ }
+
+ NativeLibraryLoader.loadNativeLibrary("glfw-lwjgl3", true);
+ NativeLibraryLoader.loadNativeLibrary("jemalloc-lwjgl3", true);
+ NativeLibraryLoader.loadNativeLibrary("lwjgl3", true);
+ }
+
+ /**
+ * Check if the display is a retina display.
+ * @return true
if the display is a retina display and false
otherwise.
+ */
+ public boolean isRetinaDisplay() {
+ return GLFW.glfwGetVersionString().contains("retina");
+ }
+
+ protected int getNumSamplesToUse() {
+ int samples = 0;
+ if (settings.getSamples() > 1) {
+ samples = settings.getSamples();
+ final int supportedSamples = determineMaxSamples();
+ if (supportedSamples < samples) {
+ logger.log(Level.WARNING,
+ "Couldn't satisfy antialiasing samples requirement: x{0}. "
+ + "Video hardware only supports: x{1}",
+ new Object[]{samples, supportedSamples});
+
+ samples = supportedSamples;
+ }
+ }
+ return samples;
+ }
+
+ protected void initContextFirstTime() {
+ final GLCapabilities capabilities = createCapabilities(settings.getRenderer().equals(AppSettings.LWJGL_OPENGL3));
+
+ if (!capabilities.OpenGL20) {
+ throw new RendererException("OpenGL 2.0 or higher is required for jMonkeyEngine");
+ }
+
+ if (settings.getRenderer().equals(AppSettings.LWJGL_OPENGL2)
+ || settings.getRenderer().equals(AppSettings.LWJGL_OPENGL3)) {
+ GL gl = new LwjglGL();
+ GLExt glext = new LwjglGLExt();
+ GLFbo glfbo;
+
+ if (capabilities.OpenGL30) {
+ glfbo = new LwjglGLFboGL3();
+ } else {
+ glfbo = new LwjglGLFboEXT();
+ }
+
+ if (settings.getBoolean("GraphicsDebug")) {
+ gl = new GLDebugDesktop(gl, glext, glfbo);
+ glext = (GLExt) gl;
+ glfbo = (GLFbo) gl;
+ }
+
+ if (settings.getBoolean("GraphicsTiming")) {
+ GLTimingState timingState = new GLTimingState();
+ gl = (GL) GLTiming.createGLTiming(gl, timingState, GL.class, GL2.class, GL3.class, GL4.class);
+ glext = (GLExt) GLTiming.createGLTiming(glext, timingState, GLExt.class);
+ glfbo = (GLFbo) GLTiming.createGLTiming(glfbo, timingState, GLFbo.class);
+ }
+
+ if (settings.getBoolean("GraphicsTrace")) {
+ gl = (GL) GLTracer.createDesktopGlTracer(gl, GL.class, GL2.class, GL3.class, GL4.class);
+ glext = (GLExt) GLTracer.createDesktopGlTracer(glext, GLExt.class);
+ glfbo = (GLFbo) GLTracer.createDesktopGlTracer(glfbo, GLFbo.class);
+ }
+
+ renderer = new GLRenderer(gl, glext, glfbo);
+ renderer.initialize();
+ } else {
+ throw new UnsupportedOperationException("Unsupported renderer: " + settings.getRenderer());
+ }
+
+ //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());
+
+ // Init input
+ if (keyInput != null) {
+ keyInput.initialize();
+ }
+
+ if (mouseInput != null) {
+ mouseInput.initialize();
+ }
+
+ if (joyInput != null) {
+ joyInput.initialize();
+ }
+ renderable.set(true);
+ }
+
+ /**
+ * Context internal destroy.
+ */
+ public void internalDestroy() {
+ renderer = null;
+ timer = null;
+ renderable.set(false);
+ synchronized (createdLock) {
+ created.set(false);
+ createdLock.notifyAll();
+ }
+ }
+
+ /**
+ * Context internal create.
+ */
+ public void internalCreate() {
+ synchronized (createdLock) {
+ created.set(true);
+ createdLock.notifyAll();
+ }
+
+ initContextFirstTime();
+ }
+
+ /**
+ * Create the context.
+ */
+ public void create() {
+ create(false);
+ }
+
+ /**
+ * Destroy the context.
+ */
+ public void destroy() {
+ destroy(false);
+ }
+
+ /**
+ *
+ * @param createdVal
+ */
+ protected void waitFor(boolean createdVal) {
+ synchronized (createdLock) {
+ while (created.get() != createdVal) {
+ try {
+ createdLock.wait();
+ } catch (InterruptedException ignored) {
+ }
+ }
+ }
+ }
+
+ @Override
+ public boolean isCreated() {
+ return created.get();
+ }
+
+ @Override
+ public boolean isRenderable() {
+ return renderable.get();
+ }
+
+ @Override
+ public void setSettings(AppSettings settings) {
+ this.settings.copyFrom(settings);
+ }
+
+ @Override
+ public AppSettings getSettings() {
+ return settings;
+ }
+
+ @Override
+ public Renderer getRenderer() {
+ return renderer;
+ }
+
+ @Override
+ public Timer getTimer() {
+ return timer;
+ }
+
+}
diff --git a/jme3-vr/src/main/java/com/jme3/system/lwjgl/LwjglDisplayVR.java b/jme3-vr/src/main/java/com/jme3/system/lwjgl/LwjglDisplayVR.java
new file mode 100644
index 000000000..03ce516af
--- /dev/null
+++ b/jme3-vr/src/main/java/com/jme3/system/lwjgl/LwjglDisplayVR.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2009-2012 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.jme3.system.lwjgl;
+
+
+/**
+ * A VR oriented LWJGL display.
+ * @author Daniel Johansson
+ * @author reden - phr00t - https://github.com/phr00t
+ * @author Julien Seinturier - (c) 2016 - JOrigin project - http:/www.jorigin.org
+ */
+public class LwjglDisplayVR extends LwjglWindowVR {
+
+ /**
+ * Create a new VR oriented LWJGL display.
+ */
+ public LwjglDisplayVR() {
+ super(Type.Display);
+ }
+
+
+}
diff --git a/jme3-vr/src/main/java/com/jme3/system/lwjgl/LwjglOffscreenBufferVR.java b/jme3-vr/src/main/java/com/jme3/system/lwjgl/LwjglOffscreenBufferVR.java
new file mode 100644
index 000000000..9fc51e805
--- /dev/null
+++ b/jme3-vr/src/main/java/com/jme3/system/lwjgl/LwjglOffscreenBufferVR.java
@@ -0,0 +1,53 @@
+package com.jme3.system.lwjgl;
+
+/*
+ * Copyright (c) 2009-2012 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import com.jme3.system.JmeContext;
+
+/**
+ * A VR oriented LWJGL offscreen buffer.
+ * @author Daniel Johansson
+ * @author reden - phr00t - https://github.com/phr00t
+ * @author Julien Seinturier - (c) 2016 - JOrigin project - http:/www.jorigin.org
+ */
+public class LwjglOffscreenBufferVR extends LwjglWindow {
+
+ /**
+ * Create a new VR oriented LWJGL offscreen buffer.
+ */
+ public LwjglOffscreenBufferVR() {
+ super(JmeContext.Type.OffscreenSurface);
+ }
+
+
+}
diff --git a/jme3-vr/src/main/java/com/jme3/system/lwjgl/LwjglWindowVR.java b/jme3-vr/src/main/java/com/jme3/system/lwjgl/LwjglWindowVR.java
new file mode 100644
index 000000000..15ba921f2
--- /dev/null
+++ b/jme3-vr/src/main/java/com/jme3/system/lwjgl/LwjglWindowVR.java
@@ -0,0 +1,581 @@
+package com.jme3.system.lwjgl;
+
+/*
+ * Copyright (c) 2009-2012 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import com.jme3.input.JoyInput;
+import com.jme3.input.KeyInput;
+import com.jme3.input.MouseInput;
+import com.jme3.input.TouchInput;
+import com.jme3.input.lwjgl.GlfwJoystickInput;
+import com.jme3.input.lwjgl.GlfwKeyInputVR;
+import com.jme3.input.lwjgl.GlfwMouseInputVR;
+import com.jme3.renderer.opengl.GL;
+import com.jme3.system.AppSettings;
+import com.jme3.system.JmeContext;
+import com.jme3.system.JmeSystem;
+import com.jme3.system.NanoTimer;
+
+import org.lwjgl.glfw.*;
+import org.lwjgl.opengl.GL11;
+
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import org.lwjgl.Version;
+
+import static org.lwjgl.glfw.GLFW.*;
+import static org.lwjgl.opengl.GL11.GL_FALSE;
+import static org.lwjgl.system.MemoryUtil.NULL;
+
+/**
+ * A wrapper class over the GLFW framework in LWJGL 3.
+ *
+ * @author Daniel Johansson
+ * @author reden - phr00t - https://github.com/phr00t
+ * @author Julien Seinturier - (c) 2016 - JOrigin project - http:/www.jorigin.org
+ */
+public abstract class LwjglWindowVR extends LwjglContextVR implements Runnable {
+
+ private static final Logger LOGGER = Logger.getLogger(LwjglWindowVR.class.getName());
+
+ protected AtomicBoolean needClose = new AtomicBoolean(false);
+ protected final AtomicBoolean needRestart = new AtomicBoolean(false);
+ protected int wasActive = GL.GL_FALSE;
+ protected boolean autoFlush = true;
+ protected boolean allowSwapBuffers = false;
+ private long window = NULL;
+ private final JmeContext.Type type;
+ private int frameRateLimit = -1;
+ private double frameSleepTime;
+
+ private GLFWErrorCallback errorCallback;
+ private GLFWWindowSizeCallback windowSizeCallback;
+ private GLFWWindowFocusCallback windowFocusCallback;
+ private Thread mainThread;
+
+ /**
+ * Create a new wrapper class over the GLFW framework in LWJGL 3.
+ * @param type the {@link com.jme3.system.JmeContext.Type type} of the display.
+ */
+ public LwjglWindowVR(final JmeContext.Type type) {
+ if (!JmeContext.Type.Display.equals(type) && !JmeContext.Type.OffscreenSurface.equals(type) && !JmeContext.Type.Canvas.equals(type)) {
+ throw new IllegalArgumentException("Unsupported type '" + type.name() + "' provided");
+ }
+
+ this.type = type;
+ }
+
+ /**
+ * @return Type.Display or Type.Canvas
+ */
+ public JmeContext.Type getType() {
+ return type;
+ }
+
+ /**
+ * Set the title if its a windowed display
+ *
+ * @param title the title to set
+ */
+ public void setTitle(final String title) {
+ if (created.get() && window != NULL) {
+ glfwSetWindowTitle(window, title);
+ }
+ }
+
+ /**
+ * Restart if its a windowed or full-screen display.
+ */
+ public void restart() {
+ if (created.get()) {
+ needRestart.set(true);
+ } else {
+ LOGGER.warning("Display is not created, cannot restart window.");
+ }
+ }
+
+ /**
+ * Apply the settings, changing resolution, etc.
+ *
+ * @param settings the settings to apply when creating the context.
+ */
+ protected void createContext(final AppSettings settings) {
+ glfwSetErrorCallback(errorCallback = new GLFWErrorCallback() {
+ @Override
+ public void invoke(int error, long description) {
+ final String message = GLFWErrorCallback.getDescription(description);
+ listener.handleError(message, new Exception(message));
+ }
+ });
+
+ if ( glfwInit() == GLFW_FALSE ) {
+ throw new IllegalStateException("Unable to initialize GLFW");
+ }
+
+ glfwDefaultWindowHints();
+
+ // just use defaults, which should provide the best compatibility
+ /*if (settings.getRenderer().equals(AppSettings.LWJGL_OPENGL3)) {
+ glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
+ glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GLFW_FALSE);
+ glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
+ glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
+ } else {
+ glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2);
+ glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
+ }*/
+
+ if (settings.getBoolean("RendererDebug")) {
+ glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GLFW_TRUE);
+ }
+
+ if (settings.isGammaCorrection()) {
+ glfwWindowHint(GLFW_SRGB_CAPABLE, GLFW_TRUE);
+ }
+
+ glfwWindowHint(GLFW_VISIBLE, GL_FALSE);
+ glfwWindowHint(GLFW_RESIZABLE, settings.isResizable() ? GLFW_TRUE : GLFW_FALSE);
+ glfwWindowHint(GLFW_DOUBLE_BUFFER, GLFW_TRUE);
+ glfwWindowHint(GLFW_DEPTH_BITS, settings.getDepthBits());
+ glfwWindowHint(GLFW_STENCIL_BITS, settings.getStencilBits());
+ glfwWindowHint(GLFW_SAMPLES, settings.getSamples());
+ glfwWindowHint(GLFW_STEREO, settings.useStereo3D() ? GLFW_TRUE : GLFW_FALSE);
+ glfwWindowHint(GLFW_REFRESH_RATE, settings.getFrequency());
+
+ if (settings.getBitsPerPixel() == 24) {
+ glfwWindowHint(GLFW_RED_BITS, 8);
+ glfwWindowHint(GLFW_GREEN_BITS, 8);
+ glfwWindowHint(GLFW_BLUE_BITS, 8);
+ } else if (settings.getBitsPerPixel() == 16) {
+ glfwWindowHint(GLFW_RED_BITS, 5);
+ glfwWindowHint(GLFW_GREEN_BITS, 6);
+ glfwWindowHint(GLFW_BLUE_BITS, 5);
+ }
+
+ glfwWindowHint(GLFW_ALPHA_BITS, settings.getAlphaBits());
+
+ // TODO: Add support for monitor selection
+ long monitor = NULL;
+
+ if (settings.isFullscreen()) {
+ monitor = glfwGetPrimaryMonitor();
+ }
+
+ final GLFWVidMode videoMode = glfwGetVideoMode(glfwGetPrimaryMonitor());
+
+ if (settings.getWidth() <= 0 || settings.getHeight() <= 0) {
+ settings.setResolution(videoMode.width(), videoMode.height());
+ }
+
+ window = glfwCreateWindow(settings.getWidth(), settings.getHeight(), settings.getTitle(), monitor, NULL);
+
+ if (window == NULL) {
+ throw new RuntimeException("Failed to create the GLFW window");
+ }
+
+ glfwSetWindowFocusCallback(window, windowFocusCallback = new GLFWWindowFocusCallback() {
+
+ @Override
+ public void invoke(long window, int focused) {
+ if (wasActive != focused) {
+ if (wasActive == GL11.GL_FALSE) {
+ listener.gainFocus();
+ timer.reset();
+ wasActive = GL11.GL_TRUE;
+ } else {
+ listener.loseFocus();
+ wasActive = GL11.GL_FALSE;
+ }
+
+
+ }
+ }
+ });
+
+ // Center the window
+ if( Type.Display.equals(type) ) {
+ if (!settings.isFullscreen()) {
+ glfwSetWindowPos(window,
+ (videoMode.width() - settings.getWidth()) / 2,
+ (videoMode.height() - settings.getHeight()) / 2);
+ }
+ }
+
+ // Make the OpenGL context current
+ glfwMakeContextCurrent(window);
+
+ // Enable vsync
+ if (settings.isVSync()) {
+ glfwSwapInterval(1);
+ } else {
+ glfwSwapInterval(0);
+ }
+
+ // Make the window visible
+ if (Type.Display.equals(type)) {
+ glfwShowWindow(window);
+
+ //FIXME: Needs LGJGL 3.1.0
+ //glfwFocusWindow(window);
+ }
+
+ // Add a resize callback which delegates to the listener
+ glfwSetWindowSizeCallback(window, windowSizeCallback = new GLFWWindowSizeCallback() {
+ @Override
+ public void invoke(final long window, final int width, final int height) {
+ settings.setResolution(width, height);
+ listener.reshape(width, height);
+ }
+ });
+
+ allowSwapBuffers = settings.isSwapBuffers();
+
+ // TODO: When GLFW 3.2 is released and included in LWJGL 3.x then we should hopefully be able to set the window icon.
+ }
+
+ /**
+ * Destroy the context.
+ */
+ protected void destroyContext() {
+ try {
+ if (renderer != null) {
+ renderer.cleanup();
+ }
+
+ if (errorCallback != null) {
+
+ //FIXME: Needs LWJGL 3.1.0
+ //errorCallback.free();
+ errorCallback.release();
+
+ errorCallback = null;
+ }
+
+ if (windowSizeCallback != null) {
+
+ //FIXME: Needs LWJGL 3.1.0
+ //windowSizeCallback.free();
+ windowSizeCallback.release();
+
+ windowSizeCallback = null;
+ }
+
+ if (windowFocusCallback != null) {
+
+ //FIXME: Needs LWJGL 3.1.0
+ //windowFocusCallback.free();
+ windowFocusCallback.release();
+
+ windowFocusCallback = null;
+ }
+
+ if (window != NULL) {
+ glfwDestroyWindow(window);
+ window = NULL;
+ }
+ } catch (Exception ex) {
+ listener.handleError("Failed to destroy context", ex);
+ }
+ }
+
+ @Override
+ public void create(boolean waitFor) {
+ if (created.get()) {
+ LOGGER.warning("create() called when display is already created!");
+ return;
+ }
+
+ mainThread = Thread.currentThread();
+ run();
+ }
+
+ /**
+ * Does LWJGL display initialization in the OpenGL thread
+ */
+ protected boolean initInThread() {
+ try {
+ if (!JmeSystem.isLowPermissions()) {
+ // Enable uncaught exception handler only for current thread
+ Thread.currentThread().setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
+ @Override
+ public void uncaughtException(Thread thread, Throwable thrown) {
+ listener.handleError("Uncaught exception thrown in " + thread.toString(), thrown);
+ if (needClose.get()) {
+ // listener.handleError() has requested the
+ // context to close. Satisfy request.
+ deinitInThread();
+ }
+ }
+ });
+ }
+
+ loadNatives();
+ timer = new NanoTimer();
+
+ // For canvas, this will create a pbuffer,
+ // allowing us to query information.
+ // When the canvas context becomes available, it will
+ // be replaced seamlessly.
+ createContext(settings);
+ printContextInitInfo();
+
+ created.set(true);
+ super.internalCreate();
+ } catch (Exception ex) {
+ try {
+ if (window != NULL) {
+ glfwDestroyWindow(window);
+ window = NULL;
+ }
+ } catch (Exception ex2) {
+ LOGGER.log(Level.WARNING, null, ex2);
+ }
+
+ listener.handleError("Failed to create display", ex);
+ return false; // if we failed to create display, do not continue
+ }
+
+ listener.initialize();
+ return true;
+ }
+
+ /**
+ * execute one iteration of the render loop in the OpenGL thread
+ */
+ protected void runLoop() {
+ // If a restart is required, lets recreate the context.
+ if (needRestart.getAndSet(false)) {
+ try {
+ destroyContext();
+ createContext(settings);
+ } catch (Exception ex) {
+ LOGGER.log(Level.SEVERE, "Failed to set display settings!", ex);
+ }
+
+ LOGGER.fine("Display restarted.");
+ }
+
+ if (!created.get()) {
+ throw new IllegalStateException();
+ }
+
+ listener.update();
+
+ // All this does is call swap buffers
+ // If the canvas is not active, there's no need to waste time
+ // doing that ..
+ if (renderable.get()) {
+ // calls swap buffers, etc.
+ try {
+ if (allowSwapBuffers && autoFlush) {
+ glfwSwapBuffers(window);
+ }
+ } catch (Throwable ex) {
+ listener.handleError("Error while swapping buffers", ex);
+ }
+ }
+
+ // Subclasses just call GLObjectManager clean up objects here
+ // it is safe .. for now.
+ if (renderer != null) {
+ renderer.postFrame();
+ }
+
+ if (autoFlush) {
+ if (frameRateLimit != getSettings().getFrameRate()) {
+ setFrameRateLimit(getSettings().getFrameRate());
+ }
+ } else if (frameRateLimit != 20) {
+ setFrameRateLimit(20);
+ }
+
+ // If software frame rate limiting has been asked for, lets calculate sleep time based on a base value calculated
+ // from 1000 / frameRateLimit in milliseconds subtracting the time it has taken to render last frame.
+ // This gives an approximate limit within 3 fps of the given frame rate limit.
+ if (frameRateLimit > 0) {
+ final double sleep = frameSleepTime - (timer.getTimePerFrame() / 1000.0);
+ final long sleepMillis = (long) sleep;
+ final int additionalNanos = (int) ((sleep - sleepMillis) * 1000000.0);
+
+ if (sleepMillis >= 0 && additionalNanos >= 0) {
+ try {
+ Thread.sleep(sleepMillis, additionalNanos);
+ } catch (InterruptedException ignored) {
+ }
+ }
+ }
+
+ glfwPollEvents();
+ }
+
+ private void setFrameRateLimit(int frameRateLimit) {
+ this.frameRateLimit = frameRateLimit;
+ frameSleepTime = 1000.0 / this.frameRateLimit;
+ }
+
+ /**
+ * De-initialize in the OpenGL thread.
+ */
+
+ protected void deinitInThread() {
+ listener.destroy();
+
+ destroyContext();
+ super.internalDestroy();
+
+ LOGGER.fine("Display destroyed.");
+ }
+
+ @Override
+ public void run() {
+ if (listener == null) {
+ throw new IllegalStateException("SystemListener is not set on context!"
+ + "Must set with JmeContext.setSystemListener().");
+ }
+
+
+ LOGGER.log(Level.FINE, "Using LWJGL {0}", Version.getVersion());
+
+ if (!initInThread()) {
+ LOGGER.log(Level.SEVERE, "Display initialization failed. Cannot continue.");
+ return;
+ }
+
+ while (true) {
+
+ runLoop();
+
+ if (needClose.get()) {
+ break;
+ }
+
+ if (glfwWindowShouldClose(window) == GLFW_TRUE) {
+ listener.requestClose(false);
+ }
+ }
+
+ deinitInThread();
+ }
+
+ public JoyInput getJoyInput() {
+ if (joyInput == null) {
+ joyInput = new GlfwJoystickInput();
+ }
+ return joyInput;
+ }
+
+ public MouseInput getMouseInput() {
+ if (mouseInput == null) {
+ mouseInput = new GlfwMouseInputVR(this);
+ }
+ return mouseInput;
+ }
+
+ public KeyInput getKeyInput() {
+ if (keyInput == null) {
+ keyInput = new GlfwKeyInputVR(this);
+ }
+
+ return keyInput;
+ }
+
+ public TouchInput getTouchInput() {
+ return null;
+ }
+
+ public void setAutoFlushFrames(boolean enabled) {
+ this.autoFlush = enabled;
+ }
+
+ public void destroy(boolean waitFor) {
+ needClose.set(true);
+ if (mainThread == Thread.currentThread()) {
+ // Ignore waitFor.
+ return;
+ }
+
+ if (waitFor) {
+ waitFor(false);
+ }
+ }
+
+ /**
+ * Get the window handle.
+ * @return the window handle as an internal GLFW identifier.
+ */
+ public long getWindowHandle() {
+ return window;
+ }
+
+
+ // TODO: Implement support for window icon when GLFW supports it.
+ /*
+ private ByteBuffer[] imagesToByteBuffers(Object[] images) {
+ ByteBuffer[] out = new ByteBuffer[images.length];
+ for (int i = 0; i < images.length; i++) {
+ BufferedImage image = (BufferedImage) images[i];
+ out[i] = imageToByteBuffer(image);
+ }
+ return out;
+ }
+
+
+ private ByteBuffer imageToByteBuffer(BufferedImage image) {
+ if (image.getType() != BufferedImage.TYPE_INT_ARGB_PRE) {
+ BufferedImage convertedImage = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_INT_ARGB_PRE);
+ Graphics2D g = convertedImage.createGraphics();
+ double width = image.getWidth() * (double) 1;
+ double height = image.getHeight() * (double) 1;
+ g.drawImage(image, (int) ((convertedImage.getWidth() - width) / 2),
+ (int) ((convertedImage.getHeight() - height) / 2),
+ (int) (width), (int) (height), null);
+ g.dispose();
+ image = convertedImage;
+ }
+
+ byte[] imageBuffer = new byte[image.getWidth() * image.getHeight() * 4];
+ int counter = 0;
+ for (int i = 0; i < image.getHeight(); i++) {
+ for (int j = 0; j < image.getWidth(); j++) {
+ int colorSpace = image.getRGB(j, i);
+ imageBuffer[counter + 0] = (byte) ((colorSpace << 8) >> 24);
+ imageBuffer[counter + 1] = (byte) ((colorSpace << 16) >> 24);
+ imageBuffer[counter + 2] = (byte) ((colorSpace << 24) >> 24);
+ imageBuffer[counter + 3] = (byte) (colorSpace >> 24);
+ counter += 4;
+ }
+ }
+ return ByteBuffer.wrap(imageBuffer);
+ }
+ */
+}
diff --git a/jme3-vr/src/main/java/jmevr/util/CenterQuad.java b/jme3-vr/src/main/java/jmevr/util/CenterQuad.java
new file mode 100644
index 000000000..7564afdba
--- /dev/null
+++ b/jme3-vr/src/main/java/jmevr/util/CenterQuad.java
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2009-2010 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package jmevr.util;
+
+import com.jme3.scene.Mesh;
+import com.jme3.scene.VertexBuffer.Type;
+
+/**
+ * Quad
represents a rectangular plane in space
+ * defined by 4 vertices. The quad's lower-left side is contained
+ * at the local space origin (0, 0, 0), while the upper-right
+ * side is located at the width/height coordinates (width, height, 0).
+ *
+ * @author Kirill Vainer
+ */
+public class CenterQuad extends Mesh {
+
+ public static CenterQuad UnitQuad = new CenterQuad(0.5f, 0.5f);
+ public static Mesh CenterSplitQuad;
+
+ private float width;
+ private float height;
+
+ /**
+ * Create a quad with the given width and height. The quad
+ * is always created in the XY plane.
+ *
+ * @param width The X extent or width
+ * @param height The Y extent or width
+ */
+ public CenterQuad(float width, float height){
+ updateGeometry(width, height);
+ }
+
+ /**
+ * Create a quad with the given width and height. The quad
+ * is always created in the XY plane.
+ *
+ * @param width The X extent or width
+ * @param height The Y extent or width
+ * @param flipCoords If true, the texture coordinates will be flipped
+ * along the Y axis.
+ */
+ public CenterQuad(float width, float height, boolean flipCoords){
+ updateGeometry(width, height, flipCoords);
+ this.setStatic();
+ }
+
+ public float getHeight() {
+ return height;
+ }
+
+ public float getWidth() {
+ return width;
+ }
+
+ public void updateGeometry(float width, float height){
+ updateGeometry(width, height, false);
+ }
+
+ public void updateGeometry(float width, float height, boolean flipCoords) {
+ this.width = width;
+ this.height = height;
+ setBuffer(Type.Position, 3, new float[]{-width/2, -height/2, 0,
+ width/2, -height/2, 0,
+ width/2, height/2, 0,
+ -width/2, height/2, 0
+ });
+
+
+ if (flipCoords){
+ setBuffer(Type.TexCoord, 2, new float[]{0, 1,
+ 1, 1,
+ 1, 0,
+ 0, 0});
+ }else{
+ setBuffer(Type.TexCoord, 2, new float[]{0, 0,
+ 1, 0,
+ 1, 1,
+ 0, 1});
+ }
+ setBuffer(Type.Normal, 3, new float[]{0, 0, 1,
+ 0, 0, 1,
+ 0, 0, 1,
+ 0, 0, 1});
+ if (height < 0){
+ setBuffer(Type.Index, 3, new short[]{0, 2, 1,
+ 0, 3, 2});
+ }else{
+ setBuffer(Type.Index, 3, new short[]{0, 1, 2,
+ 0, 2, 3});
+ }
+
+ updateBound();
+ }
+
+
+}
diff --git a/jme3-vr/src/main/java/jmevr/util/FilterUtil.java b/jme3-vr/src/main/java/jmevr/util/FilterUtil.java
new file mode 100644
index 000000000..70214aa6b
--- /dev/null
+++ b/jme3-vr/src/main/java/jmevr/util/FilterUtil.java
@@ -0,0 +1,47 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package jmevr.util;
+
+import com.jme3.asset.AssetManager;
+import com.jme3.post.filters.FogFilter;
+import com.jme3.post.ssao.SSAOFilter;
+import com.jme3.shadow.DirectionalLightShadowFilter;
+
+/**
+ *
+ * @author Rickard
+ */
+public class FilterUtil {
+
+ public static FogFilter cloneFogFilter(FogFilter fogFilter){
+ FogFilter filterClone = new FogFilter();
+ filterClone.setFogColor(fogFilter.getFogColor());
+ filterClone.setFogDensity(fogFilter.getFogDensity());
+ filterClone.setFogDistance(fogFilter.getFogDistance());
+ filterClone.setName(fogFilter.getName() + " Clone");
+
+ return filterClone;
+ }
+
+ public static SSAOFilter cloneSSAOFilter(SSAOFilter filter){
+ SSAOFilter clone = new SSAOFilter();
+ clone.setSampleRadius(filter.getSampleRadius());
+ clone.setIntensity(filter.getIntensity());
+ clone.setScale(filter.getScale());
+ clone.setBias(filter.getBias());
+ return clone;
+ }
+
+ public static DirectionalLightShadowFilter cloneDirectionalLightShadowFilter(AssetManager assetManager, DirectionalLightShadowFilter filter){
+ DirectionalLightShadowFilter clone = new DirectionalLightShadowFilter(assetManager, 512, 3);
+ clone.setLight(filter.getLight());
+ clone.setLambda(filter.getLambda());
+ clone.setShadowIntensity(filter.getShadowIntensity());
+ clone.setEdgeFilteringMode(filter.getEdgeFilteringMode());
+// clone.setEnabled(filter.isEnabled());
+ return clone;
+ }
+
+}
diff --git a/jme3-vr/src/main/java/jmevr/util/MeshUtil.java b/jme3-vr/src/main/java/jmevr/util/MeshUtil.java
new file mode 100644
index 000000000..246f51938
--- /dev/null
+++ b/jme3-vr/src/main/java/jmevr/util/MeshUtil.java
@@ -0,0 +1,107 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+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;
+
+/**
+ *
+ * @author reden
+ */
+public class MeshUtil {
+
+ public static Mesh setupDistortionMesh(int eye) {
+ Mesh distortionMesh = new Mesh();
+ float m_iLensGridSegmentCountH = 43, m_iLensGridSegmentCountV = 43;
+
+ float w = 1f / (m_iLensGridSegmentCountH - 1f);
+ float h = 1f / (m_iLensGridSegmentCountV - 1f);
+
+ float u, v;
+
+ float verts[] = new float[(int) (m_iLensGridSegmentCountV * m_iLensGridSegmentCountH) * 3];
+
+ float texcoordR[] = new float[(int) (m_iLensGridSegmentCountV * m_iLensGridSegmentCountH) * 2];
+ float texcoordG[] = new float[(int) (m_iLensGridSegmentCountV * m_iLensGridSegmentCountH) * 2];
+ float texcoordB[] = new float[(int) (m_iLensGridSegmentCountV * m_iLensGridSegmentCountH) * 2];
+
+ int vertPos = 0, coordPos = 0;
+
+ float Xoffset = eye == JOpenVRLibrary.EVREye.EVREye_Eye_Left ? -1f : 0;
+ for (int y = 0; y < m_iLensGridSegmentCountV; y++) {
+ for (int x = 0; x < m_iLensGridSegmentCountH; x++) {
+ u = x * w;
+ v = 1 - y * h;
+ verts[vertPos] = Xoffset + u; // x
+ verts[vertPos + 1] = -1 + 2 * y * h; // y
+ verts[vertPos + 2] = 0f; // z
+ vertPos += 3;
+
+ DistortionCoordinates_t dc0;
+ if( VRApplication.getVRHardware().getVRSystem() == null ) {
+ // default to no distortion
+ texcoordR[coordPos] = u;
+ texcoordR[coordPos + 1] = 1 - v;
+ texcoordG[coordPos] = u;
+ texcoordG[coordPos + 1] = 1 - v;
+ texcoordB[coordPos] = u;
+ texcoordB[coordPos + 1] = 1 - v;
+ } else {
+ dc0 = ((VR_IVRSystem_FnTable)VRApplication.getVRHardware().getVRSystem()).ComputeDistortion.apply(eye, u, v);
+
+ texcoordR[coordPos] = dc0.rfRed[0];
+ texcoordR[coordPos + 1] = 1 - dc0.rfRed[1];
+ texcoordG[coordPos] = dc0.rfGreen[0];
+ texcoordG[coordPos + 1] = 1 - dc0.rfGreen[1];
+ texcoordB[coordPos] = dc0.rfBlue[0];
+ texcoordB[coordPos + 1] = 1 - dc0.rfBlue[1];
+ }
+
+ coordPos += 2;
+ }
+ }
+
+ // have UV coordinates & positions, now to setup indices
+
+ int[] indices = new int[(int) ((m_iLensGridSegmentCountV - 1) * (m_iLensGridSegmentCountH - 1)) * 6];
+ int indexPos = 0;
+ int a, b, c, d;
+
+ int offset = 0;
+ for (int y = 0; y < m_iLensGridSegmentCountV - 1; y++) {
+ for (int x = 0; x < m_iLensGridSegmentCountH - 1; x++) {
+ a = (int) (m_iLensGridSegmentCountH * y + x + offset);
+ b = (int) (m_iLensGridSegmentCountH * y + x + 1 + offset);
+ c = (int) ((y + 1) * m_iLensGridSegmentCountH + x + 1 + offset);
+ d = (int) ((y + 1) * m_iLensGridSegmentCountH + x + offset);
+
+ indices[indexPos] = a;
+ indices[indexPos + 1] = b;
+ indices[indexPos + 2] = c;
+
+ indices[indexPos + 3] = a;
+ indices[indexPos + 4] = c;
+ indices[indexPos + 5] = d;
+
+ indexPos += 6;
+ }
+ }
+
+ // OK, create the mesh
+ distortionMesh.setBuffer(VertexBuffer.Type.Position, 3, verts);
+ distortionMesh.setBuffer(VertexBuffer.Type.Index, 1, indices);
+ distortionMesh.setBuffer(VertexBuffer.Type.TexCoord, 2, texcoordR);
+ distortionMesh.setBuffer(VertexBuffer.Type.TexCoord2, 2, texcoordG);
+ distortionMesh.setBuffer(VertexBuffer.Type.TexCoord3, 2, texcoordB);
+ distortionMesh.setStatic();
+ return distortionMesh;
+ }
+}
diff --git a/jme3-vr/src/main/java/jmevr/util/VRGuiManager.java b/jme3-vr/src/main/java/jmevr/util/VRGuiManager.java
new file mode 100644
index 000000000..33281e7d7
--- /dev/null
+++ b/jme3-vr/src/main/java/jmevr/util/VRGuiManager.java
@@ -0,0 +1,286 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package jmevr.util;
+
+import com.jme3.app.VRApplication;
+import com.jme3.material.Material;
+import com.jme3.material.RenderState.BlendMode;
+import com.jme3.math.ColorRGBA;
+import com.jme3.math.Matrix3f;
+import com.jme3.math.Quaternion;
+import com.jme3.math.Vector2f;
+import com.jme3.math.Vector3f;
+import com.jme3.renderer.Camera;
+import com.jme3.renderer.ViewPort;
+import com.jme3.renderer.queue.RenderQueue.Bucket;
+import com.jme3.scene.Spatial;
+import com.jme3.scene.Geometry;
+import com.jme3.scene.Node;
+import com.jme3.system.AppSettings;
+import com.jme3.texture.FrameBuffer;
+import com.jme3.texture.Image.Format;
+import com.jme3.texture.Texture;
+import com.jme3.texture.Texture2D;
+import java.awt.GraphicsEnvironment;
+
+/**
+ *
+ * @author
+ * phr00t
+ */
+public class VRGuiManager {
+
+ public enum POSITIONING_MODE {
+ 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 static final Matrix3f orient = new Matrix3f();
+ private static Vector2f screenSize;
+ protected static boolean wantsReposition;
+
+ /**
+ *
+ * Makes auto GUI positioning happen not immediately, but like an
+ * elastic connected to the headset. Setting to 0 disables (default)
+ * Higher settings make it track the headset quicker.
+ *
+ * @param elastic amount of elasticity
+ */
+ public static void setPositioningElasticity(float elastic) {
+ guiPositioningElastic = elastic;
+ }
+
+ public static float getPositioningElasticity() {
+ return guiPositioningElastic;
+ }
+
+ public static void setPositioningMode(POSITIONING_MODE mode) {
+ posMode = mode;
+ }
+
+ public static Vector2f getCanvasSize() {
+ if( screenSize == null ) {
+ if( VRApplication.isInVR() && VRApplication.getVRHardware() != null ) {
+ screenSize = new Vector2f();
+ VRApplication.getVRHardware().getRenderSize(screenSize);
+ screenSize.multLocal(VRApplication.getVRViewManager().getResolutionMuliplier());
+ } else {
+ AppSettings as = VRApplication.getMainVRApp().getContext().getSettings();
+ screenSize = new Vector2f(as.getWidth(), as.getHeight());
+ }
+ }
+ return screenSize;
+ }
+
+ private static Vector2f ratio;
+ public static 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());
+ int height = Integer.min(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode().getHeight(),
+ VRApplication.getMainVRApp().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() {
+ return posMode;
+ }
+
+ public static 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) {
+ Vector3f guiPos = guiQuadNode.getLocalTranslation();
+ guiPos.set(0f, 0f, guiDistance);
+ dir.mult(guiPos, guiPos);
+ guiPos.x += pos.x;
+ guiPos.y += pos.y + VRApplication.getVRHeightAdjustment();
+ guiPos.z += pos.z;
+ if( guiPositioningElastic > 0f && posMode != POSITIONING_MODE.MANUAL ) {
+ // mix pos & dir with current pos & dir
+ guiPos.interpolateLocal(EoldPos, guiPos, Float.min(1f, tpf * guiPositioningElastic));
+ EoldPos.set(guiPos);
+ }
+ }
+
+ protected static void updateGuiQuadGeometricState() {
+ guiQuadNode.updateGeometricState();
+ }
+
+ protected static void positionGuiNow(float tpf) {
+ wantsReposition = false;
+ if( VRApplication.isInVR() == false ) return;
+ guiQuadNode.setLocalScale(guiDistance * guiScale * 4f, 4f * guiDistance * guiScale, 1f);
+ switch( posMode ) {
+ case MANUAL:
+ case AUTO_CAM_ALL_SKIP_PITCH:
+ case AUTO_CAM_ALL:
+ if( camLeft != null && camRight != null ) {
+ // get middle point
+ temppos.set(camLeft.getLocation()).interpolateLocal(camRight.getLocation(), 0.5f);
+ positionTo(temppos, camLeft.getRotation(), tpf);
+ }
+ rotateScreenTo(camLeft.getRotation(), tpf);
+ break;
+ case AUTO_OBSERVER_POS_CAM_ROTATION:
+ Object obs = VRApplication.getObserver();
+ if( obs != null ) {
+ if( obs instanceof Camera ) {
+ positionTo(((Camera)obs).getLocation(), camLeft.getRotation(), tpf);
+ } else {
+ positionTo(((Spatial)obs).getWorldTranslation(), camLeft.getRotation(), tpf);
+ }
+ }
+ rotateScreenTo(camLeft.getRotation(), tpf);
+ break;
+ case AUTO_OBSERVER_ALL:
+ case AUTO_OBSERVER_ALL_CAMHEIGHT:
+ obs = VRApplication.getObserver();
+ if( obs != null ) {
+ Quaternion q;
+ if( obs instanceof Camera ) {
+ q = ((Camera)obs).getRotation();
+ temppos.set(((Camera)obs).getLocation());
+ } else {
+ q = ((Spatial)obs).getWorldRotation();
+ temppos.set(((Spatial)obs).getWorldTranslation());
+ }
+ if( posMode == POSITIONING_MODE.AUTO_OBSERVER_ALL_CAMHEIGHT ) {
+ temppos.y = camLeft.getLocation().y;
+ }
+ 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) {
+ dir.getRotationColumn(2, look).negateLocal();
+ dir.getRotationColumn(0, left).negateLocal();
+ orient.fromAxes(left, dir.getRotationColumn(1, up), look);
+ Quaternion rot = tempq.fromRotationMatrix(orient);
+ if( posMode == POSITIONING_MODE.AUTO_CAM_ALL_SKIP_PITCH ) VRUtil.stripToYaw(rot);
+ if( guiPositioningElastic > 0f && posMode != POSITIONING_MODE.MANUAL ) {
+ // mix pos & dir with current pos & dir
+ EoldDir.nlerp(rot, tpf * guiPositioningElastic);
+ guiQuadNode.setLocalRotation(EoldDir);
+ } else {
+ guiQuadNode.setLocalRotation(rot);
+ }
+ }
+
+ public static void setGuiDistance(float newGuiDistance) {
+ guiDistance = newGuiDistance;
+ }
+
+ public static void setGuiScale(float scale) {
+ guiScale = scale;
+ }
+
+ public static float getGuiDistance() {
+ return guiDistance;
+ }
+
+ public static void adjustGuiDistance(float adjustAmount) {
+ guiDistance += adjustAmount;
+ }
+
+ protected static void setupGui(Camera leftcam, Camera rightcam, ViewPort left, ViewPort right) {
+ if( VRApplication.hasTraditionalGUIOverlay() ) {
+ camLeft = leftcam;
+ camRight = rightcam;
+ Spatial guiScene = getGuiQuad(camLeft);
+ left.attachScene(guiScene);
+ if( right != null ) right.attachScene(guiScene);
+ setPositioningMode(posMode);
+ }
+ }
+
+ /*
+ do not use, set by preconfigure routine in VRApplication
+ */
+ public static void _enableCurvedSuface(boolean set) {
+ useCurvedSurface = set;
+ }
+
+ /*
+ do not use, set by preconfigure routine in VRApplication
+ */
+ public static 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){
+ 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.setClearFlags(true, true, true);
+ offView.setBackgroundColor(ColorRGBA.BlackNoAlpha);
+
+ // create offscreen framebuffer
+ FrameBuffer offBuffer = new FrameBuffer((int)guiCanvasSize.x, (int)guiCanvasSize.y, 1);
+
+ //setup framebuffer's texture
+ guiTexture = new Texture2D((int)guiCanvasSize.x, (int)guiCanvasSize.y, Format.RGBA8);
+ guiTexture.setMinFilter(Texture.MinFilter.BilinearNoMipMaps);
+ guiTexture.setMagFilter(Texture.MagFilter.Bilinear);
+
+ //setup framebuffer to use texture
+ offBuffer.setDepthBuffer(Format.Depth);
+ offBuffer.setColorTexture(guiTexture);
+
+ //set viewport to render to offscreen framebuffer
+ offView.setOutputFrameBuffer(offBuffer);
+
+ // setup framebuffer's scene
+ offView.attachScene(sourceApp.getGuiNode());
+
+ if( useCurvedSurface ) {
+ guiQuad = (Geometry)VRApplication.getMainVRApp().getAssetManager().loadModel("jmevr/util/gui_mesh.j3o");
+ } else {
+ guiQuad = new Geometry("guiQuad", new CenterQuad(1f, 1f));
+ }
+
+ Material mat = new Material(sourceApp.getAssetManager(), "Common/MatDefs/VR/GuiOverlay.j3md");
+ mat.getAdditionalRenderState().setDepthTest(!overdraw);
+ mat.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
+ mat.getAdditionalRenderState().setDepthWrite(false);
+ mat.setTexture("ColorMap", guiTexture);
+ guiQuad.setQueueBucket(Bucket.Translucent);
+ guiQuad.setMaterial(mat);
+
+ guiQuadNode = new Node("gui-quad-node");
+ guiQuadNode.setQueueBucket(Bucket.Translucent);
+ guiQuadNode.attachChild(guiQuad);
+ }
+ return guiQuadNode;
+ }
+}
diff --git a/jme3-vr/src/main/java/jmevr/util/VRMouseManager.java b/jme3-vr/src/main/java/jmevr/util/VRMouseManager.java
new file mode 100644
index 000000000..df31c70ee
--- /dev/null
+++ b/jme3-vr/src/main/java/jmevr/util/VRMouseManager.java
@@ -0,0 +1,178 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package jmevr.util;
+
+import com.jme3.app.VRApplication;
+import com.jme3.input.MouseInput;
+import com.jme3.input.controls.AnalogListener;
+import com.jme3.input.lwjgl.GlfwMouseInputVR;
+import com.jme3.input.vr.VRInputType;
+import com.jme3.material.RenderState.BlendMode;
+import com.jme3.math.Vector2f;
+import com.jme3.system.AppSettings;
+import com.jme3.system.lwjgl.LwjglWindowVR;
+import com.jme3.texture.Texture;
+import com.jme3.texture.Texture2D;
+import com.jme3.ui.Picture;
+
+/**
+ *
+ * @author Phr00t
+ */
+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) {
+ float amt = 0f;
+ for(float f : arr) amt += f;
+ return amt / arr.length;
+ }
+
+ protected static void init() {
+ // load default mouseimage
+ mouseImage = new Picture("mouse");
+ setImage("jmevr/util/mouse.png");
+ // hide default cursor by making it invisible
+ MouseInput mi = VRApplication.getMainVRApp().getContext().getMouseInput();
+ if( mi instanceof GlfwMouseInputVR ){
+ ((GlfwMouseInputVR)mi).hideActiveCursor();
+ }
+ centerMouse();
+ }
+
+ public static void setThumbstickMode(boolean set) {
+ thumbstickMode = set;
+ }
+
+ public static boolean isThumbstickMode() {
+ return thumbstickMode;
+ }
+
+ public static void setSpeed(float sensitivity, float acceleration) {
+ VRMouseManager.sensitivity = sensitivity;
+ VRMouseManager.acceleration = acceleration;
+ }
+
+ public static float getSpeedSensitivity() {
+ return sensitivity;
+ }
+
+ public static float getSpeedAcceleration() {
+ return acceleration;
+ }
+
+ public static 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 static 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;
+ Vector2f tpDelta;
+ if( thumbstickMode ) {
+ tpDelta = VRApplication.getVRinput().getAxis(inputIndex, VRInputType.ViveTrackpadAxis);
+ } else {
+ tpDelta = VRApplication.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);
+ if( tpDelta.x < 0f ) Xamount = -Xamount;
+ if( tpDelta.y < 0f ) Yamount = -Yamount;
+ Xamount *= moveScale; Yamount *= moveScale;
+ if( mouseListener != null ) {
+ if( tpDelta.x != 0f && mouseXName != null ) mouseListener.onAnalog(mouseXName, Xamount * 0.2f, tpf);
+ if( tpDelta.y != 0f && mouseYName != null ) mouseListener.onAnalog(mouseYName, Yamount * 0.2f, tpf);
+ }
+ if( VRApplication.getMainVRApp().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();
+ if( cursorPos.x > maxsize.x ) cursorPos.x = maxsize.x;
+ if( cursorPos.x < 0f ) cursorPos.x = 0f;
+ if( cursorPos.y > maxsize.y ) cursorPos.y = maxsize.y;
+ if( cursorPos.y < 0f ) cursorPos.y = 0f;
+ }
+ }
+
+ public static Vector2f getCursorPosition() {
+ if( VRApplication.isInVR() ) {
+ return cursorPos;
+ }
+ return VRApplication.getMainVRApp().getInputManager().getCursorPosition();
+ }
+
+ public static 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();
+ if( mi instanceof GlfwMouseInputVR ) ((GlfwMouseInputVR)mi).setCursorPosition((int)(as.getWidth() / 2f), (int)(as.getHeight() / 2f));
+ if( VRApplication.isInVR() ) {
+ cursorPos.x = size.x / 2f;
+ cursorPos.y = size.y / 2f;
+ recentCenterCount = 2;
+ }
+ }
+
+ protected static void update(float tpf) {
+ // if we are showing the cursor, add our picture as it
+ VRApplication vrapp = VRApplication.getMainVRApp();
+ if( vrapp.getInputManager().isCursorVisible() ) {
+ if( mouseImage.getParent() == null ) {
+ VRApplication.getMainVRApp().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.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();
+ if( mi instanceof GlfwMouseInputVR ) {
+ if( recentCenterCount <= 0 ) {
+ //Vector2f winratio = VRGuiManager.getCanvasToWindowRatio();
+ cursorPos.x += ((GlfwMouseInputVR)mi).getLastDeltaX();// * winratio.x;
+ cursorPos.y += ((GlfwMouseInputVR)mi).getLastDeltaY();// * winratio.y;
+ if( cursorPos.x < 0f ) cursorPos.x = 0f;
+ if( cursorPos.y < 0f ) cursorPos.y = 0f;
+ if( cursorPos.x > VRGuiManager.getCanvasSize().x ) cursorPos.x = VRGuiManager.getCanvasSize().x;
+ if( cursorPos.y > VRGuiManager.getCanvasSize().y ) cursorPos.y = VRGuiManager.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);
+ } 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
new file mode 100644
index 000000000..a77a76b17
--- /dev/null
+++ b/jme3-vr/src/main/java/jmevr/util/VRUtil.java
@@ -0,0 +1,111 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package jmevr.util;
+
+import com.jme3.math.FastMath;
+import com.jme3.math.Matrix4f;
+import com.jme3.math.Quaternion;
+import java.util.concurrent.TimeUnit;
+import jopenvr.HmdMatrix34_t;
+import jopenvr.HmdMatrix44_t;
+
+/**
+ *
+ * @author reden
+ */
+public class VRUtil {
+
+ private static final long SLEEP_PRECISION = TimeUnit.MILLISECONDS.toNanos(4);
+ private static final long SPIN_YIELD_PRECISION = TimeUnit.MILLISECONDS.toNanos(2);
+
+ public static void sleepNanos(long nanoDuration) {
+ final long end = System.nanoTime() + nanoDuration;
+ long timeLeft = nanoDuration;
+ do {
+ try {
+ if (timeLeft > SLEEP_PRECISION) {
+ Thread.sleep(1);
+ } else if (timeLeft > SPIN_YIELD_PRECISION) {
+ Thread.sleep(0);
+ }
+ } catch(Exception e) { }
+ timeLeft = end - System.nanoTime();
+ } while (timeLeft > 0);
+ }
+
+ public static Matrix4f convertSteamVRMatrix3ToMatrix4f(HmdMatrix34_t hmdMatrix, Matrix4f mat){
+ mat.set(hmdMatrix.m[0], hmdMatrix.m[1], hmdMatrix.m[2], hmdMatrix.m[3],
+ hmdMatrix.m[4], hmdMatrix.m[5], hmdMatrix.m[6], hmdMatrix.m[7],
+ hmdMatrix.m[8], hmdMatrix.m[9], hmdMatrix.m[10], hmdMatrix.m[11],
+ 0f, 0f, 0f, 1f);
+ return mat;
+ }
+
+ public static Matrix4f convertSteamVRMatrix4ToMatrix4f(HmdMatrix44_t hmdMatrix, Matrix4f mat){
+ mat.set(hmdMatrix.m[0], hmdMatrix.m[1], hmdMatrix.m[2], hmdMatrix.m[3],
+ hmdMatrix.m[4], hmdMatrix.m[5], hmdMatrix.m[6], hmdMatrix.m[7],
+ hmdMatrix.m[8], hmdMatrix.m[9], hmdMatrix.m[10], hmdMatrix.m[11],
+ hmdMatrix.m[12], hmdMatrix.m[13], hmdMatrix.m[14], hmdMatrix.m[15]);
+ return mat;
+ }
+
+ public static void convertMatrix4toQuat(Matrix4f in, Quaternion out) {
+ // convert rotation matrix to quat
+ out.fromRotationMatrix(in.m00, in.m01, in.m02, in.m10, in.m11, in.m12, in.m20, in.m21, in.m22);
+ // flip the pitch
+ out.set(-out.getX(), out.getY(), -out.getZ(), out.getW());
+ }
+
+ public static Quaternion FastFullAngles(Quaternion use, float yaw, float pitch, float roll) {
+ float angle;
+ float sinRoll, sinPitch, sinYaw, cosRoll, cosPitch, cosYaw;
+ angle = roll * 0.5f;
+ sinPitch = (float)Math.sin(angle);
+ cosPitch = (float)Math.cos(angle);
+ angle = yaw * 0.5f;
+ sinRoll = (float)Math.sin(angle);
+ cosRoll = (float)Math.cos(angle);
+ angle = pitch * 0.5f;
+ sinYaw = (float)Math.sin(angle);
+ cosYaw = (float)Math.cos(angle);
+
+ // variables used to reduce multiplication calls.
+ float cosRollXcosPitch = cosRoll * cosPitch;
+ float sinRollXsinPitch = sinRoll * sinPitch;
+ float cosRollXsinPitch = cosRoll * sinPitch;
+ float sinRollXcosPitch = sinRoll * cosPitch;
+
+ use.set((cosRollXcosPitch * sinYaw + sinRollXsinPitch * cosYaw),
+ (sinRollXcosPitch * cosYaw + cosRollXsinPitch * sinYaw),
+ (cosRollXsinPitch * cosYaw - sinRollXcosPitch * sinYaw),
+ (cosRollXcosPitch * cosYaw - sinRollXsinPitch * sinYaw));
+
+ return use;
+ }
+
+ public static Quaternion stripToYaw(Quaternion q) {
+ float yaw;
+ float w = q.getW();
+ float x = q.getX();
+ float y = q.getY();
+ float z = q.getZ();
+ float sqx = x*x;
+ float sqy = y*y;
+ float sqz = z*z;
+ float sqw = w*w;
+ float unit = sqx + sqy + sqz + sqw; // if normalized is one, otherwise
+ // is correction factor
+ float test = x * y + z * w;
+ if (test > 0.499 * unit) { // singularity at north pole
+ yaw = 2 * FastMath.atan2(x, w);
+ } else if (test < -0.499 * unit) { // singularity at south pole
+ yaw = -2 * FastMath.atan2(x, w);
+ } else {
+ yaw = FastMath.atan2(2 * y * w - 2 * x * z, sqx - sqy - sqz + sqw); // roll or heading
+ }
+ FastFullAngles(q, yaw, 0f, 0f);
+ return q;
+ }
+}
diff --git a/jme3-vr/src/main/java/jmevr/util/VRViewManager.java b/jme3-vr/src/main/java/jmevr/util/VRViewManager.java
new file mode 100644
index 000000000..6cd3fb052
--- /dev/null
+++ b/jme3-vr/src/main/java/jmevr/util/VRViewManager.java
@@ -0,0 +1,640 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package jmevr.util;
+
+import com.jme3.app.VRApplication;
+import com.jme3.input.vr.OSVR;
+import com.jme3.input.vr.OpenVR;
+import com.jme3.input.vr.VRAPI;
+import com.jme3.material.Material;
+import com.jme3.math.ColorRGBA;
+import com.jme3.math.Quaternion;
+import com.jme3.math.Vector2f;
+import com.jme3.math.Vector3f;
+import com.jme3.post.CartoonSSAO;
+import com.jme3.post.Filter;
+import com.jme3.post.FilterPostProcessor;
+import com.jme3.post.SceneProcessor;
+import com.jme3.post.filters.FogFilter;
+import com.jme3.post.filters.TranslucentBucketFilter;
+import com.jme3.post.ssao.SSAOFilter;
+import com.jme3.renderer.Camera;
+import com.jme3.renderer.ViewPort;
+import com.jme3.renderer.queue.RenderQueue.Bucket;
+import com.jme3.scene.Geometry;
+import com.jme3.scene.Node;
+import com.jme3.scene.Spatial;
+import com.jme3.shadow.DirectionalLightShadowFilter;
+import com.jme3.shadow.VRDirectionalLightShadowRenderer;
+import com.jme3.system.lwjgl.LwjglWindow;
+import com.jme3.texture.FrameBuffer;
+import com.jme3.texture.Image;
+import com.jme3.texture.Texture;
+import com.jme3.texture.Texture2D;
+import com.jme3.ui.Picture;
+import com.sun.jna.Pointer;
+import com.sun.jna.ptr.PointerByReference;
+
+import static com.jme3.app.VRApplication.isInVR;
+
+import java.awt.GraphicsEnvironment;
+
+import jopenvr.JOpenVRLibrary;
+import jopenvr.Texture_t;
+import jopenvr.VRTextureBounds_t;
+import osvrrendermanageropengl.OSVR_RenderBufferOpenGL;
+import osvrrendermanageropengl.OSVR_ViewportDescription;
+import osvrrendermanageropengl.OsvrRenderManagerOpenGLLibrary;
+
+/**
+ *
+ * @author reden
+ */
+public class VRViewManager {
+
+ private final VRApplication app;
+ private Camera camLeft,camRight;
+ private ViewPort viewPortLeft, viewPortRight;
+ private FilterPostProcessor ppLeft, ppRight;
+
+ // OpenVR values
+ private VRTextureBounds_t texBoundsLeft, texBoundsRight;
+ private Texture_t texTypeLeft, texTypeRight;
+
+ // OSVR values
+ OSVR_RenderBufferOpenGL.ByValue[] osvr_renderBuffer;
+ OSVR_ViewportDescription.ByValue osvr_viewDescFull, osvr_viewDescLeft, osvr_viewDescRight;
+ Pointer osvr_rmBufferState;
+
+ //private static boolean useCustomDistortion;
+ private float heightAdjustment;
+
+ private Texture2D leftEyeTex, rightEyeTex, dualEyeTex;
+ private Texture2D leftEyeDepth, rightEyeDepth;
+
+ private final static String LEFT_VIEW_NAME = "Left View";
+ private final static String RIGHT_VIEW_NAME = "Right View";
+
+ /*
+ do not use. set via preconfigure routine in VRApplication
+ */
+ @Deprecated
+ public static void _setCustomDistortion(boolean set) {
+ //useCustomDistortion = set;
+ }
+
+ public VRViewManager(VRApplication forVRApp){
+ app = forVRApp;
+ }
+
+ private int getRightTexId() {
+ return (int)rightEyeTex.getImage().getId();
+ }
+
+ private int getFullTexId() {
+ return (int)dualEyeTex.getImage().getId();
+ }
+
+ private int getLeftTexId() {
+ return (int)leftEyeTex.getImage().getId();
+ }
+
+ public float getHeightAdjustment() {
+ return heightAdjustment;
+ }
+
+ public void setHeightAdjustment(float amount) {
+ heightAdjustment = amount;
+ }
+
+ private void initTextureSubmitStructs() {
+ texTypeLeft = new Texture_t();
+ texTypeRight = new Texture_t();
+ if( VRApplication.getVRHardware() instanceof OpenVR ) {
+ texBoundsLeft = new VRTextureBounds_t();
+ texBoundsRight = new VRTextureBounds_t();
+ // left eye
+ texBoundsLeft.uMax = 0.5f;
+ texBoundsLeft.uMin = 0f;
+ texBoundsLeft.vMax = 1f;
+ texBoundsLeft.vMin = 0f;
+ texBoundsLeft.setAutoSynch(false);
+ texBoundsLeft.setAutoRead(false);
+ texBoundsLeft.setAutoWrite(false);
+ texBoundsLeft.write();
+ // right eye
+ texBoundsRight.uMax = 1f;
+ texBoundsRight.uMin = 0.5f;
+ texBoundsRight.vMax = 1f;
+ texBoundsRight.vMin = 0f;
+ texBoundsRight.setAutoSynch(false);
+ texBoundsRight.setAutoRead(false);
+ texBoundsRight.setAutoWrite(false);
+ texBoundsRight.write();
+ // texture type
+ texTypeLeft.eColorSpace = JOpenVRLibrary.EColorSpace.EColorSpace_ColorSpace_Gamma;
+ texTypeLeft.eType = JOpenVRLibrary.EGraphicsAPIConvention.EGraphicsAPIConvention_API_OpenGL;
+ texTypeLeft.setAutoSynch(false);
+ texTypeLeft.setAutoRead(false);
+ texTypeLeft.setAutoWrite(false);
+ texTypeLeft.handle = -1;
+ texTypeRight.eColorSpace = JOpenVRLibrary.EColorSpace.EColorSpace_ColorSpace_Gamma;
+ texTypeRight.eType = JOpenVRLibrary.EGraphicsAPIConvention.EGraphicsAPIConvention_API_OpenGL;
+ texTypeRight.setAutoSynch(false);
+ texTypeRight.setAutoRead(false);
+ texTypeRight.setAutoWrite(false);
+ texTypeRight.handle = -1;
+ } else if( VRApplication.getVRHardware() instanceof OSVR ) {
+ // must be OSVR
+ osvr_renderBuffer = new OSVR_RenderBufferOpenGL.ByValue[2];
+ osvr_renderBuffer[OSVR.EYE_LEFT] = new OSVR_RenderBufferOpenGL.ByValue();
+ osvr_renderBuffer[OSVR.EYE_RIGHT] = new OSVR_RenderBufferOpenGL.ByValue();
+ osvr_renderBuffer[OSVR.EYE_LEFT].setAutoSynch(false);
+ osvr_renderBuffer[OSVR.EYE_RIGHT].setAutoSynch(false);
+ osvr_viewDescFull = new OSVR_ViewportDescription.ByValue();
+ osvr_viewDescFull.setAutoSynch(false);
+ osvr_viewDescFull.left = osvr_viewDescFull.lower = 0.0;
+ osvr_viewDescFull.width = osvr_viewDescFull.height = 1.0;
+ osvr_viewDescLeft = new OSVR_ViewportDescription.ByValue();
+ osvr_viewDescLeft.setAutoSynch(false);
+ osvr_viewDescLeft.left = osvr_viewDescLeft.lower = 0.0;
+ osvr_viewDescLeft.width = 0.5;
+ osvr_viewDescLeft.height = 1.0;
+ osvr_viewDescRight = new OSVR_ViewportDescription.ByValue();
+ osvr_viewDescRight.setAutoSynch(false);
+ osvr_viewDescRight.left = 0.5;
+ osvr_viewDescRight.lower = 0.0;
+ osvr_viewDescRight.width = 0.5;
+ osvr_viewDescRight.height = 1.0;
+ osvr_viewDescRight.write();
+ osvr_viewDescLeft.write();
+ osvr_viewDescFull.write();
+ osvr_renderBuffer[OSVR.EYE_LEFT].depthStencilBufferName = -1;
+ osvr_renderBuffer[OSVR.EYE_LEFT].colorBufferName = -1;
+ osvr_renderBuffer[OSVR.EYE_RIGHT].depthStencilBufferName = -1;
+ osvr_renderBuffer[OSVR.EYE_RIGHT].colorBufferName = -1;
+ }
+ }
+
+ private final PointerByReference grabRBS = new PointerByReference();
+ 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);
+ }
+
+ public void sendTextures() {
+ if( isInVR() ) {
+ VRAPI api = VRApplication.getVRHardware();
+ if( api.getCompositor() != null ) {
+ // using the compositor...
+ int errl = 0, errr = 0;
+ if( VRApplication.isInstanceVRRendering() ) {
+ if( texTypeLeft.handle == -1 || texTypeLeft.handle != getFullTexId() ) {
+ texTypeLeft.handle = getFullTexId();
+ if( texTypeLeft.handle != -1 ) {
+ texTypeLeft.write();
+ if( api instanceof OSVR ) {
+ osvr_renderBuffer[OSVR.EYE_LEFT].colorBufferName = texTypeLeft.handle;
+ osvr_renderBuffer[OSVR.EYE_LEFT].depthStencilBufferName = dualEyeTex.getImage().getId();
+ osvr_renderBuffer[OSVR.EYE_LEFT].write();
+ registerOSVRBuffer(osvr_renderBuffer[OSVR.EYE_LEFT]);
+ }
+ }
+ } else {
+ if( api instanceof OpenVR ) {
+ int submitFlag = JOpenVRLibrary.EVRSubmitFlags.EVRSubmitFlags_Submit_Default;
+ errr = ((OpenVR)api).getCompositor().Submit.apply(JOpenVRLibrary.EVREye.EVREye_Eye_Right, texTypeLeft, texBoundsRight, submitFlag);
+ errl = ((OpenVR)api).getCompositor().Submit.apply(JOpenVRLibrary.EVREye.EVREye_Eye_Left, texTypeLeft, texBoundsLeft, submitFlag);
+ } else if( api instanceof OSVR ) {
+ ((OSVR)api).handleRenderBufferPresent(osvr_viewDescLeft, osvr_viewDescRight,
+ osvr_renderBuffer[OSVR.EYE_LEFT], osvr_renderBuffer[OSVR.EYE_LEFT]);
+ }
+ }
+ } else if( texTypeLeft.handle == -1 || texTypeRight.handle == -1 ||
+ texTypeLeft.handle != getLeftTexId() || texTypeRight.handle != getRightTexId() ) {
+ texTypeLeft.handle = getLeftTexId();
+ if( texTypeLeft.handle != -1 ) {
+ texTypeLeft.write();
+ if( api instanceof OSVR ) {
+ osvr_renderBuffer[OSVR.EYE_LEFT].colorBufferName = texTypeLeft.handle;
+ if( leftEyeDepth != null ) osvr_renderBuffer[OSVR.EYE_LEFT].depthStencilBufferName = leftEyeDepth.getImage().getId();
+ osvr_renderBuffer[OSVR.EYE_LEFT].write();
+ registerOSVRBuffer(osvr_renderBuffer[OSVR.EYE_LEFT]);
+ }
+ }
+ texTypeRight.handle = getRightTexId();
+ if( texTypeRight.handle != -1 ) {
+ texTypeRight.write();
+ if( api instanceof OSVR ) {
+ osvr_renderBuffer[OSVR.EYE_RIGHT].colorBufferName = texTypeRight.handle;
+ if( rightEyeDepth != null ) osvr_renderBuffer[OSVR.EYE_RIGHT].depthStencilBufferName = rightEyeDepth.getImage().getId();
+ osvr_renderBuffer[OSVR.EYE_RIGHT].write();
+ registerOSVRBuffer(osvr_renderBuffer[OSVR.EYE_RIGHT]);
+ }
+ }
+ } else {
+ if( api instanceof OpenVR ) {
+ errl = ((OpenVR)api).getCompositor().Submit.apply(JOpenVRLibrary.EVREye.EVREye_Eye_Left, texTypeLeft, null,
+ JOpenVRLibrary.EVRSubmitFlags.EVRSubmitFlags_Submit_Default);
+ errr = ((OpenVR)api).getCompositor().Submit.apply(JOpenVRLibrary.EVREye.EVREye_Eye_Right, texTypeRight, null,
+ JOpenVRLibrary.EVRSubmitFlags.EVRSubmitFlags_Submit_Default);
+ } else if( api instanceof OSVR ) {
+ ((OSVR)api).handleRenderBufferPresent(osvr_viewDescFull, osvr_viewDescFull,
+ osvr_renderBuffer[OSVR.EYE_LEFT], osvr_renderBuffer[OSVR.EYE_RIGHT]);
+ }
+ }
+ if( errl != 0 ) System.out.println("Submit left compositor error: " + Integer.toString(errl));
+ if( errr != 0 ) System.out.println("Submit right compositor error: " + Integer.toString(errr));
+ }
+ }
+ }
+
+ public Camera getCamLeft() {
+ return camLeft;
+ }
+
+ public Camera getCamRight() {
+ return camRight;
+ }
+
+ public ViewPort getViewPortLeft() {
+ return viewPortLeft;
+ }
+
+ public ViewPort getViewPortRight() {
+ return viewPortRight;
+ }
+
+ public void initialize(VRApplication app) {
+ initTextureSubmitStructs();
+ setupCamerasAndViews();
+ setupVRScene();
+ moveScreenProcessingToEyes();
+ if( VRApplication.hasTraditionalGUIOverlay() ) {
+ VRMouseManager.init();
+ // update the pose to position the gui correctly on start
+ update(0f);
+ VRGuiManager.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 ) {
+ int origWidth = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode().getWidth();
+ int origHeight = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode().getHeight();
+ long window = ((LwjglWindow)VRApplication.getMainVRApp().getContext()).getWindowHandle();
+ Vector2f windowSize = new Vector2f();
+ ((OSVR)VRApplication.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);
+ 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.glfwSetCursorPos(window, origWidth / 2.0, origHeight / 2.0);
+ }
+ }
+
+ private float resMult = 1f;
+ public void setResolutionMultiplier(float resMult) {
+ this.resMult = resMult;
+ }
+
+ public float getResolutionMuliplier() {
+ return resMult;
+ }
+
+ private void prepareCameraSize(Camera cam, float xMult) {
+ Vector2f size = new Vector2f();
+ VRAPI vrhmd = VRApplication.getVRHardware();
+
+ if( vrhmd == null ) {
+ size.x = 1280f;
+ size.y = 720f;
+ } else {
+ vrhmd.getRenderSize(size);
+ }
+
+ if( size.x < app.getContext().getSettings().getWidth() ) {
+ size.x = app.getContext().getSettings().getWidth();
+ }
+ if( size.y < app.getContext().getSettings().getHeight() ) {
+ size.y = app.getContext().getSettings().getHeight();
+ }
+
+ if( VRApplication.isInstanceVRRendering() ) size.x *= 2f;
+
+ // other adjustments
+ size.x *= xMult;
+ size.x *= resMult;
+ size.y *= resMult;
+
+ if( cam.getWidth() != size.x || cam.getHeight() != size.y ) cam.resize((int)size.x, (int)size.y, false);
+ }
+
+ /**
+ * Replaces rootNode as the main cameras scene with the distortion mesh
+ */
+ private void setupVRScene(){
+ // no special scene to setup if we are doing instancing
+ if( VRApplication.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);
+ }
+ return;
+ }
+
+ leftEyeTex = (Texture2D)viewPortLeft.getOutputFrameBuffer().getColorBuffer().getTexture();
+ rightEyeTex = (Texture2D)viewPortRight.getOutputFrameBuffer().getColorBuffer().getTexture();
+ leftEyeDepth = (Texture2D)viewPortLeft.getOutputFrameBuffer().getDepthBuffer().getTexture();
+ rightEyeDepth = (Texture2D)viewPortRight.getOutputFrameBuffer().getDepthBuffer().getTexture();
+ // main viewport is either going to be a distortion scene or nothing
+ // mirroring is handled by copying framebuffers
+ app.getViewPort().detachScene(app.getRootNode());
+ 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 ) {
+ 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));
+ 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));
+ rightEye.setMaterial(rightMat);
+ distortionScene.attachChild(rightEye);
+
+ distortionScene.updateGeometricState();
+
+ app.getViewPort().attachScene(distortionScene);
+
+ //if( useCustomDistortion ) setupFinalFullTexture(app.getViewPort().getCamera());
+ }
+
+ if( app.getContext().getSettings().isSwapBuffers() ) {
+ setupMirrorBuffers(app.getCamera(), leftEyeTex, false);
+ }
+ }
+
+ //final & temp values for camera calculations
+ private final Vector3f finalPosition = new Vector3f();
+ private final Quaternion finalRotation = new Quaternion();
+ private final Vector3f hmdPos = new Vector3f();
+ private final Quaternion hmdRot = new Quaternion();
+
+ public void update(float tpf) {
+
+ // grab the observer
+ Object obs = VRApplication.getObserver();
+ Quaternion objRot;
+ Vector3f objPos;
+ if( obs instanceof Camera ) {
+ objRot = ((Camera)obs).getRotation();
+ objPos = ((Camera)obs).getLocation();
+ } else {
+ objRot = ((Spatial)obs).getWorldRotation();
+ objPos = ((Spatial)obs).getWorldTranslation();
+ }
+ // grab the hardware handle
+ VRAPI dev = VRApplication.getVRHardware();
+ if( dev != null ) {
+ // update the HMD's position & orientation
+ dev.updatePose();
+ dev.getPositionAndOrientation(hmdPos, hmdRot);
+ if( obs != null ) {
+ // update hmdPos based on obs rotation
+ finalRotation.set(objRot);
+ finalRotation.mult(hmdPos, hmdPos);
+ finalRotation.multLocal(hmdRot);
+ }
+
+ finalizeCamera(dev.getHMDVectorPoseLeftEye(), objPos, camLeft);
+ finalizeCamera(dev.getHMDVectorPoseRightEye(), objPos, camRight);
+ } else {
+ camLeft.setFrame(objPos, objRot);
+ camRight.setFrame(objPos, objRot);
+ }
+
+ if( VRApplication.hasTraditionalGUIOverlay() ) {
+ // update the mouse?
+ VRMouseManager.update(tpf);
+
+ // update GUI position?
+ if( VRGuiManager.wantsReposition || VRGuiManager.getPositioningMode() != VRGuiManager.POSITIONING_MODE.MANUAL ) {
+ VRGuiManager.positionGuiNow(tpf);
+ VRGuiManager.updateGuiQuadGeometricState();
+ }
+ }
+ }
+
+ private void finalizeCamera(Vector3f eyePos, Vector3f obsPosition, Camera cam) {
+ finalRotation.mult(eyePos, finalPosition);
+ finalPosition.addLocal(hmdPos);
+ if( obsPosition != null ) finalPosition.addLocal(obsPosition);
+ finalPosition.y += heightAdjustment;
+ cam.setFrame(finalPosition, finalRotation);
+ }
+
+ /*
+ handles moving filters from the main view to each eye
+ */
+ public void moveScreenProcessingToEyes() {
+ if( viewPortRight == null ) return;
+ syncScreenProcessing(VRApplication.getMainVRApp().getViewPort());
+ VRApplication.getMainVRApp().getViewPort().clearProcessors();
+ }
+
+ /*
+ sets the two views to use the list of processors
+ */
+ public void syncScreenProcessing(ViewPort sourceViewport) {
+ if( viewPortRight == null ) return;
+ // setup post processing filters
+ if( ppRight == null ) {
+ ppRight = new FilterPostProcessor(app.getAssetManager());
+ ppLeft = new FilterPostProcessor(app.getAssetManager());
+ }
+ // clear out all filters & processors, to start from scratch
+ ppRight.removeAllFilters();
+ ppLeft.removeAllFilters();
+ viewPortLeft.clearProcessors();
+ viewPortRight.clearProcessors();
+ // if we have no processors to sync, don't add the FilterPostProcessor
+ if( sourceViewport.getProcessors().isEmpty() ) return;
+ // add post processors we just made, which are empty
+ viewPortLeft.addProcessor(ppLeft);
+ viewPortRight.addProcessor(ppRight);
+ // go through all of the filters in the processors list
+ // add them to the left viewport processor & clone them to the right
+ for(SceneProcessor sceneProcessor : sourceViewport.getProcessors()) {
+ if (sceneProcessor instanceof FilterPostProcessor) {
+ for(Filter f : ((FilterPostProcessor)sceneProcessor).getFilterList() ) {
+ if( f instanceof TranslucentBucketFilter ) {
+ // just remove this filter, we will add it at the end manually
+ ((FilterPostProcessor)sceneProcessor).removeFilter(f);
+ } else {
+ ppLeft.addFilter(f);
+ // clone to the right
+ Filter f2;
+ if(f instanceof FogFilter){
+ f2 = FilterUtil.cloneFogFilter((FogFilter)f);
+ } else if (f instanceof CartoonSSAO ) {
+ f2 = new CartoonSSAO((CartoonSSAO)f);
+ } else if (f instanceof SSAOFilter){
+ f2 = FilterUtil.cloneSSAOFilter((SSAOFilter)f);
+ } else if (f instanceof DirectionalLightShadowFilter){
+ f2 = FilterUtil.cloneDirectionalLightShadowFilter(app.getAssetManager(), (DirectionalLightShadowFilter)f);
+ } else {
+ f2 = f; // dof, bloom, lightscattering etc.
+ }
+ ppRight.addFilter(f2);
+ }
+ }
+ } else if (sceneProcessor instanceof VRDirectionalLightShadowRenderer) {
+ // shadow processing
+ // TODO: make right shadow processor use same left shadow maps for performance
+ VRDirectionalLightShadowRenderer dlsr = (VRDirectionalLightShadowRenderer) sceneProcessor;
+ VRDirectionalLightShadowRenderer dlsrRight = dlsr.clone();
+ dlsrRight.setLight(dlsr.getLight());
+ viewPortRight.getProcessors().add(0, dlsrRight);
+ viewPortLeft.getProcessors().add(0, sceneProcessor);
+ }
+ }
+ // make sure each has a translucent filter renderer
+ ppLeft.addFilter(new TranslucentBucketFilter());
+ ppRight.addFilter(new TranslucentBucketFilter());
+ }
+
+ private void setupCamerasAndViews() {
+ // get desired frustrum from original camera
+ Camera origCam = app.getBaseCamera();
+ float fFar = origCam.getFrustumFar();
+ float fNear = origCam.getFrustumNear();
+
+ // if we are using OSVR get the eye info here
+ if( VRApplication.getVRHardware() instanceof OSVR ) {
+ ((OSVR)VRApplication.getVRHardware()).getEyeInfo();
+ }
+
+ // restore frustrum on distortion scene cam, if needed
+ if( VRApplication.isInstanceVRRendering() ) {
+ camLeft = origCam;
+ } else if( VRApplication.compositorAllowed() == false ) {
+ origCam.setFrustumFar(100f);
+ origCam.setFrustumNear(1f);
+ camLeft = origCam.clone();
+ prepareCameraSize(origCam, 2f);
+ } else {
+ camLeft = origCam.clone();
+ }
+
+ camLeft.setFrustumPerspective(VRApplication.DEFAULT_FOV, VRApplication.DEFAULT_ASPECT, fNear, fFar);
+
+ prepareCameraSize(camLeft, 1f);
+ if( VRApplication.getVRHardware() != null ) camLeft.setProjectionMatrix(VRApplication.getVRHardware().getHMDMatrixProjectionLeftEye(camLeft));
+ //org.lwjgl.opengl.GL11.glEnable(org.lwjgl.opengl.GL30.GL_FRAMEBUFFER_SRGB);
+
+ if( VRApplication.isInstanceVRRendering() == false ) {
+ viewPortLeft = setupViewBuffers(camLeft, LEFT_VIEW_NAME);
+ camRight = camLeft.clone();
+ if( VRApplication.getVRHardware() != null ) camRight.setProjectionMatrix(VRApplication.getVRHardware().getHMDMatrixProjectionRightEye(camRight));
+ viewPortRight = setupViewBuffers(camRight, RIGHT_VIEW_NAME);
+ } else {
+ viewPortLeft = app.getViewPort();
+ viewPortLeft.attachScene(VRApplication.getMainVRApp().getRootNode());
+ camRight = camLeft.clone();
+ if( VRApplication.getVRHardware() != null ) camRight.setProjectionMatrix(VRApplication.getVRHardware().getHMDMatrixProjectionRightEye(camRight));
+
+ org.lwjgl.opengl.GL11.glEnable(org.lwjgl.opengl.GL30.GL_CLIP_DISTANCE0);
+
+ //FIXME: Fix with JMonkey next release
+ //RenderManager._VRInstancing_RightCamProjection = camRight.getViewProjectionMatrix();
+
+ setupFinalFullTexture(app.getViewPort().getCamera());
+ }
+
+ // setup gui
+ VRGuiManager.setupGui(camLeft, camRight, viewPortLeft, viewPortRight);
+
+ if( VRApplication.getVRHardware() != null ) {
+ // call these to cache the results internally
+ VRApplication.getVRHardware().getHMDMatrixPoseLeftEye();
+ VRApplication.getVRHardware().getHMDMatrixPoseRightEye();
+ }
+
+ }
+
+ private ViewPort setupMirrorBuffers(Camera cam, Texture tex, boolean expand) {
+ Camera clonecam = cam.clone();
+ ViewPort viewPort = app.getRenderManager().createPostView("MirrorView", clonecam);
+ clonecam.setParallelProjection(true);
+ viewPort.setClearFlags(true, true, true);
+ viewPort.setBackgroundColor(ColorRGBA.Black);
+ Picture pic = new Picture("fullscene");
+ pic.setLocalTranslation(-0.75f, -0.5f, 0f);
+ if( expand ) {
+ pic.setLocalScale(3f, 1f, 1f);
+ } else {
+ pic.setLocalScale(1.5f, 1f, 1f);
+ }
+ pic.setQueueBucket(Bucket.Opaque);
+ pic.setTexture(app.getAssetManager(), (Texture2D)tex, false);
+ pic.updateGeometricState();
+ viewPort.attachScene(pic);
+ viewPort.setOutputFrameBuffer(null);
+ return viewPort;
+ }
+
+ private void setupFinalFullTexture(Camera cam) {
+ // create offscreen framebuffer
+ FrameBuffer out = new FrameBuffer(cam.getWidth(), cam.getHeight(), 1);
+ //offBuffer.setSrgb(true);
+
+ //setup framebuffer's texture
+ dualEyeTex = new Texture2D(cam.getWidth(), cam.getHeight(), Image.Format.RGBA8);
+ dualEyeTex.setMinFilter(Texture.MinFilter.BilinearNoMipMaps);
+ dualEyeTex.setMagFilter(Texture.MagFilter.Bilinear);
+
+ //setup framebuffer to use texture
+ out.setDepthBuffer(Image.Format.Depth);
+ out.setColorTexture(dualEyeTex);
+
+ ViewPort viewPort = this.app.getViewPort();
+ viewPort.setClearFlags(true, true, true);
+ viewPort.setBackgroundColor(ColorRGBA.Black);
+ viewPort.setOutputFrameBuffer(out);
+
+ }
+
+ private ViewPort setupViewBuffers(Camera cam, String viewName){
+ // create offscreen framebuffer
+ FrameBuffer offBufferLeft = new FrameBuffer(cam.getWidth(), cam.getHeight(), 1);
+ //offBufferLeft.setSrgb(true);
+
+ //setup framebuffer's texture
+ Texture2D offTex = new Texture2D(cam.getWidth(), cam.getHeight(), Image.Format.RGBA8);
+ offTex.setMinFilter(Texture.MinFilter.BilinearNoMipMaps);
+ offTex.setMagFilter(Texture.MagFilter.Bilinear);
+
+ //setup framebuffer to use texture
+ offBufferLeft.setDepthBuffer(Image.Format.Depth);
+ offBufferLeft.setColorTexture(offTex);
+
+ ViewPort viewPort = app.getRenderManager().createPreView(viewName, cam);
+ viewPort.setClearFlags(true, true, true);
+ viewPort.setBackgroundColor(ColorRGBA.Black);
+ viewPort.attachScene(this.app.getRootNode());
+ //set viewport to render to offscreen framebuffer
+ viewPort.setOutputFrameBuffer(offBufferLeft);
+ return viewPort;
+ }
+}
diff --git a/jme3-vr/src/main/java/jmevr/util/gui_mesh.j3o b/jme3-vr/src/main/java/jmevr/util/gui_mesh.j3o
new file mode 100644
index 000000000..728a70602
Binary files /dev/null and b/jme3-vr/src/main/java/jmevr/util/gui_mesh.j3o differ
diff --git a/jme3-vr/src/main/java/jmevr/util/gui_mesh.j3odata b/jme3-vr/src/main/java/jmevr/util/gui_mesh.j3odata
new file mode 100644
index 000000000..c5df9acd6
--- /dev/null
+++ b/jme3-vr/src/main/java/jmevr/util/gui_mesh.j3odata
@@ -0,0 +1,3 @@
+#
+#Thu Oct 01 10:33:02 EDT 2015
+ORIGINAL_PATH=Models/gui_mesh.obj
diff --git a/jme3-vr/src/main/java/jmevr/util/mouse.png b/jme3-vr/src/main/java/jmevr/util/mouse.png
new file mode 100644
index 000000000..8ca6edbe1
Binary files /dev/null and b/jme3-vr/src/main/java/jmevr/util/mouse.png differ
diff --git a/jme3-vr/src/main/java/jopenvr/AppOverrideKeys_t.java b/jme3-vr/src/main/java/jopenvr/AppOverrideKeys_t.java
new file mode 100644
index 000000000..a6d5da083
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/AppOverrideKeys_t.java
@@ -0,0 +1,48 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class AppOverrideKeys_t extends Structure {
+ /**
+ * const char *
+ * C type : char*
+ */
+ public Pointer pchKey;
+ /**
+ * const char *
+ * C type : char*
+ */
+ public Pointer pchValue;
+ public AppOverrideKeys_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("pchKey", "pchValue");
+ }
+ /**
+ * @param pchKey const char *
+ * C type : char*
+ * @param pchValue const char *
+ * C type : char*
+ */
+ public AppOverrideKeys_t(Pointer pchKey, Pointer pchValue) {
+ super();
+ this.pchKey = pchKey;
+ this.pchValue = pchValue;
+ }
+ public AppOverrideKeys_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends AppOverrideKeys_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends AppOverrideKeys_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/COpenVRContext.java b/jme3-vr/src/main/java/jopenvr/COpenVRContext.java
new file mode 100644
index 000000000..48dcafe6c
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/COpenVRContext.java
@@ -0,0 +1,88 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import com.sun.jna.ptr.IntByReference;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class COpenVRContext extends Structure {
+ /**
+ * class vr::IVRSystem *
+ * C type : intptr_t
+ */
+ public IntByReference m_pVRSystem;
+ /**
+ * class vr::IVRChaperone *
+ * C type : intptr_t
+ */
+ public IntByReference m_pVRChaperone;
+ /**
+ * class vr::IVRChaperoneSetup *
+ * C type : intptr_t
+ */
+ public IntByReference m_pVRChaperoneSetup;
+ /**
+ * class vr::IVRCompositor *
+ * C type : intptr_t
+ */
+ public IntByReference m_pVRCompositor;
+ /**
+ * class vr::IVROverlay *
+ * C type : intptr_t
+ */
+ public IntByReference m_pVROverlay;
+ /**
+ * class vr::IVRResources *
+ * C type : intptr_t
+ */
+ public IntByReference m_pVRResources;
+ /**
+ * class vr::IVRRenderModels *
+ * C type : intptr_t
+ */
+ public IntByReference m_pVRRenderModels;
+ /**
+ * class vr::IVRExtendedDisplay *
+ * C type : intptr_t
+ */
+ public IntByReference m_pVRExtendedDisplay;
+ /**
+ * class vr::IVRSettings *
+ * C type : intptr_t
+ */
+ public IntByReference m_pVRSettings;
+ /**
+ * class vr::IVRApplications *
+ * C type : intptr_t
+ */
+ public IntByReference m_pVRApplications;
+ /**
+ * class vr::IVRTrackedCamera *
+ * C type : intptr_t
+ */
+ public IntByReference m_pVRTrackedCamera;
+ /**
+ * class vr::IVRScreenshots *
+ * C type : intptr_t
+ */
+ public IntByReference m_pVRScreenshots;
+ public COpenVRContext() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("m_pVRSystem", "m_pVRChaperone", "m_pVRChaperoneSetup", "m_pVRCompositor", "m_pVROverlay", "m_pVRResources", "m_pVRRenderModels", "m_pVRExtendedDisplay", "m_pVRSettings", "m_pVRApplications", "m_pVRTrackedCamera", "m_pVRScreenshots");
+ }
+ public COpenVRContext(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends COpenVRContext implements Structure.ByReference {
+
+ };
+ public static class ByValue extends COpenVRContext implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/CameraVideoStreamFrameHeader_t.java b/jme3-vr/src/main/java/jopenvr/CameraVideoStreamFrameHeader_t.java
new file mode 100644
index 000000000..432dce772
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/CameraVideoStreamFrameHeader_t.java
@@ -0,0 +1,52 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class CameraVideoStreamFrameHeader_t extends Structure {
+ /**
+ * @see EVRTrackedCameraFrameType
+ * C type : EVRTrackedCameraFrameType
+ */
+ public int eFrameType;
+ public int nWidth;
+ public int nHeight;
+ public int nBytesPerPixel;
+ public int nFrameSequence;
+ /** C type : TrackedDevicePose_t */
+ public TrackedDevicePose_t standingTrackedDevicePose;
+ public CameraVideoStreamFrameHeader_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("eFrameType", "nWidth", "nHeight", "nBytesPerPixel", "nFrameSequence", "standingTrackedDevicePose");
+ }
+ /**
+ * @param eFrameType @see EVRTrackedCameraFrameType
+ * C type : EVRTrackedCameraFrameType
+ * @param standingTrackedDevicePose C type : TrackedDevicePose_t
+ */
+ public CameraVideoStreamFrameHeader_t(int eFrameType, int nWidth, int nHeight, int nBytesPerPixel, int nFrameSequence, TrackedDevicePose_t standingTrackedDevicePose) {
+ super();
+ this.eFrameType = eFrameType;
+ this.nWidth = nWidth;
+ this.nHeight = nHeight;
+ this.nBytesPerPixel = nBytesPerPixel;
+ this.nFrameSequence = nFrameSequence;
+ this.standingTrackedDevicePose = standingTrackedDevicePose;
+ }
+ public CameraVideoStreamFrameHeader_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends CameraVideoStreamFrameHeader_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends CameraVideoStreamFrameHeader_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/Compositor_CumulativeStats.java b/jme3-vr/src/main/java/jopenvr/Compositor_CumulativeStats.java
new file mode 100644
index 000000000..23c1df549
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/Compositor_CumulativeStats.java
@@ -0,0 +1,42 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class Compositor_CumulativeStats extends Structure {
+ public int m_nPid;
+ public int m_nNumFramePresents;
+ public int m_nNumDroppedFrames;
+ public int m_nNumReprojectedFrames;
+ public int m_nNumFramePresentsOnStartup;
+ public int m_nNumDroppedFramesOnStartup;
+ public int m_nNumReprojectedFramesOnStartup;
+ public int m_nNumLoading;
+ public int m_nNumFramePresentsLoading;
+ public int m_nNumDroppedFramesLoading;
+ public int m_nNumReprojectedFramesLoading;
+ public int m_nNumTimedOut;
+ public int m_nNumFramePresentsTimedOut;
+ public int m_nNumDroppedFramesTimedOut;
+ public int m_nNumReprojectedFramesTimedOut;
+ public Compositor_CumulativeStats() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("m_nPid", "m_nNumFramePresents", "m_nNumDroppedFrames", "m_nNumReprojectedFrames", "m_nNumFramePresentsOnStartup", "m_nNumDroppedFramesOnStartup", "m_nNumReprojectedFramesOnStartup", "m_nNumLoading", "m_nNumFramePresentsLoading", "m_nNumDroppedFramesLoading", "m_nNumReprojectedFramesLoading", "m_nNumTimedOut", "m_nNumFramePresentsTimedOut", "m_nNumDroppedFramesTimedOut", "m_nNumReprojectedFramesTimedOut");
+ }
+ public Compositor_CumulativeStats(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends Compositor_CumulativeStats implements Structure.ByReference {
+
+ };
+ public static class ByValue extends Compositor_CumulativeStats implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/Compositor_FrameTiming.java b/jme3-vr/src/main/java/jopenvr/Compositor_FrameTiming.java
new file mode 100644
index 000000000..4cf148640
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/Compositor_FrameTiming.java
@@ -0,0 +1,51 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class Compositor_FrameTiming extends Structure {
+ public int m_nSize;
+ public int m_nFrameIndex;
+ public int m_nNumFramePresents;
+ public int m_nNumDroppedFrames;
+ public int m_nReprojectionFlags;
+ public double m_flSystemTimeInSeconds;
+ public float m_flPreSubmitGpuMs;
+ public float m_flPostSubmitGpuMs;
+ public float m_flTotalRenderGpuMs;
+ public float m_flCompositorRenderGpuMs;
+ public float m_flCompositorRenderCpuMs;
+ public float m_flCompositorIdleCpuMs;
+ public float m_flClientFrameIntervalMs;
+ public float m_flPresentCallCpuMs;
+ public float m_flWaitForPresentCpuMs;
+ public float m_flSubmitFrameMs;
+ public float m_flWaitGetPosesCalledMs;
+ public float m_flNewPosesReadyMs;
+ public float m_flNewFrameReadyMs;
+ public float m_flCompositorUpdateStartMs;
+ public float m_flCompositorUpdateEndMs;
+ public float m_flCompositorRenderStartMs;
+ /** C type : TrackedDevicePose_t */
+ public TrackedDevicePose_t m_HmdPose;
+ public Compositor_FrameTiming() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("m_nSize", "m_nFrameIndex", "m_nNumFramePresents", "m_nNumDroppedFrames", "m_nReprojectionFlags", "m_flSystemTimeInSeconds", "m_flPreSubmitGpuMs", "m_flPostSubmitGpuMs", "m_flTotalRenderGpuMs", "m_flCompositorRenderGpuMs", "m_flCompositorRenderCpuMs", "m_flCompositorIdleCpuMs", "m_flClientFrameIntervalMs", "m_flPresentCallCpuMs", "m_flWaitForPresentCpuMs", "m_flSubmitFrameMs", "m_flWaitGetPosesCalledMs", "m_flNewPosesReadyMs", "m_flNewFrameReadyMs", "m_flCompositorUpdateStartMs", "m_flCompositorUpdateEndMs", "m_flCompositorRenderStartMs", "m_HmdPose");
+ }
+ public Compositor_FrameTiming(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends Compositor_FrameTiming implements Structure.ByReference {
+
+ };
+ public static class ByValue extends Compositor_FrameTiming implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/Compositor_OverlaySettings.java b/jme3-vr/src/main/java/jopenvr/Compositor_OverlaySettings.java
new file mode 100644
index 000000000..7a30351be
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/Compositor_OverlaySettings.java
@@ -0,0 +1,42 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class Compositor_OverlaySettings extends Structure {
+ public int size;
+ public byte curved;
+ public byte antialias;
+ public float scale;
+ public float distance;
+ public float alpha;
+ public float uOffset;
+ public float vOffset;
+ public float uScale;
+ public float vScale;
+ public float gridDivs;
+ public float gridWidth;
+ public float gridScale;
+ /** C type : HmdMatrix44_t */
+ public HmdMatrix44_t transform;
+ public Compositor_OverlaySettings() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("size", "curved", "antialias", "scale", "distance", "alpha", "uOffset", "vOffset", "uScale", "vScale", "gridDivs", "gridWidth", "gridScale", "transform");
+ }
+ public Compositor_OverlaySettings(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends Compositor_OverlaySettings implements Structure.ByReference {
+
+ };
+ public static class ByValue extends Compositor_OverlaySettings implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/DistortionCoordinates_t.java b/jme3-vr/src/main/java/jopenvr/DistortionCoordinates_t.java
new file mode 100644
index 000000000..8320681b7
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/DistortionCoordinates_t.java
@@ -0,0 +1,62 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class DistortionCoordinates_t extends Structure {
+ /**
+ * float[2]
+ * C type : float[2]
+ */
+ public float[] rfRed = new float[2];
+ /**
+ * float[2]
+ * C type : float[2]
+ */
+ public float[] rfGreen = new float[2];
+ /**
+ * float[2]
+ * C type : float[2]
+ */
+ public float[] rfBlue = new float[2];
+ public DistortionCoordinates_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("rfRed", "rfGreen", "rfBlue");
+ }
+ /**
+ * @param rfRed float[2]
+ * C type : float[2]
+ * @param rfGreen float[2]
+ * C type : float[2]
+ * @param rfBlue float[2]
+ * C type : float[2]
+ */
+ public DistortionCoordinates_t(float rfRed[], float rfGreen[], float rfBlue[]) {
+ super();
+ if ((rfRed.length != this.rfRed.length))
+ throw new IllegalArgumentException("Wrong array size !");
+ this.rfRed = rfRed;
+ if ((rfGreen.length != this.rfGreen.length))
+ throw new IllegalArgumentException("Wrong array size !");
+ this.rfGreen = rfGreen;
+ if ((rfBlue.length != this.rfBlue.length))
+ throw new IllegalArgumentException("Wrong array size !");
+ this.rfBlue = rfBlue;
+ }
+ public DistortionCoordinates_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends DistortionCoordinates_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends DistortionCoordinates_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/HiddenAreaMesh_t.java b/jme3-vr/src/main/java/jopenvr/HiddenAreaMesh_t.java
new file mode 100644
index 000000000..9b3811989
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/HiddenAreaMesh_t.java
@@ -0,0 +1,42 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class HiddenAreaMesh_t extends Structure {
+ /**
+ * const struct vr::HmdVector2_t *
+ * C type : HmdVector2_t*
+ */
+ public jopenvr.HmdVector2_t.ByReference pVertexData;
+ public int unTriangleCount;
+ public HiddenAreaMesh_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("pVertexData", "unTriangleCount");
+ }
+ /**
+ * @param pVertexData const struct vr::HmdVector2_t *
+ * C type : HmdVector2_t*
+ */
+ public HiddenAreaMesh_t(jopenvr.HmdVector2_t.ByReference pVertexData, int unTriangleCount) {
+ super();
+ this.pVertexData = pVertexData;
+ this.unTriangleCount = unTriangleCount;
+ }
+ public HiddenAreaMesh_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends HiddenAreaMesh_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends HiddenAreaMesh_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/HmdColor_t.java b/jme3-vr/src/main/java/jopenvr/HmdColor_t.java
new file mode 100644
index 000000000..37cadb7fb
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/HmdColor_t.java
@@ -0,0 +1,38 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class HmdColor_t extends Structure {
+ public float r;
+ public float g;
+ public float b;
+ public float a;
+ public HmdColor_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("r", "g", "b", "a");
+ }
+ public HmdColor_t(float r, float g, float b, float a) {
+ super();
+ this.r = r;
+ this.g = g;
+ this.b = b;
+ this.a = a;
+ }
+ public HmdColor_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends HmdColor_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends HmdColor_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/HmdMatrix34_t.java b/jme3-vr/src/main/java/jopenvr/HmdMatrix34_t.java
new file mode 100644
index 000000000..4241d949d
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/HmdMatrix34_t.java
@@ -0,0 +1,42 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class HmdMatrix34_t extends Structure {
+ /**
+ * float[3][4]
+ * C type : float[3][4]
+ */
+ public float[] m = new float[((3) * (4))];
+ public HmdMatrix34_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("m");
+ }
+ /**
+ * @param m float[3][4]
+ * C type : float[3][4]
+ */
+ public HmdMatrix34_t(float m[]) {
+ super();
+ if ((m.length != this.m.length))
+ throw new IllegalArgumentException("Wrong array size !");
+ this.m = m;
+ }
+ public HmdMatrix34_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends HmdMatrix34_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends HmdMatrix34_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/HmdMatrix44_t.java b/jme3-vr/src/main/java/jopenvr/HmdMatrix44_t.java
new file mode 100644
index 000000000..b7ff205a9
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/HmdMatrix44_t.java
@@ -0,0 +1,42 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class HmdMatrix44_t extends Structure {
+ /**
+ * float[4][4]
+ * C type : float[4][4]
+ */
+ public float[] m = new float[((4) * (4))];
+ public HmdMatrix44_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("m");
+ }
+ /**
+ * @param m float[4][4]
+ * C type : float[4][4]
+ */
+ public HmdMatrix44_t(float m[]) {
+ super();
+ if ((m.length != this.m.length))
+ throw new IllegalArgumentException("Wrong array size !");
+ this.m = m;
+ }
+ public HmdMatrix44_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends HmdMatrix44_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends HmdMatrix44_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/HmdQuad_t.java b/jme3-vr/src/main/java/jopenvr/HmdQuad_t.java
new file mode 100644
index 000000000..fcb994343
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/HmdQuad_t.java
@@ -0,0 +1,42 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class HmdQuad_t extends Structure {
+ /**
+ * struct vr::HmdVector3_t[4]
+ * C type : HmdVector3_t[4]
+ */
+ public HmdVector3_t[] vCorners = new HmdVector3_t[4];
+ public HmdQuad_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("vCorners");
+ }
+ /**
+ * @param vCorners struct vr::HmdVector3_t[4]
+ * C type : HmdVector3_t[4]
+ */
+ public HmdQuad_t(HmdVector3_t vCorners[]) {
+ super();
+ if ((vCorners.length != this.vCorners.length))
+ throw new IllegalArgumentException("Wrong array size !");
+ this.vCorners = vCorners;
+ }
+ public HmdQuad_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends HmdQuad_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends HmdQuad_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/HmdQuaternion_t.java b/jme3-vr/src/main/java/jopenvr/HmdQuaternion_t.java
new file mode 100644
index 000000000..44e16e8e8
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/HmdQuaternion_t.java
@@ -0,0 +1,38 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class HmdQuaternion_t extends Structure {
+ public double w;
+ public double x;
+ public double y;
+ public double z;
+ public HmdQuaternion_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("w", "x", "y", "z");
+ }
+ public HmdQuaternion_t(double w, double x, double y, double z) {
+ super();
+ this.w = w;
+ this.x = x;
+ this.y = y;
+ this.z = z;
+ }
+ public HmdQuaternion_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends HmdQuaternion_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends HmdQuaternion_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/HmdRect2_t.java b/jme3-vr/src/main/java/jopenvr/HmdRect2_t.java
new file mode 100644
index 000000000..263cee18b
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/HmdRect2_t.java
@@ -0,0 +1,40 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class HmdRect2_t extends Structure {
+ /** C type : HmdVector2_t */
+ public HmdVector2_t vTopLeft;
+ /** C type : HmdVector2_t */
+ public HmdVector2_t vBottomRight;
+ public HmdRect2_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("vTopLeft", "vBottomRight");
+ }
+ /**
+ * @param vTopLeft C type : HmdVector2_t
+ * @param vBottomRight C type : HmdVector2_t
+ */
+ public HmdRect2_t(HmdVector2_t vTopLeft, HmdVector2_t vBottomRight) {
+ super();
+ this.vTopLeft = vTopLeft;
+ this.vBottomRight = vBottomRight;
+ }
+ public HmdRect2_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends HmdRect2_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends HmdRect2_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/HmdVector2_t.java b/jme3-vr/src/main/java/jopenvr/HmdVector2_t.java
new file mode 100644
index 000000000..88cdaecb6
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/HmdVector2_t.java
@@ -0,0 +1,42 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class HmdVector2_t extends Structure {
+ /**
+ * float[2]
+ * C type : float[2]
+ */
+ public float[] v = new float[2];
+ public HmdVector2_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("v");
+ }
+ /**
+ * @param v float[2]
+ * C type : float[2]
+ */
+ public HmdVector2_t(float v[]) {
+ super();
+ if ((v.length != this.v.length))
+ throw new IllegalArgumentException("Wrong array size !");
+ this.v = v;
+ }
+ public HmdVector2_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends HmdVector2_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends HmdVector2_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/HmdVector3_t.java b/jme3-vr/src/main/java/jopenvr/HmdVector3_t.java
new file mode 100644
index 000000000..28ed95c5a
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/HmdVector3_t.java
@@ -0,0 +1,42 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class HmdVector3_t extends Structure {
+ /**
+ * float[3]
+ * C type : float[3]
+ */
+ public float[] v = new float[3];
+ public HmdVector3_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("v");
+ }
+ /**
+ * @param v float[3]
+ * C type : float[3]
+ */
+ public HmdVector3_t(float v[]) {
+ super();
+ if ((v.length != this.v.length))
+ throw new IllegalArgumentException("Wrong array size !");
+ this.v = v;
+ }
+ public HmdVector3_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends HmdVector3_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends HmdVector3_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/HmdVector3d_t.java b/jme3-vr/src/main/java/jopenvr/HmdVector3d_t.java
new file mode 100644
index 000000000..2a41737f4
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/HmdVector3d_t.java
@@ -0,0 +1,42 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class HmdVector3d_t extends Structure {
+ /**
+ * double[3]
+ * C type : double[3]
+ */
+ public double[] v = new double[3];
+ public HmdVector3d_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("v");
+ }
+ /**
+ * @param v double[3]
+ * C type : double[3]
+ */
+ public HmdVector3d_t(double v[]) {
+ super();
+ if ((v.length != this.v.length))
+ throw new IllegalArgumentException("Wrong array size !");
+ this.v = v;
+ }
+ public HmdVector3d_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends HmdVector3d_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends HmdVector3d_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/HmdVector4_t.java b/jme3-vr/src/main/java/jopenvr/HmdVector4_t.java
new file mode 100644
index 000000000..485de30c3
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/HmdVector4_t.java
@@ -0,0 +1,42 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class HmdVector4_t extends Structure {
+ /**
+ * float[4]
+ * C type : float[4]
+ */
+ public float[] v = new float[4];
+ public HmdVector4_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("v");
+ }
+ /**
+ * @param v float[4]
+ * C type : float[4]
+ */
+ public HmdVector4_t(float v[]) {
+ super();
+ if ((v.length != this.v.length))
+ throw new IllegalArgumentException("Wrong array size !");
+ this.v = v;
+ }
+ public HmdVector4_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends HmdVector4_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends HmdVector4_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/JOpenVRLibrary.java b/jme3-vr/src/main/java/jopenvr/JOpenVRLibrary.java
new file mode 100644
index 000000000..efbeeaa90
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/JOpenVRLibrary.java
@@ -0,0 +1,756 @@
+package jopenvr;
+import com.sun.jna.Library;
+import com.sun.jna.Native;
+import com.sun.jna.NativeLibrary;
+import com.sun.jna.Pointer;
+import com.sun.jna.ptr.IntByReference;
+import java.nio.IntBuffer;
+/**
+ * JNA Wrapper for library JOpenVR
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class JOpenVRLibrary implements Library {
+ public static final String JNA_LIBRARY_NAME = "openvr_api";
+ public static final NativeLibrary JNA_NATIVE_LIB = NativeLibrary.getInstance(JOpenVRLibrary.JNA_LIBRARY_NAME);
+ static {
+ Native.register(JOpenVRLibrary.class, JOpenVRLibrary.JNA_NATIVE_LIB);
+ }
+ /** enum values */
+ public static interface EVREye {
+ public static final int EVREye_Eye_Left = 0;
+ public static final int EVREye_Eye_Right = 1;
+ };
+ /** enum values */
+ public static interface EGraphicsAPIConvention {
+ public static final int EGraphicsAPIConvention_API_DirectX = 0;
+ public static final int EGraphicsAPIConvention_API_OpenGL = 1;
+ };
+ /** enum values */
+ public static interface EColorSpace {
+ public static final int EColorSpace_ColorSpace_Auto = 0;
+ public static final int EColorSpace_ColorSpace_Gamma = 1;
+ public static final int EColorSpace_ColorSpace_Linear = 2;
+ };
+ /** enum values */
+ public static interface ETrackingResult {
+ public static final int ETrackingResult_TrackingResult_Uninitialized = 1;
+ public static final int ETrackingResult_TrackingResult_Calibrating_InProgress = 100;
+ public static final int ETrackingResult_TrackingResult_Calibrating_OutOfRange = 101;
+ public static final int ETrackingResult_TrackingResult_Running_OK = 200;
+ public static final int ETrackingResult_TrackingResult_Running_OutOfRange = 201;
+ };
+ /** enum values */
+ public static interface ETrackedDeviceClass {
+ public static final int ETrackedDeviceClass_TrackedDeviceClass_Invalid = 0;
+ public static final int ETrackedDeviceClass_TrackedDeviceClass_HMD = 1;
+ public static final int ETrackedDeviceClass_TrackedDeviceClass_Controller = 2;
+ public static final int ETrackedDeviceClass_TrackedDeviceClass_TrackingReference = 4;
+ public static final int ETrackedDeviceClass_TrackedDeviceClass_Other = 1000;
+ };
+ /** enum values */
+ public static interface ETrackedControllerRole {
+ public static final int ETrackedControllerRole_TrackedControllerRole_Invalid = 0;
+ public static final int ETrackedControllerRole_TrackedControllerRole_LeftHand = 1;
+ public static final int ETrackedControllerRole_TrackedControllerRole_RightHand = 2;
+ };
+ /** enum values */
+ public static interface ETrackingUniverseOrigin {
+ public static final int ETrackingUniverseOrigin_TrackingUniverseSeated = 0;
+ public static final int ETrackingUniverseOrigin_TrackingUniverseStanding = 1;
+ public static final int ETrackingUniverseOrigin_TrackingUniverseRawAndUncalibrated = 2;
+ };
+ /** enum values */
+ public static interface ETrackedDeviceProperty {
+ public static final int ETrackedDeviceProperty_Prop_TrackingSystemName_String = 1000;
+ public static final int ETrackedDeviceProperty_Prop_ModelNumber_String = 1001;
+ public static final int ETrackedDeviceProperty_Prop_SerialNumber_String = 1002;
+ public static final int ETrackedDeviceProperty_Prop_RenderModelName_String = 1003;
+ public static final int ETrackedDeviceProperty_Prop_WillDriftInYaw_Bool = 1004;
+ public static final int ETrackedDeviceProperty_Prop_ManufacturerName_String = 1005;
+ public static final int ETrackedDeviceProperty_Prop_TrackingFirmwareVersion_String = 1006;
+ public static final int ETrackedDeviceProperty_Prop_HardwareRevision_String = 1007;
+ public static final int ETrackedDeviceProperty_Prop_AllWirelessDongleDescriptions_String = 1008;
+ public static final int ETrackedDeviceProperty_Prop_ConnectedWirelessDongle_String = 1009;
+ public static final int ETrackedDeviceProperty_Prop_DeviceIsWireless_Bool = 1010;
+ public static final int ETrackedDeviceProperty_Prop_DeviceIsCharging_Bool = 1011;
+ public static final int ETrackedDeviceProperty_Prop_DeviceBatteryPercentage_Float = 1012;
+ public static final int ETrackedDeviceProperty_Prop_StatusDisplayTransform_Matrix34 = 1013;
+ public static final int ETrackedDeviceProperty_Prop_Firmware_UpdateAvailable_Bool = 1014;
+ public static final int ETrackedDeviceProperty_Prop_Firmware_ManualUpdate_Bool = 1015;
+ public static final int ETrackedDeviceProperty_Prop_Firmware_ManualUpdateURL_String = 1016;
+ public static final int ETrackedDeviceProperty_Prop_HardwareRevision_Uint64 = 1017;
+ public static final int ETrackedDeviceProperty_Prop_FirmwareVersion_Uint64 = 1018;
+ public static final int ETrackedDeviceProperty_Prop_FPGAVersion_Uint64 = 1019;
+ public static final int ETrackedDeviceProperty_Prop_VRCVersion_Uint64 = 1020;
+ public static final int ETrackedDeviceProperty_Prop_RadioVersion_Uint64 = 1021;
+ public static final int ETrackedDeviceProperty_Prop_DongleVersion_Uint64 = 1022;
+ public static final int ETrackedDeviceProperty_Prop_BlockServerShutdown_Bool = 1023;
+ public static final int ETrackedDeviceProperty_Prop_CanUnifyCoordinateSystemWithHmd_Bool = 1024;
+ public static final int ETrackedDeviceProperty_Prop_ContainsProximitySensor_Bool = 1025;
+ public static final int ETrackedDeviceProperty_Prop_DeviceProvidesBatteryStatus_Bool = 1026;
+ public static final int ETrackedDeviceProperty_Prop_DeviceCanPowerOff_Bool = 1027;
+ public static final int ETrackedDeviceProperty_Prop_Firmware_ProgrammingTarget_String = 1028;
+ public static final int ETrackedDeviceProperty_Prop_DeviceClass_Int32 = 1029;
+ public static final int ETrackedDeviceProperty_Prop_HasCamera_Bool = 1030;
+ public static final int ETrackedDeviceProperty_Prop_DriverVersion_String = 1031;
+ public static final int ETrackedDeviceProperty_Prop_Firmware_ForceUpdateRequired_Bool = 1032;
+ public static final int ETrackedDeviceProperty_Prop_ReportsTimeSinceVSync_Bool = 2000;
+ public static final int ETrackedDeviceProperty_Prop_SecondsFromVsyncToPhotons_Float = 2001;
+ public static final int ETrackedDeviceProperty_Prop_DisplayFrequency_Float = 2002;
+ public static final int ETrackedDeviceProperty_Prop_UserIpdMeters_Float = 2003;
+ public static final int ETrackedDeviceProperty_Prop_CurrentUniverseId_Uint64 = 2004;
+ public static final int ETrackedDeviceProperty_Prop_PreviousUniverseId_Uint64 = 2005;
+ public static final int ETrackedDeviceProperty_Prop_DisplayFirmwareVersion_Uint64 = 2006;
+ public static final int ETrackedDeviceProperty_Prop_IsOnDesktop_Bool = 2007;
+ public static final int ETrackedDeviceProperty_Prop_DisplayMCType_Int32 = 2008;
+ public static final int ETrackedDeviceProperty_Prop_DisplayMCOffset_Float = 2009;
+ public static final int ETrackedDeviceProperty_Prop_DisplayMCScale_Float = 2010;
+ public static final int ETrackedDeviceProperty_Prop_EdidVendorID_Int32 = 2011;
+ public static final int ETrackedDeviceProperty_Prop_DisplayMCImageLeft_String = 2012;
+ public static final int ETrackedDeviceProperty_Prop_DisplayMCImageRight_String = 2013;
+ public static final int ETrackedDeviceProperty_Prop_DisplayGCBlackClamp_Float = 2014;
+ public static final int ETrackedDeviceProperty_Prop_EdidProductID_Int32 = 2015;
+ public static final int ETrackedDeviceProperty_Prop_CameraToHeadTransform_Matrix34 = 2016;
+ public static final int ETrackedDeviceProperty_Prop_DisplayGCType_Int32 = 2017;
+ public static final int ETrackedDeviceProperty_Prop_DisplayGCOffset_Float = 2018;
+ public static final int ETrackedDeviceProperty_Prop_DisplayGCScale_Float = 2019;
+ public static final int ETrackedDeviceProperty_Prop_DisplayGCPrescale_Float = 2020;
+ public static final int ETrackedDeviceProperty_Prop_DisplayGCImage_String = 2021;
+ public static final int ETrackedDeviceProperty_Prop_LensCenterLeftU_Float = 2022;
+ public static final int ETrackedDeviceProperty_Prop_LensCenterLeftV_Float = 2023;
+ public static final int ETrackedDeviceProperty_Prop_LensCenterRightU_Float = 2024;
+ public static final int ETrackedDeviceProperty_Prop_LensCenterRightV_Float = 2025;
+ public static final int ETrackedDeviceProperty_Prop_UserHeadToEyeDepthMeters_Float = 2026;
+ public static final int ETrackedDeviceProperty_Prop_CameraFirmwareVersion_Uint64 = 2027;
+ public static final int ETrackedDeviceProperty_Prop_CameraFirmwareDescription_String = 2028;
+ public static final int ETrackedDeviceProperty_Prop_DisplayFPGAVersion_Uint64 = 2029;
+ public static final int ETrackedDeviceProperty_Prop_DisplayBootloaderVersion_Uint64 = 2030;
+ public static final int ETrackedDeviceProperty_Prop_DisplayHardwareVersion_Uint64 = 2031;
+ public static final int ETrackedDeviceProperty_Prop_AudioFirmwareVersion_Uint64 = 2032;
+ public static final int ETrackedDeviceProperty_Prop_CameraCompatibilityMode_Int32 = 2033;
+ public static final int ETrackedDeviceProperty_Prop_ScreenshotHorizontalFieldOfViewDegrees_Float = 2034;
+ public static final int ETrackedDeviceProperty_Prop_ScreenshotVerticalFieldOfViewDegrees_Float = 2035;
+ public static final int ETrackedDeviceProperty_Prop_DisplaySuppressed_Bool = 2036;
+ public static final int ETrackedDeviceProperty_Prop_AttachedDeviceId_String = 3000;
+ public static final int ETrackedDeviceProperty_Prop_SupportedButtons_Uint64 = 3001;
+ public static final int ETrackedDeviceProperty_Prop_Axis0Type_Int32 = 3002;
+ public static final int ETrackedDeviceProperty_Prop_Axis1Type_Int32 = 3003;
+ public static final int ETrackedDeviceProperty_Prop_Axis2Type_Int32 = 3004;
+ public static final int ETrackedDeviceProperty_Prop_Axis3Type_Int32 = 3005;
+ public static final int ETrackedDeviceProperty_Prop_Axis4Type_Int32 = 3006;
+ public static final int ETrackedDeviceProperty_Prop_ControllerRoleHint_Int32 = 3007;
+ public static final int ETrackedDeviceProperty_Prop_FieldOfViewLeftDegrees_Float = 4000;
+ public static final int ETrackedDeviceProperty_Prop_FieldOfViewRightDegrees_Float = 4001;
+ public static final int ETrackedDeviceProperty_Prop_FieldOfViewTopDegrees_Float = 4002;
+ public static final int ETrackedDeviceProperty_Prop_FieldOfViewBottomDegrees_Float = 4003;
+ public static final int ETrackedDeviceProperty_Prop_TrackingRangeMinimumMeters_Float = 4004;
+ public static final int ETrackedDeviceProperty_Prop_TrackingRangeMaximumMeters_Float = 4005;
+ public static final int ETrackedDeviceProperty_Prop_ModeLabel_String = 4006;
+ public static final int ETrackedDeviceProperty_Prop_VendorSpecific_Reserved_Start = 10000;
+ public static final int ETrackedDeviceProperty_Prop_VendorSpecific_Reserved_End = 10999;
+ };
+ /** enum values */
+ public static interface ETrackedPropertyError {
+ public static final int ETrackedPropertyError_TrackedProp_Success = 0;
+ public static final int ETrackedPropertyError_TrackedProp_WrongDataType = 1;
+ public static final int ETrackedPropertyError_TrackedProp_WrongDeviceClass = 2;
+ public static final int ETrackedPropertyError_TrackedProp_BufferTooSmall = 3;
+ public static final int ETrackedPropertyError_TrackedProp_UnknownProperty = 4;
+ public static final int ETrackedPropertyError_TrackedProp_InvalidDevice = 5;
+ public static final int ETrackedPropertyError_TrackedProp_CouldNotContactServer = 6;
+ public static final int ETrackedPropertyError_TrackedProp_ValueNotProvidedByDevice = 7;
+ public static final int ETrackedPropertyError_TrackedProp_StringExceedsMaximumLength = 8;
+ public static final int ETrackedPropertyError_TrackedProp_NotYetAvailable = 9;
+ };
+ /** enum values */
+ public static interface EVRSubmitFlags {
+ public static final int EVRSubmitFlags_Submit_Default = 0;
+ public static final int EVRSubmitFlags_Submit_LensDistortionAlreadyApplied = 1;
+ public static final int EVRSubmitFlags_Submit_GlRenderBuffer = 2;
+ };
+ /** enum values */
+ public static interface EVRState {
+ public static final int EVRState_VRState_Undefined = -1;
+ public static final int EVRState_VRState_Off = 0;
+ public static final int EVRState_VRState_Searching = 1;
+ public static final int EVRState_VRState_Searching_Alert = 2;
+ public static final int EVRState_VRState_Ready = 3;
+ public static final int EVRState_VRState_Ready_Alert = 4;
+ public static final int EVRState_VRState_NotReady = 5;
+ public static final int EVRState_VRState_Standby = 6;
+ public static final int EVRState_VRState_Ready_Alert_Low = 7;
+ };
+ /** enum values */
+ public static interface EVREventType {
+ public static final int EVREventType_VREvent_None = 0;
+ public static final int EVREventType_VREvent_TrackedDeviceActivated = 100;
+ public static final int EVREventType_VREvent_TrackedDeviceDeactivated = 101;
+ public static final int EVREventType_VREvent_TrackedDeviceUpdated = 102;
+ public static final int EVREventType_VREvent_TrackedDeviceUserInteractionStarted = 103;
+ public static final int EVREventType_VREvent_TrackedDeviceUserInteractionEnded = 104;
+ public static final int EVREventType_VREvent_IpdChanged = 105;
+ public static final int EVREventType_VREvent_EnterStandbyMode = 106;
+ public static final int EVREventType_VREvent_LeaveStandbyMode = 107;
+ public static final int EVREventType_VREvent_TrackedDeviceRoleChanged = 108;
+ public static final int EVREventType_VREvent_WatchdogWakeUpRequested = 109;
+ public static final int EVREventType_VREvent_ButtonPress = 200;
+ public static final int EVREventType_VREvent_ButtonUnpress = 201;
+ public static final int EVREventType_VREvent_ButtonTouch = 202;
+ public static final int EVREventType_VREvent_ButtonUntouch = 203;
+ public static final int EVREventType_VREvent_MouseMove = 300;
+ public static final int EVREventType_VREvent_MouseButtonDown = 301;
+ public static final int EVREventType_VREvent_MouseButtonUp = 302;
+ public static final int EVREventType_VREvent_FocusEnter = 303;
+ public static final int EVREventType_VREvent_FocusLeave = 304;
+ public static final int EVREventType_VREvent_Scroll = 305;
+ public static final int EVREventType_VREvent_TouchPadMove = 306;
+ public static final int EVREventType_VREvent_OverlayFocusChanged = 307;
+ public static final int EVREventType_VREvent_InputFocusCaptured = 400;
+ public static final int EVREventType_VREvent_InputFocusReleased = 401;
+ public static final int EVREventType_VREvent_SceneFocusLost = 402;
+ public static final int EVREventType_VREvent_SceneFocusGained = 403;
+ public static final int EVREventType_VREvent_SceneApplicationChanged = 404;
+ public static final int EVREventType_VREvent_SceneFocusChanged = 405;
+ public static final int EVREventType_VREvent_InputFocusChanged = 406;
+ public static final int EVREventType_VREvent_SceneApplicationSecondaryRenderingStarted = 407;
+ public static final int EVREventType_VREvent_HideRenderModels = 410;
+ public static final int EVREventType_VREvent_ShowRenderModels = 411;
+ public static final int EVREventType_VREvent_OverlayShown = 500;
+ public static final int EVREventType_VREvent_OverlayHidden = 501;
+ public static final int EVREventType_VREvent_DashboardActivated = 502;
+ public static final int EVREventType_VREvent_DashboardDeactivated = 503;
+ public static final int EVREventType_VREvent_DashboardThumbSelected = 504;
+ public static final int EVREventType_VREvent_DashboardRequested = 505;
+ public static final int EVREventType_VREvent_ResetDashboard = 506;
+ public static final int EVREventType_VREvent_RenderToast = 507;
+ public static final int EVREventType_VREvent_ImageLoaded = 508;
+ public static final int EVREventType_VREvent_ShowKeyboard = 509;
+ public static final int EVREventType_VREvent_HideKeyboard = 510;
+ public static final int EVREventType_VREvent_OverlayGamepadFocusGained = 511;
+ public static final int EVREventType_VREvent_OverlayGamepadFocusLost = 512;
+ public static final int EVREventType_VREvent_OverlaySharedTextureChanged = 513;
+ public static final int EVREventType_VREvent_DashboardGuideButtonDown = 514;
+ public static final int EVREventType_VREvent_DashboardGuideButtonUp = 515;
+ public static final int EVREventType_VREvent_ScreenshotTriggered = 516;
+ public static final int EVREventType_VREvent_ImageFailed = 517;
+ public static final int EVREventType_VREvent_RequestScreenshot = 520;
+ public static final int EVREventType_VREvent_ScreenshotTaken = 521;
+ public static final int EVREventType_VREvent_ScreenshotFailed = 522;
+ public static final int EVREventType_VREvent_SubmitScreenshotToDashboard = 523;
+ public static final int EVREventType_VREvent_ScreenshotProgressToDashboard = 524;
+ public static final int EVREventType_VREvent_Notification_Shown = 600;
+ public static final int EVREventType_VREvent_Notification_Hidden = 601;
+ public static final int EVREventType_VREvent_Notification_BeginInteraction = 602;
+ public static final int EVREventType_VREvent_Notification_Destroyed = 603;
+ public static final int EVREventType_VREvent_Quit = 700;
+ public static final int EVREventType_VREvent_ProcessQuit = 701;
+ public static final int EVREventType_VREvent_QuitAborted_UserPrompt = 702;
+ public static final int EVREventType_VREvent_QuitAcknowledged = 703;
+ public static final int EVREventType_VREvent_DriverRequestedQuit = 704;
+ public static final int EVREventType_VREvent_ChaperoneDataHasChanged = 800;
+ public static final int EVREventType_VREvent_ChaperoneUniverseHasChanged = 801;
+ public static final int EVREventType_VREvent_ChaperoneTempDataHasChanged = 802;
+ public static final int EVREventType_VREvent_ChaperoneSettingsHaveChanged = 803;
+ public static final int EVREventType_VREvent_SeatedZeroPoseReset = 804;
+ public static final int EVREventType_VREvent_AudioSettingsHaveChanged = 820;
+ public static final int EVREventType_VREvent_BackgroundSettingHasChanged = 850;
+ public static final int EVREventType_VREvent_CameraSettingsHaveChanged = 851;
+ public static final int EVREventType_VREvent_ReprojectionSettingHasChanged = 852;
+ public static final int EVREventType_VREvent_ModelSkinSettingsHaveChanged = 853;
+ public static final int EVREventType_VREvent_EnvironmentSettingsHaveChanged = 854;
+ public static final int EVREventType_VREvent_StatusUpdate = 900;
+ public static final int EVREventType_VREvent_MCImageUpdated = 1000;
+ public static final int EVREventType_VREvent_FirmwareUpdateStarted = 1100;
+ public static final int EVREventType_VREvent_FirmwareUpdateFinished = 1101;
+ public static final int EVREventType_VREvent_KeyboardClosed = 1200;
+ public static final int EVREventType_VREvent_KeyboardCharInput = 1201;
+ public static final int EVREventType_VREvent_KeyboardDone = 1202;
+ public static final int EVREventType_VREvent_ApplicationTransitionStarted = 1300;
+ public static final int EVREventType_VREvent_ApplicationTransitionAborted = 1301;
+ public static final int EVREventType_VREvent_ApplicationTransitionNewAppStarted = 1302;
+ public static final int EVREventType_VREvent_ApplicationListUpdated = 1303;
+ public static final int EVREventType_VREvent_ApplicationMimeTypeLoad = 1304;
+ public static final int EVREventType_VREvent_Compositor_MirrorWindowShown = 1400;
+ public static final int EVREventType_VREvent_Compositor_MirrorWindowHidden = 1401;
+ public static final int EVREventType_VREvent_Compositor_ChaperoneBoundsShown = 1410;
+ public static final int EVREventType_VREvent_Compositor_ChaperoneBoundsHidden = 1411;
+ public static final int EVREventType_VREvent_TrackedCamera_StartVideoStream = 1500;
+ public static final int EVREventType_VREvent_TrackedCamera_StopVideoStream = 1501;
+ public static final int EVREventType_VREvent_TrackedCamera_PauseVideoStream = 1502;
+ public static final int EVREventType_VREvent_TrackedCamera_ResumeVideoStream = 1503;
+ public static final int EVREventType_VREvent_PerformanceTest_EnableCapture = 1600;
+ public static final int EVREventType_VREvent_PerformanceTest_DisableCapture = 1601;
+ public static final int EVREventType_VREvent_PerformanceTest_FidelityLevel = 1602;
+ public static final int EVREventType_VREvent_VendorSpecific_Reserved_Start = 10000;
+ public static final int EVREventType_VREvent_VendorSpecific_Reserved_End = 19999;
+ };
+ /** enum values */
+ public static interface EDeviceActivityLevel {
+ public static final int EDeviceActivityLevel_k_EDeviceActivityLevel_Unknown = -1;
+ public static final int EDeviceActivityLevel_k_EDeviceActivityLevel_Idle = 0;
+ public static final int EDeviceActivityLevel_k_EDeviceActivityLevel_UserInteraction = 1;
+ public static final int EDeviceActivityLevel_k_EDeviceActivityLevel_UserInteraction_Timeout = 2;
+ public static final int EDeviceActivityLevel_k_EDeviceActivityLevel_Standby = 3;
+ };
+ /** enum values */
+ public static interface EVRButtonId {
+ public static final int EVRButtonId_k_EButton_System = 0;
+ public static final int EVRButtonId_k_EButton_ApplicationMenu = 1;
+ public static final int EVRButtonId_k_EButton_Grip = 2;
+ public static final int EVRButtonId_k_EButton_DPad_Left = 3;
+ public static final int EVRButtonId_k_EButton_DPad_Up = 4;
+ public static final int EVRButtonId_k_EButton_DPad_Right = 5;
+ public static final int EVRButtonId_k_EButton_DPad_Down = 6;
+ public static final int EVRButtonId_k_EButton_A = 7;
+ public static final int EVRButtonId_k_EButton_Axis0 = 32;
+ public static final int EVRButtonId_k_EButton_Axis1 = 33;
+ public static final int EVRButtonId_k_EButton_Axis2 = 34;
+ public static final int EVRButtonId_k_EButton_Axis3 = 35;
+ public static final int EVRButtonId_k_EButton_Axis4 = 36;
+ public static final int EVRButtonId_k_EButton_SteamVR_Touchpad = 32;
+ public static final int EVRButtonId_k_EButton_SteamVR_Trigger = 33;
+ public static final int EVRButtonId_k_EButton_Dashboard_Back = 2;
+ public static final int EVRButtonId_k_EButton_Max = 64;
+ };
+ /** enum values */
+ public static interface EVRMouseButton {
+ public static final int EVRMouseButton_VRMouseButton_Left = 1;
+ public static final int EVRMouseButton_VRMouseButton_Right = 2;
+ public static final int EVRMouseButton_VRMouseButton_Middle = 4;
+ };
+ /** enum values */
+ public static interface EVRControllerAxisType {
+ public static final int EVRControllerAxisType_k_eControllerAxis_None = 0;
+ public static final int EVRControllerAxisType_k_eControllerAxis_TrackPad = 1;
+ public static final int EVRControllerAxisType_k_eControllerAxis_Joystick = 2;
+ public static final int EVRControllerAxisType_k_eControllerAxis_Trigger = 3;
+ };
+ /** enum values */
+ public static interface EVRControllerEventOutputType {
+ public static final int EVRControllerEventOutputType_ControllerEventOutput_OSEvents = 0;
+ public static final int EVRControllerEventOutputType_ControllerEventOutput_VREvents = 1;
+ };
+ /** enum values */
+ public static interface ECollisionBoundsStyle {
+ public static final int ECollisionBoundsStyle_COLLISION_BOUNDS_STYLE_BEGINNER = 0;
+ public static final int ECollisionBoundsStyle_COLLISION_BOUNDS_STYLE_INTERMEDIATE = 1;
+ public static final int ECollisionBoundsStyle_COLLISION_BOUNDS_STYLE_SQUARES = 2;
+ public static final int ECollisionBoundsStyle_COLLISION_BOUNDS_STYLE_ADVANCED = 3;
+ public static final int ECollisionBoundsStyle_COLLISION_BOUNDS_STYLE_NONE = 4;
+ public static final int ECollisionBoundsStyle_COLLISION_BOUNDS_STYLE_COUNT = 5;
+ };
+ /** enum values */
+ public static interface EVROverlayError {
+ public static final int EVROverlayError_VROverlayError_None = 0;
+ public static final int EVROverlayError_VROverlayError_UnknownOverlay = 10;
+ public static final int EVROverlayError_VROverlayError_InvalidHandle = 11;
+ public static final int EVROverlayError_VROverlayError_PermissionDenied = 12;
+ public static final int EVROverlayError_VROverlayError_OverlayLimitExceeded = 13;
+ public static final int EVROverlayError_VROverlayError_WrongVisibilityType = 14;
+ public static final int EVROverlayError_VROverlayError_KeyTooLong = 15;
+ public static final int EVROverlayError_VROverlayError_NameTooLong = 16;
+ public static final int EVROverlayError_VROverlayError_KeyInUse = 17;
+ public static final int EVROverlayError_VROverlayError_WrongTransformType = 18;
+ public static final int EVROverlayError_VROverlayError_InvalidTrackedDevice = 19;
+ public static final int EVROverlayError_VROverlayError_InvalidParameter = 20;
+ public static final int EVROverlayError_VROverlayError_ThumbnailCantBeDestroyed = 21;
+ public static final int EVROverlayError_VROverlayError_ArrayTooSmall = 22;
+ public static final int EVROverlayError_VROverlayError_RequestFailed = 23;
+ public static final int EVROverlayError_VROverlayError_InvalidTexture = 24;
+ public static final int EVROverlayError_VROverlayError_UnableToLoadFile = 25;
+ public static final int EVROverlayError_VROVerlayError_KeyboardAlreadyInUse = 26;
+ public static final int EVROverlayError_VROverlayError_NoNeighbor = 27;
+ };
+ /** enum values */
+ public static interface EVRApplicationType {
+ public static final int EVRApplicationType_VRApplication_Other = 0;
+ public static final int EVRApplicationType_VRApplication_Scene = 1;
+ public static final int EVRApplicationType_VRApplication_Overlay = 2;
+ public static final int EVRApplicationType_VRApplication_Background = 3;
+ public static final int EVRApplicationType_VRApplication_Utility = 4;
+ public static final int EVRApplicationType_VRApplication_VRMonitor = 5;
+ public static final int EVRApplicationType_VRApplication_SteamWatchdog = 6;
+ public static final int EVRApplicationType_VRApplication_Max = 7;
+ };
+ /** enum values */
+ public static interface EVRFirmwareError {
+ public static final int EVRFirmwareError_VRFirmwareError_None = 0;
+ public static final int EVRFirmwareError_VRFirmwareError_Success = 1;
+ public static final int EVRFirmwareError_VRFirmwareError_Fail = 2;
+ };
+ /** enum values */
+ public static interface EVRNotificationError {
+ public static final int EVRNotificationError_VRNotificationError_OK = 0;
+ public static final int EVRNotificationError_VRNotificationError_InvalidNotificationId = 100;
+ public static final int EVRNotificationError_VRNotificationError_NotificationQueueFull = 101;
+ public static final int EVRNotificationError_VRNotificationError_InvalidOverlayHandle = 102;
+ public static final int EVRNotificationError_VRNotificationError_SystemWithUserValueAlreadyExists = 103;
+ };
+ /** enum values */
+ public static interface EVRInitError {
+ public static final int EVRInitError_VRInitError_None = 0;
+ public static final int EVRInitError_VRInitError_Unknown = 1;
+ public static final int EVRInitError_VRInitError_Init_InstallationNotFound = 100;
+ public static final int EVRInitError_VRInitError_Init_InstallationCorrupt = 101;
+ public static final int EVRInitError_VRInitError_Init_VRClientDLLNotFound = 102;
+ public static final int EVRInitError_VRInitError_Init_FileNotFound = 103;
+ public static final int EVRInitError_VRInitError_Init_FactoryNotFound = 104;
+ public static final int EVRInitError_VRInitError_Init_InterfaceNotFound = 105;
+ public static final int EVRInitError_VRInitError_Init_InvalidInterface = 106;
+ public static final int EVRInitError_VRInitError_Init_UserConfigDirectoryInvalid = 107;
+ public static final int EVRInitError_VRInitError_Init_HmdNotFound = 108;
+ public static final int EVRInitError_VRInitError_Init_NotInitialized = 109;
+ public static final int EVRInitError_VRInitError_Init_PathRegistryNotFound = 110;
+ public static final int EVRInitError_VRInitError_Init_NoConfigPath = 111;
+ public static final int EVRInitError_VRInitError_Init_NoLogPath = 112;
+ public static final int EVRInitError_VRInitError_Init_PathRegistryNotWritable = 113;
+ public static final int EVRInitError_VRInitError_Init_AppInfoInitFailed = 114;
+ public static final int EVRInitError_VRInitError_Init_Retry = 115;
+ public static final int EVRInitError_VRInitError_Init_InitCanceledByUser = 116;
+ public static final int EVRInitError_VRInitError_Init_AnotherAppLaunching = 117;
+ public static final int EVRInitError_VRInitError_Init_SettingsInitFailed = 118;
+ public static final int EVRInitError_VRInitError_Init_ShuttingDown = 119;
+ public static final int EVRInitError_VRInitError_Init_TooManyObjects = 120;
+ public static final int EVRInitError_VRInitError_Init_NoServerForBackgroundApp = 121;
+ public static final int EVRInitError_VRInitError_Init_NotSupportedWithCompositor = 122;
+ public static final int EVRInitError_VRInitError_Init_NotAvailableToUtilityApps = 123;
+ public static final int EVRInitError_VRInitError_Init_Internal = 124;
+ public static final int EVRInitError_VRInitError_Init_HmdDriverIdIsNone = 125;
+ public static final int EVRInitError_VRInitError_Init_HmdNotFoundPresenceFailed = 126;
+ public static final int EVRInitError_VRInitError_Init_VRMonitorNotFound = 127;
+ public static final int EVRInitError_VRInitError_Init_VRMonitorStartupFailed = 128;
+ public static final int EVRInitError_VRInitError_Init_LowPowerWatchdogNotSupported = 129;
+ public static final int EVRInitError_VRInitError_Init_InvalidApplicationType = 130;
+ public static final int EVRInitError_VRInitError_Init_NotAvailableToWatchdogApps = 131;
+ public static final int EVRInitError_VRInitError_Init_WatchdogDisabledInSettings = 132;
+ public static final int EVRInitError_VRInitError_Driver_Failed = 200;
+ public static final int EVRInitError_VRInitError_Driver_Unknown = 201;
+ public static final int EVRInitError_VRInitError_Driver_HmdUnknown = 202;
+ public static final int EVRInitError_VRInitError_Driver_NotLoaded = 203;
+ public static final int EVRInitError_VRInitError_Driver_RuntimeOutOfDate = 204;
+ public static final int EVRInitError_VRInitError_Driver_HmdInUse = 205;
+ public static final int EVRInitError_VRInitError_Driver_NotCalibrated = 206;
+ public static final int EVRInitError_VRInitError_Driver_CalibrationInvalid = 207;
+ public static final int EVRInitError_VRInitError_Driver_HmdDisplayNotFound = 208;
+ public static final int EVRInitError_VRInitError_Driver_TrackedDeviceInterfaceUnknown = 209;
+ public static final int EVRInitError_VRInitError_Driver_HmdDriverIdOutOfBounds = 211;
+ public static final int EVRInitError_VRInitError_Driver_HmdDisplayMirrored = 212;
+ public static final int EVRInitError_VRInitError_IPC_ServerInitFailed = 300;
+ public static final int EVRInitError_VRInitError_IPC_ConnectFailed = 301;
+ public static final int EVRInitError_VRInitError_IPC_SharedStateInitFailed = 302;
+ public static final int EVRInitError_VRInitError_IPC_CompositorInitFailed = 303;
+ public static final int EVRInitError_VRInitError_IPC_MutexInitFailed = 304;
+ public static final int EVRInitError_VRInitError_IPC_Failed = 305;
+ public static final int EVRInitError_VRInitError_IPC_CompositorConnectFailed = 306;
+ public static final int EVRInitError_VRInitError_IPC_CompositorInvalidConnectResponse = 307;
+ public static final int EVRInitError_VRInitError_IPC_ConnectFailedAfterMultipleAttempts = 308;
+ public static final int EVRInitError_VRInitError_Compositor_Failed = 400;
+ public static final int EVRInitError_VRInitError_Compositor_D3D11HardwareRequired = 401;
+ public static final int EVRInitError_VRInitError_Compositor_FirmwareRequiresUpdate = 402;
+ public static final int EVRInitError_VRInitError_Compositor_OverlayInitFailed = 403;
+ public static final int EVRInitError_VRInitError_Compositor_ScreenshotsInitFailed = 404;
+ public static final int EVRInitError_VRInitError_VendorSpecific_UnableToConnectToOculusRuntime = 1000;
+ public static final int EVRInitError_VRInitError_VendorSpecific_HmdFound_CantOpenDevice = 1101;
+ public static final int EVRInitError_VRInitError_VendorSpecific_HmdFound_UnableToRequestConfigStart = 1102;
+ public static final int EVRInitError_VRInitError_VendorSpecific_HmdFound_NoStoredConfig = 1103;
+ public static final int EVRInitError_VRInitError_VendorSpecific_HmdFound_ConfigTooBig = 1104;
+ public static final int EVRInitError_VRInitError_VendorSpecific_HmdFound_ConfigTooSmall = 1105;
+ public static final int EVRInitError_VRInitError_VendorSpecific_HmdFound_UnableToInitZLib = 1106;
+ public static final int EVRInitError_VRInitError_VendorSpecific_HmdFound_CantReadFirmwareVersion = 1107;
+ public static final int EVRInitError_VRInitError_VendorSpecific_HmdFound_UnableToSendUserDataStart = 1108;
+ public static final int EVRInitError_VRInitError_VendorSpecific_HmdFound_UnableToGetUserDataStart = 1109;
+ public static final int EVRInitError_VRInitError_VendorSpecific_HmdFound_UnableToGetUserDataNext = 1110;
+ public static final int EVRInitError_VRInitError_VendorSpecific_HmdFound_UserDataAddressRange = 1111;
+ public static final int EVRInitError_VRInitError_VendorSpecific_HmdFound_UserDataError = 1112;
+ public static final int EVRInitError_VRInitError_VendorSpecific_HmdFound_ConfigFailedSanityCheck = 1113;
+ public static final int EVRInitError_VRInitError_Steam_SteamInstallationNotFound = 2000;
+ };
+ /** enum values */
+ public static interface EVRScreenshotType {
+ public static final int EVRScreenshotType_VRScreenshotType_None = 0;
+ public static final int EVRScreenshotType_VRScreenshotType_Mono = 1;
+ public static final int EVRScreenshotType_VRScreenshotType_Stereo = 2;
+ public static final int EVRScreenshotType_VRScreenshotType_Cubemap = 3;
+ public static final int EVRScreenshotType_VRScreenshotType_MonoPanorama = 4;
+ public static final int EVRScreenshotType_VRScreenshotType_StereoPanorama = 5;
+ };
+ /** enum values */
+ public static interface EVRScreenshotPropertyFilenames {
+ public static final int EVRScreenshotPropertyFilenames_VRScreenshotPropertyFilenames_Preview = 0;
+ public static final int EVRScreenshotPropertyFilenames_VRScreenshotPropertyFilenames_VR = 1;
+ };
+ /** enum values */
+ public static interface EVRTrackedCameraError {
+ public static final int EVRTrackedCameraError_VRTrackedCameraError_None = 0;
+ public static final int EVRTrackedCameraError_VRTrackedCameraError_OperationFailed = 100;
+ public static final int EVRTrackedCameraError_VRTrackedCameraError_InvalidHandle = 101;
+ public static final int EVRTrackedCameraError_VRTrackedCameraError_InvalidFrameHeaderVersion = 102;
+ public static final int EVRTrackedCameraError_VRTrackedCameraError_OutOfHandles = 103;
+ public static final int EVRTrackedCameraError_VRTrackedCameraError_IPCFailure = 104;
+ public static final int EVRTrackedCameraError_VRTrackedCameraError_NotSupportedForThisDevice = 105;
+ public static final int EVRTrackedCameraError_VRTrackedCameraError_SharedMemoryFailure = 106;
+ public static final int EVRTrackedCameraError_VRTrackedCameraError_FrameBufferingFailure = 107;
+ public static final int EVRTrackedCameraError_VRTrackedCameraError_StreamSetupFailure = 108;
+ public static final int EVRTrackedCameraError_VRTrackedCameraError_InvalidGLTextureId = 109;
+ public static final int EVRTrackedCameraError_VRTrackedCameraError_InvalidSharedTextureHandle = 110;
+ public static final int EVRTrackedCameraError_VRTrackedCameraError_FailedToGetGLTextureId = 111;
+ public static final int EVRTrackedCameraError_VRTrackedCameraError_SharedTextureFailure = 112;
+ public static final int EVRTrackedCameraError_VRTrackedCameraError_NoFrameAvailable = 113;
+ public static final int EVRTrackedCameraError_VRTrackedCameraError_InvalidArgument = 114;
+ public static final int EVRTrackedCameraError_VRTrackedCameraError_InvalidFrameBufferSize = 115;
+ };
+ /** enum values */
+ public static interface EVRTrackedCameraFrameType {
+ public static final int EVRTrackedCameraFrameType_VRTrackedCameraFrameType_Distorted = 0;
+ public static final int EVRTrackedCameraFrameType_VRTrackedCameraFrameType_Undistorted = 1;
+ public static final int EVRTrackedCameraFrameType_VRTrackedCameraFrameType_MaximumUndistorted = 2;
+ public static final int EVRTrackedCameraFrameType_MAX_CAMERA_FRAME_TYPES = 3;
+ };
+ public static interface EVRApplicationError {
+ public static final int EVRApplicationError_VRApplicationError_None = 0;
+ public static final int EVRApplicationError_VRApplicationError_AppKeyAlreadyExists = 100;
+ public static final int EVRApplicationError_VRApplicationError_NoManifest = 101;
+ public static final int EVRApplicationError_VRApplicationError_NoApplication = 102;
+ public static final int EVRApplicationError_VRApplicationError_InvalidIndex = 103;
+ public static final int EVRApplicationError_VRApplicationError_UnknownApplication = 104;
+ public static final int EVRApplicationError_VRApplicationError_IPCFailed = 105;
+ public static final int EVRApplicationError_VRApplicationError_ApplicationAlreadyRunning = 106;
+ public static final int EVRApplicationError_VRApplicationError_InvalidManifest = 107;
+ public static final int EVRApplicationError_VRApplicationError_InvalidApplication = 108;
+ public static final int EVRApplicationError_VRApplicationError_LaunchFailed = 109;
+ public static final int EVRApplicationError_VRApplicationError_ApplicationAlreadyStarting = 110;
+ public static final int EVRApplicationError_VRApplicationError_LaunchInProgress = 111;
+ public static final int EVRApplicationError_VRApplicationError_OldApplicationQuitting = 112;
+ public static final int EVRApplicationError_VRApplicationError_TransitionAborted = 113;
+ public static final int EVRApplicationError_VRApplicationError_IsTemplate = 114;
+ public static final int EVRApplicationError_VRApplicationError_BufferTooSmall = 200;
+ public static final int EVRApplicationError_VRApplicationError_PropertyNotSet = 201;
+ public static final int EVRApplicationError_VRApplicationError_UnknownProperty = 202;
+ public static final int EVRApplicationError_VRApplicationError_InvalidParameter = 203;
+ };
+ /** enum values */
+ public static interface EVRApplicationProperty {
+ public static final int EVRApplicationProperty_VRApplicationProperty_Name_String = 0;
+ public static final int EVRApplicationProperty_VRApplicationProperty_LaunchType_String = 11;
+ public static final int EVRApplicationProperty_VRApplicationProperty_WorkingDirectory_String = 12;
+ public static final int EVRApplicationProperty_VRApplicationProperty_BinaryPath_String = 13;
+ public static final int EVRApplicationProperty_VRApplicationProperty_Arguments_String = 14;
+ public static final int EVRApplicationProperty_VRApplicationProperty_URL_String = 15;
+ public static final int EVRApplicationProperty_VRApplicationProperty_Description_String = 50;
+ public static final int EVRApplicationProperty_VRApplicationProperty_NewsURL_String = 51;
+ public static final int EVRApplicationProperty_VRApplicationProperty_ImagePath_String = 52;
+ public static final int EVRApplicationProperty_VRApplicationProperty_Source_String = 53;
+ public static final int EVRApplicationProperty_VRApplicationProperty_IsDashboardOverlay_Bool = 60;
+ public static final int EVRApplicationProperty_VRApplicationProperty_IsTemplate_Bool = 61;
+ public static final int EVRApplicationProperty_VRApplicationProperty_IsInstanced_Bool = 62;
+ public static final int EVRApplicationProperty_VRApplicationProperty_LastLaunchTime_Uint64 = 70;
+ };
+ /** enum values */
+ public static interface EVRApplicationTransitionState {
+ public static final int EVRApplicationTransitionState_VRApplicationTransition_None = 0;
+ public static final int EVRApplicationTransitionState_VRApplicationTransition_OldAppQuitSent = 10;
+ public static final int EVRApplicationTransitionState_VRApplicationTransition_WaitingForExternalLaunch = 11;
+ public static final int EVRApplicationTransitionState_VRApplicationTransition_NewAppLaunched = 20;
+ };
+ /** enum values */
+ public static interface ChaperoneCalibrationState {
+ public static final int ChaperoneCalibrationState_OK = 1;
+ public static final int ChaperoneCalibrationState_Warning = 100;
+ public static final int ChaperoneCalibrationState_Warning_BaseStationMayHaveMoved = 101;
+ public static final int ChaperoneCalibrationState_Warning_BaseStationRemoved = 102;
+ public static final int ChaperoneCalibrationState_Warning_SeatedBoundsInvalid = 103;
+ public static final int ChaperoneCalibrationState_Error = 200;
+ public static final int ChaperoneCalibrationState_Error_BaseStationUninitalized = 201;
+ public static final int ChaperoneCalibrationState_Error_BaseStationConflict = 202;
+ public static final int ChaperoneCalibrationState_Error_PlayAreaInvalid = 203;
+ public static final int ChaperoneCalibrationState_Error_CollisionBoundsInvalid = 204;
+ };
+ /** enum values */
+ public static interface EChaperoneConfigFile {
+ public static final int EChaperoneConfigFile_Live = 1;
+ public static final int EChaperoneConfigFile_Temp = 2;
+ };
+ /** enum values */
+ public static interface EChaperoneImportFlags {
+ public static final int EChaperoneImportFlags_EChaperoneImport_BoundsOnly = 1;
+ };
+ public static interface EVRCompositorError {
+ public static final int EVRCompositorError_VRCompositorError_None = 0;
+ public static final int EVRCompositorError_VRCompositorError_RequestFailed = 1;
+ public static final int EVRCompositorError_VRCompositorError_IncompatibleVersion = 100;
+ public static final int EVRCompositorError_VRCompositorError_DoNotHaveFocus = 101;
+ public static final int EVRCompositorError_VRCompositorError_InvalidTexture = 102;
+ public static final int EVRCompositorError_VRCompositorError_IsNotSceneApplication = 103;
+ public static final int EVRCompositorError_VRCompositorError_TextureIsOnWrongDevice = 104;
+ public static final int EVRCompositorError_VRCompositorError_TextureUsesUnsupportedFormat = 105;
+ public static final int EVRCompositorError_VRCompositorError_SharedTexturesNotSupported = 106;
+ public static final int EVRCompositorError_VRCompositorError_IndexOutOfRange = 107;
+ };
+ /** enum values */
+ public static interface VROverlayInputMethod {
+ public static final int VROverlayInputMethod_None = 0;
+ public static final int VROverlayInputMethod_Mouse = 1;
+ };
+ /** enum values */
+ public static interface VROverlayTransformType {
+ public static final int VROverlayTransformType_VROverlayTransform_Absolute = 0;
+ public static final int VROverlayTransformType_VROverlayTransform_TrackedDeviceRelative = 1;
+ public static final int VROverlayTransformType_VROverlayTransform_SystemOverlay = 2;
+ public static final int VROverlayTransformType_VROverlayTransform_TrackedComponent = 3;
+ };
+ /** enum values */
+ public static interface VROverlayFlags {
+ public static final int VROverlayFlags_None = 0;
+ public static final int VROverlayFlags_Curved = 1;
+ public static final int VROverlayFlags_RGSS4X = 2;
+ public static final int VROverlayFlags_NoDashboardTab = 3;
+ public static final int VROverlayFlags_AcceptsGamepadEvents = 4;
+ public static final int VROverlayFlags_ShowGamepadFocus = 5;
+ public static final int VROverlayFlags_SendVRScrollEvents = 6;
+ public static final int VROverlayFlags_SendVRTouchpadEvents = 7;
+ public static final int VROverlayFlags_ShowTouchPadScrollWheel = 8;
+ public static final int VROverlayFlags_TransferOwnershipToInternalProcess = 9;
+ public static final int VROverlayFlags_SideBySide_Parallel = 10;
+ public static final int VROverlayFlags_SideBySide_Crossed = 11;
+ public static final int VROverlayFlags_Panorama = 12;
+ public static final int VROverlayFlags_StereoPanorama = 13;
+ public static final int VROverlayFlags_SortWithNonSceneOverlays = 14;
+ };
+ /** enum values */
+ public static interface EGamepadTextInputMode {
+ public static final int EGamepadTextInputMode_k_EGamepadTextInputModeNormal = 0;
+ public static final int EGamepadTextInputMode_k_EGamepadTextInputModePassword = 1;
+ public static final int EGamepadTextInputMode_k_EGamepadTextInputModeSubmit = 2;
+ };
+ /** enum values */
+ public static interface EGamepadTextInputLineMode {
+ public static final int EGamepadTextInputLineMode_k_EGamepadTextInputLineModeSingleLine = 0;
+ public static final int EGamepadTextInputLineMode_k_EGamepadTextInputLineModeMultipleLines = 1;
+ };
+ /** enum values */
+ public static interface EOverlayDirection {
+ public static final int EOverlayDirection_OverlayDirection_Up = 0;
+ public static final int EOverlayDirection_OverlayDirection_Down = 1;
+ public static final int EOverlayDirection_OverlayDirection_Left = 2;
+ public static final int EOverlayDirection_OverlayDirection_Right = 3;
+ public static final int EOverlayDirection_OverlayDirection_Count = 4;
+ };
+ /** enum values */
+ public static interface EVRRenderModelError {
+ public static final int EVRRenderModelError_VRRenderModelError_None = 0;
+ public static final int EVRRenderModelError_VRRenderModelError_Loading = 100;
+ public static final int EVRRenderModelError_VRRenderModelError_NotSupported = 200;
+ public static final int EVRRenderModelError_VRRenderModelError_InvalidArg = 300;
+ public static final int EVRRenderModelError_VRRenderModelError_InvalidModel = 301;
+ public static final int EVRRenderModelError_VRRenderModelError_NoShapes = 302;
+ public static final int EVRRenderModelError_VRRenderModelError_MultipleShapes = 303;
+ public static final int EVRRenderModelError_VRRenderModelError_TooManyVertices = 304;
+ public static final int EVRRenderModelError_VRRenderModelError_MultipleTextures = 305;
+ public static final int EVRRenderModelError_VRRenderModelError_BufferTooSmall = 306;
+ public static final int EVRRenderModelError_VRRenderModelError_NotEnoughNormals = 307;
+ public static final int EVRRenderModelError_VRRenderModelError_NotEnoughTexCoords = 308;
+ public static final int EVRRenderModelError_VRRenderModelError_InvalidTexture = 400;
+ };
+ /** enum values */
+ public static interface EVRComponentProperty {
+ public static final int EVRComponentProperty_VRComponentProperty_IsStatic = 1;
+ public static final int EVRComponentProperty_VRComponentProperty_IsVisible = 2;
+ public static final int EVRComponentProperty_VRComponentProperty_IsTouched = 4;
+ public static final int EVRComponentProperty_VRComponentProperty_IsPressed = 8;
+ public static final int EVRComponentProperty_VRComponentProperty_IsScrolled = 16;
+ };
+ /** enum values */
+ public static interface EVRNotificationType {
+ public static final int EVRNotificationType_Transient = 0;
+ public static final int EVRNotificationType_Persistent = 1;
+ public static final int EVRNotificationType_Transient_SystemWithUserValue = 2;
+ };
+ /** enum values */
+ public static interface EVRNotificationStyle {
+ public static final int EVRNotificationStyle_None = 0;
+ public static final int EVRNotificationStyle_Application = 100;
+ public static final int EVRNotificationStyle_Contact_Disabled = 200;
+ public static final int EVRNotificationStyle_Contact_Enabled = 201;
+ public static final int EVRNotificationStyle_Contact_Active = 202;
+ };
+ /** enum values */
+ public static interface EVRSettingsError {
+ public static final int EVRSettingsError_VRSettingsError_None = 0;
+ public static final int EVRSettingsError_VRSettingsError_IPCFailed = 1;
+ public static final int EVRSettingsError_VRSettingsError_WriteFailed = 2;
+ public static final int EVRSettingsError_VRSettingsError_ReadFailed = 3;
+ };
+ /** enum values */
+ public static interface EVRScreenshotError {
+ public static final int EVRScreenshotError_VRScreenshotError_None = 0;
+ public static final int EVRScreenshotError_VRScreenshotError_RequestFailed = 1;
+ public static final int EVRScreenshotError_VRScreenshotError_IncompatibleVersion = 100;
+ public static final int EVRScreenshotError_VRScreenshotError_NotFound = 101;
+ public static final int EVRScreenshotError_VRScreenshotError_BufferTooSmall = 102;
+ public static final int EVRScreenshotError_VRScreenshotError_ScreenshotAlreadyInProgress = 108;
+ };
+ /** OpenVR Constants */
+ public static final int k_unTrackingStringSize = 32;
+ public static final int k_unMaxDriverDebugResponseSize = 32768;
+ public static final int k_unTrackedDeviceIndex_Hmd = 0;
+ public static final int k_unMaxTrackedDeviceCount = 16;
+ public static final int k_unTrackedDeviceIndexOther = 0xFFFFFFFF;
+ public static final int k_unTrackedDeviceIndexInvalid = 0xFFFFFFFF;
+ public static final int k_unMaxPropertyStringSize = 32768;
+ public static final int k_unControllerStateAxisCount = 5;
+ public static final long k_ulOverlayHandleInvalid = 0;
+ public static final int k_unScreenshotHandleInvalid = 0;
+ public static final int k_unMaxApplicationKeyLength = 128;
+ public static final int k_unVROverlayMaxKeyLength = 128;
+ public static final int k_unVROverlayMaxNameLength = 128;
+ public static final int k_unMaxOverlayCount = 32;
+ public static final int k_unNotificationTextMaxSize = 256;
+ public static final int k_unMaxSettingsKeyLength = 128;
+ /**
+ * Global entry points
+ * Original signature : intptr_t VR_InitInternal(EVRInitError*, EVRApplicationType)
+ * @deprecated use the safer methods {@link #VR_InitInternal(java.nio.IntBuffer, int)} and {@link #VR_InitInternal(com.sun.jna.ptr.IntByReference, int)} instead
+ */
+ @Deprecated
+ public static native Pointer VR_InitInternal(IntByReference peError, int eType);
+ /**
+ * Global entry points
+ * Original signature : intptr_t VR_InitInternal(EVRInitError*, EVRApplicationType)
+ */
+ public static native Pointer VR_InitInternal(IntBuffer peError, int eType);
+ /** Original signature : void VR_ShutdownInternal()
*/
+ public static native void VR_ShutdownInternal();
+ /** Original signature : bool VR_IsHmdPresent()
*/
+ public static native byte VR_IsHmdPresent();
+ /**
+ * Original signature : intptr_t VR_GetGenericInterface(const char*, EVRInitError*)
+ * @deprecated use the safer methods {@link #VR_GetGenericInterface(java.lang.String, java.nio.IntBuffer)} and {@link #VR_GetGenericInterface(com.sun.jna.Pointer, com.sun.jna.ptr.IntByReference)} instead
+ */
+ @Deprecated
+ public static native Pointer VR_GetGenericInterface(Pointer pchInterfaceVersion, IntByReference peError);
+ /** Original signature : intptr_t VR_GetGenericInterface(const char*, EVRInitError*)
*/
+ public static native Pointer VR_GetGenericInterface(String pchInterfaceVersion, IntBuffer peError);
+ /** Original signature : bool VR_IsRuntimeInstalled()
*/
+ public static native byte VR_IsRuntimeInstalled();
+ /** Original signature : char* VR_GetVRInitErrorAsSymbol(EVRInitError)
*/
+ public static native Pointer VR_GetVRInitErrorAsSymbol(int error);
+ /** Original signature : char* VR_GetVRInitErrorAsEnglishDescription(EVRInitError)
*/
+ public static native Pointer VR_GetVRInitErrorAsEnglishDescription(int error);
+
+ public static String IVRSystem_Version = "FnTable:IVRSystem_012";
+ public static String IVRApplications_Version = "FnTable:IVRApplications_006";
+ public static String IVRSettings_Version = "FnTable:IVRSettings_001";
+ public static String IVRExtendedDisplay_Version = "FnTable:IVRExtendedDisplay_001";
+ public static String IVRChaperone_Version = "FnTable:IVRChaperone_003";
+ public static String IVRChaperoneSetup_Version = "FnTable:IVRChaperoneSetup_005";
+ public static String IVRCompositor_Version = "FnTable:IVRCompositor_016";
+ public static String IVROverlay_Version = "FnTable:IVROverlay_013";
+ public static String IVRRenderModels_Version = "FnTable:IVRRenderModels_005";
+ public static String IVRControlPanel_Version = "FnTable:IVRControlPanel_001";
+ public static String IVRNotifications_Version = "FnTable:IVRNotifications_002";
+ public static String IVRTrackedCamera_Version = "FnTable:IVRTrackedCamera_003";
+ public static String IVRScreenshots_Version = "FnTable:IVRScreenshots_001";
+ public static String IVRResources_Version = "FnTable:IVRResources_001";
+}
diff --git a/jme3-vr/src/main/java/jopenvr/NotificationBitmap_t.java b/jme3-vr/src/main/java/jopenvr/NotificationBitmap_t.java
new file mode 100644
index 000000000..92539ab2d
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/NotificationBitmap_t.java
@@ -0,0 +1,46 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class NotificationBitmap_t extends Structure {
+ /**
+ * void *
+ * C type : void*
+ */
+ public Pointer m_pImageData;
+ public int m_nWidth;
+ public int m_nHeight;
+ public int m_nBytesPerPixel;
+ public NotificationBitmap_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("m_pImageData", "m_nWidth", "m_nHeight", "m_nBytesPerPixel");
+ }
+ /**
+ * @param m_pImageData void *
+ * C type : void*
+ */
+ public NotificationBitmap_t(Pointer m_pImageData, int m_nWidth, int m_nHeight, int m_nBytesPerPixel) {
+ super();
+ this.m_pImageData = m_pImageData;
+ this.m_nWidth = m_nWidth;
+ this.m_nHeight = m_nHeight;
+ this.m_nBytesPerPixel = m_nBytesPerPixel;
+ }
+ public NotificationBitmap_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends NotificationBitmap_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends NotificationBitmap_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/RenderModel_ComponentState_t.java b/jme3-vr/src/main/java/jopenvr/RenderModel_ComponentState_t.java
new file mode 100644
index 000000000..a6e119d02
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/RenderModel_ComponentState_t.java
@@ -0,0 +1,44 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class RenderModel_ComponentState_t extends Structure {
+ /** C type : HmdMatrix34_t */
+ public HmdMatrix34_t mTrackingToComponentRenderModel;
+ /** C type : HmdMatrix34_t */
+ public HmdMatrix34_t mTrackingToComponentLocal;
+ /** C type : VRComponentProperties */
+ public int uProperties;
+ public RenderModel_ComponentState_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("mTrackingToComponentRenderModel", "mTrackingToComponentLocal", "uProperties");
+ }
+ /**
+ * @param mTrackingToComponentRenderModel C type : HmdMatrix34_t
+ * @param mTrackingToComponentLocal C type : HmdMatrix34_t
+ * @param uProperties C type : VRComponentProperties
+ */
+ public RenderModel_ComponentState_t(HmdMatrix34_t mTrackingToComponentRenderModel, HmdMatrix34_t mTrackingToComponentLocal, int uProperties) {
+ super();
+ this.mTrackingToComponentRenderModel = mTrackingToComponentRenderModel;
+ this.mTrackingToComponentLocal = mTrackingToComponentLocal;
+ this.uProperties = uProperties;
+ }
+ public RenderModel_ComponentState_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends RenderModel_ComponentState_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends RenderModel_ComponentState_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/RenderModel_ControllerMode_State_t.java b/jme3-vr/src/main/java/jopenvr/RenderModel_ControllerMode_State_t.java
new file mode 100644
index 000000000..7f7f3bc6c
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/RenderModel_ControllerMode_State_t.java
@@ -0,0 +1,32 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class RenderModel_ControllerMode_State_t extends Structure {
+ public byte bScrollWheelVisible;
+ public RenderModel_ControllerMode_State_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("bScrollWheelVisible");
+ }
+ public RenderModel_ControllerMode_State_t(byte bScrollWheelVisible) {
+ super();
+ this.bScrollWheelVisible = bScrollWheelVisible;
+ }
+ public RenderModel_ControllerMode_State_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends RenderModel_ControllerMode_State_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends RenderModel_ControllerMode_State_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/RenderModel_TextureMap_t.java b/jme3-vr/src/main/java/jopenvr/RenderModel_TextureMap_t.java
new file mode 100644
index 000000000..382bc5c3c
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/RenderModel_TextureMap_t.java
@@ -0,0 +1,44 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class RenderModel_TextureMap_t extends Structure {
+ public short unWidth;
+ public short unHeight;
+ /**
+ * const uint8_t *
+ * C type : uint8_t*
+ */
+ public Pointer rubTextureMapData;
+ public RenderModel_TextureMap_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("unWidth", "unHeight", "rubTextureMapData");
+ }
+ /**
+ * @param rubTextureMapData const uint8_t *
+ * C type : uint8_t*
+ */
+ public RenderModel_TextureMap_t(short unWidth, short unHeight, Pointer rubTextureMapData) {
+ super();
+ this.unWidth = unWidth;
+ this.unHeight = unHeight;
+ this.rubTextureMapData = rubTextureMapData;
+ }
+ public RenderModel_TextureMap_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends RenderModel_TextureMap_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends RenderModel_TextureMap_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/RenderModel_Vertex_t.java b/jme3-vr/src/main/java/jopenvr/RenderModel_Vertex_t.java
new file mode 100644
index 000000000..f38b36baf
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/RenderModel_Vertex_t.java
@@ -0,0 +1,50 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class RenderModel_Vertex_t extends Structure {
+ /** C type : HmdVector3_t */
+ public HmdVector3_t vPosition;
+ /** C type : HmdVector3_t */
+ public HmdVector3_t vNormal;
+ /**
+ * float[2]
+ * C type : float[2]
+ */
+ public float[] rfTextureCoord = new float[2];
+ public RenderModel_Vertex_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("vPosition", "vNormal", "rfTextureCoord");
+ }
+ /**
+ * @param vPosition C type : HmdVector3_t
+ * @param vNormal C type : HmdVector3_t
+ * @param rfTextureCoord float[2]
+ * C type : float[2]
+ */
+ public RenderModel_Vertex_t(HmdVector3_t vPosition, HmdVector3_t vNormal, float rfTextureCoord[]) {
+ super();
+ this.vPosition = vPosition;
+ this.vNormal = vNormal;
+ if ((rfTextureCoord.length != this.rfTextureCoord.length))
+ throw new IllegalArgumentException("Wrong array size !");
+ this.rfTextureCoord = rfTextureCoord;
+ }
+ public RenderModel_Vertex_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends RenderModel_Vertex_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends RenderModel_Vertex_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/RenderModel_t.java b/jme3-vr/src/main/java/jopenvr/RenderModel_t.java
new file mode 100644
index 000000000..542c01912
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/RenderModel_t.java
@@ -0,0 +1,57 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import com.sun.jna.ptr.ShortByReference;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class RenderModel_t extends Structure {
+ /**
+ * const struct vr::RenderModel_Vertex_t *
+ * C type : RenderModel_Vertex_t*
+ */
+ public jopenvr.RenderModel_Vertex_t.ByReference rVertexData;
+ public int unVertexCount;
+ /**
+ * const uint16_t *
+ * C type : uint16_t*
+ */
+ public ShortByReference rIndexData;
+ public int unTriangleCount;
+ /** C type : TextureID_t */
+ public int diffuseTextureId;
+ public RenderModel_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("rVertexData", "unVertexCount", "rIndexData", "unTriangleCount", "diffuseTextureId");
+ }
+ /**
+ * @param rVertexData const struct vr::RenderModel_Vertex_t *
+ * C type : RenderModel_Vertex_t*
+ * @param rIndexData const uint16_t *
+ * C type : uint16_t*
+ * @param diffuseTextureId C type : TextureID_t
+ */
+ public RenderModel_t(jopenvr.RenderModel_Vertex_t.ByReference rVertexData, int unVertexCount, ShortByReference rIndexData, int unTriangleCount, int diffuseTextureId) {
+ super();
+ this.rVertexData = rVertexData;
+ this.unVertexCount = unVertexCount;
+ this.rIndexData = rIndexData;
+ this.unTriangleCount = unTriangleCount;
+ this.diffuseTextureId = diffuseTextureId;
+ }
+ public RenderModel_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends RenderModel_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends RenderModel_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/Texture_t.java b/jme3-vr/src/main/java/jopenvr/Texture_t.java
new file mode 100644
index 000000000..7cf88971c
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/Texture_t.java
@@ -0,0 +1,56 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class Texture_t extends Structure {
+ /**
+ * void *
+ * C type : void*
+ */
+ public int handle;
+ /**
+ * @see EGraphicsAPIConvention
+ * C type : EGraphicsAPIConvention
+ */
+ public int eType;
+ /**
+ * @see EColorSpace
+ * C type : EColorSpace
+ */
+ public int eColorSpace;
+ public Texture_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("handle", "eType", "eColorSpace");
+ }
+ /**
+ * @param handle void *
+ * C type : void*
+ * @param eType @see EGraphicsAPIConvention
+ * C type : EGraphicsAPIConvention
+ * @param eColorSpace @see EColorSpace
+ * C type : EColorSpace
+ */
+ public Texture_t(int handle, int eType, int eColorSpace) {
+ super();
+ this.handle = handle;
+ this.eType = eType;
+ this.eColorSpace = eColorSpace;
+ }
+ public Texture_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends Texture_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends Texture_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/TrackedDevicePose_t.java b/jme3-vr/src/main/java/jopenvr/TrackedDevicePose_t.java
new file mode 100644
index 000000000..26d4982a0
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/TrackedDevicePose_t.java
@@ -0,0 +1,56 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class TrackedDevicePose_t extends Structure {
+ /** C type : HmdMatrix34_t */
+ public HmdMatrix34_t mDeviceToAbsoluteTracking;
+ /** C type : HmdVector3_t */
+ public HmdVector3_t vVelocity;
+ /** C type : HmdVector3_t */
+ public HmdVector3_t vAngularVelocity;
+ /**
+ * @see ETrackingResult
+ * C type : ETrackingResult
+ */
+ public int eTrackingResult;
+ public byte bPoseIsValid;
+ public byte bDeviceIsConnected;
+ public TrackedDevicePose_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("mDeviceToAbsoluteTracking", "vVelocity", "vAngularVelocity", "eTrackingResult", "bPoseIsValid", "bDeviceIsConnected");
+ }
+ /**
+ * @param mDeviceToAbsoluteTracking C type : HmdMatrix34_t
+ * @param vVelocity C type : HmdVector3_t
+ * @param vAngularVelocity C type : HmdVector3_t
+ * @param eTrackingResult @see ETrackingResult
+ * C type : ETrackingResult
+ */
+ public TrackedDevicePose_t(HmdMatrix34_t mDeviceToAbsoluteTracking, HmdVector3_t vVelocity, HmdVector3_t vAngularVelocity, int eTrackingResult, byte bPoseIsValid, byte bDeviceIsConnected) {
+ super();
+ this.mDeviceToAbsoluteTracking = mDeviceToAbsoluteTracking;
+ this.vVelocity = vVelocity;
+ this.vAngularVelocity = vAngularVelocity;
+ this.eTrackingResult = eTrackingResult;
+ this.bPoseIsValid = bPoseIsValid;
+ this.bDeviceIsConnected = bDeviceIsConnected;
+ }
+ public TrackedDevicePose_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends TrackedDevicePose_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends TrackedDevicePose_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/VRControllerAxis_t.java b/jme3-vr/src/main/java/jopenvr/VRControllerAxis_t.java
new file mode 100644
index 000000000..430e50f87
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/VRControllerAxis_t.java
@@ -0,0 +1,34 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class VRControllerAxis_t extends Structure {
+ public float x;
+ public float y;
+ public VRControllerAxis_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("x", "y");
+ }
+ public VRControllerAxis_t(float x, float y) {
+ super();
+ this.x = x;
+ this.y = y;
+ }
+ public VRControllerAxis_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends VRControllerAxis_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends VRControllerAxis_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/VRControllerState_t.java b/jme3-vr/src/main/java/jopenvr/VRControllerState_t.java
new file mode 100644
index 000000000..8a8e25f37
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/VRControllerState_t.java
@@ -0,0 +1,95 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * Holds all the state of a controller at one moment in time (see IVRSystem::GetControllerState ).
+ *
+ *
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class VRControllerState_t extends Structure {
+
+ /**
+ * If packet num matches that on your prior call,
+ * then the controller state hasn't been changed since your last call and there is no need to process it.
+ */
+ public int unPacketNum;
+
+ /**
+ * Bit flags for each of the buttons. Use ButtonMaskFromId to turn an ID into a mask.
+ */
+ public long ulButtonPressed;
+
+ /**
+ * Bit flags for each of the buttons. Use ButtonMaskFromId to turn an ID into a mask
+ */
+ public long ulButtonTouched;
+
+ /**
+ * Axis data for the controller's analog inputs.
+ */
+ public VRControllerAxis_t[] rAxis = new VRControllerAxis_t[5];
+
+
+ /**
+ * Create a new VR controller state.
+ */
+ public VRControllerState_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("unPacketNum", "ulButtonPressed", "ulButtonTouched", "rAxis");
+ }
+
+ /**
+ * Create a new VR controller state.
+ * @param unPacketNum if packet num matches that on your prior call, then the controller state hasn't been changed since your last call and there is no need to process it.
+ * @param ulButtonPressed bit flags for each of the buttons. Use ButtonMaskFromId to turn an ID into a mask
+ * @param ulButtonTouched bit flags for each of the buttons. Use ButtonMaskFromId to turn an ID into a mask
+ * @param rAxis axis data for the controller's analog inputs.
+ */
+ public VRControllerState_t(int unPacketNum, long ulButtonPressed, long ulButtonTouched, VRControllerAxis_t rAxis[]) {
+ super();
+ this.unPacketNum = unPacketNum;
+ this.ulButtonPressed = ulButtonPressed;
+ this.ulButtonTouched = ulButtonTouched;
+ if ((rAxis.length != this.rAxis.length))
+ throw new IllegalArgumentException("Wrong array size !");
+ this.rAxis = rAxis;
+ }
+
+ /**
+ * Create a new VR controller state.
+ * @param peer the pointer to the native structure.
+ */
+ public VRControllerState_t(Pointer peer) {
+ super(peer);
+ }
+
+ /**
+ * JNA specific type.
+ *
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+ public static class ByReference extends VRControllerState_t implements Structure.ByReference {
+
+ };
+
+ /**
+ * JNA specific type.
+ *
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ *
+ */
+ public static class ByValue extends VRControllerState_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/VREvent_ApplicationLaunch_t.java b/jme3-vr/src/main/java/jopenvr/VREvent_ApplicationLaunch_t.java
new file mode 100644
index 000000000..dd9785421
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/VREvent_ApplicationLaunch_t.java
@@ -0,0 +1,34 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class VREvent_ApplicationLaunch_t extends Structure {
+ public int pid;
+ public int unArgsHandle;
+ public VREvent_ApplicationLaunch_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("pid", "unArgsHandle");
+ }
+ public VREvent_ApplicationLaunch_t(int pid, int unArgsHandle) {
+ super();
+ this.pid = pid;
+ this.unArgsHandle = unArgsHandle;
+ }
+ public VREvent_ApplicationLaunch_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends VREvent_ApplicationLaunch_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends VREvent_ApplicationLaunch_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/VREvent_Chaperone_t.java b/jme3-vr/src/main/java/jopenvr/VREvent_Chaperone_t.java
new file mode 100644
index 000000000..82173a618
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/VREvent_Chaperone_t.java
@@ -0,0 +1,34 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class VREvent_Chaperone_t extends Structure {
+ public long m_nPreviousUniverse;
+ public long m_nCurrentUniverse;
+ public VREvent_Chaperone_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("m_nPreviousUniverse", "m_nCurrentUniverse");
+ }
+ public VREvent_Chaperone_t(long m_nPreviousUniverse, long m_nCurrentUniverse) {
+ super();
+ this.m_nPreviousUniverse = m_nPreviousUniverse;
+ this.m_nCurrentUniverse = m_nCurrentUniverse;
+ }
+ public VREvent_Chaperone_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends VREvent_Chaperone_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends VREvent_Chaperone_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/VREvent_Controller_t.java b/jme3-vr/src/main/java/jopenvr/VREvent_Controller_t.java
new file mode 100644
index 000000000..28a9d80b1
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/VREvent_Controller_t.java
@@ -0,0 +1,32 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class VREvent_Controller_t extends Structure {
+ public int button;
+ public VREvent_Controller_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("button");
+ }
+ public VREvent_Controller_t(int button) {
+ super();
+ this.button = button;
+ }
+ public VREvent_Controller_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends VREvent_Controller_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends VREvent_Controller_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/VREvent_Data_t.java b/jme3-vr/src/main/java/jopenvr/VREvent_Data_t.java
new file mode 100644
index 000000000..c798ebdbc
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/VREvent_Data_t.java
@@ -0,0 +1,134 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Union;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class VREvent_Data_t extends Union {
+ /** C type : VREvent_Reserved_t */
+ public VREvent_Reserved_t reserved;
+ /** C type : VREvent_Controller_t */
+ public VREvent_Controller_t controller;
+ /** C type : VREvent_Mouse_t */
+ public VREvent_Mouse_t mouse;
+ /** C type : VREvent_Scroll_t */
+ public VREvent_Scroll_t scroll;
+ /** C type : VREvent_Process_t */
+ public VREvent_Process_t process;
+ /** C type : VREvent_Notification_t */
+ public VREvent_Notification_t notification;
+ /** C type : VREvent_Overlay_t */
+ public VREvent_Overlay_t overlay;
+ /** C type : VREvent_Status_t */
+ public VREvent_Status_t status;
+ /** C type : VREvent_Keyboard_t */
+ public VREvent_Keyboard_t keyboard;
+ /** C type : VREvent_Ipd_t */
+ public VREvent_Ipd_t ipd;
+ /** C type : VREvent_Chaperone_t */
+ public VREvent_Chaperone_t chaperone;
+ /** C type : VREvent_PerformanceTest_t */
+ public VREvent_PerformanceTest_t performanceTest;
+ /** C type : VREvent_TouchPadMove_t */
+ public VREvent_TouchPadMove_t touchPadMove;
+ /** C type : VREvent_SeatedZeroPoseReset_t */
+ public VREvent_SeatedZeroPoseReset_t seatedZeroPoseReset;
+ public VREvent_Data_t() {
+ super();
+ }
+ /** @param reserved C type : VREvent_Reserved_t */
+ public VREvent_Data_t(VREvent_Reserved_t reserved) {
+ super();
+ this.reserved = reserved;
+ setType(VREvent_Reserved_t.class);
+ }
+ /** @param controller C type : VREvent_Controller_t */
+ public VREvent_Data_t(VREvent_Controller_t controller) {
+ super();
+ this.controller = controller;
+ setType(VREvent_Controller_t.class);
+ }
+ /** @param mouse C type : VREvent_Mouse_t */
+ public VREvent_Data_t(VREvent_Mouse_t mouse) {
+ super();
+ this.mouse = mouse;
+ setType(VREvent_Mouse_t.class);
+ }
+ /** @param scroll C type : VREvent_Scroll_t */
+ public VREvent_Data_t(VREvent_Scroll_t scroll) {
+ super();
+ this.scroll = scroll;
+ setType(VREvent_Scroll_t.class);
+ }
+ /** @param process C type : VREvent_Process_t */
+ public VREvent_Data_t(VREvent_Process_t process) {
+ super();
+ this.process = process;
+ setType(VREvent_Process_t.class);
+ }
+ /** @param notification C type : VREvent_Notification_t */
+ public VREvent_Data_t(VREvent_Notification_t notification) {
+ super();
+ this.notification = notification;
+ setType(VREvent_Notification_t.class);
+ }
+ /** @param overlay C type : VREvent_Overlay_t */
+ public VREvent_Data_t(VREvent_Overlay_t overlay) {
+ super();
+ this.overlay = overlay;
+ setType(VREvent_Overlay_t.class);
+ }
+ /** @param status C type : VREvent_Status_t */
+ public VREvent_Data_t(VREvent_Status_t status) {
+ super();
+ this.status = status;
+ setType(VREvent_Status_t.class);
+ }
+ /** @param keyboard C type : VREvent_Keyboard_t */
+ public VREvent_Data_t(VREvent_Keyboard_t keyboard) {
+ super();
+ this.keyboard = keyboard;
+ setType(VREvent_Keyboard_t.class);
+ }
+ /** @param ipd C type : VREvent_Ipd_t */
+ public VREvent_Data_t(VREvent_Ipd_t ipd) {
+ super();
+ this.ipd = ipd;
+ setType(VREvent_Ipd_t.class);
+ }
+ /** @param chaperone C type : VREvent_Chaperone_t */
+ public VREvent_Data_t(VREvent_Chaperone_t chaperone) {
+ super();
+ this.chaperone = chaperone;
+ setType(VREvent_Chaperone_t.class);
+ }
+ /** @param performanceTest C type : VREvent_PerformanceTest_t */
+ public VREvent_Data_t(VREvent_PerformanceTest_t performanceTest) {
+ super();
+ this.performanceTest = performanceTest;
+ setType(VREvent_PerformanceTest_t.class);
+ }
+ /** @param touchPadMove C type : VREvent_TouchPadMove_t */
+ public VREvent_Data_t(VREvent_TouchPadMove_t touchPadMove) {
+ super();
+ this.touchPadMove = touchPadMove;
+ setType(VREvent_TouchPadMove_t.class);
+ }
+ /** @param seatedZeroPoseReset C type : VREvent_SeatedZeroPoseReset_t */
+ public VREvent_Data_t(VREvent_SeatedZeroPoseReset_t seatedZeroPoseReset) {
+ super();
+ this.seatedZeroPoseReset = seatedZeroPoseReset;
+ setType(VREvent_SeatedZeroPoseReset_t.class);
+ }
+ public VREvent_Data_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends VREvent_Data_t implements com.sun.jna.Structure.ByReference {
+
+ };
+ public static class ByValue extends VREvent_Data_t implements com.sun.jna.Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/VREvent_Ipd_t.java b/jme3-vr/src/main/java/jopenvr/VREvent_Ipd_t.java
new file mode 100644
index 000000000..b156ad316
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/VREvent_Ipd_t.java
@@ -0,0 +1,32 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class VREvent_Ipd_t extends Structure {
+ public float ipdMeters;
+ public VREvent_Ipd_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("ipdMeters");
+ }
+ public VREvent_Ipd_t(float ipdMeters) {
+ super();
+ this.ipdMeters = ipdMeters;
+ }
+ public VREvent_Ipd_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends VREvent_Ipd_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends VREvent_Ipd_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/VREvent_Keyboard_t.java b/jme3-vr/src/main/java/jopenvr/VREvent_Keyboard_t.java
new file mode 100644
index 000000000..5a6524097
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/VREvent_Keyboard_t.java
@@ -0,0 +1,44 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class VREvent_Keyboard_t extends Structure {
+ /**
+ * char[8]
+ * C type : char*[8]
+ */
+ public Pointer[] cNewInput = new Pointer[8];
+ public long uUserValue;
+ public VREvent_Keyboard_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("cNewInput", "uUserValue");
+ }
+ /**
+ * @param cNewInput char[8]
+ * C type : char*[8]
+ */
+ public VREvent_Keyboard_t(Pointer cNewInput[], long uUserValue) {
+ super();
+ if ((cNewInput.length != this.cNewInput.length))
+ throw new IllegalArgumentException("Wrong array size !");
+ this.cNewInput = cNewInput;
+ this.uUserValue = uUserValue;
+ }
+ public VREvent_Keyboard_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends VREvent_Keyboard_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends VREvent_Keyboard_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/VREvent_Mouse_t.java b/jme3-vr/src/main/java/jopenvr/VREvent_Mouse_t.java
new file mode 100644
index 000000000..6a828c4a5
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/VREvent_Mouse_t.java
@@ -0,0 +1,36 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class VREvent_Mouse_t extends Structure {
+ public float x;
+ public float y;
+ public int button;
+ public VREvent_Mouse_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("x", "y", "button");
+ }
+ public VREvent_Mouse_t(float x, float y, int button) {
+ super();
+ this.x = x;
+ this.y = y;
+ this.button = button;
+ }
+ public VREvent_Mouse_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends VREvent_Mouse_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends VREvent_Mouse_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/VREvent_Notification_t.java b/jme3-vr/src/main/java/jopenvr/VREvent_Notification_t.java
new file mode 100644
index 000000000..1b742ffd3
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/VREvent_Notification_t.java
@@ -0,0 +1,34 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class VREvent_Notification_t extends Structure {
+ public long ulUserValue;
+ public int notificationId;
+ public VREvent_Notification_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("ulUserValue", "notificationId");
+ }
+ public VREvent_Notification_t(long ulUserValue, int notificationId) {
+ super();
+ this.ulUserValue = ulUserValue;
+ this.notificationId = notificationId;
+ }
+ public VREvent_Notification_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends VREvent_Notification_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends VREvent_Notification_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/VREvent_Overlay_t.java b/jme3-vr/src/main/java/jopenvr/VREvent_Overlay_t.java
new file mode 100644
index 000000000..a6f87c401
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/VREvent_Overlay_t.java
@@ -0,0 +1,32 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class VREvent_Overlay_t extends Structure {
+ public long overlayHandle;
+ public VREvent_Overlay_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("overlayHandle");
+ }
+ public VREvent_Overlay_t(long overlayHandle) {
+ super();
+ this.overlayHandle = overlayHandle;
+ }
+ public VREvent_Overlay_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends VREvent_Overlay_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends VREvent_Overlay_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/VREvent_PerformanceTest_t.java b/jme3-vr/src/main/java/jopenvr/VREvent_PerformanceTest_t.java
new file mode 100644
index 000000000..53a3c3e6e
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/VREvent_PerformanceTest_t.java
@@ -0,0 +1,32 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class VREvent_PerformanceTest_t extends Structure {
+ public int m_nFidelityLevel;
+ public VREvent_PerformanceTest_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("m_nFidelityLevel");
+ }
+ public VREvent_PerformanceTest_t(int m_nFidelityLevel) {
+ super();
+ this.m_nFidelityLevel = m_nFidelityLevel;
+ }
+ public VREvent_PerformanceTest_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends VREvent_PerformanceTest_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends VREvent_PerformanceTest_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/VREvent_Process_t.java b/jme3-vr/src/main/java/jopenvr/VREvent_Process_t.java
new file mode 100644
index 000000000..9ec273b1d
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/VREvent_Process_t.java
@@ -0,0 +1,36 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class VREvent_Process_t extends Structure {
+ public int pid;
+ public int oldPid;
+ public byte bForced;
+ public VREvent_Process_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("pid", "oldPid", "bForced");
+ }
+ public VREvent_Process_t(int pid, int oldPid, byte bForced) {
+ super();
+ this.pid = pid;
+ this.oldPid = oldPid;
+ this.bForced = bForced;
+ }
+ public VREvent_Process_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends VREvent_Process_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends VREvent_Process_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/VREvent_Reserved_t.java b/jme3-vr/src/main/java/jopenvr/VREvent_Reserved_t.java
new file mode 100644
index 000000000..969de7e54
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/VREvent_Reserved_t.java
@@ -0,0 +1,34 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class VREvent_Reserved_t extends Structure {
+ public long reserved0;
+ public long reserved1;
+ public VREvent_Reserved_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("reserved0", "reserved1");
+ }
+ public VREvent_Reserved_t(long reserved0, long reserved1) {
+ super();
+ this.reserved0 = reserved0;
+ this.reserved1 = reserved1;
+ }
+ public VREvent_Reserved_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends VREvent_Reserved_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends VREvent_Reserved_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/VREvent_ScreenshotProgress_t.java b/jme3-vr/src/main/java/jopenvr/VREvent_ScreenshotProgress_t.java
new file mode 100644
index 000000000..b80dd4fd4
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/VREvent_ScreenshotProgress_t.java
@@ -0,0 +1,32 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class VREvent_ScreenshotProgress_t extends Structure {
+ public float progress;
+ public VREvent_ScreenshotProgress_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("progress");
+ }
+ public VREvent_ScreenshotProgress_t(float progress) {
+ super();
+ this.progress = progress;
+ }
+ public VREvent_ScreenshotProgress_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends VREvent_ScreenshotProgress_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends VREvent_ScreenshotProgress_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/VREvent_Screenshot_t.java b/jme3-vr/src/main/java/jopenvr/VREvent_Screenshot_t.java
new file mode 100644
index 000000000..9f0ac401a
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/VREvent_Screenshot_t.java
@@ -0,0 +1,34 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class VREvent_Screenshot_t extends Structure {
+ public int handle;
+ public int type;
+ public VREvent_Screenshot_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("handle", "type");
+ }
+ public VREvent_Screenshot_t(int handle, int type) {
+ super();
+ this.handle = handle;
+ this.type = type;
+ }
+ public VREvent_Screenshot_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends VREvent_Screenshot_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends VREvent_Screenshot_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/VREvent_Scroll_t.java b/jme3-vr/src/main/java/jopenvr/VREvent_Scroll_t.java
new file mode 100644
index 000000000..085596999
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/VREvent_Scroll_t.java
@@ -0,0 +1,36 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class VREvent_Scroll_t extends Structure {
+ public float xdelta;
+ public float ydelta;
+ public int repeatCount;
+ public VREvent_Scroll_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("xdelta", "ydelta", "repeatCount");
+ }
+ public VREvent_Scroll_t(float xdelta, float ydelta, int repeatCount) {
+ super();
+ this.xdelta = xdelta;
+ this.ydelta = ydelta;
+ this.repeatCount = repeatCount;
+ }
+ public VREvent_Scroll_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends VREvent_Scroll_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends VREvent_Scroll_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/VREvent_SeatedZeroPoseReset_t.java b/jme3-vr/src/main/java/jopenvr/VREvent_SeatedZeroPoseReset_t.java
new file mode 100644
index 000000000..9978bd346
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/VREvent_SeatedZeroPoseReset_t.java
@@ -0,0 +1,32 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class VREvent_SeatedZeroPoseReset_t extends Structure {
+ public byte bResetBySystemMenu;
+ public VREvent_SeatedZeroPoseReset_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("bResetBySystemMenu");
+ }
+ public VREvent_SeatedZeroPoseReset_t(byte bResetBySystemMenu) {
+ super();
+ this.bResetBySystemMenu = bResetBySystemMenu;
+ }
+ public VREvent_SeatedZeroPoseReset_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends VREvent_SeatedZeroPoseReset_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends VREvent_SeatedZeroPoseReset_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/VREvent_Status_t.java b/jme3-vr/src/main/java/jopenvr/VREvent_Status_t.java
new file mode 100644
index 000000000..b580b0d61
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/VREvent_Status_t.java
@@ -0,0 +1,32 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class VREvent_Status_t extends Structure {
+ public int statusState;
+ public VREvent_Status_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("statusState");
+ }
+ public VREvent_Status_t(int statusState) {
+ super();
+ this.statusState = statusState;
+ }
+ public VREvent_Status_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends VREvent_Status_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends VREvent_Status_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/VREvent_TouchPadMove_t.java b/jme3-vr/src/main/java/jopenvr/VREvent_TouchPadMove_t.java
new file mode 100644
index 000000000..ea673e56e
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/VREvent_TouchPadMove_t.java
@@ -0,0 +1,42 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class VREvent_TouchPadMove_t extends Structure {
+ public byte bFingerDown;
+ public float flSecondsFingerDown;
+ public float fValueXFirst;
+ public float fValueYFirst;
+ public float fValueXRaw;
+ public float fValueYRaw;
+ public VREvent_TouchPadMove_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("bFingerDown", "flSecondsFingerDown", "fValueXFirst", "fValueYFirst", "fValueXRaw", "fValueYRaw");
+ }
+ public VREvent_TouchPadMove_t(byte bFingerDown, float flSecondsFingerDown, float fValueXFirst, float fValueYFirst, float fValueXRaw, float fValueYRaw) {
+ super();
+ this.bFingerDown = bFingerDown;
+ this.flSecondsFingerDown = flSecondsFingerDown;
+ this.fValueXFirst = fValueXFirst;
+ this.fValueYFirst = fValueYFirst;
+ this.fValueXRaw = fValueXRaw;
+ this.fValueYRaw = fValueYRaw;
+ }
+ public VREvent_TouchPadMove_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends VREvent_TouchPadMove_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends VREvent_TouchPadMove_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/VREvent_t.java b/jme3-vr/src/main/java/jopenvr/VREvent_t.java
new file mode 100644
index 000000000..4c69e5f42
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/VREvent_t.java
@@ -0,0 +1,47 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * An event posted by the server to all running applications
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class VREvent_t extends Structure {
+ /** EVREventType enum */
+ public int eventType;
+ /** C type : TrackedDeviceIndex_t */
+ public int trackedDeviceIndex;
+ public float eventAgeSeconds;
+ /** C type : VREvent_Data_t */
+ public VREvent_Data_t data;
+ public VREvent_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("eventType", "trackedDeviceIndex", "eventAgeSeconds", "data");
+ }
+ /**
+ * @param eventType EVREventType enum
+ * @param trackedDeviceIndex C type : TrackedDeviceIndex_t
+ * @param data C type : VREvent_Data_t
+ */
+ public VREvent_t(int eventType, int trackedDeviceIndex, float eventAgeSeconds, VREvent_Data_t data) {
+ super();
+ this.eventType = eventType;
+ this.trackedDeviceIndex = trackedDeviceIndex;
+ this.eventAgeSeconds = eventAgeSeconds;
+ this.data = data;
+ }
+ public VREvent_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends VREvent_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends VREvent_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/VROverlayIntersectionParams_t.java b/jme3-vr/src/main/java/jopenvr/VROverlayIntersectionParams_t.java
new file mode 100644
index 000000000..d6d0ff83d
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/VROverlayIntersectionParams_t.java
@@ -0,0 +1,48 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class VROverlayIntersectionParams_t extends Structure {
+ /** C type : HmdVector3_t */
+ public HmdVector3_t vSource;
+ /** C type : HmdVector3_t */
+ public HmdVector3_t vDirection;
+ /**
+ * @see ETrackingUniverseOrigin
+ * C type : ETrackingUniverseOrigin
+ */
+ public int eOrigin;
+ public VROverlayIntersectionParams_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("vSource", "vDirection", "eOrigin");
+ }
+ /**
+ * @param vSource C type : HmdVector3_t
+ * @param vDirection C type : HmdVector3_t
+ * @param eOrigin @see ETrackingUniverseOrigin
+ * C type : ETrackingUniverseOrigin
+ */
+ public VROverlayIntersectionParams_t(HmdVector3_t vSource, HmdVector3_t vDirection, int eOrigin) {
+ super();
+ this.vSource = vSource;
+ this.vDirection = vDirection;
+ this.eOrigin = eOrigin;
+ }
+ public VROverlayIntersectionParams_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends VROverlayIntersectionParams_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends VROverlayIntersectionParams_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/VROverlayIntersectionResults_t.java b/jme3-vr/src/main/java/jopenvr/VROverlayIntersectionResults_t.java
new file mode 100644
index 000000000..2fa8f3077
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/VROverlayIntersectionResults_t.java
@@ -0,0 +1,46 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class VROverlayIntersectionResults_t extends Structure {
+ /** C type : HmdVector3_t */
+ public HmdVector3_t vPoint;
+ /** C type : HmdVector3_t */
+ public HmdVector3_t vNormal;
+ /** C type : HmdVector2_t */
+ public HmdVector2_t vUVs;
+ public float fDistance;
+ public VROverlayIntersectionResults_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("vPoint", "vNormal", "vUVs", "fDistance");
+ }
+ /**
+ * @param vPoint C type : HmdVector3_t
+ * @param vNormal C type : HmdVector3_t
+ * @param vUVs C type : HmdVector2_t
+ */
+ public VROverlayIntersectionResults_t(HmdVector3_t vPoint, HmdVector3_t vNormal, HmdVector2_t vUVs, float fDistance) {
+ super();
+ this.vPoint = vPoint;
+ this.vNormal = vNormal;
+ this.vUVs = vUVs;
+ this.fDistance = fDistance;
+ }
+ public VROverlayIntersectionResults_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends VROverlayIntersectionResults_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends VROverlayIntersectionResults_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/VRTextureBounds_t.java b/jme3-vr/src/main/java/jopenvr/VRTextureBounds_t.java
new file mode 100644
index 000000000..d50186d83
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/VRTextureBounds_t.java
@@ -0,0 +1,38 @@
+package jopenvr;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class VRTextureBounds_t extends Structure {
+ public float uMin;
+ public float vMin;
+ public float uMax;
+ public float vMax;
+ public VRTextureBounds_t() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("uMin", "vMin", "uMax", "vMax");
+ }
+ public VRTextureBounds_t(float uMin, float vMin, float uMax, float vMax) {
+ super();
+ this.uMin = uMin;
+ this.vMin = vMin;
+ this.uMax = uMax;
+ this.vMax = vMax;
+ }
+ public VRTextureBounds_t(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends VRTextureBounds_t implements Structure.ByReference {
+
+ };
+ public static class ByValue extends VRTextureBounds_t implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/VR_IVRApplications_FnTable.java b/jme3-vr/src/main/java/jopenvr/VR_IVRApplications_FnTable.java
new file mode 100644
index 000000000..de1d65f0c
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/VR_IVRApplications_FnTable.java
@@ -0,0 +1,175 @@
+package jopenvr;
+import com.sun.jna.Callback;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import com.sun.jna.ptr.IntByReference;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class VR_IVRApplications_FnTable extends Structure {
+ /** C type : AddApplicationManifest_callback* */
+ public VR_IVRApplications_FnTable.AddApplicationManifest_callback AddApplicationManifest;
+ /** C type : RemoveApplicationManifest_callback* */
+ public VR_IVRApplications_FnTable.RemoveApplicationManifest_callback RemoveApplicationManifest;
+ /** C type : IsApplicationInstalled_callback* */
+ public VR_IVRApplications_FnTable.IsApplicationInstalled_callback IsApplicationInstalled;
+ /** C type : GetApplicationCount_callback* */
+ public VR_IVRApplications_FnTable.GetApplicationCount_callback GetApplicationCount;
+ /** C type : GetApplicationKeyByIndex_callback* */
+ public VR_IVRApplications_FnTable.GetApplicationKeyByIndex_callback GetApplicationKeyByIndex;
+ /** C type : GetApplicationKeyByProcessId_callback* */
+ public VR_IVRApplications_FnTable.GetApplicationKeyByProcessId_callback GetApplicationKeyByProcessId;
+ /** C type : LaunchApplication_callback* */
+ public VR_IVRApplications_FnTable.LaunchApplication_callback LaunchApplication;
+ /** C type : LaunchDashboardOverlay_callback* */
+ public VR_IVRApplications_FnTable.LaunchTemplateApplication_callback LaunchTemplateApplication;
+ public VR_IVRApplications_FnTable.LaunchApplicationFromMimeType_callback LaunchApplicationFromMimeType;
+ public VR_IVRApplications_FnTable.LaunchDashboardOverlay_callback LaunchDashboardOverlay;
+ /** C type : CancelApplicationLaunch_callback* */
+ public VR_IVRApplications_FnTable.CancelApplicationLaunch_callback CancelApplicationLaunch;
+ /** C type : IdentifyApplication_callback* */
+ public VR_IVRApplications_FnTable.IdentifyApplication_callback IdentifyApplication;
+ /** C type : GetApplicationProcessId_callback* */
+ public VR_IVRApplications_FnTable.GetApplicationProcessId_callback GetApplicationProcessId;
+ /** C type : GetApplicationsErrorNameFromEnum_callback* */
+ public VR_IVRApplications_FnTable.GetApplicationsErrorNameFromEnum_callback GetApplicationsErrorNameFromEnum;
+ /** C type : GetApplicationPropertyString_callback* */
+ public VR_IVRApplications_FnTable.GetApplicationPropertyString_callback GetApplicationPropertyString;
+ /** C type : GetApplicationPropertyBool_callback* */
+ public VR_IVRApplications_FnTable.GetApplicationPropertyBool_callback GetApplicationPropertyBool;
+ /** C type : GetApplicationPropertyUint64_callback* */
+ public VR_IVRApplications_FnTable.GetApplicationPropertyUint64_callback GetApplicationPropertyUint64;
+ /** C type : SetApplicationAutoLaunch_callback* */
+ public VR_IVRApplications_FnTable.SetApplicationAutoLaunch_callback SetApplicationAutoLaunch;
+ /** C type : GetApplicationAutoLaunch_callback* */
+ public VR_IVRApplications_FnTable.GetApplicationAutoLaunch_callback GetApplicationAutoLaunch;
+ public VR_IVRApplications_FnTable.SetDefaultApplicationForMimeType_callback SetDefaultApplicationForMimeType;
+ /** C type : GetDefaultApplicationForMimeType_callback* */
+ public VR_IVRApplications_FnTable.GetDefaultApplicationForMimeType_callback GetDefaultApplicationForMimeType;
+ /** C type : GetApplicationSupportedMimeTypes_callback* */
+ public VR_IVRApplications_FnTable.GetApplicationSupportedMimeTypes_callback GetApplicationSupportedMimeTypes;
+ /** C type : GetApplicationsThatSupportMimeType_callback* */
+ public VR_IVRApplications_FnTable.GetApplicationsThatSupportMimeType_callback GetApplicationsThatSupportMimeType;
+ /** C type : GetApplicationLaunchArguments_callback* */
+ public VR_IVRApplications_FnTable.GetApplicationLaunchArguments_callback GetApplicationLaunchArguments;
+ /** C type : GetStartingApplication_callback* */
+ public VR_IVRApplications_FnTable.GetStartingApplication_callback GetStartingApplication;
+ /** C type : GetTransitionState_callback* */
+ public VR_IVRApplications_FnTable.GetTransitionState_callback GetTransitionState;
+ /** C type : PerformApplicationPrelaunchCheck_callback* */
+ public VR_IVRApplications_FnTable.PerformApplicationPrelaunchCheck_callback PerformApplicationPrelaunchCheck;
+ /** C type : GetApplicationsTransitionStateNameFromEnum_callback* */
+ public VR_IVRApplications_FnTable.GetApplicationsTransitionStateNameFromEnum_callback GetApplicationsTransitionStateNameFromEnum;
+ /** C type : IsQuitUserPromptRequested_callback* */
+ public VR_IVRApplications_FnTable.IsQuitUserPromptRequested_callback IsQuitUserPromptRequested;
+ public VR_IVRApplications_FnTable.LaunchInternalProcess_callback LaunchInternalProcess;
+ public interface AddApplicationManifest_callback extends Callback {
+ int apply(Pointer pchApplicationManifestFullPath, byte bTemporary);
+ };
+ public interface RemoveApplicationManifest_callback extends Callback {
+ int apply(Pointer pchApplicationManifestFullPath);
+ };
+ public interface IsApplicationInstalled_callback extends Callback {
+ byte apply(Pointer pchAppKey);
+ };
+ public interface GetApplicationCount_callback extends Callback {
+ int apply();
+ };
+ public interface GetApplicationKeyByIndex_callback extends Callback {
+ int apply(int unApplicationIndex, Pointer pchAppKeyBuffer, int unAppKeyBufferLen);
+ };
+ public interface GetApplicationKeyByProcessId_callback extends Callback {
+ int apply(int unProcessId, Pointer pchAppKeyBuffer, int unAppKeyBufferLen);
+ };
+ public interface LaunchApplication_callback extends Callback {
+ int apply(Pointer pchAppKey);
+ };
+ public interface LaunchTemplateApplication_callback extends Callback {
+ int apply(Pointer pchTemplateAppKey, Pointer pchNewAppKey, AppOverrideKeys_t pKeys, int unKeys);
+ };
+ public interface LaunchApplicationFromMimeType_callback extends Callback {
+ int apply(Pointer pchMimeType, Pointer pchArgs);
+ };
+ public interface LaunchDashboardOverlay_callback extends Callback {
+ int apply(Pointer pchAppKey);
+ };
+ public interface CancelApplicationLaunch_callback extends Callback {
+ byte apply(Pointer pchAppKey);
+ };
+ public interface IdentifyApplication_callback extends Callback {
+ int apply(int unProcessId, Pointer pchAppKey);
+ };
+ public interface GetApplicationProcessId_callback extends Callback {
+ int apply(Pointer pchAppKey);
+ };
+ public interface GetApplicationsErrorNameFromEnum_callback extends Callback {
+ Pointer apply(int error);
+ };
+ public interface GetApplicationPropertyString_callback extends Callback {
+ int apply(Pointer pchAppKey, int eProperty, Pointer pchPropertyValueBuffer, int unPropertyValueBufferLen, IntByReference peError);
+ };
+ public interface GetApplicationPropertyBool_callback extends Callback {
+ byte apply(Pointer pchAppKey, int eProperty, IntByReference peError);
+ };
+ public interface GetApplicationPropertyUint64_callback extends Callback {
+ long apply(Pointer pchAppKey, int eProperty, IntByReference peError);
+ };
+ public interface SetApplicationAutoLaunch_callback extends Callback {
+ int apply(Pointer pchAppKey, byte bAutoLaunch);
+ };
+ public interface GetApplicationAutoLaunch_callback extends Callback {
+ byte apply(Pointer pchAppKey);
+ };
+ public interface SetDefaultApplicationForMimeType_callback extends Callback {
+ int apply(Pointer pchAppKey, Pointer pchMimeType);
+ };
+ public interface GetDefaultApplicationForMimeType_callback extends Callback {
+ byte apply(Pointer pchMimeType, Pointer pchAppKeyBuffer, int unAppKeyBufferLen);
+ };
+ public interface GetApplicationSupportedMimeTypes_callback extends Callback {
+ byte apply(Pointer pchAppKey, Pointer pchMimeTypesBuffer, int unMimeTypesBuffer);
+ };
+ public interface GetApplicationsThatSupportMimeType_callback extends Callback {
+ int apply(Pointer pchMimeType, Pointer pchAppKeysThatSupportBuffer, int unAppKeysThatSupportBuffer);
+ };
+ public interface GetApplicationLaunchArguments_callback extends Callback {
+ int apply(int unHandle, Pointer pchArgs, int unArgs);
+ };
+ public interface GetStartingApplication_callback extends Callback {
+ int apply(Pointer pchAppKeyBuffer, int unAppKeyBufferLen);
+ };
+ public interface GetTransitionState_callback extends Callback {
+ int apply();
+ };
+ public interface PerformApplicationPrelaunchCheck_callback extends Callback {
+ int apply(Pointer pchAppKey);
+ };
+ public interface GetApplicationsTransitionStateNameFromEnum_callback extends Callback {
+ Pointer apply(int state);
+ };
+ public interface IsQuitUserPromptRequested_callback extends Callback {
+ byte apply();
+ };
+ public interface LaunchInternalProcess_callback extends Callback {
+ int apply(Pointer pchBinaryPath, Pointer pchArguments, Pointer pchWorkingDirectory);
+ };
+ public VR_IVRApplications_FnTable() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("AddApplicationManifest", "RemoveApplicationManifest", "IsApplicationInstalled", "GetApplicationCount", "GetApplicationKeyByIndex", "GetApplicationKeyByProcessId", "LaunchApplication", "LaunchTemplateApplication", "LaunchApplicationFromMimeType", "LaunchDashboardOverlay", "CancelApplicationLaunch", "IdentifyApplication", "GetApplicationProcessId", "GetApplicationsErrorNameFromEnum", "GetApplicationPropertyString", "GetApplicationPropertyBool", "GetApplicationPropertyUint64", "SetApplicationAutoLaunch", "GetApplicationAutoLaunch", "SetDefaultApplicationForMimeType", "GetDefaultApplicationForMimeType", "GetApplicationSupportedMimeTypes", "GetApplicationsThatSupportMimeType", "GetApplicationLaunchArguments", "GetStartingApplication", "GetTransitionState", "PerformApplicationPrelaunchCheck", "GetApplicationsTransitionStateNameFromEnum", "IsQuitUserPromptRequested", "LaunchInternalProcess");
+ }
+ public VR_IVRApplications_FnTable(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends VR_IVRApplications_FnTable implements Structure.ByReference {
+
+ };
+ public static class ByValue extends VR_IVRApplications_FnTable implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/VR_IVRChaperoneSetup_FnTable.java b/jme3-vr/src/main/java/jopenvr/VR_IVRChaperoneSetup_FnTable.java
new file mode 100644
index 000000000..9dd5c7ec3
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/VR_IVRChaperoneSetup_FnTable.java
@@ -0,0 +1,129 @@
+package jopenvr;
+import com.sun.jna.Callback;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import com.sun.jna.ptr.FloatByReference;
+import com.sun.jna.ptr.IntByReference;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class VR_IVRChaperoneSetup_FnTable extends Structure {
+ /** C type : CommitWorkingCopy_callback* */
+ public VR_IVRChaperoneSetup_FnTable.CommitWorkingCopy_callback CommitWorkingCopy;
+ /** C type : RevertWorkingCopy_callback* */
+ public VR_IVRChaperoneSetup_FnTable.RevertWorkingCopy_callback RevertWorkingCopy;
+ /** C type : GetWorkingPlayAreaSize_callback* */
+ public VR_IVRChaperoneSetup_FnTable.GetWorkingPlayAreaSize_callback GetWorkingPlayAreaSize;
+ /** C type : GetWorkingPlayAreaRect_callback* */
+ public VR_IVRChaperoneSetup_FnTable.GetWorkingPlayAreaRect_callback GetWorkingPlayAreaRect;
+ /** C type : GetWorkingCollisionBoundsInfo_callback* */
+ public VR_IVRChaperoneSetup_FnTable.GetWorkingCollisionBoundsInfo_callback GetWorkingCollisionBoundsInfo;
+ /** C type : GetLiveCollisionBoundsInfo_callback* */
+ public VR_IVRChaperoneSetup_FnTable.GetLiveCollisionBoundsInfo_callback GetLiveCollisionBoundsInfo;
+ /** C type : GetWorkingSeatedZeroPoseToRawTrackingPose_callback* */
+ public VR_IVRChaperoneSetup_FnTable.GetWorkingSeatedZeroPoseToRawTrackingPose_callback GetWorkingSeatedZeroPoseToRawTrackingPose;
+ /** C type : GetWorkingStandingZeroPoseToRawTrackingPose_callback* */
+ public VR_IVRChaperoneSetup_FnTable.GetWorkingStandingZeroPoseToRawTrackingPose_callback GetWorkingStandingZeroPoseToRawTrackingPose;
+ /** C type : SetWorkingPlayAreaSize_callback* */
+ public VR_IVRChaperoneSetup_FnTable.SetWorkingPlayAreaSize_callback SetWorkingPlayAreaSize;
+ /** C type : SetWorkingCollisionBoundsInfo_callback* */
+ public VR_IVRChaperoneSetup_FnTable.SetWorkingCollisionBoundsInfo_callback SetWorkingCollisionBoundsInfo;
+ /** C type : SetWorkingSeatedZeroPoseToRawTrackingPose_callback* */
+ public VR_IVRChaperoneSetup_FnTable.SetWorkingSeatedZeroPoseToRawTrackingPose_callback SetWorkingSeatedZeroPoseToRawTrackingPose;
+ /** C type : SetWorkingStandingZeroPoseToRawTrackingPose_callback* */
+ public VR_IVRChaperoneSetup_FnTable.SetWorkingStandingZeroPoseToRawTrackingPose_callback SetWorkingStandingZeroPoseToRawTrackingPose;
+ /** C type : ReloadFromDisk_callback* */
+ public VR_IVRChaperoneSetup_FnTable.ReloadFromDisk_callback ReloadFromDisk;
+ /** C type : GetLiveSeatedZeroPoseToRawTrackingPose_callback* */
+ public VR_IVRChaperoneSetup_FnTable.GetLiveSeatedZeroPoseToRawTrackingPose_callback GetLiveSeatedZeroPoseToRawTrackingPose;
+ /** C type : SetWorkingCollisionBoundsTagsInfo_callback* */
+ public VR_IVRChaperoneSetup_FnTable.SetWorkingCollisionBoundsTagsInfo_callback SetWorkingCollisionBoundsTagsInfo;
+ /** C type : GetLiveCollisionBoundsTagsInfo_callback* */
+ public VR_IVRChaperoneSetup_FnTable.GetLiveCollisionBoundsTagsInfo_callback GetLiveCollisionBoundsTagsInfo;
+ /** C type : SetWorkingPhysicalBoundsInfo_callback* */
+ public VR_IVRChaperoneSetup_FnTable.SetWorkingPhysicalBoundsInfo_callback SetWorkingPhysicalBoundsInfo;
+ /** C type : GetLivePhysicalBoundsInfo_callback* */
+ public VR_IVRChaperoneSetup_FnTable.GetLivePhysicalBoundsInfo_callback GetLivePhysicalBoundsInfo;
+ public VR_IVRChaperoneSetup_FnTable.ExportLiveToBuffer_callback ExportLiveToBuffer;
+ /** C type : ImportFromBufferToWorking_callback* */
+ public VR_IVRChaperoneSetup_FnTable.ImportFromBufferToWorking_callback ImportFromBufferToWorking;
+ public interface CommitWorkingCopy_callback extends Callback {
+ byte apply(int configFile);
+ };
+ public interface RevertWorkingCopy_callback extends Callback {
+ void apply();
+ };
+ public interface GetWorkingPlayAreaSize_callback extends Callback {
+ byte apply(FloatByReference pSizeX, FloatByReference pSizeZ);
+ };
+ public interface GetWorkingPlayAreaRect_callback extends Callback {
+ byte apply(HmdQuad_t rect);
+ };
+ public interface GetWorkingCollisionBoundsInfo_callback extends Callback {
+ byte apply(HmdQuad_t pQuadsBuffer, IntByReference punQuadsCount);
+ };
+ public interface GetLiveCollisionBoundsInfo_callback extends Callback {
+ byte apply(HmdQuad_t pQuadsBuffer, IntByReference punQuadsCount);
+ };
+ public interface GetWorkingSeatedZeroPoseToRawTrackingPose_callback extends Callback {
+ byte apply(HmdMatrix34_t pmatSeatedZeroPoseToRawTrackingPose);
+ };
+ public interface GetWorkingStandingZeroPoseToRawTrackingPose_callback extends Callback {
+ byte apply(HmdMatrix34_t pmatStandingZeroPoseToRawTrackingPose);
+ };
+ public interface SetWorkingPlayAreaSize_callback extends Callback {
+ void apply(float sizeX, float sizeZ);
+ };
+ public interface SetWorkingCollisionBoundsInfo_callback extends Callback {
+ void apply(HmdQuad_t pQuadsBuffer, int unQuadsCount);
+ };
+ public interface SetWorkingSeatedZeroPoseToRawTrackingPose_callback extends Callback {
+ void apply(HmdMatrix34_t pMatSeatedZeroPoseToRawTrackingPose);
+ };
+ public interface SetWorkingStandingZeroPoseToRawTrackingPose_callback extends Callback {
+ void apply(HmdMatrix34_t pMatStandingZeroPoseToRawTrackingPose);
+ };
+ public interface ReloadFromDisk_callback extends Callback {
+ void apply(int configFile);
+ };
+ public interface GetLiveSeatedZeroPoseToRawTrackingPose_callback extends Callback {
+ byte apply(HmdMatrix34_t pmatSeatedZeroPoseToRawTrackingPose);
+ };
+ public interface SetWorkingCollisionBoundsTagsInfo_callback extends Callback {
+ void apply(Pointer pTagsBuffer, int unTagCount);
+ };
+ public interface GetLiveCollisionBoundsTagsInfo_callback extends Callback {
+ byte apply(Pointer pTagsBuffer, IntByReference punTagCount);
+ };
+ public interface SetWorkingPhysicalBoundsInfo_callback extends Callback {
+ byte apply(HmdQuad_t pQuadsBuffer, int unQuadsCount);
+ };
+ public interface GetLivePhysicalBoundsInfo_callback extends Callback {
+ byte apply(HmdQuad_t pQuadsBuffer, IntByReference punQuadsCount);
+ };
+ public interface ExportLiveToBuffer_callback extends Callback {
+ byte apply(Pointer pBuffer, IntByReference pnBufferLength);
+ };
+ public interface ImportFromBufferToWorking_callback extends Callback {
+ byte apply(Pointer pBuffer, int nImportFlags);
+ };
+ public VR_IVRChaperoneSetup_FnTable() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("CommitWorkingCopy", "RevertWorkingCopy", "GetWorkingPlayAreaSize", "GetWorkingPlayAreaRect", "GetWorkingCollisionBoundsInfo", "GetLiveCollisionBoundsInfo", "GetWorkingSeatedZeroPoseToRawTrackingPose", "GetWorkingStandingZeroPoseToRawTrackingPose", "SetWorkingPlayAreaSize", "SetWorkingCollisionBoundsInfo", "SetWorkingSeatedZeroPoseToRawTrackingPose", "SetWorkingStandingZeroPoseToRawTrackingPose", "ReloadFromDisk", "GetLiveSeatedZeroPoseToRawTrackingPose", "SetWorkingCollisionBoundsTagsInfo", "GetLiveCollisionBoundsTagsInfo", "SetWorkingPhysicalBoundsInfo", "GetLivePhysicalBoundsInfo", "ExportLiveToBuffer", "ImportFromBufferToWorking");
+ }
+ public VR_IVRChaperoneSetup_FnTable(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends VR_IVRChaperoneSetup_FnTable implements Structure.ByReference {
+
+ };
+ public static class ByValue extends VR_IVRChaperoneSetup_FnTable implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/VR_IVRChaperone_FnTable.java b/jme3-vr/src/main/java/jopenvr/VR_IVRChaperone_FnTable.java
new file mode 100644
index 000000000..bb0c52ba6
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/VR_IVRChaperone_FnTable.java
@@ -0,0 +1,90 @@
+package jopenvr;
+import com.sun.jna.Callback;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.nio.FloatBuffer;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class VR_IVRChaperone_FnTable extends Structure {
+ /** C type : GetCalibrationState_callback* */
+ public VR_IVRChaperone_FnTable.GetCalibrationState_callback GetCalibrationState;
+ /** C type : GetPlayAreaSize_callback* */
+ public VR_IVRChaperone_FnTable.GetPlayAreaSize_callback GetPlayAreaSize;
+ /** C type : GetPlayAreaRect_callback* */
+ public VR_IVRChaperone_FnTable.GetPlayAreaRect_callback GetPlayAreaRect;
+ /** C type : ReloadInfo_callback* */
+ public VR_IVRChaperone_FnTable.ReloadInfo_callback ReloadInfo;
+ /** C type : SetSceneColor_callback* */
+ public VR_IVRChaperone_FnTable.SetSceneColor_callback SetSceneColor;
+ /** C type : GetBoundsColor_callback* */
+ public VR_IVRChaperone_FnTable.GetBoundsColor_callback GetBoundsColor;
+ /** C type : AreBoundsVisible_callback* */
+ public VR_IVRChaperone_FnTable.AreBoundsVisible_callback AreBoundsVisible;
+ /** C type : ForceBoundsVisible_callback* */
+ public VR_IVRChaperone_FnTable.ForceBoundsVisible_callback ForceBoundsVisible;
+ public interface GetCalibrationState_callback extends Callback {
+ int apply();
+ };
+ public interface GetPlayAreaSize_callback extends Callback {
+ byte apply(FloatBuffer pSizeX, FloatBuffer pSizeZ);
+ };
+ public interface GetPlayAreaRect_callback extends Callback {
+ byte apply(HmdQuad_t rect);
+ };
+ public interface ReloadInfo_callback extends Callback {
+ void apply();
+ };
+ public interface SetSceneColor_callback extends Callback {
+ void apply(HmdColor_t.ByValue color);
+ };
+ public interface GetBoundsColor_callback extends Callback {
+ void apply(HmdColor_t pOutputColorArray, int nNumOutputColors, float flCollisionBoundsFadeDistance, HmdColor_t pOutputCameraColor);
+ };
+ public interface AreBoundsVisible_callback extends Callback {
+ byte apply();
+ };
+ public interface ForceBoundsVisible_callback extends Callback {
+ void apply(byte bForce);
+ };
+ public VR_IVRChaperone_FnTable() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("GetCalibrationState", "GetPlayAreaSize", "GetPlayAreaRect", "ReloadInfo", "SetSceneColor", "GetBoundsColor", "AreBoundsVisible", "ForceBoundsVisible");
+ }
+ /**
+ * @param GetCalibrationState C type : GetCalibrationState_callback*
+ * @param GetPlayAreaSize C type : GetPlayAreaSize_callback*
+ * @param GetPlayAreaRect C type : GetPlayAreaRect_callback*
+ * @param ReloadInfo C type : ReloadInfo_callback*
+ * @param SetSceneColor C type : SetSceneColor_callback*
+ * @param GetBoundsColor C type : GetBoundsColor_callback*
+ * @param AreBoundsVisible C type : AreBoundsVisible_callback*
+ * @param ForceBoundsVisible C type : ForceBoundsVisible_callback*
+ */
+ public VR_IVRChaperone_FnTable(VR_IVRChaperone_FnTable.GetCalibrationState_callback GetCalibrationState, VR_IVRChaperone_FnTable.GetPlayAreaSize_callback GetPlayAreaSize, VR_IVRChaperone_FnTable.GetPlayAreaRect_callback GetPlayAreaRect, VR_IVRChaperone_FnTable.ReloadInfo_callback ReloadInfo, VR_IVRChaperone_FnTable.SetSceneColor_callback SetSceneColor, VR_IVRChaperone_FnTable.GetBoundsColor_callback GetBoundsColor, VR_IVRChaperone_FnTable.AreBoundsVisible_callback AreBoundsVisible, VR_IVRChaperone_FnTable.ForceBoundsVisible_callback ForceBoundsVisible) {
+ super();
+ this.GetCalibrationState = GetCalibrationState;
+ this.GetPlayAreaSize = GetPlayAreaSize;
+ this.GetPlayAreaRect = GetPlayAreaRect;
+ this.ReloadInfo = ReloadInfo;
+ this.SetSceneColor = SetSceneColor;
+ this.GetBoundsColor = GetBoundsColor;
+ this.AreBoundsVisible = AreBoundsVisible;
+ this.ForceBoundsVisible = ForceBoundsVisible;
+ }
+ public VR_IVRChaperone_FnTable(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends VR_IVRChaperone_FnTable implements Structure.ByReference {
+
+ };
+ public static class ByValue extends VR_IVRChaperone_FnTable implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/VR_IVRCompositor_FnTable.java b/jme3-vr/src/main/java/jopenvr/VR_IVRCompositor_FnTable.java
new file mode 100644
index 000000000..58465080d
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/VR_IVRCompositor_FnTable.java
@@ -0,0 +1,221 @@
+package jopenvr;
+import com.sun.jna.Callback;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import com.sun.jna.ptr.IntByReference;
+import com.sun.jna.ptr.PointerByReference;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class VR_IVRCompositor_FnTable extends Structure {
+ /** C type : SetTrackingSpace_callback* */
+ public VR_IVRCompositor_FnTable.SetTrackingSpace_callback SetTrackingSpace;
+ /** C type : GetTrackingSpace_callback* */
+ public VR_IVRCompositor_FnTable.GetTrackingSpace_callback GetTrackingSpace;
+ /** C type : WaitGetPoses_callback* */
+ public VR_IVRCompositor_FnTable.WaitGetPoses_callback WaitGetPoses;
+ /** C type : GetLastPoses_callback* */
+ public VR_IVRCompositor_FnTable.GetLastPoses_callback GetLastPoses;
+ /** C type : GetLastPoseForTrackedDeviceIndex_callback* */
+ public VR_IVRCompositor_FnTable.GetLastPoseForTrackedDeviceIndex_callback GetLastPoseForTrackedDeviceIndex;
+ /** C type : Submit_callback* */
+ public VR_IVRCompositor_FnTable.Submit_callback Submit;
+ /** C type : ClearLastSubmittedFrame_callback* */
+ public VR_IVRCompositor_FnTable.ClearLastSubmittedFrame_callback ClearLastSubmittedFrame;
+ /** C type : PostPresentHandoff_callback* */
+ public VR_IVRCompositor_FnTable.PostPresentHandoff_callback PostPresentHandoff;
+ /** C type : GetFrameTiming_callback* */
+ public VR_IVRCompositor_FnTable.GetFrameTiming_callback GetFrameTiming;
+ /** C type : GetFrameTimeRemaining_callback* */
+ public VR_IVRCompositor_FnTable.GetFrameTimeRemaining_callback GetFrameTimeRemaining;
+ /** C type : FadeToColor_callback* */
+ public VR_IVRCompositor_FnTable.GetCumulativeStats_callback GetCumulativeStats;
+ /** C type wrapping */
+ public VR_IVRCompositor_FnTable.FadeToColor_callback FadeToColor;
+ /** C type : FadeGrid_callback* */
+ public VR_IVRCompositor_FnTable.FadeGrid_callback FadeGrid;
+ /** C type : SetSkyboxOverride_callback* */
+ public VR_IVRCompositor_FnTable.SetSkyboxOverride_callback SetSkyboxOverride;
+ /** C type : ClearSkyboxOverride_callback* */
+ public VR_IVRCompositor_FnTable.ClearSkyboxOverride_callback ClearSkyboxOverride;
+ /** C type : CompositorBringToFront_callback* */
+ public VR_IVRCompositor_FnTable.CompositorBringToFront_callback CompositorBringToFront;
+ /** C type : CompositorGoToBack_callback* */
+ public VR_IVRCompositor_FnTable.CompositorGoToBack_callback CompositorGoToBack;
+ /** C type : CompositorQuit_callback* */
+ public VR_IVRCompositor_FnTable.CompositorQuit_callback CompositorQuit;
+ /** C type : IsFullscreen_callback* */
+ public VR_IVRCompositor_FnTable.IsFullscreen_callback IsFullscreen;
+ /** C type : GetCurrentSceneFocusProcess_callback* */
+ public VR_IVRCompositor_FnTable.GetCurrentSceneFocusProcess_callback GetCurrentSceneFocusProcess;
+ /** C type : GetLastFrameRenderer_callback* */
+ public VR_IVRCompositor_FnTable.GetLastFrameRenderer_callback GetLastFrameRenderer;
+ /** C type : CanRenderScene_callback* */
+ public VR_IVRCompositor_FnTable.CanRenderScene_callback CanRenderScene;
+ /** C type : ShowMirrorWindow_callback* */
+ public VR_IVRCompositor_FnTable.ShowMirrorWindow_callback ShowMirrorWindow;
+ /** C type : HideMirrorWindow_callback* */
+ public VR_IVRCompositor_FnTable.HideMirrorWindow_callback HideMirrorWindow;
+ /** C type : IsMirrorWindowVisible_callback* */
+ public VR_IVRCompositor_FnTable.IsMirrorWindowVisible_callback IsMirrorWindowVisible;
+ /** C type : CompositorDumpImages_callback* */
+ public VR_IVRCompositor_FnTable.CompositorDumpImages_callback CompositorDumpImages;
+ /** C type : ShouldAppRenderWithLowResources_callback* */
+ public VR_IVRCompositor_FnTable.ShouldAppRenderWithLowResources_callback ShouldAppRenderWithLowResources;
+ /** C type : ForceInterleavedReprojectionOn_callback* */
+ public VR_IVRCompositor_FnTable.ForceInterleavedReprojectionOn_callback ForceInterleavedReprojectionOn;
+ /** C type wrapping */
+ public VR_IVRCompositor_FnTable.ForceReconnectProcess_callback ForceReconnectProcess;
+ /** C type : SuspendRendering_callback* */
+ public VR_IVRCompositor_FnTable.SuspendRendering_callback SuspendRendering;
+ /** C type : GetMirrorTextureD3D11_callback* */
+ public VR_IVRCompositor_FnTable.GetMirrorTextureD3D11_callback GetMirrorTextureD3D11;
+ /** C type : GetMirrorTextureGL_callback* */
+ public VR_IVRCompositor_FnTable.GetMirrorTextureGL_callback GetMirrorTextureGL;
+ /** C type : ReleaseSharedGLTexture_callback* */
+ public VR_IVRCompositor_FnTable.ReleaseSharedGLTexture_callback ReleaseSharedGLTexture;
+ /** C type : LockGLSharedTextureForAccess_callback* */
+ public VR_IVRCompositor_FnTable.LockGLSharedTextureForAccess_callback LockGLSharedTextureForAccess;
+ /** C type : UnlockGLSharedTextureForAccess_callback* */
+ public VR_IVRCompositor_FnTable.UnlockGLSharedTextureForAccess_callback UnlockGLSharedTextureForAccess;
+
+ /** C type wrapping */
+ public interface SetTrackingSpace_callback extends Callback {
+
+ /** C type wrapping */
+ void apply(int eOrigin);
+ };
+
+ /** C type wrapping */
+ public interface GetTrackingSpace_callback extends Callback {
+
+ /** C type wrapping */
+ int apply();
+ };
+
+ /** C type wrapping */
+ public interface WaitGetPoses_callback extends Callback {
+ /** C type wrapping
+ * @param pRenderPoseArray
+ * @param unRenderPoseArrayCount
+ * @param pGamePoseArray
+ * @param unGamePoseArrayCount
+ * @return */
+ int apply(TrackedDevicePose_t pRenderPoseArray, int unRenderPoseArrayCount, TrackedDevicePose_t pGamePoseArray, int unGamePoseArrayCount);
+ };
+ public interface GetLastPoses_callback extends Callback {
+ int apply(TrackedDevicePose_t pRenderPoseArray, int unRenderPoseArrayCount, TrackedDevicePose_t pGamePoseArray, int unGamePoseArrayCount);
+ };
+ public interface GetLastPoseForTrackedDeviceIndex_callback extends Callback {
+ int apply(int unDeviceIndex, TrackedDevicePose_t pOutputPose, TrackedDevicePose_t pOutputGamePose);
+ };
+ public interface Submit_callback extends Callback {
+ int apply(int eEye, Texture_t pTexture, VRTextureBounds_t pBounds, int nSubmitFlags);
+ };
+ public interface ClearLastSubmittedFrame_callback extends Callback {
+ void apply();
+ };
+ public interface PostPresentHandoff_callback extends Callback {
+ void apply();
+ };
+ public interface GetFrameTiming_callback extends Callback {
+ byte apply(Compositor_FrameTiming pTiming, int unFramesAgo);
+ };
+ public interface GetFrameTimeRemaining_callback extends Callback {
+ float apply();
+ };
+ public interface GetCumulativeStats_callback extends Callback {
+ void apply(Compositor_CumulativeStats pStats, int nStatsSizeInBytes);
+ };
+ public interface FadeToColor_callback extends Callback {
+ void apply(float fSeconds, float fRed, float fGreen, float fBlue, float fAlpha, byte bBackground);
+ };
+ public interface FadeGrid_callback extends Callback {
+ void apply(float fSeconds, byte bFadeIn);
+ };
+ public interface SetSkyboxOverride_callback extends Callback {
+ int apply(Texture_t pTextures, int unTextureCount);
+ };
+ public interface ClearSkyboxOverride_callback extends Callback {
+ void apply();
+ };
+ public interface CompositorBringToFront_callback extends Callback {
+ void apply();
+ };
+ public interface CompositorGoToBack_callback extends Callback {
+ void apply();
+ };
+ public interface CompositorQuit_callback extends Callback {
+ void apply();
+ };
+ public interface IsFullscreen_callback extends Callback {
+ byte apply();
+ };
+ public interface GetCurrentSceneFocusProcess_callback extends Callback {
+ int apply();
+ };
+ public interface GetLastFrameRenderer_callback extends Callback {
+ int apply();
+ };
+ public interface CanRenderScene_callback extends Callback {
+ byte apply();
+ };
+ public interface ShowMirrorWindow_callback extends Callback {
+ void apply();
+ };
+ public interface HideMirrorWindow_callback extends Callback {
+ void apply();
+ };
+ public interface IsMirrorWindowVisible_callback extends Callback {
+ byte apply();
+ };
+ public interface CompositorDumpImages_callback extends Callback {
+ void apply();
+ };
+ public interface ShouldAppRenderWithLowResources_callback extends Callback {
+ byte apply();
+ };
+ public interface ForceInterleavedReprojectionOn_callback extends Callback {
+ void apply(byte bOverride);
+ };
+ public interface ForceReconnectProcess_callback extends Callback {
+ void apply();
+ };
+ public interface SuspendRendering_callback extends Callback {
+ void apply(byte bSuspend);
+ };
+ public interface GetMirrorTextureD3D11_callback extends Callback {
+ int apply(int eEye, Pointer pD3D11DeviceOrResource, PointerByReference ppD3D11ShaderResourceView);
+ };
+ public interface GetMirrorTextureGL_callback extends Callback {
+ int apply(int eEye, IntByReference pglTextureId, PointerByReference pglSharedTextureHandle);
+ };
+ public interface ReleaseSharedGLTexture_callback extends Callback {
+ byte apply(int glTextureId, Pointer glSharedTextureHandle);
+ };
+ public interface LockGLSharedTextureForAccess_callback extends Callback {
+ void apply(Pointer glSharedTextureHandle);
+ };
+ public interface UnlockGLSharedTextureForAccess_callback extends Callback {
+ void apply(Pointer glSharedTextureHandle);
+ };
+ public VR_IVRCompositor_FnTable() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("SetTrackingSpace", "GetTrackingSpace", "WaitGetPoses", "GetLastPoses", "GetLastPoseForTrackedDeviceIndex", "Submit", "ClearLastSubmittedFrame", "PostPresentHandoff", "GetFrameTiming", "GetFrameTimeRemaining", "GetCumulativeStats", "FadeToColor", "FadeGrid", "SetSkyboxOverride", "ClearSkyboxOverride", "CompositorBringToFront", "CompositorGoToBack", "CompositorQuit", "IsFullscreen", "GetCurrentSceneFocusProcess", "GetLastFrameRenderer", "CanRenderScene", "ShowMirrorWindow", "HideMirrorWindow", "IsMirrorWindowVisible", "CompositorDumpImages", "ShouldAppRenderWithLowResources", "ForceInterleavedReprojectionOn", "ForceReconnectProcess", "SuspendRendering", "GetMirrorTextureD3D11", "GetMirrorTextureGL", "ReleaseSharedGLTexture", "LockGLSharedTextureForAccess", "UnlockGLSharedTextureForAccess");
+ }
+ public VR_IVRCompositor_FnTable(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends VR_IVRCompositor_FnTable implements Structure.ByReference {
+
+ };
+ public static class ByValue extends VR_IVRCompositor_FnTable implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/VR_IVRExtendedDisplay_FnTable.java b/jme3-vr/src/main/java/jopenvr/VR_IVRExtendedDisplay_FnTable.java
new file mode 100644
index 000000000..0b2a58f3a
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/VR_IVRExtendedDisplay_FnTable.java
@@ -0,0 +1,55 @@
+package jopenvr;
+import com.sun.jna.Callback;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import com.sun.jna.ptr.IntByReference;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class VR_IVRExtendedDisplay_FnTable extends Structure {
+ /** C type : GetWindowBounds_callback* */
+ public VR_IVRExtendedDisplay_FnTable.GetWindowBounds_callback GetWindowBounds;
+ /** C type : GetEyeOutputViewport_callback* */
+ public VR_IVRExtendedDisplay_FnTable.GetEyeOutputViewport_callback GetEyeOutputViewport;
+ /** C type : GetDXGIOutputInfo_callback* */
+ public VR_IVRExtendedDisplay_FnTable.GetDXGIOutputInfo_callback GetDXGIOutputInfo;
+ public interface GetWindowBounds_callback extends Callback {
+ void apply(IntByReference pnX, IntByReference pnY, IntByReference pnWidth, IntByReference pnHeight);
+ };
+ public interface GetEyeOutputViewport_callback extends Callback {
+ void apply(int eEye, IntByReference pnX, IntByReference pnY, IntByReference pnWidth, IntByReference pnHeight);
+ };
+ public interface GetDXGIOutputInfo_callback extends Callback {
+ void apply(IntByReference pnAdapterIndex, IntByReference pnAdapterOutputIndex);
+ };
+ public VR_IVRExtendedDisplay_FnTable() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("GetWindowBounds", "GetEyeOutputViewport", "GetDXGIOutputInfo");
+ }
+ /**
+ * @param GetWindowBounds C type : GetWindowBounds_callback*
+ * @param GetEyeOutputViewport C type : GetEyeOutputViewport_callback*
+ * @param GetDXGIOutputInfo C type : GetDXGIOutputInfo_callback*
+ */
+ public VR_IVRExtendedDisplay_FnTable(VR_IVRExtendedDisplay_FnTable.GetWindowBounds_callback GetWindowBounds, VR_IVRExtendedDisplay_FnTable.GetEyeOutputViewport_callback GetEyeOutputViewport, VR_IVRExtendedDisplay_FnTable.GetDXGIOutputInfo_callback GetDXGIOutputInfo) {
+ super();
+ this.GetWindowBounds = GetWindowBounds;
+ this.GetEyeOutputViewport = GetEyeOutputViewport;
+ this.GetDXGIOutputInfo = GetDXGIOutputInfo;
+ }
+ public VR_IVRExtendedDisplay_FnTable(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends VR_IVRExtendedDisplay_FnTable implements Structure.ByReference {
+
+ };
+ public static class ByValue extends VR_IVRExtendedDisplay_FnTable implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/VR_IVRNotifications_FnTable.java b/jme3-vr/src/main/java/jopenvr/VR_IVRNotifications_FnTable.java
new file mode 100644
index 000000000..2c2c3c9a4
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/VR_IVRNotifications_FnTable.java
@@ -0,0 +1,48 @@
+package jopenvr;
+import com.sun.jna.Callback;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import com.sun.jna.ptr.IntByReference;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class VR_IVRNotifications_FnTable extends Structure {
+ /** C type : CreateNotification_callback* */
+ public VR_IVRNotifications_FnTable.CreateNotification_callback CreateNotification;
+ /** C type : RemoveNotification_callback* */
+ public VR_IVRNotifications_FnTable.RemoveNotification_callback RemoveNotification;
+ public interface CreateNotification_callback extends Callback {
+ int apply(long ulOverlayHandle, long ulUserValue, int type, Pointer pchText, int style, NotificationBitmap_t pImage, IntByReference pNotificationId);
+ };
+ public interface RemoveNotification_callback extends Callback {
+ int apply(int notificationId);
+ };
+ public VR_IVRNotifications_FnTable() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("CreateNotification", "RemoveNotification");
+ }
+ /**
+ * @param CreateNotification C type : CreateNotification_callback*
+ * @param RemoveNotification C type : RemoveNotification_callback*
+ */
+ public VR_IVRNotifications_FnTable(VR_IVRNotifications_FnTable.CreateNotification_callback CreateNotification, VR_IVRNotifications_FnTable.RemoveNotification_callback RemoveNotification) {
+ super();
+ this.CreateNotification = CreateNotification;
+ this.RemoveNotification = RemoveNotification;
+ }
+ public VR_IVRNotifications_FnTable(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends VR_IVRNotifications_FnTable implements Structure.ByReference {
+
+ };
+ public static class ByValue extends VR_IVRNotifications_FnTable implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/VR_IVROverlay_FnTable.java b/jme3-vr/src/main/java/jopenvr/VR_IVROverlay_FnTable.java
new file mode 100644
index 000000000..20602d6ab
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/VR_IVROverlay_FnTable.java
@@ -0,0 +1,389 @@
+package jopenvr;
+import com.sun.jna.Callback;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import com.sun.jna.ptr.FloatByReference;
+import com.sun.jna.ptr.IntByReference;
+import com.sun.jna.ptr.LongByReference;
+import com.sun.jna.ptr.PointerByReference;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class VR_IVROverlay_FnTable extends Structure {
+ /** C type : FindOverlay_callback* */
+ public VR_IVROverlay_FnTable.FindOverlay_callback FindOverlay;
+ /** C type : CreateOverlay_callback* */
+ public VR_IVROverlay_FnTable.CreateOverlay_callback CreateOverlay;
+ /** C type : DestroyOverlay_callback* */
+ public VR_IVROverlay_FnTable.DestroyOverlay_callback DestroyOverlay;
+ /** C type : SetHighQualityOverlay_callback* */
+ public VR_IVROverlay_FnTable.SetHighQualityOverlay_callback SetHighQualityOverlay;
+ /** C type : GetHighQualityOverlay_callback* */
+ public VR_IVROverlay_FnTable.GetHighQualityOverlay_callback GetHighQualityOverlay;
+ /** C type : GetOverlayKey_callback* */
+ public VR_IVROverlay_FnTable.GetOverlayKey_callback GetOverlayKey;
+ /** C type : GetOverlayName_callback* */
+ public VR_IVROverlay_FnTable.GetOverlayName_callback GetOverlayName;
+ /** C type : GetOverlayImageData_callback* */
+ public VR_IVROverlay_FnTable.GetOverlayImageData_callback GetOverlayImageData;
+ /** C type : GetOverlayErrorNameFromEnum_callback* */
+ public VR_IVROverlay_FnTable.GetOverlayErrorNameFromEnum_callback GetOverlayErrorNameFromEnum;
+ /** C type : SetOverlayFlag_callback* */
+ public VR_IVROverlay_FnTable.SetOverlayRenderingPid_callback SetOverlayRenderingPid;
+ /** C type : GetOverlayRenderingPid_callback* */
+ public VR_IVROverlay_FnTable.GetOverlayRenderingPid_callback GetOverlayRenderingPid;
+ public VR_IVROverlay_FnTable.SetOverlayFlag_callback SetOverlayFlag;
+ /** C type : GetOverlayFlag_callback* */
+ public VR_IVROverlay_FnTable.GetOverlayFlag_callback GetOverlayFlag;
+ /** C type : SetOverlayColor_callback* */
+ public VR_IVROverlay_FnTable.SetOverlayColor_callback SetOverlayColor;
+ /** C type : GetOverlayColor_callback* */
+ public VR_IVROverlay_FnTable.GetOverlayColor_callback GetOverlayColor;
+ /** C type : SetOverlayAlpha_callback* */
+ public VR_IVROverlay_FnTable.SetOverlayAlpha_callback SetOverlayAlpha;
+ /** C type : GetOverlayAlpha_callback* */
+ public VR_IVROverlay_FnTable.GetOverlayAlpha_callback GetOverlayAlpha;
+ /** C type : SetOverlayWidthInMeters_callback* */
+ public VR_IVROverlay_FnTable.SetOverlayTexelAspect_callback SetOverlayTexelAspect;
+ /** C type : GetOverlayTexelAspect_callback* */
+ public VR_IVROverlay_FnTable.GetOverlayTexelAspect_callback GetOverlayTexelAspect;
+ /** C type : SetOverlaySortOrder_callback* */
+ public VR_IVROverlay_FnTable.SetOverlaySortOrder_callback SetOverlaySortOrder;
+ /** C type : GetOverlaySortOrder_callback* */
+ public VR_IVROverlay_FnTable.GetOverlaySortOrder_callback GetOverlaySortOrder;
+ public VR_IVROverlay_FnTable.SetOverlayWidthInMeters_callback SetOverlayWidthInMeters;
+ /** C type : GetOverlayWidthInMeters_callback* */
+ public VR_IVROverlay_FnTable.GetOverlayWidthInMeters_callback GetOverlayWidthInMeters;
+ /** C type : SetOverlayAutoCurveDistanceRangeInMeters_callback* */
+ public VR_IVROverlay_FnTable.SetOverlayAutoCurveDistanceRangeInMeters_callback SetOverlayAutoCurveDistanceRangeInMeters;
+ /** C type : GetOverlayAutoCurveDistanceRangeInMeters_callback* */
+ public VR_IVROverlay_FnTable.GetOverlayAutoCurveDistanceRangeInMeters_callback GetOverlayAutoCurveDistanceRangeInMeters;
+ /** C type : SetOverlayTextureColorSpace_callback* */
+ public VR_IVROverlay_FnTable.SetOverlayTextureColorSpace_callback SetOverlayTextureColorSpace;
+ /** C type : GetOverlayTextureColorSpace_callback* */
+ public VR_IVROverlay_FnTable.GetOverlayTextureColorSpace_callback GetOverlayTextureColorSpace;
+ /** C type : SetOverlayTextureBounds_callback* */
+ public VR_IVROverlay_FnTable.SetOverlayTextureBounds_callback SetOverlayTextureBounds;
+ /** C type : GetOverlayTextureBounds_callback* */
+ public VR_IVROverlay_FnTable.GetOverlayTextureBounds_callback GetOverlayTextureBounds;
+ /** C type : GetOverlayTransformType_callback* */
+ public VR_IVROverlay_FnTable.GetOverlayTransformType_callback GetOverlayTransformType;
+ /** C type : SetOverlayTransformAbsolute_callback* */
+ public VR_IVROverlay_FnTable.SetOverlayTransformAbsolute_callback SetOverlayTransformAbsolute;
+ /** C type : GetOverlayTransformAbsolute_callback* */
+ public VR_IVROverlay_FnTable.GetOverlayTransformAbsolute_callback GetOverlayTransformAbsolute;
+ /** C type : SetOverlayTransformTrackedDeviceRelative_callback* */
+ public VR_IVROverlay_FnTable.SetOverlayTransformTrackedDeviceRelative_callback SetOverlayTransformTrackedDeviceRelative;
+ /** C type : GetOverlayTransformTrackedDeviceRelative_callback* */
+ public VR_IVROverlay_FnTable.GetOverlayTransformTrackedDeviceRelative_callback GetOverlayTransformTrackedDeviceRelative;
+ /** C type : SetOverlayTransformTrackedDeviceComponent_callback* */
+ public VR_IVROverlay_FnTable.SetOverlayTransformTrackedDeviceComponent_callback SetOverlayTransformTrackedDeviceComponent;
+ /** C type : GetOverlayTransformTrackedDeviceComponent_callback* */
+ public VR_IVROverlay_FnTable.GetOverlayTransformTrackedDeviceComponent_callback GetOverlayTransformTrackedDeviceComponent;
+ /** C type : ShowOverlay_callback* */
+ public VR_IVROverlay_FnTable.ShowOverlay_callback ShowOverlay;
+ /** C type : HideOverlay_callback* */
+ public VR_IVROverlay_FnTable.HideOverlay_callback HideOverlay;
+ /** C type : IsOverlayVisible_callback* */
+ public VR_IVROverlay_FnTable.IsOverlayVisible_callback IsOverlayVisible;
+ /** C type : GetTransformForOverlayCoordinates_callback* */
+ public VR_IVROverlay_FnTable.GetTransformForOverlayCoordinates_callback GetTransformForOverlayCoordinates;
+ /** C type : PollNextOverlayEvent_callback* */
+ public VR_IVROverlay_FnTable.PollNextOverlayEvent_callback PollNextOverlayEvent;
+ /** C type : GetOverlayInputMethod_callback* */
+ public VR_IVROverlay_FnTable.GetOverlayInputMethod_callback GetOverlayInputMethod;
+ /** C type : SetOverlayInputMethod_callback* */
+ public VR_IVROverlay_FnTable.SetOverlayInputMethod_callback SetOverlayInputMethod;
+ /** C type : GetOverlayMouseScale_callback* */
+ public VR_IVROverlay_FnTable.GetOverlayMouseScale_callback GetOverlayMouseScale;
+ /** C type : SetOverlayMouseScale_callback* */
+ public VR_IVROverlay_FnTable.SetOverlayMouseScale_callback SetOverlayMouseScale;
+ /** C type : ComputeOverlayIntersection_callback* */
+ public VR_IVROverlay_FnTable.ComputeOverlayIntersection_callback ComputeOverlayIntersection;
+ /** C type : HandleControllerOverlayInteractionAsMouse_callback* */
+ public VR_IVROverlay_FnTable.HandleControllerOverlayInteractionAsMouse_callback HandleControllerOverlayInteractionAsMouse;
+ /** C type : IsHoverTargetOverlay_callback* */
+ public VR_IVROverlay_FnTable.IsHoverTargetOverlay_callback IsHoverTargetOverlay;
+ /** C type : GetGamepadFocusOverlay_callback* */
+ public VR_IVROverlay_FnTable.GetGamepadFocusOverlay_callback GetGamepadFocusOverlay;
+ /** C type : SetGamepadFocusOverlay_callback* */
+ public VR_IVROverlay_FnTable.SetGamepadFocusOverlay_callback SetGamepadFocusOverlay;
+ /** C type : SetOverlayNeighbor_callback* */
+ public VR_IVROverlay_FnTable.SetOverlayNeighbor_callback SetOverlayNeighbor;
+ /** C type : MoveGamepadFocusToNeighbor_callback* */
+ public VR_IVROverlay_FnTable.MoveGamepadFocusToNeighbor_callback MoveGamepadFocusToNeighbor;
+ /** C type : SetOverlayTexture_callback* */
+ public VR_IVROverlay_FnTable.SetOverlayTexture_callback SetOverlayTexture;
+ /** C type : ClearOverlayTexture_callback* */
+ public VR_IVROverlay_FnTable.ClearOverlayTexture_callback ClearOverlayTexture;
+ /** C type : SetOverlayRaw_callback* */
+ public VR_IVROverlay_FnTable.SetOverlayRaw_callback SetOverlayRaw;
+ /** C type : SetOverlayFromFile_callback* */
+ public VR_IVROverlay_FnTable.SetOverlayFromFile_callback SetOverlayFromFile;
+ public VR_IVROverlay_FnTable.GetOverlayTexture_callback GetOverlayTexture;
+ /** C type : ReleaseNativeOverlayHandle_callback* */
+ public VR_IVROverlay_FnTable.ReleaseNativeOverlayHandle_callback ReleaseNativeOverlayHandle;
+ /** C type : GetOverlayTextureSize_callback* */
+ public VR_IVROverlay_FnTable.GetOverlayTextureSize_callback GetOverlayTextureSize;
+ /** C type : CreateDashboardOverlay_callback* */
+ public VR_IVROverlay_FnTable.CreateDashboardOverlay_callback CreateDashboardOverlay;
+ /** C type : IsDashboardVisible_callback* */
+ public VR_IVROverlay_FnTable.IsDashboardVisible_callback IsDashboardVisible;
+ /** C type : IsActiveDashboardOverlay_callback* */
+ public VR_IVROverlay_FnTable.IsActiveDashboardOverlay_callback IsActiveDashboardOverlay;
+ /** C type : SetDashboardOverlaySceneProcess_callback* */
+ public VR_IVROverlay_FnTable.SetDashboardOverlaySceneProcess_callback SetDashboardOverlaySceneProcess;
+ /** C type : GetDashboardOverlaySceneProcess_callback* */
+ public VR_IVROverlay_FnTable.GetDashboardOverlaySceneProcess_callback GetDashboardOverlaySceneProcess;
+ /** C type : ShowDashboard_callback* */
+ public VR_IVROverlay_FnTable.ShowDashboard_callback ShowDashboard;
+ /** C type : GetPrimaryDashboardDevice_callback* */
+ public VR_IVROverlay_FnTable.GetPrimaryDashboardDevice_callback GetPrimaryDashboardDevice;
+ /** C type : ShowKeyboard_callback* */
+ public VR_IVROverlay_FnTable.ShowKeyboard_callback ShowKeyboard;
+ /** C type : ShowKeyboardForOverlay_callback* */
+ public VR_IVROverlay_FnTable.ShowKeyboardForOverlay_callback ShowKeyboardForOverlay;
+ /** C type : GetKeyboardText_callback* */
+ public VR_IVROverlay_FnTable.GetKeyboardText_callback GetKeyboardText;
+ /** C type : HideKeyboard_callback* */
+ public VR_IVROverlay_FnTable.HideKeyboard_callback HideKeyboard;
+ /** C type : SetKeyboardTransformAbsolute_callback* */
+ public VR_IVROverlay_FnTable.SetKeyboardTransformAbsolute_callback SetKeyboardTransformAbsolute;
+ /** C type : SetKeyboardPositionForOverlay_callback* */
+ public VR_IVROverlay_FnTable.SetKeyboardPositionForOverlay_callback SetKeyboardPositionForOverlay;
+ public interface FindOverlay_callback extends Callback {
+ int apply(Pointer pchOverlayKey, LongByReference pOverlayHandle);
+ };
+ public interface CreateOverlay_callback extends Callback {
+ int apply(Pointer pchOverlayKey, Pointer pchOverlayFriendlyName, LongByReference pOverlayHandle);
+ };
+ public interface DestroyOverlay_callback extends Callback {
+ int apply(long ulOverlayHandle);
+ };
+ public interface SetHighQualityOverlay_callback extends Callback {
+ int apply(long ulOverlayHandle);
+ };
+ public interface GetHighQualityOverlay_callback extends Callback {
+ long apply();
+ };
+ public interface GetOverlayKey_callback extends Callback {
+ int apply(long ulOverlayHandle, Pointer pchValue, int unBufferSize, IntByReference pError);
+ };
+ public interface GetOverlayName_callback extends Callback {
+ int apply(long ulOverlayHandle, Pointer pchValue, int unBufferSize, IntByReference pError);
+ };
+ public interface GetOverlayImageData_callback extends Callback {
+ int apply(long ulOverlayHandle, Pointer pvBuffer, int unBufferSize, IntByReference punWidth, IntByReference punHeight);
+ };
+ public interface GetOverlayErrorNameFromEnum_callback extends Callback {
+ Pointer apply(int error);
+ };
+ public interface SetOverlayRenderingPid_callback extends Callback {
+ int apply(long ulOverlayHandle, int unPID);
+ };
+ public interface GetOverlayRenderingPid_callback extends Callback {
+ int apply(long ulOverlayHandle);
+ };
+ public interface SetOverlayFlag_callback extends Callback {
+ int apply(long ulOverlayHandle, int eOverlayFlag, byte bEnabled);
+ };
+ public interface GetOverlayFlag_callback extends Callback {
+ int apply(long ulOverlayHandle, int eOverlayFlag, Pointer pbEnabled);
+ };
+ public interface SetOverlayColor_callback extends Callback {
+ int apply(long ulOverlayHandle, float fRed, float fGreen, float fBlue);
+ };
+ public interface GetOverlayColor_callback extends Callback {
+ int apply(long ulOverlayHandle, FloatByReference pfRed, FloatByReference pfGreen, FloatByReference pfBlue);
+ };
+ public interface SetOverlayAlpha_callback extends Callback {
+ int apply(long ulOverlayHandle, float fAlpha);
+ };
+ public interface GetOverlayAlpha_callback extends Callback {
+ int apply(long ulOverlayHandle, FloatByReference pfAlpha);
+ };
+ public interface SetOverlayTexelAspect_callback extends Callback {
+ int apply(long ulOverlayHandle, float fTexelAspect);
+ };
+ public interface GetOverlayTexelAspect_callback extends Callback {
+ int apply(long ulOverlayHandle, FloatByReference pfTexelAspect);
+ };
+ public interface SetOverlaySortOrder_callback extends Callback {
+ int apply(long ulOverlayHandle, int unSortOrder);
+ };
+ public interface GetOverlaySortOrder_callback extends Callback {
+ int apply(long ulOverlayHandle, IntByReference punSortOrder);
+ };
+ public interface SetOverlayWidthInMeters_callback extends Callback {
+ int apply(long ulOverlayHandle, float fWidthInMeters);
+ };
+ public interface GetOverlayWidthInMeters_callback extends Callback {
+ int apply(long ulOverlayHandle, FloatByReference pfWidthInMeters);
+ };
+ public interface SetOverlayAutoCurveDistanceRangeInMeters_callback extends Callback {
+ int apply(long ulOverlayHandle, float fMinDistanceInMeters, float fMaxDistanceInMeters);
+ };
+ public interface GetOverlayAutoCurveDistanceRangeInMeters_callback extends Callback {
+ int apply(long ulOverlayHandle, FloatByReference pfMinDistanceInMeters, FloatByReference pfMaxDistanceInMeters);
+ };
+ public interface SetOverlayTextureColorSpace_callback extends Callback {
+ int apply(long ulOverlayHandle, int eTextureColorSpace);
+ };
+ public interface GetOverlayTextureColorSpace_callback extends Callback {
+ int apply(long ulOverlayHandle, IntByReference peTextureColorSpace);
+ };
+ public interface SetOverlayTextureBounds_callback extends Callback {
+ int apply(long ulOverlayHandle, VRTextureBounds_t pOverlayTextureBounds);
+ };
+ public interface GetOverlayTextureBounds_callback extends Callback {
+ int apply(long ulOverlayHandle, VRTextureBounds_t pOverlayTextureBounds);
+ };
+ public interface GetOverlayTransformType_callback extends Callback {
+ int apply(long ulOverlayHandle, IntByReference peTransformType);
+ };
+ public interface SetOverlayTransformAbsolute_callback extends Callback {
+ int apply(long ulOverlayHandle, int eTrackingOrigin, HmdMatrix34_t pmatTrackingOriginToOverlayTransform);
+ };
+ public interface GetOverlayTransformAbsolute_callback extends Callback {
+ int apply(long ulOverlayHandle, IntByReference peTrackingOrigin, HmdMatrix34_t pmatTrackingOriginToOverlayTransform);
+ };
+ public interface SetOverlayTransformTrackedDeviceRelative_callback extends Callback {
+ int apply(long ulOverlayHandle, int unTrackedDevice, HmdMatrix34_t pmatTrackedDeviceToOverlayTransform);
+ };
+ public interface GetOverlayTransformTrackedDeviceRelative_callback extends Callback {
+ int apply(long ulOverlayHandle, IntByReference punTrackedDevice, HmdMatrix34_t pmatTrackedDeviceToOverlayTransform);
+ };
+ public interface SetOverlayTransformTrackedDeviceComponent_callback extends Callback {
+ int apply(long ulOverlayHandle, int unDeviceIndex, Pointer pchComponentName);
+ };
+ public interface GetOverlayTransformTrackedDeviceComponent_callback extends Callback {
+ int apply(long ulOverlayHandle, IntByReference punDeviceIndex, Pointer pchComponentName, int unComponentNameSize);
+ };
+ public interface ShowOverlay_callback extends Callback {
+ int apply(long ulOverlayHandle);
+ };
+ public interface HideOverlay_callback extends Callback {
+ int apply(long ulOverlayHandle);
+ };
+ public interface IsOverlayVisible_callback extends Callback {
+ byte apply(long ulOverlayHandle);
+ };
+ public interface GetTransformForOverlayCoordinates_callback extends Callback {
+ int apply(long ulOverlayHandle, int eTrackingOrigin, HmdVector2_t.ByValue coordinatesInOverlay, HmdMatrix34_t pmatTransform);
+ };
+ public interface PollNextOverlayEvent_callback extends Callback {
+ byte apply(long ulOverlayHandle, VREvent_t pEvent, int uncbVREvent);
+ };
+ public interface GetOverlayInputMethod_callback extends Callback {
+ int apply(long ulOverlayHandle, IntByReference peInputMethod);
+ };
+ public interface SetOverlayInputMethod_callback extends Callback {
+ int apply(long ulOverlayHandle, int eInputMethod);
+ };
+ public interface GetOverlayMouseScale_callback extends Callback {
+ int apply(long ulOverlayHandle, HmdVector2_t pvecMouseScale);
+ };
+ public interface SetOverlayMouseScale_callback extends Callback {
+ int apply(long ulOverlayHandle, HmdVector2_t pvecMouseScale);
+ };
+ public interface ComputeOverlayIntersection_callback extends Callback {
+ byte apply(long ulOverlayHandle, VROverlayIntersectionParams_t pParams, VROverlayIntersectionResults_t pResults);
+ };
+ public interface HandleControllerOverlayInteractionAsMouse_callback extends Callback {
+ byte apply(long ulOverlayHandle, int unControllerDeviceIndex);
+ };
+ public interface IsHoverTargetOverlay_callback extends Callback {
+ byte apply(long ulOverlayHandle);
+ };
+ public interface GetGamepadFocusOverlay_callback extends Callback {
+ long apply();
+ };
+ public interface SetGamepadFocusOverlay_callback extends Callback {
+ int apply(long ulNewFocusOverlay);
+ };
+ public interface SetOverlayNeighbor_callback extends Callback {
+ int apply(int eDirection, long ulFrom, long ulTo);
+ };
+ public interface MoveGamepadFocusToNeighbor_callback extends Callback {
+ int apply(int eDirection, long ulFrom);
+ };
+ public interface SetOverlayTexture_callback extends Callback {
+ int apply(long ulOverlayHandle, Texture_t pTexture);
+ };
+ public interface ClearOverlayTexture_callback extends Callback {
+ int apply(long ulOverlayHandle);
+ };
+ public interface SetOverlayRaw_callback extends Callback {
+ int apply(long ulOverlayHandle, Pointer pvBuffer, int unWidth, int unHeight, int unDepth);
+ };
+ public interface SetOverlayFromFile_callback extends Callback {
+ int apply(long ulOverlayHandle, Pointer pchFilePath);
+ };
+ public interface GetOverlayTexture_callback extends Callback {
+ int apply(long ulOverlayHandle, PointerByReference pNativeTextureHandle, Pointer pNativeTextureRef, IntByReference pWidth, IntByReference pHeight, IntByReference pNativeFormat, IntByReference pAPI, IntByReference pColorSpace);
+ };
+ public interface ReleaseNativeOverlayHandle_callback extends Callback {
+ int apply(long ulOverlayHandle, Pointer pNativeTextureHandle);
+ };
+ public interface GetOverlayTextureSize_callback extends Callback {
+ int apply(long ulOverlayHandle, IntByReference pWidth, IntByReference pHeight);
+ };
+ public interface CreateDashboardOverlay_callback extends Callback {
+ int apply(Pointer pchOverlayKey, Pointer pchOverlayFriendlyName, LongByReference pMainHandle, LongByReference pThumbnailHandle);
+ };
+ public interface IsDashboardVisible_callback extends Callback {
+ byte apply();
+ };
+ public interface IsActiveDashboardOverlay_callback extends Callback {
+ byte apply(long ulOverlayHandle);
+ };
+ public interface SetDashboardOverlaySceneProcess_callback extends Callback {
+ int apply(long ulOverlayHandle, int unProcessId);
+ };
+ public interface GetDashboardOverlaySceneProcess_callback extends Callback {
+ int apply(long ulOverlayHandle, IntByReference punProcessId);
+ };
+ public interface ShowDashboard_callback extends Callback {
+ void apply(Pointer pchOverlayToShow);
+ };
+ public interface GetPrimaryDashboardDevice_callback extends Callback {
+ int apply();
+ };
+ public interface ShowKeyboard_callback extends Callback {
+ int apply(int eInputMode, int eLineInputMode, Pointer pchDescription, int unCharMax, Pointer pchExistingText, byte bUseMinimalMode, long uUserValue);
+ };
+ public interface ShowKeyboardForOverlay_callback extends Callback {
+ int apply(long ulOverlayHandle, int eInputMode, int eLineInputMode, Pointer pchDescription, int unCharMax, Pointer pchExistingText, byte bUseMinimalMode, long uUserValue);
+ };
+ public interface GetKeyboardText_callback extends Callback {
+ int apply(Pointer pchText, int cchText);
+ };
+ public interface HideKeyboard_callback extends Callback {
+ void apply();
+ };
+ public interface SetKeyboardTransformAbsolute_callback extends Callback {
+ void apply(int eTrackingOrigin, HmdMatrix34_t pmatTrackingOriginToKeyboardTransform);
+ };
+ public interface SetKeyboardPositionForOverlay_callback extends Callback {
+ void apply(long ulOverlayHandle, jopenvr.HmdRect2_t.ByValue avoidRect);
+ };
+ public VR_IVROverlay_FnTable() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("FindOverlay", "CreateOverlay", "DestroyOverlay", "SetHighQualityOverlay", "GetHighQualityOverlay", "GetOverlayKey", "GetOverlayName", "GetOverlayImageData", "GetOverlayErrorNameFromEnum", "SetOverlayRenderingPid", "GetOverlayRenderingPid", "SetOverlayFlag", "GetOverlayFlag", "SetOverlayColor", "GetOverlayColor", "SetOverlayAlpha", "GetOverlayAlpha", "SetOverlayTexelAspect", "GetOverlayTexelAspect", "SetOverlaySortOrder", "GetOverlaySortOrder", "SetOverlayWidthInMeters", "GetOverlayWidthInMeters", "SetOverlayAutoCurveDistanceRangeInMeters", "GetOverlayAutoCurveDistanceRangeInMeters", "SetOverlayTextureColorSpace", "GetOverlayTextureColorSpace", "SetOverlayTextureBounds", "GetOverlayTextureBounds", "GetOverlayTransformType", "SetOverlayTransformAbsolute", "GetOverlayTransformAbsolute", "SetOverlayTransformTrackedDeviceRelative", "GetOverlayTransformTrackedDeviceRelative", "SetOverlayTransformTrackedDeviceComponent", "GetOverlayTransformTrackedDeviceComponent", "ShowOverlay", "HideOverlay", "IsOverlayVisible", "GetTransformForOverlayCoordinates", "PollNextOverlayEvent", "GetOverlayInputMethod", "SetOverlayInputMethod", "GetOverlayMouseScale", "SetOverlayMouseScale", "ComputeOverlayIntersection", "HandleControllerOverlayInteractionAsMouse", "IsHoverTargetOverlay", "GetGamepadFocusOverlay", "SetGamepadFocusOverlay", "SetOverlayNeighbor", "MoveGamepadFocusToNeighbor", "SetOverlayTexture", "ClearOverlayTexture", "SetOverlayRaw", "SetOverlayFromFile", "GetOverlayTexture", "ReleaseNativeOverlayHandle", "GetOverlayTextureSize", "CreateDashboardOverlay", "IsDashboardVisible", "IsActiveDashboardOverlay", "SetDashboardOverlaySceneProcess", "GetDashboardOverlaySceneProcess", "ShowDashboard", "GetPrimaryDashboardDevice", "ShowKeyboard", "ShowKeyboardForOverlay", "GetKeyboardText", "HideKeyboard", "SetKeyboardTransformAbsolute", "SetKeyboardPositionForOverlay");
+ }
+ public VR_IVROverlay_FnTable(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends VR_IVROverlay_FnTable implements Structure.ByReference {
+
+ };
+ public static class ByValue extends VR_IVROverlay_FnTable implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/VR_IVRRenderModels_FnTable.java b/jme3-vr/src/main/java/jopenvr/VR_IVRRenderModels_FnTable.java
new file mode 100644
index 000000000..669d35a50
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/VR_IVRRenderModels_FnTable.java
@@ -0,0 +1,118 @@
+package jopenvr;
+import com.sun.jna.Callback;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import com.sun.jna.ptr.IntByReference;
+import com.sun.jna.ptr.PointerByReference;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class VR_IVRRenderModels_FnTable extends Structure {
+ /** C type : LoadRenderModel_Async_callback* */
+ public VR_IVRRenderModels_FnTable.LoadRenderModel_Async_callback LoadRenderModel_Async;
+ /** C type : FreeRenderModel_callback* */
+ public VR_IVRRenderModels_FnTable.FreeRenderModel_callback FreeRenderModel;
+ /** C type : LoadTexture_Async_callback* */
+ public VR_IVRRenderModels_FnTable.LoadTexture_Async_callback LoadTexture_Async;
+ /** C type : FreeTexture_callback* */
+ public VR_IVRRenderModels_FnTable.FreeTexture_callback FreeTexture;
+ /** C type : LoadTextureD3D11_Async_callback* */
+ public VR_IVRRenderModels_FnTable.LoadTextureD3D11_Async_callback LoadTextureD3D11_Async;
+ /** C type : FreeTextureD3D11_callback* */
+ public VR_IVRRenderModels_FnTable.LoadIntoTextureD3D11_Async_callback LoadIntoTextureD3D11_Async;
+ public VR_IVRRenderModels_FnTable.FreeTextureD3D11_callback FreeTextureD3D11;
+ /** C type : GetRenderModelName_callback* */
+ public VR_IVRRenderModels_FnTable.GetRenderModelName_callback GetRenderModelName;
+ /** C type : GetRenderModelCount_callback* */
+ public VR_IVRRenderModels_FnTable.GetRenderModelCount_callback GetRenderModelCount;
+ /** C type : GetComponentCount_callback* */
+ public VR_IVRRenderModels_FnTable.GetComponentCount_callback GetComponentCount;
+ /** C type : GetComponentName_callback* */
+ public VR_IVRRenderModels_FnTable.GetComponentName_callback GetComponentName;
+ /** C type : GetComponentButtonMask_callback* */
+ public VR_IVRRenderModels_FnTable.GetComponentButtonMask_callback GetComponentButtonMask;
+ /** C type : GetComponentRenderModelName_callback* */
+ public VR_IVRRenderModels_FnTable.GetComponentRenderModelName_callback GetComponentRenderModelName;
+ /** C type : GetComponentState_callback* */
+ public VR_IVRRenderModels_FnTable.GetComponentState_callback GetComponentState;
+ /** C type : RenderModelHasComponent_callback* */
+ public VR_IVRRenderModels_FnTable.RenderModelHasComponent_callback RenderModelHasComponent;
+ public VR_IVRRenderModels_FnTable.GetRenderModelThumbnailURL_callback GetRenderModelThumbnailURL;
+ /** C type : GetRenderModelOriginalPath_callback* */
+ public VR_IVRRenderModels_FnTable.GetRenderModelOriginalPath_callback GetRenderModelOriginalPath;
+ /** C type : GetRenderModelErrorNameFromEnum_callback* */
+ public VR_IVRRenderModels_FnTable.GetRenderModelErrorNameFromEnum_callback GetRenderModelErrorNameFromEnum;
+ public interface LoadRenderModel_Async_callback extends Callback {
+ int apply(Pointer pchRenderModelName, PointerByReference ppRenderModel);
+ };
+ public interface FreeRenderModel_callback extends Callback {
+ void apply(RenderModel_t pRenderModel);
+ };
+ public interface LoadTexture_Async_callback extends Callback {
+ int apply(int textureId, PointerByReference ppTexture);
+ };
+ public interface FreeTexture_callback extends Callback {
+ void apply(RenderModel_TextureMap_t pTexture);
+ };
+ public interface LoadTextureD3D11_Async_callback extends Callback {
+ int apply(int textureId, Pointer pD3D11Device, PointerByReference ppD3D11Texture2D);
+ };
+ public interface LoadIntoTextureD3D11_Async_callback extends Callback {
+ int apply(int textureId, Pointer pDstTexture);
+ };
+ public interface FreeTextureD3D11_callback extends Callback {
+ void apply(Pointer pD3D11Texture2D);
+ };
+ public interface GetRenderModelName_callback extends Callback {
+ int apply(int unRenderModelIndex, Pointer pchRenderModelName, int unRenderModelNameLen);
+ };
+ public interface GetRenderModelCount_callback extends Callback {
+ int apply();
+ };
+ public interface GetComponentCount_callback extends Callback {
+ int apply(Pointer pchRenderModelName);
+ };
+ public interface GetComponentName_callback extends Callback {
+ int apply(Pointer pchRenderModelName, int unComponentIndex, Pointer pchComponentName, int unComponentNameLen);
+ };
+ public interface GetComponentButtonMask_callback extends Callback {
+ long apply(Pointer pchRenderModelName, Pointer pchComponentName);
+ };
+ public interface GetComponentRenderModelName_callback extends Callback {
+ int apply(Pointer pchRenderModelName, Pointer pchComponentName, Pointer pchComponentRenderModelName, int unComponentRenderModelNameLen);
+ };
+ public interface GetComponentState_callback extends Callback {
+ byte apply(Pointer pchRenderModelName, Pointer pchComponentName, VRControllerState_t pControllerState, RenderModel_ControllerMode_State_t pState, RenderModel_ComponentState_t pComponentState);
+ };
+ public interface RenderModelHasComponent_callback extends Callback {
+ byte apply(Pointer pchRenderModelName, Pointer pchComponentName);
+ };
+ public interface GetRenderModelThumbnailURL_callback extends Callback {
+ int apply(Pointer pchRenderModelName, Pointer pchThumbnailURL, int unThumbnailURLLen, IntByReference peError);
+ };
+ public interface GetRenderModelOriginalPath_callback extends Callback {
+ int apply(Pointer pchRenderModelName, Pointer pchOriginalPath, int unOriginalPathLen, IntByReference peError);
+ };
+ public interface GetRenderModelErrorNameFromEnum_callback extends Callback {
+ Pointer apply(int error);
+ };
+ public VR_IVRRenderModels_FnTable() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("LoadRenderModel_Async", "FreeRenderModel", "LoadTexture_Async", "FreeTexture", "LoadTextureD3D11_Async", "LoadIntoTextureD3D11_Async", "FreeTextureD3D11", "GetRenderModelName", "GetRenderModelCount", "GetComponentCount", "GetComponentName", "GetComponentButtonMask", "GetComponentRenderModelName", "GetComponentState", "RenderModelHasComponent", "GetRenderModelThumbnailURL", "GetRenderModelOriginalPath", "GetRenderModelErrorNameFromEnum");
+ }
+ public VR_IVRRenderModels_FnTable(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends VR_IVRRenderModels_FnTable implements Structure.ByReference {
+
+ };
+ public static class ByValue extends VR_IVRRenderModels_FnTable implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/VR_IVRResources_FnTable.java b/jme3-vr/src/main/java/jopenvr/VR_IVRResources_FnTable.java
new file mode 100644
index 000000000..1b4ce444d
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/VR_IVRResources_FnTable.java
@@ -0,0 +1,47 @@
+package jopenvr;
+import com.sun.jna.Callback;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class VR_IVRResources_FnTable extends Structure {
+ /** C type : LoadSharedResource_callback* */
+ public VR_IVRResources_FnTable.LoadSharedResource_callback LoadSharedResource;
+ /** C type : GetResourceFullPath_callback* */
+ public VR_IVRResources_FnTable.GetResourceFullPath_callback GetResourceFullPath;
+ public interface LoadSharedResource_callback extends Callback {
+ int apply(Pointer pchResourceName, Pointer pchBuffer, int unBufferLen);
+ };
+ public interface GetResourceFullPath_callback extends Callback {
+ int apply(Pointer pchResourceName, Pointer pchResourceTypeDirectory, Pointer pchPathBuffer, int unBufferLen);
+ };
+ public VR_IVRResources_FnTable() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("LoadSharedResource", "GetResourceFullPath");
+ }
+ /**
+ * @param LoadSharedResource C type : LoadSharedResource_callback*
+ * @param GetResourceFullPath C type : GetResourceFullPath_callback*
+ */
+ public VR_IVRResources_FnTable(VR_IVRResources_FnTable.LoadSharedResource_callback LoadSharedResource, VR_IVRResources_FnTable.GetResourceFullPath_callback GetResourceFullPath) {
+ super();
+ this.LoadSharedResource = LoadSharedResource;
+ this.GetResourceFullPath = GetResourceFullPath;
+ }
+ public VR_IVRResources_FnTable(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends VR_IVRResources_FnTable implements Structure.ByReference {
+
+ };
+ public static class ByValue extends VR_IVRResources_FnTable implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/VR_IVRScreenshots_FnTable.java b/jme3-vr/src/main/java/jopenvr/VR_IVRScreenshots_FnTable.java
new file mode 100644
index 000000000..691f59c46
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/VR_IVRScreenshots_FnTable.java
@@ -0,0 +1,83 @@
+package jopenvr;
+import com.sun.jna.Callback;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import com.sun.jna.ptr.IntByReference;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class VR_IVRScreenshots_FnTable extends Structure {
+ /** C type : RequestScreenshot_callback* */
+ public VR_IVRScreenshots_FnTable.RequestScreenshot_callback RequestScreenshot;
+ /** C type : HookScreenshot_callback* */
+ public VR_IVRScreenshots_FnTable.HookScreenshot_callback HookScreenshot;
+ /** C type : GetScreenshotPropertyType_callback* */
+ public VR_IVRScreenshots_FnTable.GetScreenshotPropertyType_callback GetScreenshotPropertyType;
+ /** C type : GetScreenshotPropertyFilename_callback* */
+ public VR_IVRScreenshots_FnTable.GetScreenshotPropertyFilename_callback GetScreenshotPropertyFilename;
+ /** C type : UpdateScreenshotProgress_callback* */
+ public VR_IVRScreenshots_FnTable.UpdateScreenshotProgress_callback UpdateScreenshotProgress;
+ /** C type : TakeStereoScreenshot_callback* */
+ public VR_IVRScreenshots_FnTable.TakeStereoScreenshot_callback TakeStereoScreenshot;
+ /** C type : SubmitScreenshot_callback* */
+ public VR_IVRScreenshots_FnTable.SubmitScreenshot_callback SubmitScreenshot;
+ public interface RequestScreenshot_callback extends Callback {
+ int apply(IntByReference pOutScreenshotHandle, int type, Pointer pchPreviewFilename, Pointer pchVRFilename);
+ };
+ public interface HookScreenshot_callback extends Callback {
+ int apply(IntByReference pSupportedTypes, int numTypes);
+ };
+ public interface GetScreenshotPropertyType_callback extends Callback {
+ int apply(int screenshotHandle, IntByReference pError);
+ };
+ public interface GetScreenshotPropertyFilename_callback extends Callback {
+ int apply(int screenshotHandle, int filenameType, Pointer pchFilename, int cchFilename, IntByReference pError);
+ };
+ public interface UpdateScreenshotProgress_callback extends Callback {
+ int apply(int screenshotHandle, float flProgress);
+ };
+ public interface TakeStereoScreenshot_callback extends Callback {
+ int apply(IntByReference pOutScreenshotHandle, Pointer pchPreviewFilename, Pointer pchVRFilename);
+ };
+ public interface SubmitScreenshot_callback extends Callback {
+ int apply(int screenshotHandle, int type, Pointer pchSourcePreviewFilename, Pointer pchSourceVRFilename);
+ };
+ public VR_IVRScreenshots_FnTable() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("RequestScreenshot", "HookScreenshot", "GetScreenshotPropertyType", "GetScreenshotPropertyFilename", "UpdateScreenshotProgress", "TakeStereoScreenshot", "SubmitScreenshot");
+ }
+ /**
+ * @param RequestScreenshot C type : RequestScreenshot_callback*
+ * @param HookScreenshot C type : HookScreenshot_callback*
+ * @param GetScreenshotPropertyType C type : GetScreenshotPropertyType_callback*
+ * @param GetScreenshotPropertyFilename C type : GetScreenshotPropertyFilename_callback*
+ * @param UpdateScreenshotProgress C type : UpdateScreenshotProgress_callback*
+ * @param TakeStereoScreenshot C type : TakeStereoScreenshot_callback*
+ * @param SubmitScreenshot C type : SubmitScreenshot_callback*
+ */
+ public VR_IVRScreenshots_FnTable(VR_IVRScreenshots_FnTable.RequestScreenshot_callback RequestScreenshot, VR_IVRScreenshots_FnTable.HookScreenshot_callback HookScreenshot, VR_IVRScreenshots_FnTable.GetScreenshotPropertyType_callback GetScreenshotPropertyType, VR_IVRScreenshots_FnTable.GetScreenshotPropertyFilename_callback GetScreenshotPropertyFilename, VR_IVRScreenshots_FnTable.UpdateScreenshotProgress_callback UpdateScreenshotProgress, VR_IVRScreenshots_FnTable.TakeStereoScreenshot_callback TakeStereoScreenshot, VR_IVRScreenshots_FnTable.SubmitScreenshot_callback SubmitScreenshot) {
+ super();
+ this.RequestScreenshot = RequestScreenshot;
+ this.HookScreenshot = HookScreenshot;
+ this.GetScreenshotPropertyType = GetScreenshotPropertyType;
+ this.GetScreenshotPropertyFilename = GetScreenshotPropertyFilename;
+ this.UpdateScreenshotProgress = UpdateScreenshotProgress;
+ this.TakeStereoScreenshot = TakeStereoScreenshot;
+ this.SubmitScreenshot = SubmitScreenshot;
+ }
+ public VR_IVRScreenshots_FnTable(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends VR_IVRScreenshots_FnTable implements Structure.ByReference {
+
+ };
+ public static class ByValue extends VR_IVRScreenshots_FnTable implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/VR_IVRSettings_FnTable.java b/jme3-vr/src/main/java/jopenvr/VR_IVRSettings_FnTable.java
new file mode 100644
index 000000000..e329c3b6b
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/VR_IVRSettings_FnTable.java
@@ -0,0 +1,89 @@
+package jopenvr;
+import com.sun.jna.Callback;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import com.sun.jna.ptr.IntByReference;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class VR_IVRSettings_FnTable extends Structure {
+ /** C type : GetSettingsErrorNameFromEnum_callback* */
+ public VR_IVRSettings_FnTable.GetSettingsErrorNameFromEnum_callback GetSettingsErrorNameFromEnum;
+ /** C type : Sync_callback* */
+ public VR_IVRSettings_FnTable.Sync_callback Sync;
+ /** C type : GetBool_callback* */
+ public VR_IVRSettings_FnTable.GetBool_callback GetBool;
+ /** C type : SetBool_callback* */
+ public VR_IVRSettings_FnTable.SetBool_callback SetBool;
+ /** C type : GetInt32_callback* */
+ public VR_IVRSettings_FnTable.GetInt32_callback GetInt32;
+ /** C type : SetInt32_callback* */
+ public VR_IVRSettings_FnTable.SetInt32_callback SetInt32;
+ /** C type : GetFloat_callback* */
+ public VR_IVRSettings_FnTable.GetFloat_callback GetFloat;
+ /** C type : SetFloat_callback* */
+ public VR_IVRSettings_FnTable.SetFloat_callback SetFloat;
+ /** C type : GetString_callback* */
+ public VR_IVRSettings_FnTable.GetString_callback GetString;
+ /** C type : SetString_callback* */
+ public VR_IVRSettings_FnTable.SetString_callback SetString;
+ /** C type : RemoveSection_callback* */
+ public VR_IVRSettings_FnTable.RemoveSection_callback RemoveSection;
+ /** C type : RemoveKeyInSection_callback* */
+ public VR_IVRSettings_FnTable.RemoveKeyInSection_callback RemoveKeyInSection;
+ public interface GetSettingsErrorNameFromEnum_callback extends Callback {
+ Pointer apply(int eError);
+ };
+ public interface Sync_callback extends Callback {
+ byte apply(byte bForce, IntByReference peError);
+ };
+ public interface GetBool_callback extends Callback {
+ byte apply(Pointer pchSection, Pointer pchSettingsKey, byte bDefaultValue, IntByReference peError);
+ };
+ public interface SetBool_callback extends Callback {
+ void apply(Pointer pchSection, Pointer pchSettingsKey, byte bValue, IntByReference peError);
+ };
+ public interface GetInt32_callback extends Callback {
+ int apply(Pointer pchSection, Pointer pchSettingsKey, int nDefaultValue, IntByReference peError);
+ };
+ public interface SetInt32_callback extends Callback {
+ void apply(Pointer pchSection, Pointer pchSettingsKey, int nValue, IntByReference peError);
+ };
+ public interface GetFloat_callback extends Callback {
+ float apply(Pointer pchSection, Pointer pchSettingsKey, float flDefaultValue, IntByReference peError);
+ };
+ public interface SetFloat_callback extends Callback {
+ void apply(Pointer pchSection, Pointer pchSettingsKey, float flValue, IntByReference peError);
+ };
+ public interface GetString_callback extends Callback {
+ void apply(Pointer pchSection, Pointer pchSettingsKey, Pointer pchValue, int unValueLen, Pointer pchDefaultValue, IntByReference peError);
+ };
+ public interface SetString_callback extends Callback {
+ void apply(Pointer pchSection, Pointer pchSettingsKey, Pointer pchValue, IntByReference peError);
+ };
+ public interface RemoveSection_callback extends Callback {
+ void apply(Pointer pchSection, IntByReference peError);
+ };
+ public interface RemoveKeyInSection_callback extends Callback {
+ void apply(Pointer pchSection, Pointer pchSettingsKey, IntByReference peError);
+ };
+ public VR_IVRSettings_FnTable() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("GetSettingsErrorNameFromEnum", "Sync", "GetBool", "SetBool", "GetInt32", "SetInt32", "GetFloat", "SetFloat", "GetString", "SetString", "RemoveSection", "RemoveKeyInSection");
+ }
+ public VR_IVRSettings_FnTable(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends VR_IVRSettings_FnTable implements Structure.ByReference {
+
+ };
+ public static class ByValue extends VR_IVRSettings_FnTable implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/VR_IVRSystem_FnTable.java b/jme3-vr/src/main/java/jopenvr/VR_IVRSystem_FnTable.java
new file mode 100644
index 000000000..6b04410db
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/VR_IVRSystem_FnTable.java
@@ -0,0 +1,363 @@
+package jopenvr;
+import com.sun.jna.Callback;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import com.sun.jna.ptr.FloatByReference;
+import com.sun.jna.ptr.IntByReference;
+import java.nio.FloatBuffer;
+import java.nio.IntBuffer;
+import java.nio.LongBuffer;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * OpenVR Function Pointer Tables
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class VR_IVRSystem_FnTable extends Structure {
+ /** C type : GetRecommendedRenderTargetSize_callback* */
+ public VR_IVRSystem_FnTable.GetRecommendedRenderTargetSize_callback GetRecommendedRenderTargetSize;
+ /** C type : GetProjectionMatrix_callback* */
+ public VR_IVRSystem_FnTable.GetProjectionMatrix_callback GetProjectionMatrix;
+ /** C type : GetProjectionRaw_callback* */
+ public VR_IVRSystem_FnTable.GetProjectionRaw_callback GetProjectionRaw;
+ /** C type : ComputeDistortion_callback* */
+ public VR_IVRSystem_FnTable.ComputeDistortion_callback ComputeDistortion;
+ /** C type : GetEyeToHeadTransform_callback* */
+ public VR_IVRSystem_FnTable.GetEyeToHeadTransform_callback GetEyeToHeadTransform;
+ /** C type : GetTimeSinceLastVsync_callback* */
+ public VR_IVRSystem_FnTable.GetTimeSinceLastVsync_callback GetTimeSinceLastVsync;
+ /** C type : GetD3D9AdapterIndex_callback* */
+ public VR_IVRSystem_FnTable.GetD3D9AdapterIndex_callback GetD3D9AdapterIndex;
+ /** C type : GetDXGIOutputInfo_callback* */
+ public jopenvr.VR_IVRExtendedDisplay_FnTable.GetDXGIOutputInfo_callback GetDXGIOutputInfo;
+ /** C type : IsDisplayOnDesktop_callback* */
+ public VR_IVRSystem_FnTable.IsDisplayOnDesktop_callback IsDisplayOnDesktop;
+ /** C type : SetDisplayVisibility_callback* */
+ public VR_IVRSystem_FnTable.SetDisplayVisibility_callback SetDisplayVisibility;
+ /** C type : GetDeviceToAbsoluteTrackingPose_callback* */
+ public VR_IVRSystem_FnTable.GetDeviceToAbsoluteTrackingPose_callback GetDeviceToAbsoluteTrackingPose;
+ /** C type : ResetSeatedZeroPose_callback* */
+ public VR_IVRSystem_FnTable.ResetSeatedZeroPose_callback ResetSeatedZeroPose;
+ /** C type : GetSeatedZeroPoseToStandingAbsoluteTrackingPose_callback* */
+ public VR_IVRSystem_FnTable.GetSeatedZeroPoseToStandingAbsoluteTrackingPose_callback GetSeatedZeroPoseToStandingAbsoluteTrackingPose;
+ /** C type : GetRawZeroPoseToStandingAbsoluteTrackingPose_callback* */
+ public VR_IVRSystem_FnTable.GetRawZeroPoseToStandingAbsoluteTrackingPose_callback GetRawZeroPoseToStandingAbsoluteTrackingPose;
+ /** C type : GetSortedTrackedDeviceIndicesOfClass_callback* */
+ public VR_IVRSystem_FnTable.GetSortedTrackedDeviceIndicesOfClass_callback GetSortedTrackedDeviceIndicesOfClass;
+ /** C type : GetTrackedDeviceActivityLevel_callback* */
+ public VR_IVRSystem_FnTable.GetTrackedDeviceActivityLevel_callback GetTrackedDeviceActivityLevel;
+ /** C type : ApplyTransform_callback* */
+ public VR_IVRSystem_FnTable.ApplyTransform_callback ApplyTransform;
+ /** C type : GetTrackedDeviceIndexForControllerRole_callback* */
+ public VR_IVRSystem_FnTable.GetTrackedDeviceIndexForControllerRole_callback GetTrackedDeviceIndexForControllerRole;
+ /** C type : GetControllerRoleForTrackedDeviceIndex_callback* */
+ public VR_IVRSystem_FnTable.GetControllerRoleForTrackedDeviceIndex_callback GetControllerRoleForTrackedDeviceIndex;
+ /** C type : GetTrackedDeviceClass_callback* */
+ public VR_IVRSystem_FnTable.GetTrackedDeviceClass_callback GetTrackedDeviceClass;
+ /** C type : IsTrackedDeviceConnected_callback* */
+ public VR_IVRSystem_FnTable.IsTrackedDeviceConnected_callback IsTrackedDeviceConnected;
+ /** C type : GetBoolTrackedDeviceProperty_callback* */
+ public VR_IVRSystem_FnTable.GetBoolTrackedDeviceProperty_callback GetBoolTrackedDeviceProperty;
+
+ /**
+ * Returns a static property for a tracked device.
+ * The different typed GetXTrackedDeviceProperty functions return a value on failure that is generally reasonable for that type:
+ *
+ * GetBoolTrackedDeviceProperty - false
+ * GetFloatTrackedDeviceProperty - 0.0
+ * GetInt32TrackedDeviceProperty - 0
+ * GetUint64TrackedDeviceProperty - 0
+ * GetMatrix34TrackedDeviceProperty - identity matrix
+ * GetStringTrackedDeviceProperty - 0 (and 0-length string)
+ *
+ *
+ * String Properties
+ * Because the application owns the buffer to fill with a string property, retrieving a string property is a little different.
+ * GetStringTrackedDeviceProperty
returns the number of bytes necessary to hold the string, including the trailing null.
+ * If the buffer wasn't large enough it passes back TrackedProp_BufferTooSmall as the error and doesn't fill the string into the buffer.
+ * Strings will generally fit in buffers of k_unTrackingStringSize characters.
+ *
+ * Property Errors
+ * TrackedPropertyError will be one of:
+ *
+ * TrackedProp_Success - The property request was successful.
+ * TrackedProp_WrongDataType - The property was requested with the wrong typed function.
+ * TrackedProp_WrongDeviceClass - The property was requested on a tracked device with the wrong class.
+ * TrackedProp_BufferTooSmall - The string property will not fit in the provided buffer. The buffer size needed is returned.
+ * TrackedProp_UnknownProperty - The property enum value is unknown.
+ * TrackedProp_InvalidDevice - The tracked device index was invalid.
+ * TrackedProp_CouldNotContactServer - OpenVR could not contact vrserver to query the device for this property.
+ * TrackedProp_ValueNotProvidedByDevice - The driver for this device returned that it does not provide this specific property for this device.
+ * TrackedProp_StringExceedsMaximumLength - The string property value returned by a driver exceeded the maximum property length of 32k.
+ *
+ */
+ public VR_IVRSystem_FnTable.GetFloatTrackedDeviceProperty_callback GetFloatTrackedDeviceProperty;
+
+ /** C type : GetInt32TrackedDeviceProperty_callback* */
+ public VR_IVRSystem_FnTable.GetInt32TrackedDeviceProperty_callback GetInt32TrackedDeviceProperty;
+ /** C type : GetUint64TrackedDeviceProperty_callback* */
+ public VR_IVRSystem_FnTable.GetUint64TrackedDeviceProperty_callback GetUint64TrackedDeviceProperty;
+ /** C type : GetMatrix34TrackedDeviceProperty_callback* */
+ public VR_IVRSystem_FnTable.GetMatrix34TrackedDeviceProperty_callback GetMatrix34TrackedDeviceProperty;
+ /** C type : GetStringTrackedDeviceProperty_callback* */
+ public VR_IVRSystem_FnTable.GetStringTrackedDeviceProperty_callback GetStringTrackedDeviceProperty;
+ /** C type : GetPropErrorNameFromEnum_callback* */
+ public VR_IVRSystem_FnTable.GetPropErrorNameFromEnum_callback GetPropErrorNameFromEnum;
+ /** C type : PollNextEvent_callback* */
+ public VR_IVRSystem_FnTable.PollNextEvent_callback PollNextEvent;
+ /** C type : PollNextEventWithPose_callback* */
+ public VR_IVRSystem_FnTable.PollNextEventWithPose_callback PollNextEventWithPose;
+ /** C type : GetEventTypeNameFromEnum_callback* */
+ public VR_IVRSystem_FnTable.GetEventTypeNameFromEnum_callback GetEventTypeNameFromEnum;
+ /** C type : GetHiddenAreaMesh_callback* */
+ public VR_IVRSystem_FnTable.GetHiddenAreaMesh_callback GetHiddenAreaMesh;
+ /** C type : GetControllerState_callback* */
+ public VR_IVRSystem_FnTable.GetControllerState_callback GetControllerState;
+ /** C type : GetControllerStateWithPose_callback* */
+ public VR_IVRSystem_FnTable.GetControllerStateWithPose_callback GetControllerStateWithPose;
+
+
+ /**
+ * Trigger a single haptic pulse on a controller.
+ *
+ * vr::TrackedDeviceIndex_t unControllerDeviceIndex
- The tracked device index of the controller to trigger a haptic pulse on.
+ * uint32_t unAxisId
- The ID of the axis to trigger a haptic pulse on.
+ * unsigned short usDurationMicroSec
- The duration of the desired haptic pulse in microseconds.
+ *
+ *
+ * Description
+ * Trigger a single haptic pulse on a controller.
+ * Note: After this call the application may not trigger another haptic pulse on this controller and axis combination for 5ms.
+ *
+ * see IVRSystem::TriggerHapticPulse
+ */
+ public VR_IVRSystem_FnTable.TriggerHapticPulse_callback TriggerHapticPulse;
+
+
+ /** C type : GetButtonIdNameFromEnum_callback* */
+ public VR_IVRSystem_FnTable.GetButtonIdNameFromEnum_callback GetButtonIdNameFromEnum;
+ /** C type : GetControllerAxisTypeNameFromEnum_callback* */
+ public VR_IVRSystem_FnTable.GetControllerAxisTypeNameFromEnum_callback GetControllerAxisTypeNameFromEnum;
+ /** C type : CaptureInputFocus_callback* */
+ public VR_IVRSystem_FnTable.CaptureInputFocus_callback CaptureInputFocus;
+ /** C type : ReleaseInputFocus_callback* */
+ public VR_IVRSystem_FnTable.ReleaseInputFocus_callback ReleaseInputFocus;
+ /** C type : IsInputFocusCapturedByAnotherProcess_callback* */
+ public VR_IVRSystem_FnTable.IsInputFocusCapturedByAnotherProcess_callback IsInputFocusCapturedByAnotherProcess;
+ /** C type : DriverDebugRequest_callback* */
+ public VR_IVRSystem_FnTable.DriverDebugRequest_callback DriverDebugRequest;
+ /** C type : PerformFirmwareUpdate_callback* */
+ public VR_IVRSystem_FnTable.PerformFirmwareUpdate_callback PerformFirmwareUpdate;
+ /** C type : AcknowledgeQuit_Exiting_callback* */
+ public VR_IVRSystem_FnTable.AcknowledgeQuit_Exiting_callback AcknowledgeQuit_Exiting;
+ /** C type : AcknowledgeQuit_UserPrompt_callback* */
+ public VR_IVRSystem_FnTable.AcknowledgeQuit_UserPrompt_callback AcknowledgeQuit_UserPrompt;
+ /** C type : PerformanceTestEnableCapture_callback* */
+ public interface GetRecommendedRenderTargetSize_callback extends Callback {
+ 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);
+ };
+ 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);
+ };
+ public interface GetEyeToHeadTransform_callback extends Callback {
+ HmdMatrix34_t.ByValue apply(int eEye);
+ };
+ public interface GetTimeSinceLastVsync_callback extends Callback {
+ byte apply(FloatBuffer pfSecondsSinceLastVsync, LongBuffer pulFrameCounter);
+ };
+ public interface GetD3D9AdapterIndex_callback extends Callback {
+ int apply();
+ };
+ public interface GetDXGIOutputInfo_callback extends Callback {
+ void apply(IntByReference pnAdapterIndex);
+ };
+ public interface IsDisplayOnDesktop_callback extends Callback {
+ byte apply();
+ };
+ public interface SetDisplayVisibility_callback extends Callback {
+ byte apply(byte bIsVisibleOnDesktop);
+ };
+ public interface GetDeviceToAbsoluteTrackingPose_callback extends Callback {
+ void apply(int eOrigin, float fPredictedSecondsToPhotonsFromNow, TrackedDevicePose_t pTrackedDevicePoseArray, int unTrackedDevicePoseArrayCount);
+ };
+ public interface ResetSeatedZeroPose_callback extends Callback {
+ void apply();
+ };
+ public interface GetSeatedZeroPoseToStandingAbsoluteTrackingPose_callback extends Callback {
+ HmdMatrix34_t.ByValue apply();
+ };
+ public interface GetRawZeroPoseToStandingAbsoluteTrackingPose_callback extends Callback {
+ HmdMatrix34_t.ByValue apply();
+ };
+ public interface GetSortedTrackedDeviceIndicesOfClass_callback extends Callback {
+ int apply(int eTrackedDeviceClass, IntByReference punTrackedDeviceIndexArray, int unTrackedDeviceIndexArrayCount, int unRelativeToTrackedDeviceIndex);
+ };
+ public interface GetTrackedDeviceActivityLevel_callback extends Callback {
+ int apply(int unDeviceId);
+ };
+ public interface ApplyTransform_callback extends Callback {
+ void apply(TrackedDevicePose_t pOutputPose, TrackedDevicePose_t pTrackedDevicePose, HmdMatrix34_t pTransform);
+ };
+ public interface GetTrackedDeviceIndexForControllerRole_callback extends Callback {
+ int apply(int unDeviceType);
+ };
+ public interface GetControllerRoleForTrackedDeviceIndex_callback extends Callback {
+ int apply(int unDeviceIndex);
+ };
+ public interface GetTrackedDeviceClass_callback extends Callback {
+ int apply(int unDeviceIndex);
+ };
+ public interface IsTrackedDeviceConnected_callback extends Callback {
+ byte apply(int unDeviceIndex);
+ };
+ public interface GetBoolTrackedDeviceProperty_callback extends Callback {
+ byte apply(int unDeviceIndex, int prop, IntBuffer pError);
+ };
+
+ /**
+ * IVRSystem::GetTrackedDeviceProperty encapsulation.
+ */
+ public interface GetFloatTrackedDeviceProperty_callback extends Callback {
+
+ /**
+ * Returns a static property for a tracked device.
+ * The different typed GetXTrackedDeviceProperty functions return a value on failure that is generally reasonable for that type:
+ *
+ * GetBoolTrackedDeviceProperty - false
+ * GetFloatTrackedDeviceProperty - 0.0
+ * GetInt32TrackedDeviceProperty - 0
+ * GetUint64TrackedDeviceProperty - 0
+ * GetMatrix34TrackedDeviceProperty - identity matrix
+ * GetStringTrackedDeviceProperty - 0 (and 0-length string)
+ *
+ *
+ * String Properties
+ * Because the application owns the buffer to fill with a string property, retrieving a string property is a little different.
+ * GetStringTrackedDeviceProperty
returns the number of bytes necessary to hold the string, including the trailing null.
+ * If the buffer wasn't large enough it passes back TrackedProp_BufferTooSmall as the error and doesn't fill the string into the buffer.
+ * Strings will generally fit in buffers of k_unTrackingStringSize characters.
+ *
+ * Property Errors
+ * TrackedPropertyError will be one of:
+ *
+ * TrackedProp_Success - The property request was successful.
+ * TrackedProp_WrongDataType - The property was requested with the wrong typed function.
+ * TrackedProp_WrongDeviceClass - The property was requested on a tracked device with the wrong class.
+ * TrackedProp_BufferTooSmall - The string property will not fit in the provided buffer. The buffer size needed is returned.
+ * TrackedProp_UnknownProperty - The property enum value is unknown.
+ * TrackedProp_InvalidDevice - The tracked device index was invalid.
+ * TrackedProp_CouldNotContactServer - OpenVR could not contact vrserver to query the device for this property.
+ * TrackedProp_ValueNotProvidedByDevice - The driver for this device returned that it does not provide this specific property for this device.
+ * TrackedProp_StringExceedsMaximumLength - The string property value returned by a driver exceeded the maximum property length of 32k.
+ *
+ *
+ * see IVRSystem::GetTrackedDeviceProperty .
+ * @param unDeviceIndex Index of the device to get the property for.
+ * @param prop Which property to get.
+ * @param pError The error returned when attempting to fetch this property. This can be NULL if the caller doesn't care about the source of a property error.
+ * @return the float value of the property.
+ */
+ float apply(int unDeviceIndex, int prop, IntBuffer pError);
+ };
+ public interface GetInt32TrackedDeviceProperty_callback extends Callback {
+ int apply(int unDeviceIndex, int prop, IntBuffer pError);
+ };
+ public interface GetUint64TrackedDeviceProperty_callback extends Callback {
+ long apply(int unDeviceIndex, int prop, IntBuffer pError);
+ };
+ public interface GetMatrix34TrackedDeviceProperty_callback extends Callback {
+ HmdMatrix34_t.ByValue apply(int unDeviceIndex, int prop, IntByReference pError);
+ };
+ public interface GetStringTrackedDeviceProperty_callback extends Callback {
+ int apply(int unDeviceIndex, int prop, Pointer pchValue, int unBufferSize, IntBuffer pError);
+ };
+ public interface GetPropErrorNameFromEnum_callback extends Callback {
+ Pointer apply(int error);
+ };
+ public interface PollNextEvent_callback extends Callback {
+ byte apply(VREvent_t pEvent, int uncbVREvent);
+ };
+ public interface PollNextEventWithPose_callback extends Callback {
+ byte apply(int eOrigin, VREvent_t pEvent, int uncbVREvent, TrackedDevicePose_t pTrackedDevicePose);
+ };
+ public interface GetEventTypeNameFromEnum_callback extends Callback {
+ Pointer apply(int eType);
+ };
+ public interface GetHiddenAreaMesh_callback extends Callback {
+ jopenvr.HiddenAreaMesh_t.ByValue apply(int eEye);
+ };
+ public interface GetControllerState_callback extends Callback {
+ byte apply(int unControllerDeviceIndex, VRControllerState_t pControllerState);
+ };
+ public interface GetControllerStateWithPose_callback extends Callback {
+ byte apply(int eOrigin, int unControllerDeviceIndex, VRControllerState_t pControllerState, TrackedDevicePose_t pTrackedDevicePose);
+ };
+
+
+ /**
+ * IVRSystem::TriggerHapticPulse encapsulation.
+ */
+ public interface TriggerHapticPulse_callback extends Callback {
+
+ /**
+ * Trigger a single haptic pulse on a controller.
+ * Note: After this call the application may not trigger another haptic pulse on this controller and axis combination for 5ms.
+ *
+ * see IVRSystem::TriggerHapticPulse
+ * @param unControllerDeviceIndex The tracked device index of the controller to trigger a haptic pulse on.
+ * @param unAxisId The ID of the axis to trigger a haptic pulse on.
+ * @param usDurationMicroSec The duration of the desired haptic pulse in microseconds.
+ */
+ void apply(int unControllerDeviceIndex, int unAxisId, short usDurationMicroSec);
+ };
+ public interface GetButtonIdNameFromEnum_callback extends Callback {
+ Pointer apply(int eButtonId);
+ };
+ public interface GetControllerAxisTypeNameFromEnum_callback extends Callback {
+ Pointer apply(int eAxisType);
+ };
+ public interface CaptureInputFocus_callback extends Callback {
+ byte apply();
+ };
+ public interface ReleaseInputFocus_callback extends Callback {
+ void apply();
+ };
+ public interface IsInputFocusCapturedByAnotherProcess_callback extends Callback {
+ byte apply();
+ };
+ public interface DriverDebugRequest_callback extends Callback {
+ int apply(int unDeviceIndex, Pointer pchRequest, Pointer pchResponseBuffer, int unResponseBufferSize);
+ };
+ public interface PerformFirmwareUpdate_callback extends Callback {
+ int apply(int unDeviceIndex);
+ };
+ public interface AcknowledgeQuit_Exiting_callback extends Callback {
+ void apply();
+ };
+ public interface AcknowledgeQuit_UserPrompt_callback extends Callback {
+ void apply();
+ };
+ public VR_IVRSystem_FnTable() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("GetRecommendedRenderTargetSize", "GetProjectionMatrix", "GetProjectionRaw", "ComputeDistortion", "GetEyeToHeadTransform", "GetTimeSinceLastVsync", "GetD3D9AdapterIndex", "GetDXGIOutputInfo", "IsDisplayOnDesktop", "SetDisplayVisibility", "GetDeviceToAbsoluteTrackingPose", "ResetSeatedZeroPose", "GetSeatedZeroPoseToStandingAbsoluteTrackingPose", "GetRawZeroPoseToStandingAbsoluteTrackingPose", "GetSortedTrackedDeviceIndicesOfClass", "GetTrackedDeviceActivityLevel", "ApplyTransform", "GetTrackedDeviceIndexForControllerRole", "GetControllerRoleForTrackedDeviceIndex", "GetTrackedDeviceClass", "IsTrackedDeviceConnected", "GetBoolTrackedDeviceProperty", "GetFloatTrackedDeviceProperty", "GetInt32TrackedDeviceProperty", "GetUint64TrackedDeviceProperty", "GetMatrix34TrackedDeviceProperty", "GetStringTrackedDeviceProperty", "GetPropErrorNameFromEnum", "PollNextEvent", "PollNextEventWithPose", "GetEventTypeNameFromEnum", "GetHiddenAreaMesh", "GetControllerState", "GetControllerStateWithPose", "TriggerHapticPulse", "GetButtonIdNameFromEnum", "GetControllerAxisTypeNameFromEnum", "CaptureInputFocus", "ReleaseInputFocus", "IsInputFocusCapturedByAnotherProcess", "DriverDebugRequest", "PerformFirmwareUpdate", "AcknowledgeQuit_Exiting", "AcknowledgeQuit_UserPrompt");
+ }
+ public VR_IVRSystem_FnTable(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends VR_IVRSystem_FnTable implements Structure.ByReference {
+
+ };
+ public static class ByValue extends VR_IVRSystem_FnTable implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/jopenvr/VR_IVRTrackedCamera_FnTable.java b/jme3-vr/src/main/java/jopenvr/VR_IVRTrackedCamera_FnTable.java
new file mode 100644
index 000000000..c6d7253da
--- /dev/null
+++ b/jme3-vr/src/main/java/jopenvr/VR_IVRTrackedCamera_FnTable.java
@@ -0,0 +1,90 @@
+package jopenvr;
+import com.sun.jna.Callback;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import com.sun.jna.ptr.IntByReference;
+import com.sun.jna.ptr.LongByReference;
+import com.sun.jna.ptr.PointerByReference;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class VR_IVRTrackedCamera_FnTable extends Structure {
+ /** C type : GetCameraErrorNameFromEnum_callback* */
+ public VR_IVRTrackedCamera_FnTable.GetCameraErrorNameFromEnum_callback GetCameraErrorNameFromEnum;
+ /** C type : HasCamera_callback* */
+ public VR_IVRTrackedCamera_FnTable.HasCamera_callback HasCamera;
+ /** C type : GetCameraFrameSize_callback* */
+ public VR_IVRTrackedCamera_FnTable.GetCameraFrameSize_callback GetCameraFrameSize;
+ /** C type : GetCameraIntrinisics_callback* */
+ public VR_IVRTrackedCamera_FnTable.GetCameraIntrinisics_callback GetCameraIntrinisics;
+ /** C type : GetCameraProjection_callback* */
+ public VR_IVRTrackedCamera_FnTable.GetCameraProjection_callback GetCameraProjection;
+ /** C type : AcquireVideoStreamingService_callback* */
+ public VR_IVRTrackedCamera_FnTable.AcquireVideoStreamingService_callback AcquireVideoStreamingService;
+ /** C type : ReleaseVideoStreamingService_callback* */
+ public VR_IVRTrackedCamera_FnTable.ReleaseVideoStreamingService_callback ReleaseVideoStreamingService;
+ /** C type : GetVideoStreamFrameBuffer_callback* */
+ public VR_IVRTrackedCamera_FnTable.GetVideoStreamFrameBuffer_callback GetVideoStreamFrameBuffer;
+ public VR_IVRTrackedCamera_FnTable.GetVideoStreamTextureSize_callback GetVideoStreamTextureSize;
+ /** C type : GetVideoStreamTextureD3D11_callback* */
+ public VR_IVRTrackedCamera_FnTable.GetVideoStreamTextureD3D11_callback GetVideoStreamTextureD3D11;
+ /** C type : GetVideoStreamTextureGL_callback* */
+ public VR_IVRTrackedCamera_FnTable.GetVideoStreamTextureGL_callback GetVideoStreamTextureGL;
+ /** C type : ReleaseVideoStreamTextureGL_callback* */
+ public VR_IVRTrackedCamera_FnTable.ReleaseVideoStreamTextureGL_callback ReleaseVideoStreamTextureGL;
+ public interface GetCameraErrorNameFromEnum_callback extends Callback {
+ Pointer apply(int eCameraError);
+ };
+ public interface HasCamera_callback extends Callback {
+ int apply(int nDeviceIndex, Pointer pHasCamera);
+ };
+ public interface GetCameraFrameSize_callback extends Callback {
+ int apply(int nDeviceIndex, int eFrameType, IntByReference pnWidth, IntByReference pnHeight, IntByReference pnFrameBufferSize);
+ };
+ public interface GetCameraIntrinisics_callback extends Callback {
+ int apply(int nDeviceIndex, int eFrameType, HmdVector2_t pFocalLength, HmdVector2_t pCenter);
+ };
+ public interface GetCameraProjection_callback extends Callback {
+ int apply(int nDeviceIndex, int eFrameType, float flZNear, float flZFar, HmdMatrix44_t pProjection);
+ };
+ public interface AcquireVideoStreamingService_callback extends Callback {
+ int apply(int nDeviceIndex, LongByReference pHandle);
+ };
+ public interface ReleaseVideoStreamingService_callback extends Callback {
+ int apply(long hTrackedCamera);
+ };
+ public interface GetVideoStreamFrameBuffer_callback extends Callback {
+ int apply(long hTrackedCamera, int eFrameType, Pointer pFrameBuffer, int nFrameBufferSize, CameraVideoStreamFrameHeader_t pFrameHeader, int nFrameHeaderSize);
+ };
+ public interface GetVideoStreamTextureSize_callback extends Callback {
+ int apply(int nDeviceIndex, int eFrameType, VRTextureBounds_t pTextureBounds, IntByReference pnWidth, IntByReference pnHeight);
+ };
+ public interface GetVideoStreamTextureD3D11_callback extends Callback {
+ int apply(long hTrackedCamera, int eFrameType, Pointer pD3D11DeviceOrResource, PointerByReference ppD3D11ShaderResourceView, CameraVideoStreamFrameHeader_t pFrameHeader, int nFrameHeaderSize);
+ };
+ public interface GetVideoStreamTextureGL_callback extends Callback {
+ int apply(long hTrackedCamera, int eFrameType, IntByReference pglTextureId, CameraVideoStreamFrameHeader_t pFrameHeader, int nFrameHeaderSize);
+ };
+ public interface ReleaseVideoStreamTextureGL_callback extends Callback {
+ int apply(long hTrackedCamera, int glTextureId);
+ };
+ public VR_IVRTrackedCamera_FnTable() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("GetCameraErrorNameFromEnum", "HasCamera", "GetCameraFrameSize", "GetCameraIntrinisics", "GetCameraProjection", "AcquireVideoStreamingService", "ReleaseVideoStreamingService", "GetVideoStreamFrameBuffer", "GetVideoStreamTextureSize", "GetVideoStreamTextureD3D11", "GetVideoStreamTextureGL", "ReleaseVideoStreamTextureGL");
+ }
+ public VR_IVRTrackedCamera_FnTable(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends VR_IVRTrackedCamera_FnTable implements Structure.ByReference {
+
+ };
+ public static class ByValue extends VR_IVRTrackedCamera_FnTable implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrclientkit/OsvrClientKitLibrary.java b/jme3-vr/src/main/java/osvrclientkit/OsvrClientKitLibrary.java
new file mode 100644
index 000000000..23975954d
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrclientkit/OsvrClientKitLibrary.java
@@ -0,0 +1,328 @@
+package osvrclientkit;
+import com.sun.jna.Callback;
+import com.sun.jna.Library;
+import com.sun.jna.Native;
+import com.sun.jna.NativeLibrary;
+import com.sun.jna.Pointer;
+import com.sun.jna.PointerType;
+import com.sun.jna.ptr.PointerByReference;
+/**
+ * JNA Wrapper for library osvrClientKit
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OsvrClientKitLibrary implements Library {
+ public static final String JNA_LIBRARY_NAME = "osvrClientKit";
+ public static final NativeLibrary JNA_NATIVE_LIB = NativeLibrary.getInstance(OsvrClientKitLibrary.JNA_LIBRARY_NAME);
+ static {
+ Native.register(OsvrClientKitLibrary.class, OsvrClientKitLibrary.JNA_NATIVE_LIB);
+ }
+ /**
+ * @brief Initialize the library.
+ * @param applicationIdentifier A null terminated string identifying your
+ * application. Reverse DNS format strongly suggested.
+ * @param flags initialization options (reserved) - pass 0 for now.
+ * @returns Client context - will be needed for subsequent calls
+ * Original signature : OSVR_ClientContext osvrClientInit(const char[], uint32_t)
+ * @deprecated use the safer methods {@link #osvrClientInit(byte[], int)} and {@link #osvrClientInit(com.sun.jna.Pointer, int)} instead
+ */
+ @Deprecated
+ public static native OsvrClientKitLibrary.OSVR_ClientContext osvrClientInit(Pointer applicationIdentifier, int flags);
+ /**
+ * @brief Initialize the library.
+ * @param applicationIdentifier A null terminated string identifying your
+ * application. Reverse DNS format strongly suggested.
+ * @param flags initialization options (reserved) - pass 0 for now.
+ * @returns Client context - will be needed for subsequent calls
+ * Original signature : OSVR_ClientContext osvrClientInit(const char[], uint32_t)
+ */
+ public static native OsvrClientKitLibrary.OSVR_ClientContext osvrClientInit(byte applicationIdentifier[], int flags);
+ /**
+ * @brief Updates the state of the context - call regularly in your mainloop.
+ * @param ctx Client context
+ * Original signature : OSVR_ReturnCode osvrClientUpdate(OSVR_ClientContext)
+ * @deprecated use the safer methods {@link #osvrClientUpdate(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientContext)} and {@link #osvrClientUpdate(com.sun.jna.Pointer)} instead
+ */
+ @Deprecated
+ public static native byte osvrClientUpdate(Pointer ctx);
+ /**
+ * @brief Updates the state of the context - call regularly in your mainloop.
+ * @param ctx Client context
+ * Original signature : OSVR_ReturnCode osvrClientUpdate(OSVR_ClientContext)
+ */
+ public static native byte osvrClientUpdate(OsvrClientKitLibrary.OSVR_ClientContext ctx);
+ /**
+ * @brief Checks to see if the client context is fully started up and connected
+ * properly to a server.
+ * If this reports that the client context is not OK, there may not be a server
+ * running, or you may just have to call osvrClientUpdate() a few times to
+ * permit startup to finish. The return value of this call will not change from
+ * failure to success without calling osvrClientUpdate().
+ * @param ctx Client context
+ * @return OSVR_RETURN_FAILURE if not yet fully connected/initialized, or if
+ * some other error (null context) occurs.
+ * Original signature : OSVR_ReturnCode osvrClientCheckStatus(OSVR_ClientContext)
+ * @deprecated use the safer methods {@link #osvrClientCheckStatus(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientContext)} and {@link #osvrClientCheckStatus(com.sun.jna.Pointer)} instead
+ */
+ @Deprecated
+ public static native byte osvrClientCheckStatus(Pointer ctx);
+ /**
+ * @brief Checks to see if the client context is fully started up and connected
+ * properly to a server.
+ * If this reports that the client context is not OK, there may not be a server
+ * running, or you may just have to call osvrClientUpdate() a few times to
+ * permit startup to finish. The return value of this call will not change from
+ * failure to success without calling osvrClientUpdate().
+ * @param ctx Client context
+ * @return OSVR_RETURN_FAILURE if not yet fully connected/initialized, or if
+ * some other error (null context) occurs.
+ * Original signature : OSVR_ReturnCode osvrClientCheckStatus(OSVR_ClientContext)
+ */
+ public static native byte osvrClientCheckStatus(OsvrClientKitLibrary.OSVR_ClientContext ctx);
+ /**
+ * @brief Shutdown the library.
+ * @param ctx Client context
+ * Original signature : OSVR_ReturnCode osvrClientShutdown(OSVR_ClientContext)
+ * @deprecated use the safer methods {@link #osvrClientShutdown(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientContext)} and {@link #osvrClientShutdown(com.sun.jna.Pointer)} instead
+ */
+ @Deprecated
+ public static native byte osvrClientShutdown(Pointer ctx);
+ /**
+ * @brief Shutdown the library.
+ * @param ctx Client context
+ * Original signature : OSVR_ReturnCode osvrClientShutdown(OSVR_ClientContext)
+ */
+ public static native byte osvrClientShutdown(OsvrClientKitLibrary.OSVR_ClientContext ctx);
+ /**
+ * @brief Log a message from the client.
+ * Original signature : void osvrClientLog(OSVR_ClientContext, OSVR_LogLevel, const char*)
+ * @deprecated use the safer methods {@link #osvrClientLog(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientContext, int, java.lang.String)} and {@link #osvrClientLog(com.sun.jna.Pointer, int, com.sun.jna.Pointer)} instead
+ */
+ @Deprecated
+ public static native void osvrClientLog(Pointer ctx, int severity, Pointer message);
+ /**
+ * @brief Log a message from the client.
+ * Original signature : void osvrClientLog(OSVR_ClientContext, OSVR_LogLevel, const char*)
+ */
+ public static native void osvrClientLog(OsvrClientKitLibrary.OSVR_ClientContext ctx, int severity, String message);
+ /**
+ * @brief Get the interface associated with the given path.
+ * @param ctx Client context
+ * @param path A resource path (null-terminated string)
+ * @param[out] iface The interface object. May be freed when no longer needed,
+ * otherwise it will be freed when the context is closed.
+ * Original signature : OSVR_ReturnCode osvrClientGetInterface(OSVR_ClientContext, const char[], OSVR_ClientInterface*)
+ * @deprecated use the safer methods {@link #osvrClientGetInterface(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientContext, byte[], com.sun.jna.ptr.PointerByReference)} and {@link #osvrClientGetInterface(com.sun.jna.Pointer, com.sun.jna.Pointer, com.sun.jna.ptr.PointerByReference)} instead
+ */
+ @Deprecated
+ public static native byte osvrClientGetInterface(Pointer ctx, Pointer path, Pointer iface);
+ /**
+ * @brief Get the interface associated with the given path.
+ * @param ctx Client context
+ * @param path A resource path (null-terminated string)
+ * @param[out] iface The interface object. May be freed when no longer needed,
+ * otherwise it will be freed when the context is closed.
+ * Original signature : OSVR_ReturnCode osvrClientGetInterface(OSVR_ClientContext, const char[], OSVR_ClientInterface*)
+ */
+ public static native byte osvrClientGetInterface(OsvrClientKitLibrary.OSVR_ClientContext ctx, byte path[], PointerByReference iface);
+ /**
+ * @brief Get the interface associated with the given path.
+ * @param ctx Client context
+ * @param path A resource path (null-terminated string)
+ * @param[out] iface The interface object. May be freed when no longer needed,
+ * otherwise it will be freed when the context is closed.
+ * Original signature : OSVR_ReturnCode osvrClientGetInterface(OSVR_ClientContext, const char[], OSVR_ClientInterface*)
+ */
+ public static native byte osvrClientGetInterface(Pointer ctx, Pointer path, PointerByReference iface);
+ /**
+ * @brief Free an interface object before context closure.
+ * @param ctx Client context
+ * @param iface The interface object
+ * @returns OSVR_RETURN_SUCCESS unless a null context or interface was passed
+ * or the given interface was not found in the context (i.e. had already been
+ * freed)
+ * Original signature : OSVR_ReturnCode osvrClientFreeInterface(OSVR_ClientContext, OSVR_ClientInterface)
+ * @deprecated use the safer methods {@link #osvrClientFreeInterface(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientContext, osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface)} and {@link #osvrClientFreeInterface(com.sun.jna.Pointer, com.sun.jna.Pointer)} instead
+ */
+ @Deprecated
+ public static native byte osvrClientFreeInterface(Pointer ctx, Pointer iface);
+ /**
+ * @brief Free an interface object before context closure.
+ * @param ctx Client context
+ * @param iface The interface object
+ * @returns OSVR_RETURN_SUCCESS unless a null context or interface was passed
+ * or the given interface was not found in the context (i.e. had already been
+ * freed)
+ * Original signature : OSVR_ReturnCode osvrClientFreeInterface(OSVR_ClientContext, OSVR_ClientInterface)
+ */
+ public static native byte osvrClientFreeInterface(OsvrClientKitLibrary.OSVR_ClientContext ctx, OsvrClientKitLibrary.OSVR_ClientInterface iface);
+ /**
+ * Original signature : OSVR_ReturnCode osvrRegisterPoseCallback(OSVR_ClientInterface, OSVR_PoseCallback, void*)
+ * @deprecated use the safer methods {@link #osvrRegisterPoseCallback(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface, com.sun.jna.Pointer, com.sun.jna.Pointer)} and {@link #osvrRegisterPoseCallback(com.sun.jna.Pointer, com.sun.jna.Pointer, com.sun.jna.Pointer)} instead
+ */
+ @Deprecated
+ public static native byte osvrRegisterPoseCallback(Pointer iface, Pointer cb, Pointer userdata);
+ /** Original signature : OSVR_ReturnCode osvrRegisterPoseCallback(OSVR_ClientInterface, OSVR_PoseCallback, void*)
*/
+ public static native byte osvrRegisterPoseCallback(OsvrClientKitLibrary.OSVR_ClientInterface iface, Pointer cb, Pointer userdata);
+ /**
+ * Original signature : OSVR_ReturnCode osvrRegisterPositionCallback(OSVR_ClientInterface, OSVR_PositionCallback, void*)
+ * @deprecated use the safer methods {@link #osvrRegisterPositionCallback(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface, com.sun.jna.Pointer, com.sun.jna.Pointer)} and {@link #osvrRegisterPositionCallback(com.sun.jna.Pointer, com.sun.jna.Pointer, com.sun.jna.Pointer)} instead
+ */
+ @Deprecated
+ public static native byte osvrRegisterPositionCallback(Pointer iface, Pointer cb, Pointer userdata);
+ /** Original signature : OSVR_ReturnCode osvrRegisterPositionCallback(OSVR_ClientInterface, OSVR_PositionCallback, void*)
*/
+ public static native byte osvrRegisterPositionCallback(OsvrClientKitLibrary.OSVR_ClientInterface iface, Pointer cb, Pointer userdata);
+ /**
+ * Original signature : OSVR_ReturnCode osvrRegisterOrientationCallback(OSVR_ClientInterface, OSVR_OrientationCallback, void*)
+ * @deprecated use the safer methods {@link #osvrRegisterOrientationCallback(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface, com.sun.jna.Pointer, com.sun.jna.Pointer)} and {@link #osvrRegisterOrientationCallback(com.sun.jna.Pointer, com.sun.jna.Pointer, com.sun.jna.Pointer)} instead
+ */
+ @Deprecated
+ public static native byte osvrRegisterOrientationCallback(Pointer iface, Pointer cb, Pointer userdata);
+ /** Original signature : OSVR_ReturnCode osvrRegisterOrientationCallback(OSVR_ClientInterface, OSVR_OrientationCallback, void*)
*/
+ public static native byte osvrRegisterOrientationCallback(OsvrClientKitLibrary.OSVR_ClientInterface iface, Pointer cb, Pointer userdata);
+ /**
+ * Original signature : OSVR_ReturnCode osvrRegisterVelocityCallback(OSVR_ClientInterface, OSVR_VelocityCallback, void*)
+ * @deprecated use the safer methods {@link #osvrRegisterVelocityCallback(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface, com.sun.jna.Pointer, com.sun.jna.Pointer)} and {@link #osvrRegisterVelocityCallback(com.sun.jna.Pointer, com.sun.jna.Pointer, com.sun.jna.Pointer)} instead
+ */
+ @Deprecated
+ public static native byte osvrRegisterVelocityCallback(Pointer iface, Pointer cb, Pointer userdata);
+ /** Original signature : OSVR_ReturnCode osvrRegisterVelocityCallback(OSVR_ClientInterface, OSVR_VelocityCallback, void*)
*/
+ public static native byte osvrRegisterVelocityCallback(OsvrClientKitLibrary.OSVR_ClientInterface iface, Pointer cb, Pointer userdata);
+ /**
+ * Original signature : OSVR_ReturnCode osvrRegisterLinearVelocityCallback(OSVR_ClientInterface, OSVR_LinearVelocityCallback, void*)
+ * @deprecated use the safer methods {@link #osvrRegisterLinearVelocityCallback(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface, com.sun.jna.Pointer, com.sun.jna.Pointer)} and {@link #osvrRegisterLinearVelocityCallback(com.sun.jna.Pointer, com.sun.jna.Pointer, com.sun.jna.Pointer)} instead
+ */
+ @Deprecated
+ public static native byte osvrRegisterLinearVelocityCallback(Pointer iface, Pointer cb, Pointer userdata);
+ /** Original signature : OSVR_ReturnCode osvrRegisterLinearVelocityCallback(OSVR_ClientInterface, OSVR_LinearVelocityCallback, void*)
*/
+ public static native byte osvrRegisterLinearVelocityCallback(OsvrClientKitLibrary.OSVR_ClientInterface iface, Pointer cb, Pointer userdata);
+ /**
+ * Original signature : OSVR_ReturnCode osvrRegisterAngularVelocityCallback(OSVR_ClientInterface, OSVR_AngularVelocityCallback, void*)
+ * @deprecated use the safer methods {@link #osvrRegisterAngularVelocityCallback(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface, com.sun.jna.Pointer, com.sun.jna.Pointer)} and {@link #osvrRegisterAngularVelocityCallback(com.sun.jna.Pointer, com.sun.jna.Pointer, com.sun.jna.Pointer)} instead
+ */
+ @Deprecated
+ public static native byte osvrRegisterAngularVelocityCallback(Pointer iface, Pointer cb, Pointer userdata);
+ /** Original signature : OSVR_ReturnCode osvrRegisterAngularVelocityCallback(OSVR_ClientInterface, OSVR_AngularVelocityCallback, void*)
*/
+ public static native byte osvrRegisterAngularVelocityCallback(OsvrClientKitLibrary.OSVR_ClientInterface iface, Pointer cb, Pointer userdata);
+ /**
+ * Original signature : OSVR_ReturnCode osvrRegisterAccelerationCallback(OSVR_ClientInterface, OSVR_AccelerationCallback, void*)
+ * @deprecated use the safer methods {@link #osvrRegisterAccelerationCallback(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface, com.sun.jna.Pointer, com.sun.jna.Pointer)} and {@link #osvrRegisterAccelerationCallback(com.sun.jna.Pointer, com.sun.jna.Pointer, com.sun.jna.Pointer)} instead
+ */
+ @Deprecated
+ public static native byte osvrRegisterAccelerationCallback(Pointer iface, Pointer cb, Pointer userdata);
+ /** Original signature : OSVR_ReturnCode osvrRegisterAccelerationCallback(OSVR_ClientInterface, OSVR_AccelerationCallback, void*)
*/
+ public static native byte osvrRegisterAccelerationCallback(OsvrClientKitLibrary.OSVR_ClientInterface iface, Pointer cb, Pointer userdata);
+ /**
+ * Original signature : OSVR_ReturnCode osvrRegisterLinearAccelerationCallback(OSVR_ClientInterface, OSVR_LinearAccelerationCallback, void*)
+ * @deprecated use the safer methods {@link #osvrRegisterLinearAccelerationCallback(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface, com.sun.jna.Pointer, com.sun.jna.Pointer)} and {@link #osvrRegisterLinearAccelerationCallback(com.sun.jna.Pointer, com.sun.jna.Pointer, com.sun.jna.Pointer)} instead
+ */
+ @Deprecated
+ public static native byte osvrRegisterLinearAccelerationCallback(Pointer iface, Pointer cb, Pointer userdata);
+ /** Original signature : OSVR_ReturnCode osvrRegisterLinearAccelerationCallback(OSVR_ClientInterface, OSVR_LinearAccelerationCallback, void*)
*/
+ public static native byte osvrRegisterLinearAccelerationCallback(OsvrClientKitLibrary.OSVR_ClientInterface iface, Pointer cb, Pointer userdata);
+ /**
+ * Original signature : OSVR_ReturnCode osvrRegisterAngularAccelerationCallback(OSVR_ClientInterface, OSVR_AngularAccelerationCallback, void*)
+ * @deprecated use the safer methods {@link #osvrRegisterAngularAccelerationCallback(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface, com.sun.jna.Pointer, com.sun.jna.Pointer)} and {@link #osvrRegisterAngularAccelerationCallback(com.sun.jna.Pointer, com.sun.jna.Pointer, com.sun.jna.Pointer)} instead
+ */
+ @Deprecated
+ public static native byte osvrRegisterAngularAccelerationCallback(Pointer iface, Pointer cb, Pointer userdata);
+ /** Original signature : OSVR_ReturnCode osvrRegisterAngularAccelerationCallback(OSVR_ClientInterface, OSVR_AngularAccelerationCallback, void*)
*/
+ public static native byte osvrRegisterAngularAccelerationCallback(OsvrClientKitLibrary.OSVR_ClientInterface iface, Pointer cb, Pointer userdata);
+ /**
+ * Original signature : OSVR_ReturnCode osvrRegisterButtonCallback(OSVR_ClientInterface, OSVR_ButtonCallback, void*)
+ * @deprecated use the safer methods {@link #osvrRegisterButtonCallback(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface, com.sun.jna.Pointer, com.sun.jna.Pointer)} and {@link #osvrRegisterButtonCallback(com.sun.jna.Pointer, com.sun.jna.Pointer, com.sun.jna.Pointer)} instead
+ */
+ @Deprecated
+ public static native byte osvrRegisterButtonCallback(Pointer iface, Pointer cb, Pointer userdata);
+ /** Original signature : OSVR_ReturnCode osvrRegisterButtonCallback(OSVR_ClientInterface, OSVR_ButtonCallback, void*)
*/
+ public static native byte osvrRegisterButtonCallback(OsvrClientKitLibrary.OSVR_ClientInterface iface, Callback cb, Pointer userdata);
+ /**
+ * Original signature : OSVR_ReturnCode osvrRegisterAnalogCallback(OSVR_ClientInterface, OSVR_AnalogCallback, void*)
+ * @deprecated use the safer methods {@link #osvrRegisterAnalogCallback(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface, com.sun.jna.Pointer, com.sun.jna.Pointer)} and {@link #osvrRegisterAnalogCallback(com.sun.jna.Pointer, com.sun.jna.Pointer, com.sun.jna.Pointer)} instead
+ */
+ @Deprecated
+ public static native byte osvrRegisterAnalogCallback(Pointer iface, Pointer cb, Pointer userdata);
+ /** Original signature : OSVR_ReturnCode osvrRegisterAnalogCallback(OSVR_ClientInterface, OSVR_AnalogCallback, void*)
*/
+ public static native byte osvrRegisterAnalogCallback(OsvrClientKitLibrary.OSVR_ClientInterface iface, Callback cb, Pointer userdata);
+ /**
+ * Original signature : OSVR_ReturnCode osvrRegisterImagingCallback(OSVR_ClientInterface, OSVR_ImagingCallback, void*)
+ * @deprecated use the safer methods {@link #osvrRegisterImagingCallback(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface, com.sun.jna.Pointer, com.sun.jna.Pointer)} and {@link #osvrRegisterImagingCallback(com.sun.jna.Pointer, com.sun.jna.Pointer, com.sun.jna.Pointer)} instead
+ */
+ @Deprecated
+ public static native byte osvrRegisterImagingCallback(Pointer iface, Pointer cb, Pointer userdata);
+ /** Original signature : OSVR_ReturnCode osvrRegisterImagingCallback(OSVR_ClientInterface, OSVR_ImagingCallback, void*)
*/
+ public static native byte osvrRegisterImagingCallback(OsvrClientKitLibrary.OSVR_ClientInterface iface, Pointer cb, Pointer userdata);
+ /**
+ * Original signature : OSVR_ReturnCode osvrRegisterLocation2DCallback(OSVR_ClientInterface, OSVR_Location2DCallback, void*)
+ * @deprecated use the safer methods {@link #osvrRegisterLocation2DCallback(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface, com.sun.jna.Pointer, com.sun.jna.Pointer)} and {@link #osvrRegisterLocation2DCallback(com.sun.jna.Pointer, com.sun.jna.Pointer, com.sun.jna.Pointer)} instead
+ */
+ @Deprecated
+ public static native byte osvrRegisterLocation2DCallback(Pointer iface, Pointer cb, Pointer userdata);
+ /** Original signature : OSVR_ReturnCode osvrRegisterLocation2DCallback(OSVR_ClientInterface, OSVR_Location2DCallback, void*)
*/
+ public static native byte osvrRegisterLocation2DCallback(OsvrClientKitLibrary.OSVR_ClientInterface iface, Pointer cb, Pointer userdata);
+ /**
+ * Original signature : OSVR_ReturnCode osvrRegisterDirectionCallback(OSVR_ClientInterface, OSVR_DirectionCallback, void*)
+ * @deprecated use the safer methods {@link #osvrRegisterDirectionCallback(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface, com.sun.jna.Pointer, com.sun.jna.Pointer)} and {@link #osvrRegisterDirectionCallback(com.sun.jna.Pointer, com.sun.jna.Pointer, com.sun.jna.Pointer)} instead
+ */
+ @Deprecated
+ public static native byte osvrRegisterDirectionCallback(Pointer iface, Pointer cb, Pointer userdata);
+ /** Original signature : OSVR_ReturnCode osvrRegisterDirectionCallback(OSVR_ClientInterface, OSVR_DirectionCallback, void*)
*/
+ public static native byte osvrRegisterDirectionCallback(OsvrClientKitLibrary.OSVR_ClientInterface iface, Pointer cb, Pointer userdata);
+ /**
+ * Original signature : OSVR_ReturnCode osvrRegisterEyeTracker2DCallback(OSVR_ClientInterface, OSVR_EyeTracker2DCallback, void*)
+ * @deprecated use the safer methods {@link #osvrRegisterEyeTracker2DCallback(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface, com.sun.jna.Pointer, com.sun.jna.Pointer)} and {@link #osvrRegisterEyeTracker2DCallback(com.sun.jna.Pointer, com.sun.jna.Pointer, com.sun.jna.Pointer)} instead
+ */
+ @Deprecated
+ public static native byte osvrRegisterEyeTracker2DCallback(Pointer iface, Pointer cb, Pointer userdata);
+ /** Original signature : OSVR_ReturnCode osvrRegisterEyeTracker2DCallback(OSVR_ClientInterface, OSVR_EyeTracker2DCallback, void*)
*/
+ public static native byte osvrRegisterEyeTracker2DCallback(OsvrClientKitLibrary.OSVR_ClientInterface iface, Pointer cb, Pointer userdata);
+ /**
+ * Original signature : OSVR_ReturnCode osvrRegisterEyeTracker3DCallback(OSVR_ClientInterface, OSVR_EyeTracker3DCallback, void*)
+ * @deprecated use the safer methods {@link #osvrRegisterEyeTracker3DCallback(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface, com.sun.jna.Pointer, com.sun.jna.Pointer)} and {@link #osvrRegisterEyeTracker3DCallback(com.sun.jna.Pointer, com.sun.jna.Pointer, com.sun.jna.Pointer)} instead
+ */
+ @Deprecated
+ public static native byte osvrRegisterEyeTracker3DCallback(Pointer iface, Pointer cb, Pointer userdata);
+ /** Original signature : OSVR_ReturnCode osvrRegisterEyeTracker3DCallback(OSVR_ClientInterface, OSVR_EyeTracker3DCallback, void*)
*/
+ public static native byte osvrRegisterEyeTracker3DCallback(OsvrClientKitLibrary.OSVR_ClientInterface iface, Pointer cb, Pointer userdata);
+ /**
+ * Original signature : OSVR_ReturnCode osvrRegisterEyeTrackerBlinkCallback(OSVR_ClientInterface, OSVR_EyeTrackerBlinkCallback, void*)
+ * @deprecated use the safer methods {@link #osvrRegisterEyeTrackerBlinkCallback(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface, com.sun.jna.Pointer, com.sun.jna.Pointer)} and {@link #osvrRegisterEyeTrackerBlinkCallback(com.sun.jna.Pointer, com.sun.jna.Pointer, com.sun.jna.Pointer)} instead
+ */
+ @Deprecated
+ public static native byte osvrRegisterEyeTrackerBlinkCallback(Pointer iface, Pointer cb, Pointer userdata);
+ /** Original signature : OSVR_ReturnCode osvrRegisterEyeTrackerBlinkCallback(OSVR_ClientInterface, OSVR_EyeTrackerBlinkCallback, void*)
*/
+ public static native byte osvrRegisterEyeTrackerBlinkCallback(OsvrClientKitLibrary.OSVR_ClientInterface iface, Pointer cb, Pointer userdata);
+ /**
+ * Original signature : OSVR_ReturnCode osvrRegisterNaviVelocityCallback(OSVR_ClientInterface, OSVR_NaviVelocityCallback, void*)
+ * @deprecated use the safer methods {@link #osvrRegisterNaviVelocityCallback(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface, com.sun.jna.Pointer, com.sun.jna.Pointer)} and {@link #osvrRegisterNaviVelocityCallback(com.sun.jna.Pointer, com.sun.jna.Pointer, com.sun.jna.Pointer)} instead
+ */
+ @Deprecated
+ public static native byte osvrRegisterNaviVelocityCallback(Pointer iface, Pointer cb, Pointer userdata);
+ /** Original signature : OSVR_ReturnCode osvrRegisterNaviVelocityCallback(OSVR_ClientInterface, OSVR_NaviVelocityCallback, void*)
*/
+ public static native byte osvrRegisterNaviVelocityCallback(OsvrClientKitLibrary.OSVR_ClientInterface iface, Pointer cb, Pointer userdata);
+ /**
+ * Original signature : OSVR_ReturnCode osvrRegisterNaviPositionCallback(OSVR_ClientInterface, OSVR_NaviPositionCallback, void*)
+ * @deprecated use the safer methods {@link #osvrRegisterNaviPositionCallback(osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface, com.sun.jna.Pointer, com.sun.jna.Pointer)} and {@link #osvrRegisterNaviPositionCallback(com.sun.jna.Pointer, com.sun.jna.Pointer, com.sun.jna.Pointer)} instead
+ */
+ @Deprecated
+ public static native byte osvrRegisterNaviPositionCallback(Pointer iface, Pointer cb, Pointer userdata);
+ /** Original signature : OSVR_ReturnCode osvrRegisterNaviPositionCallback(OSVR_ClientInterface, OSVR_NaviPositionCallback, void*)
*/
+ public static native byte osvrRegisterNaviPositionCallback(OsvrClientKitLibrary.OSVR_ClientInterface iface, Pointer cb, Pointer userdata);
+ public static class OSVR_ClientContext extends PointerType {
+ public OSVR_ClientContext(Pointer address) {
+ super(address);
+ }
+ public OSVR_ClientContext() {
+ super();
+ }
+ };
+ public static class OSVR_ClientInterface extends PointerType {
+ public OSVR_ClientInterface(Pointer address) {
+ super(address);
+ }
+ public OSVR_ClientInterface() {
+ super();
+ }
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_AccelerationReport.java b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_AccelerationReport.java
new file mode 100644
index 000000000..454d72949
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_AccelerationReport.java
@@ -0,0 +1,36 @@
+package osvrclientreporttypes;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_AccelerationReport extends Structure {
+ public int sensor;
+ /** C type : OSVR_AccelerationState */
+ public OSVR_AccelerationState state;
+ public OSVR_AccelerationReport() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("sensor", "state");
+ }
+ /** @param state C type : OSVR_AccelerationState */
+ public OSVR_AccelerationReport(int sensor, OSVR_AccelerationState state) {
+ super();
+ this.sensor = sensor;
+ this.state = state;
+ }
+ public OSVR_AccelerationReport(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_AccelerationReport implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_AccelerationReport implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_AccelerationState.java b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_AccelerationState.java
new file mode 100644
index 000000000..aecd5ba51
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_AccelerationState.java
@@ -0,0 +1,48 @@
+package osvrclientreporttypes;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_AccelerationState extends Structure {
+ /** C type : OSVR_LinearAccelerationState */
+ public OSVR_Vec3 linearAcceleration;
+ /** C type : OSVR_CBool */
+ public byte linearAccelerationValid;
+ /** C type : OSVR_AngularAccelerationState */
+ public OSVR_IncrementalQuaternion angularAcceleration;
+ /** C type : OSVR_CBool */
+ public byte angularAccelerationValid;
+ public OSVR_AccelerationState() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("linearAcceleration", "linearAccelerationValid", "angularAcceleration", "angularAccelerationValid");
+ }
+ /**
+ * @param linearAcceleration C type : OSVR_LinearAccelerationState
+ * @param linearAccelerationValid C type : OSVR_CBool
+ * @param angularAcceleration C type : OSVR_AngularAccelerationState
+ * @param angularAccelerationValid C type : OSVR_CBool
+ */
+ public OSVR_AccelerationState(OSVR_Vec3 linearAcceleration, byte linearAccelerationValid, OSVR_IncrementalQuaternion angularAcceleration, byte angularAccelerationValid) {
+ super();
+ this.linearAcceleration = linearAcceleration;
+ this.linearAccelerationValid = linearAccelerationValid;
+ this.angularAcceleration = angularAcceleration;
+ this.angularAccelerationValid = angularAccelerationValid;
+ }
+ public OSVR_AccelerationState(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_AccelerationState implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_AccelerationState implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_AnalogReport.java b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_AnalogReport.java
new file mode 100644
index 000000000..9c0156080
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_AnalogReport.java
@@ -0,0 +1,36 @@
+package osvrclientreporttypes;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_AnalogReport extends Structure {
+ public int sensor;
+ /** C type : OSVR_AnalogState */
+ public double state;
+ public OSVR_AnalogReport() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("sensor", "state");
+ }
+ /** @param state C type : OSVR_AnalogState */
+ public OSVR_AnalogReport(int sensor, double state) {
+ super();
+ this.sensor = sensor;
+ this.state = state;
+ }
+ public OSVR_AnalogReport(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_AnalogReport implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_AnalogReport implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_AngularAccelerationReport.java b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_AngularAccelerationReport.java
new file mode 100644
index 000000000..761fab4d0
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_AngularAccelerationReport.java
@@ -0,0 +1,36 @@
+package osvrclientreporttypes;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_AngularAccelerationReport extends Structure {
+ public int sensor;
+ /** C type : OSVR_AngularAccelerationState */
+ public OSVR_IncrementalQuaternion state;
+ public OSVR_AngularAccelerationReport() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("sensor", "state");
+ }
+ /** @param state C type : OSVR_AngularAccelerationState */
+ public OSVR_AngularAccelerationReport(int sensor, OSVR_IncrementalQuaternion state) {
+ super();
+ this.sensor = sensor;
+ this.state = state;
+ }
+ public OSVR_AngularAccelerationReport(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_AngularAccelerationReport implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_AngularAccelerationReport implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_AngularVelocityReport.java b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_AngularVelocityReport.java
new file mode 100644
index 000000000..496e6f503
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_AngularVelocityReport.java
@@ -0,0 +1,36 @@
+package osvrclientreporttypes;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_AngularVelocityReport extends Structure {
+ public int sensor;
+ /** C type : OSVR_AngularVelocityState */
+ public OSVR_IncrementalQuaternion state;
+ public OSVR_AngularVelocityReport() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("sensor", "state");
+ }
+ /** @param state C type : OSVR_AngularVelocityState */
+ public OSVR_AngularVelocityReport(int sensor, OSVR_IncrementalQuaternion state) {
+ super();
+ this.sensor = sensor;
+ this.state = state;
+ }
+ public OSVR_AngularVelocityReport(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_AngularVelocityReport implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_AngularVelocityReport implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_ButtonReport.java b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_ButtonReport.java
new file mode 100644
index 000000000..fdc0b91e3
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_ButtonReport.java
@@ -0,0 +1,36 @@
+package osvrclientreporttypes;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_ButtonReport extends Structure {
+ public int sensor;
+ /** C type : OSVR_ButtonState */
+ public byte state;
+ public OSVR_ButtonReport() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("sensor", "state");
+ }
+ /** @param state C type : OSVR_ButtonState */
+ public OSVR_ButtonReport(int sensor, byte state) {
+ super();
+ this.sensor = sensor;
+ this.state = state;
+ }
+ public OSVR_ButtonReport(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_ButtonReport implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_ButtonReport implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_DirectionReport.java b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_DirectionReport.java
new file mode 100644
index 000000000..624c9833d
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_DirectionReport.java
@@ -0,0 +1,40 @@
+package osvrclientreporttypes;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_DirectionReport extends Structure {
+ /** C type : OSVR_ChannelCount */
+ public int sensor;
+ /** C type : OSVR_DirectionState */
+ public OSVR_Vec3 direction;
+ public OSVR_DirectionReport() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("sensor", "direction");
+ }
+ /**
+ * @param sensor C type : OSVR_ChannelCount
+ * @param direction C type : OSVR_DirectionState
+ */
+ public OSVR_DirectionReport(int sensor, OSVR_Vec3 direction) {
+ super();
+ this.sensor = sensor;
+ this.direction = direction;
+ }
+ public OSVR_DirectionReport(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_DirectionReport implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_DirectionReport implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_EyeTracker2DReport.java b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_EyeTracker2DReport.java
new file mode 100644
index 000000000..335e146e8
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_EyeTracker2DReport.java
@@ -0,0 +1,40 @@
+package osvrclientreporttypes;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_EyeTracker2DReport extends Structure {
+ /** C type : OSVR_ChannelCount */
+ public int sensor;
+ /** C type : OSVR_EyeTracker2DState */
+ public OSVR_Vec2 state;
+ public OSVR_EyeTracker2DReport() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("sensor", "state");
+ }
+ /**
+ * @param sensor C type : OSVR_ChannelCount
+ * @param state C type : OSVR_EyeTracker2DState
+ */
+ public OSVR_EyeTracker2DReport(int sensor, OSVR_Vec2 state) {
+ super();
+ this.sensor = sensor;
+ this.state = state;
+ }
+ public OSVR_EyeTracker2DReport(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_EyeTracker2DReport implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_EyeTracker2DReport implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_EyeTracker3DReport.java b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_EyeTracker3DReport.java
new file mode 100644
index 000000000..4de93a11e
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_EyeTracker3DReport.java
@@ -0,0 +1,40 @@
+package osvrclientreporttypes;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_EyeTracker3DReport extends Structure {
+ /** C type : OSVR_ChannelCount */
+ public int sensor;
+ /** C type : OSVR_EyeTracker3DState */
+ public OSVR_EyeTracker3DState state;
+ public OSVR_EyeTracker3DReport() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("sensor", "state");
+ }
+ /**
+ * @param sensor C type : OSVR_ChannelCount
+ * @param state C type : OSVR_EyeTracker3DState
+ */
+ public OSVR_EyeTracker3DReport(int sensor, OSVR_EyeTracker3DState state) {
+ super();
+ this.sensor = sensor;
+ this.state = state;
+ }
+ public OSVR_EyeTracker3DReport(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_EyeTracker3DReport implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_EyeTracker3DReport implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_EyeTracker3DState.java b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_EyeTracker3DState.java
new file mode 100644
index 000000000..aef54362b
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_EyeTracker3DState.java
@@ -0,0 +1,48 @@
+package osvrclientreporttypes;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_EyeTracker3DState extends Structure {
+ /** C type : OSVR_CBool */
+ public byte directionValid;
+ /** C type : OSVR_DirectionState */
+ public OSVR_Vec3 direction;
+ /** C type : OSVR_CBool */
+ public byte basePointValid;
+ /** C type : OSVR_PositionState */
+ public OSVR_Vec3 basePoint;
+ public OSVR_EyeTracker3DState() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("directionValid", "direction", "basePointValid", "basePoint");
+ }
+ /**
+ * @param directionValid C type : OSVR_CBool
+ * @param direction C type : OSVR_DirectionState
+ * @param basePointValid C type : OSVR_CBool
+ * @param basePoint C type : OSVR_PositionState
+ */
+ public OSVR_EyeTracker3DState(byte directionValid, OSVR_Vec3 direction, byte basePointValid, OSVR_Vec3 basePoint) {
+ super();
+ this.directionValid = directionValid;
+ this.direction = direction;
+ this.basePointValid = basePointValid;
+ this.basePoint = basePoint;
+ }
+ public OSVR_EyeTracker3DState(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_EyeTracker3DState implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_EyeTracker3DState implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_EyeTrackerBlinkReport.java b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_EyeTrackerBlinkReport.java
new file mode 100644
index 000000000..96c6992b2
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_EyeTrackerBlinkReport.java
@@ -0,0 +1,40 @@
+package osvrclientreporttypes;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_EyeTrackerBlinkReport extends Structure {
+ /** C type : OSVR_ChannelCount */
+ public int sensor;
+ /** C type : OSVR_EyeTrackerBlinkState */
+ public byte state;
+ public OSVR_EyeTrackerBlinkReport() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("sensor", "state");
+ }
+ /**
+ * @param sensor C type : OSVR_ChannelCount
+ * @param state C type : OSVR_EyeTrackerBlinkState
+ */
+ public OSVR_EyeTrackerBlinkReport(int sensor, byte state) {
+ super();
+ this.sensor = sensor;
+ this.state = state;
+ }
+ public OSVR_EyeTrackerBlinkReport(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_EyeTrackerBlinkReport implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_EyeTrackerBlinkReport implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_IncrementalQuaternion.java b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_IncrementalQuaternion.java
new file mode 100644
index 000000000..2630cafd5
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_IncrementalQuaternion.java
@@ -0,0 +1,36 @@
+package osvrclientreporttypes;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_IncrementalQuaternion extends Structure {
+ /** C type : OSVR_Quaternion */
+ public OSVR_Quaternion incrementalRotation;
+ public double dt;
+ public OSVR_IncrementalQuaternion() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("incrementalRotation", "dt");
+ }
+ /** @param incrementalRotation C type : OSVR_Quaternion */
+ public OSVR_IncrementalQuaternion(OSVR_Quaternion incrementalRotation, double dt) {
+ super();
+ this.incrementalRotation = incrementalRotation;
+ this.dt = dt;
+ }
+ public OSVR_IncrementalQuaternion(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_IncrementalQuaternion implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_IncrementalQuaternion implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_LinearAccelerationReport.java b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_LinearAccelerationReport.java
new file mode 100644
index 000000000..20368ec95
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_LinearAccelerationReport.java
@@ -0,0 +1,36 @@
+package osvrclientreporttypes;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_LinearAccelerationReport extends Structure {
+ public int sensor;
+ /** C type : OSVR_LinearAccelerationState */
+ public OSVR_Vec3 state;
+ public OSVR_LinearAccelerationReport() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("sensor", "state");
+ }
+ /** @param state C type : OSVR_LinearAccelerationState */
+ public OSVR_LinearAccelerationReport(int sensor, OSVR_Vec3 state) {
+ super();
+ this.sensor = sensor;
+ this.state = state;
+ }
+ public OSVR_LinearAccelerationReport(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_LinearAccelerationReport implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_LinearAccelerationReport implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_LinearVelocityReport.java b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_LinearVelocityReport.java
new file mode 100644
index 000000000..2eddb9a4e
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_LinearVelocityReport.java
@@ -0,0 +1,36 @@
+package osvrclientreporttypes;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_LinearVelocityReport extends Structure {
+ public int sensor;
+ /** C type : OSVR_LinearVelocityState */
+ public OSVR_Vec3 state;
+ public OSVR_LinearVelocityReport() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("sensor", "state");
+ }
+ /** @param state C type : OSVR_LinearVelocityState */
+ public OSVR_LinearVelocityReport(int sensor, OSVR_Vec3 state) {
+ super();
+ this.sensor = sensor;
+ this.state = state;
+ }
+ public OSVR_LinearVelocityReport(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_LinearVelocityReport implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_LinearVelocityReport implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_Location2DReport.java b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_Location2DReport.java
new file mode 100644
index 000000000..2f1eb8561
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_Location2DReport.java
@@ -0,0 +1,40 @@
+package osvrclientreporttypes;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_Location2DReport extends Structure {
+ /** C type : OSVR_ChannelCount */
+ public int sensor;
+ /** C type : OSVR_Location2DState */
+ public OSVR_Vec2 location;
+ public OSVR_Location2DReport() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("sensor", "location");
+ }
+ /**
+ * @param sensor C type : OSVR_ChannelCount
+ * @param location C type : OSVR_Location2DState
+ */
+ public OSVR_Location2DReport(int sensor, OSVR_Vec2 location) {
+ super();
+ this.sensor = sensor;
+ this.location = location;
+ }
+ public OSVR_Location2DReport(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_Location2DReport implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_Location2DReport implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_NaviPositionReport.java b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_NaviPositionReport.java
new file mode 100644
index 000000000..3472e1ae3
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_NaviPositionReport.java
@@ -0,0 +1,40 @@
+package osvrclientreporttypes;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_NaviPositionReport extends Structure {
+ /** C type : OSVR_ChannelCount */
+ public int sensor;
+ /** C type : OSVR_NaviPositionState */
+ public OSVR_Vec2 state;
+ public OSVR_NaviPositionReport() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("sensor", "state");
+ }
+ /**
+ * @param sensor C type : OSVR_ChannelCount
+ * @param state C type : OSVR_NaviPositionState
+ */
+ public OSVR_NaviPositionReport(int sensor, OSVR_Vec2 state) {
+ super();
+ this.sensor = sensor;
+ this.state = state;
+ }
+ public OSVR_NaviPositionReport(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_NaviPositionReport implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_NaviPositionReport implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_NaviVelocityReport.java b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_NaviVelocityReport.java
new file mode 100644
index 000000000..e4e80cfb1
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_NaviVelocityReport.java
@@ -0,0 +1,40 @@
+package osvrclientreporttypes;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_NaviVelocityReport extends Structure {
+ /** C type : OSVR_ChannelCount */
+ public int sensor;
+ /** C type : OSVR_NaviVelocityState */
+ public OSVR_Vec2 state;
+ public OSVR_NaviVelocityReport() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("sensor", "state");
+ }
+ /**
+ * @param sensor C type : OSVR_ChannelCount
+ * @param state C type : OSVR_NaviVelocityState
+ */
+ public OSVR_NaviVelocityReport(int sensor, OSVR_Vec2 state) {
+ super();
+ this.sensor = sensor;
+ this.state = state;
+ }
+ public OSVR_NaviVelocityReport(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_NaviVelocityReport implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_NaviVelocityReport implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_OrientationReport.java b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_OrientationReport.java
new file mode 100644
index 000000000..b08346151
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_OrientationReport.java
@@ -0,0 +1,36 @@
+package osvrclientreporttypes;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_OrientationReport extends Structure {
+ public int sensor;
+ /** C type : OSVR_OrientationState */
+ public OSVR_Quaternion rotation;
+ public OSVR_OrientationReport() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("sensor", "rotation");
+ }
+ /** @param rotation C type : OSVR_OrientationState */
+ public OSVR_OrientationReport(int sensor, OSVR_Quaternion rotation) {
+ super();
+ this.sensor = sensor;
+ this.rotation = rotation;
+ }
+ public OSVR_OrientationReport(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_OrientationReport implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_OrientationReport implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_Pose3.java b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_Pose3.java
new file mode 100644
index 000000000..c1eaa9a85
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_Pose3.java
@@ -0,0 +1,40 @@
+package osvrclientreporttypes;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_Pose3 extends Structure {
+ /** C type : OSVR_Vec3 */
+ public OSVR_Vec3 translation;
+ /** C type : OSVR_Quaternion */
+ public OSVR_Quaternion rotation;
+ public OSVR_Pose3() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("translation", "rotation");
+ }
+ /**
+ * @param translation C type : OSVR_Vec3
+ * @param rotation C type : OSVR_Quaternion
+ */
+ public OSVR_Pose3(OSVR_Vec3 translation, OSVR_Quaternion rotation) {
+ super();
+ this.translation = translation;
+ this.rotation = rotation;
+ }
+ public OSVR_Pose3(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_Pose3 implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_Pose3 implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_PoseReport.java b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_PoseReport.java
new file mode 100644
index 000000000..2985e864f
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_PoseReport.java
@@ -0,0 +1,36 @@
+package osvrclientreporttypes;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_PoseReport extends Structure {
+ public int sensor;
+ /** C type : OSVR_PoseState */
+ public OSVR_Pose3 pose;
+ public OSVR_PoseReport() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("sensor", "pose");
+ }
+ /** @param pose C type : OSVR_PoseState */
+ public OSVR_PoseReport(int sensor, OSVR_Pose3 pose) {
+ super();
+ this.sensor = sensor;
+ this.pose = pose;
+ }
+ public OSVR_PoseReport(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_PoseReport implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_PoseReport implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_PositionReport.java b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_PositionReport.java
new file mode 100644
index 000000000..b12434c6d
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_PositionReport.java
@@ -0,0 +1,36 @@
+package osvrclientreporttypes;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_PositionReport extends Structure {
+ public int sensor;
+ /** C type : OSVR_PositionState */
+ public OSVR_Vec3 xyz;
+ public OSVR_PositionReport() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("sensor", "xyz");
+ }
+ /** @param xyz C type : OSVR_PositionState */
+ public OSVR_PositionReport(int sensor, OSVR_Vec3 xyz) {
+ super();
+ this.sensor = sensor;
+ this.xyz = xyz;
+ }
+ public OSVR_PositionReport(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_PositionReport implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_PositionReport implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_Quaternion.java b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_Quaternion.java
new file mode 100644
index 000000000..7a1c4c4b5
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_Quaternion.java
@@ -0,0 +1,36 @@
+package osvrclientreporttypes;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_Quaternion extends Structure {
+ /** C type : double[4] */
+ public double[] data = new double[4];
+ public OSVR_Quaternion() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("data");
+ }
+ /** @param data C type : double[4] */
+ public OSVR_Quaternion(double data[]) {
+ super();
+ if ((data.length != this.data.length))
+ throw new IllegalArgumentException("Wrong array size !");
+ this.data = data;
+ }
+ public OSVR_Quaternion(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_Quaternion implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_Quaternion implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_Vec2.java b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_Vec2.java
new file mode 100644
index 000000000..dc606d33f
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_Vec2.java
@@ -0,0 +1,36 @@
+package osvrclientreporttypes;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_Vec2 extends Structure {
+ /** C type : double[2] */
+ public double[] data = new double[2];
+ public OSVR_Vec2() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("data");
+ }
+ /** @param data C type : double[2] */
+ public OSVR_Vec2(double data[]) {
+ super();
+ if ((data.length != this.data.length))
+ throw new IllegalArgumentException("Wrong array size !");
+ this.data = data;
+ }
+ public OSVR_Vec2(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_Vec2 implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_Vec2 implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_Vec3.java b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_Vec3.java
new file mode 100644
index 000000000..40008b5e2
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_Vec3.java
@@ -0,0 +1,36 @@
+package osvrclientreporttypes;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_Vec3 extends Structure {
+ /** C type : double[3] */
+ public double[] data = new double[3];
+ public OSVR_Vec3() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("data");
+ }
+ /** @param data C type : double[3] */
+ public OSVR_Vec3(double data[]) {
+ super();
+ if ((data.length != this.data.length))
+ throw new IllegalArgumentException("Wrong array size !");
+ this.data = data;
+ }
+ public OSVR_Vec3(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_Vec3 implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_Vec3 implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_VelocityReport.java b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_VelocityReport.java
new file mode 100644
index 000000000..cdeab701e
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_VelocityReport.java
@@ -0,0 +1,36 @@
+package osvrclientreporttypes;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_VelocityReport extends Structure {
+ public int sensor;
+ /** C type : OSVR_VelocityState */
+ public OSVR_VelocityState state;
+ public OSVR_VelocityReport() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("sensor", "state");
+ }
+ /** @param state C type : OSVR_VelocityState */
+ public OSVR_VelocityReport(int sensor, OSVR_VelocityState state) {
+ super();
+ this.sensor = sensor;
+ this.state = state;
+ }
+ public OSVR_VelocityReport(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_VelocityReport implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_VelocityReport implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_VelocityState.java b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_VelocityState.java
new file mode 100644
index 000000000..8306902af
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrclientreporttypes/OSVR_VelocityState.java
@@ -0,0 +1,48 @@
+package osvrclientreporttypes;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_VelocityState extends Structure {
+ /** C type : OSVR_LinearVelocityState */
+ public OSVR_Vec3 linearVelocity;
+ /** C type : OSVR_CBool */
+ public byte linearVelocityValid;
+ /** C type : OSVR_AngularVelocityState */
+ public OSVR_IncrementalQuaternion angularVelocity;
+ /** C type : OSVR_CBool */
+ public byte angularVelocityValid;
+ public OSVR_VelocityState() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("linearVelocity", "linearVelocityValid", "angularVelocity", "angularVelocityValid");
+ }
+ /**
+ * @param linearVelocity C type : OSVR_LinearVelocityState
+ * @param linearVelocityValid C type : OSVR_CBool
+ * @param angularVelocity C type : OSVR_AngularVelocityState
+ * @param angularVelocityValid C type : OSVR_CBool
+ */
+ public OSVR_VelocityState(OSVR_Vec3 linearVelocity, byte linearVelocityValid, OSVR_IncrementalQuaternion angularVelocity, byte angularVelocityValid) {
+ super();
+ this.linearVelocity = linearVelocity;
+ this.linearVelocityValid = linearVelocityValid;
+ this.angularVelocity = angularVelocity;
+ this.angularVelocityValid = angularVelocityValid;
+ }
+ public OSVR_VelocityState(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_VelocityState implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_VelocityState implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrclientreporttypes/OsvrClientReportTypesLibrary.java b/jme3-vr/src/main/java/osvrclientreporttypes/OsvrClientReportTypesLibrary.java
new file mode 100644
index 000000000..66950ef8d
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrclientreporttypes/OsvrClientReportTypesLibrary.java
@@ -0,0 +1,79 @@
+package osvrclientreporttypes;
+import com.sun.jna.Library;
+import com.sun.jna.Native;
+import com.sun.jna.NativeLibrary;
+/**
+ * JNA Wrapper for library osvrClientReportTypes
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OsvrClientReportTypesLibrary implements Library {
+ public static final String JNA_LIBRARY_NAME = "osvrClientKit";
+ public static final NativeLibrary JNA_NATIVE_LIB = NativeLibrary.getInstance(OsvrClientReportTypesLibrary.JNA_LIBRARY_NAME);
+ static {
+ Native.register(OsvrClientReportTypesLibrary.class, OsvrClientReportTypesLibrary.JNA_NATIVE_LIB);
+ }
+ public static final int OSVR_TRUE = (int)(1);
+ public static final int OSVR_FALSE = (int)(0);
+ public static final int OSVR_BUTTON_PRESSED = (int)(1);
+ public static final int OSVR_BUTTON_NOT_PRESSED = (int)(0);
+ public static final int OSVR_EYE_BLINK = (int)(1);
+ public static final int OSVR_EYE_NO_BLINK = (int)(0);
+ /** Original signature : double osvrVec3GetX(const OSVR_Vec3*)
*/
+ public static native double osvrVec3GetX(OSVR_Vec3 v);
+ /** Original signature : void osvrVec3SetX(OSVR_Vec3*, double)
*/
+ public static native void osvrVec3SetX(OSVR_Vec3 v, double val);
+ /** Original signature : double osvrVec3GetY(const OSVR_Vec3*)
*/
+ public static native double osvrVec3GetY(OSVR_Vec3 v);
+ /** Original signature : void osvrVec3SetY(OSVR_Vec3*, double)
*/
+ public static native void osvrVec3SetY(OSVR_Vec3 v, double val);
+ /** Original signature : double osvrVec3GetZ(const OSVR_Vec3*)
*/
+ public static native double osvrVec3GetZ(OSVR_Vec3 v);
+ /** Original signature : void osvrVec3SetZ(OSVR_Vec3*, double)
*/
+ public static native void osvrVec3SetZ(OSVR_Vec3 v, double val);
+ /**
+ * @brief Set a Vec3 to the zero vector
+ * Original signature : void osvrVec3Zero(OSVR_Vec3*)
+ */
+ public static native void osvrVec3Zero(OSVR_Vec3 v);
+ /** Original signature : double osvrQuatGetW(const OSVR_Quaternion*)
*/
+ public static native double osvrQuatGetW(OSVR_Quaternion q);
+ /** Original signature : void osvrQuatSetW(OSVR_Quaternion*, double)
*/
+ public static native void osvrQuatSetW(OSVR_Quaternion q, double val);
+ /** Original signature : double osvrQuatGetX(const OSVR_Quaternion*)
*/
+ public static native double osvrQuatGetX(OSVR_Quaternion q);
+ /** Original signature : void osvrQuatSetX(OSVR_Quaternion*, double)
*/
+ public static native void osvrQuatSetX(OSVR_Quaternion q, double val);
+ /** Original signature : double osvrQuatGetY(const OSVR_Quaternion*)
*/
+ public static native double osvrQuatGetY(OSVR_Quaternion q);
+ /** Original signature : void osvrQuatSetY(OSVR_Quaternion*, double)
*/
+ public static native void osvrQuatSetY(OSVR_Quaternion q, double val);
+ /** Original signature : double osvrQuatGetZ(const OSVR_Quaternion*)
*/
+ public static native double osvrQuatGetZ(OSVR_Quaternion q);
+ /** Original signature : void osvrQuatSetZ(OSVR_Quaternion*, double)
*/
+ public static native void osvrQuatSetZ(OSVR_Quaternion q, double val);
+ /**
+ * @brief Set a quaternion to the identity rotation
+ * Original signature : void osvrQuatSetIdentity(OSVR_Quaternion*)
+ */
+ public static native void osvrQuatSetIdentity(OSVR_Quaternion q);
+ /**
+ * @brief Set a pose to identity
+ * Original signature : void osvrPose3SetIdentity(OSVR_Pose3*)
+ */
+ public static native void osvrPose3SetIdentity(OSVR_Pose3 pose);
+ /** Original signature : double osvrVec2GetX(const OSVR_Vec2*)
*/
+ public static native double osvrVec2GetX(OSVR_Vec2 v);
+ /** Original signature : void osvrVec2SetX(OSVR_Vec2*, double)
*/
+ public static native void osvrVec2SetX(OSVR_Vec2 v, double val);
+ /** Original signature : double osvrVec2GetY(const OSVR_Vec2*)
*/
+ public static native double osvrVec2GetY(OSVR_Vec2 v);
+ /** Original signature : void osvrVec2SetY(OSVR_Vec2*, double)
*/
+ public static native void osvrVec2SetY(OSVR_Vec2 v, double val);
+ /**
+ * @brief Set a Vec2 to the zero vector
+ * Original signature : void osvrVec2Zero(OSVR_Vec2*)
+ */
+ public static native void osvrVec2Zero(OSVR_Vec2 v);
+}
diff --git a/jme3-vr/src/main/java/osvrdisplay/OsvrDisplayLibrary.java b/jme3-vr/src/main/java/osvrdisplay/OsvrDisplayLibrary.java
new file mode 100644
index 000000000..c9c7334f0
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrdisplay/OsvrDisplayLibrary.java
@@ -0,0 +1,820 @@
+package osvrdisplay;
+import com.sun.jna.Library;
+import com.sun.jna.Native;
+import com.sun.jna.NativeLibrary;
+import com.sun.jna.Pointer;
+import com.sun.jna.PointerType;
+import com.sun.jna.ptr.DoubleByReference;
+import com.sun.jna.ptr.FloatByReference;
+import com.sun.jna.ptr.IntByReference;
+import com.sun.jna.ptr.PointerByReference;
+import java.nio.ByteBuffer;
+import java.nio.DoubleBuffer;
+import java.nio.FloatBuffer;
+import java.nio.IntBuffer;
+import osvrclientkit.OsvrClientKitLibrary;
+/**
+ * JNA Wrapper for library osvrDisplay
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OsvrDisplayLibrary implements Library {
+ public static final String JNA_LIBRARY_NAME = "osvrClientKit";
+ public static final NativeLibrary JNA_NATIVE_LIB = NativeLibrary.getInstance(OsvrDisplayLibrary.JNA_LIBRARY_NAME);
+ static {
+ Native.register(OsvrDisplayLibrary.class, OsvrDisplayLibrary.JNA_NATIVE_LIB);
+ }
+ /**
+ * @brief Allocates a display configuration object populated with data from the
+ * OSVR system.
+ * Before this call will succeed, your application will need to be correctly
+ * and fully connected to an OSVR server. You may consider putting this call in
+ * a loop alternating with osvrClientUpdate() until this call succeeds.
+ * Data provided by a display configuration object:
+ * - The logical display topology (number and relationship of viewers, eyes,
+ * and surfaces), which remains constant throughout the life of the
+ * configuration object. (A method of notification of change here is TBD).
+ * - Pose data for viewers (not required for rendering) and pose/view data for
+ * eyes (used for rendering) which is based on tracker data: if used, these
+ * should be queried every frame.
+ * - Projection matrix data for surfaces, which while in current practice may
+ * be relatively unchanging, we are not guaranteeing them to be constant:
+ * these should be queried every frame.
+ * - Video-input-relative viewport size/location for a surface: would like this
+ * to be variable, but probably not feasible. If you have input, please
+ * comment on the dev mailing list.
+ * - Per-surface distortion strategy priorities/availabilities: constant. Note
+ * the following, though...
+ * - Per-surface distortion strategy parameters: variable, request each frame.
+ * (Could make constant with a notification if needed?)
+ * Important note: While most of this data is immediately available if you are
+ * successful in getting a display config object, the pose-based data (viewer
+ * pose, eye pose, eye view matrix) needs tracker state, so at least one (and in
+ * practice, typically more) osvrClientUpdate() must be performed before a new
+ * tracker report is available to populate that state. See
+ * osvrClientCheckDisplayStartup() to query if all startup data is available.
+ * @todo Decide if relative viewport should be constant in a display config,
+ * and update docs accordingly.
+ * @todo Decide if distortion params should be constant in a display config,
+ * and update docs accordingly.
+ * @return OSVR_RETURN_FAILURE if invalid parameters were passed or some other
+ * error occurred, in which case the output argument is unmodified.
+ * Original signature : OSVR_ReturnCode osvrClientGetDisplay(OSVR_ClientContext, OSVR_DisplayConfig*)
+ * @deprecated use the safer methods {@link #osvrClientGetDisplay(osvrdisplay.OsvrDisplayLibrary.OSVR_ClientContext, com.sun.jna.ptr.PointerByReference)} and {@link #osvrClientGetDisplay(com.sun.jna.Pointer, com.sun.jna.ptr.PointerByReference)} instead
+ */
+ @Deprecated
+ public static native byte osvrClientGetDisplay(Pointer ctx, Pointer disp);
+ /**
+ * @brief Allocates a display configuration object populated with data from the
+ * OSVR system.
+ * Before this call will succeed, your application will need to be correctly
+ * and fully connected to an OSVR server. You may consider putting this call in
+ * a loop alternating with osvrClientUpdate() until this call succeeds.
+ * Data provided by a display configuration object:
+ * - The logical display topology (number and relationship of viewers, eyes,
+ * and surfaces), which remains constant throughout the life of the
+ * configuration object. (A method of notification of change here is TBD).
+ * - Pose data for viewers (not required for rendering) and pose/view data for
+ * eyes (used for rendering) which is based on tracker data: if used, these
+ * should be queried every frame.
+ * - Projection matrix data for surfaces, which while in current practice may
+ * be relatively unchanging, we are not guaranteeing them to be constant:
+ * these should be queried every frame.
+ * - Video-input-relative viewport size/location for a surface: would like this
+ * to be variable, but probably not feasible. If you have input, please
+ * comment on the dev mailing list.
+ * - Per-surface distortion strategy priorities/availabilities: constant. Note
+ * the following, though...
+ * - Per-surface distortion strategy parameters: variable, request each frame.
+ * (Could make constant with a notification if needed?)
+ * Important note: While most of this data is immediately available if you are
+ * successful in getting a display config object, the pose-based data (viewer
+ * pose, eye pose, eye view matrix) needs tracker state, so at least one (and in
+ * practice, typically more) osvrClientUpdate() must be performed before a new
+ * tracker report is available to populate that state. See
+ * osvrClientCheckDisplayStartup() to query if all startup data is available.
+ * @todo Decide if relative viewport should be constant in a display config,
+ * and update docs accordingly.
+ * @todo Decide if distortion params should be constant in a display config,
+ * and update docs accordingly.
+ * @return OSVR_RETURN_FAILURE if invalid parameters were passed or some other
+ * error occurred, in which case the output argument is unmodified.
+ * Original signature : OSVR_ReturnCode osvrClientGetDisplay(OSVR_ClientContext, OSVR_DisplayConfig*)
+ */
+ public static native byte osvrClientGetDisplay(OsvrClientKitLibrary.OSVR_ClientContext ctx, PointerByReference disp);
+ /**
+ * @brief Allocates a display configuration object populated with data from the
+ * OSVR system.
+ * Before this call will succeed, your application will need to be correctly
+ * and fully connected to an OSVR server. You may consider putting this call in
+ * a loop alternating with osvrClientUpdate() until this call succeeds.
+ * Data provided by a display configuration object:
+ * - The logical display topology (number and relationship of viewers, eyes,
+ * and surfaces), which remains constant throughout the life of the
+ * configuration object. (A method of notification of change here is TBD).
+ * - Pose data for viewers (not required for rendering) and pose/view data for
+ * eyes (used for rendering) which is based on tracker data: if used, these
+ * should be queried every frame.
+ * - Projection matrix data for surfaces, which while in current practice may
+ * be relatively unchanging, we are not guaranteeing them to be constant:
+ * these should be queried every frame.
+ * - Video-input-relative viewport size/location for a surface: would like this
+ * to be variable, but probably not feasible. If you have input, please
+ * comment on the dev mailing list.
+ * - Per-surface distortion strategy priorities/availabilities: constant. Note
+ * the following, though...
+ * - Per-surface distortion strategy parameters: variable, request each frame.
+ * (Could make constant with a notification if needed?)
+ * Important note: While most of this data is immediately available if you are
+ * successful in getting a display config object, the pose-based data (viewer
+ * pose, eye pose, eye view matrix) needs tracker state, so at least one (and in
+ * practice, typically more) osvrClientUpdate() must be performed before a new
+ * tracker report is available to populate that state. See
+ * osvrClientCheckDisplayStartup() to query if all startup data is available.
+ * @todo Decide if relative viewport should be constant in a display config,
+ * and update docs accordingly.
+ * @todo Decide if distortion params should be constant in a display config,
+ * and update docs accordingly.
+ * @return OSVR_RETURN_FAILURE if invalid parameters were passed or some other
+ * error occurred, in which case the output argument is unmodified.
+ * Original signature : OSVR_ReturnCode osvrClientGetDisplay(OSVR_ClientContext, OSVR_DisplayConfig*)
+ */
+ public static native byte osvrClientGetDisplay(Pointer ctx, PointerByReference disp);
+ /**
+ * @brief Frees a display configuration object. The corresponding context must
+ * still be open.
+ * If you fail to call this, it will be automatically called as part of
+ * clean-up when the corresponding context is closed.
+ * @return OSVR_RETURN_FAILURE if a null config was passed, or if the given
+ * display object was already freed.
+ * Original signature : OSVR_ReturnCode osvrClientFreeDisplay(OSVR_DisplayConfig)
+ * @deprecated use the safer methods {@link #osvrClientFreeDisplay(osvrdisplay.OsvrDisplayLibrary.OSVR_DisplayConfig)} and {@link #osvrClientFreeDisplay(com.sun.jna.Pointer)} instead
+ */
+ @Deprecated
+ public static native byte osvrClientFreeDisplay(Pointer disp);
+ /**
+ * @brief Frees a display configuration object. The corresponding context must
+ * still be open.
+ * If you fail to call this, it will be automatically called as part of
+ * clean-up when the corresponding context is closed.
+ * @return OSVR_RETURN_FAILURE if a null config was passed, or if the given
+ * display object was already freed.
+ * Original signature : OSVR_ReturnCode osvrClientFreeDisplay(OSVR_DisplayConfig)
+ */
+ public static native byte osvrClientFreeDisplay(OsvrDisplayLibrary.OSVR_DisplayConfig disp);
+ /**
+ * @brief Checks to see if a display is fully configured and ready, including
+ * having received its first pose update.
+ * Once this first succeeds, it will continue to succeed for the lifetime of
+ * the display config object, so it is not necessary to keep calling once you
+ * get a successful result.
+ * @return OSVR_RETURN_FAILURE if a null config was passed, or if the given
+ * display config object was otherwise not ready for full use.
+ * Original signature : OSVR_ReturnCode osvrClientCheckDisplayStartup(OSVR_DisplayConfig)
+ * @deprecated use the safer methods {@link #osvrClientCheckDisplayStartup(osvrdisplay.OsvrDisplayLibrary.OSVR_DisplayConfig)} and {@link #osvrClientCheckDisplayStartup(com.sun.jna.Pointer)} instead
+ */
+ @Deprecated
+ public static native byte osvrClientCheckDisplayStartup(Pointer disp);
+ /**
+ * @brief Checks to see if a display is fully configured and ready, including
+ * having received its first pose update.
+ * Once this first succeeds, it will continue to succeed for the lifetime of
+ * the display config object, so it is not necessary to keep calling once you
+ * get a successful result.
+ * @return OSVR_RETURN_FAILURE if a null config was passed, or if the given
+ * display config object was otherwise not ready for full use.
+ * Original signature : OSVR_ReturnCode osvrClientCheckDisplayStartup(OSVR_DisplayConfig)
+ */
+ public static native byte osvrClientCheckDisplayStartup(OsvrDisplayLibrary.OSVR_DisplayConfig disp);
+ /**
+ * @brief A display config can have one or more display inputs to pass pixels
+ * over (HDMI/DVI connections, etc): retrieve the number of display inputs in
+ * the current configuration.
+ * @param disp Display config object.
+ * @param[out] numDisplayInputs Number of display inputs in the logical display
+ * topology, **constant** throughout the active, valid lifetime of a display
+ * config object.
+ * @sa OSVR_DisplayInputCount
+ * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in
+ * which case the output argument is unmodified.
+ * Original signature : OSVR_ReturnCode osvrClientGetNumDisplayInputs(OSVR_DisplayConfig, OSVR_DisplayInputCount*)
+ * @deprecated use the safer methods {@link #osvrClientGetNumDisplayInputs(osvrdisplay.OsvrDisplayLibrary.OSVR_DisplayConfig, java.nio.ByteBuffer)} and {@link #osvrClientGetNumDisplayInputs(com.sun.jna.Pointer, com.sun.jna.Pointer)} instead
+ */
+ @Deprecated
+ public static native byte osvrClientGetNumDisplayInputs(Pointer disp, Pointer numDisplayInputs);
+ /**
+ * @brief A display config can have one or more display inputs to pass pixels
+ * over (HDMI/DVI connections, etc): retrieve the number of display inputs in
+ * the current configuration.
+ * @param disp Display config object.
+ * @param[out] numDisplayInputs Number of display inputs in the logical display
+ * topology, **constant** throughout the active, valid lifetime of a display
+ * config object.
+ * @sa OSVR_DisplayInputCount
+ * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in
+ * which case the output argument is unmodified.
+ * Original signature : OSVR_ReturnCode osvrClientGetNumDisplayInputs(OSVR_DisplayConfig, OSVR_DisplayInputCount*)
+ */
+ public static native byte osvrClientGetNumDisplayInputs(OsvrDisplayLibrary.OSVR_DisplayConfig disp, ByteBuffer numDisplayInputs);
+ /**
+ * @brief Retrieve the pixel dimensions of a given display input for a display
+ * config
+ * @param disp Display config object.
+ * @param displayInputIndex The zero-based index of the display input.
+ * @param[out] width Width (in pixels) of the display input.
+ * @param[out] height Height (in pixels) of the display input.
+ * The out parameters are **constant** throughout the active, valid lifetime of
+ * a display config object.
+ * @sa OSVR_DisplayDimension
+ * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in
+ * which case the output arguments are unmodified.
+ * Original signature : OSVR_ReturnCode osvrClientGetDisplayDimensions(OSVR_DisplayConfig, OSVR_DisplayInputCount, OSVR_DisplayDimension*, OSVR_DisplayDimension*)
+ * @deprecated use the safer methods {@link #osvrClientGetDisplayDimensions(osvrdisplay.OsvrDisplayLibrary.OSVR_DisplayConfig, byte, java.nio.IntBuffer, java.nio.IntBuffer)} and {@link #osvrClientGetDisplayDimensions(com.sun.jna.Pointer, byte, com.sun.jna.ptr.IntByReference, com.sun.jna.ptr.IntByReference)} instead
+ */
+ @Deprecated
+ public static native byte osvrClientGetDisplayDimensions(Pointer disp, byte displayInputIndex, IntByReference width, IntByReference height);
+ /**
+ * @brief Retrieve the pixel dimensions of a given display input for a display
+ * config
+ * @param disp Display config object.
+ * @param displayInputIndex The zero-based index of the display input.
+ * @param[out] width Width (in pixels) of the display input.
+ * @param[out] height Height (in pixels) of the display input.
+ * The out parameters are **constant** throughout the active, valid lifetime of
+ * a display config object.
+ * @sa OSVR_DisplayDimension
+ * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in
+ * which case the output arguments are unmodified.
+ * Original signature : OSVR_ReturnCode osvrClientGetDisplayDimensions(OSVR_DisplayConfig, OSVR_DisplayInputCount, OSVR_DisplayDimension*, OSVR_DisplayDimension*)
+ */
+ public static native byte osvrClientGetDisplayDimensions(OsvrDisplayLibrary.OSVR_DisplayConfig disp, byte displayInputIndex, IntBuffer width, IntBuffer height);
+ /**
+ * @brief A display config can have one (or theoretically more) viewers:
+ * retrieve the viewer count.
+ * @param disp Display config object.
+ * @param[out] viewers Number of viewers in the logical display topology,
+ * *constant** throughout the active, valid lifetime of a display config
+ * object.
+ * @sa OSVR_ViewerCount
+ * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in which case
+ * the output argument is unmodified.
+ * Original signature : OSVR_ReturnCode osvrClientGetNumViewers(OSVR_DisplayConfig, OSVR_ViewerCount*)
+ * @deprecated use the safer methods {@link #osvrClientGetNumViewers(osvrdisplay.OsvrDisplayLibrary.OSVR_DisplayConfig, java.nio.IntBuffer)} and {@link #osvrClientGetNumViewers(com.sun.jna.Pointer, com.sun.jna.ptr.IntByReference)} instead
+ */
+ @Deprecated
+ public static native byte osvrClientGetNumViewers(Pointer disp, IntByReference viewers);
+ /**
+ * @brief A display config can have one (or theoretically more) viewers:
+ * retrieve the viewer count.
+ * @param disp Display config object.
+ * @param[out] viewers Number of viewers in the logical display topology,
+ * *constant** throughout the active, valid lifetime of a display config
+ * object.
+ * @sa OSVR_ViewerCount
+ * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in which case
+ * the output argument is unmodified.
+ * Original signature : OSVR_ReturnCode osvrClientGetNumViewers(OSVR_DisplayConfig, OSVR_ViewerCount*)
+ */
+ public static native byte osvrClientGetNumViewers(OsvrDisplayLibrary.OSVR_DisplayConfig disp, IntBuffer viewers);
+ /**
+ * @brief Get the pose of a viewer in a display config.
+ * Note that there may not necessarily be any surfaces rendered from this pose
+ * (it's the unused "center" eye in a stereo configuration, for instance) so
+ * only use this if it makes integration into your engine or existing
+ * applications (not originally designed for stereo) easier.
+ * Will only succeed if osvrClientCheckDisplayStartup() succeeds.
+ * @return OSVR_RETURN_FAILURE if invalid parameters were passed or no pose was
+ * yet available, in which case the pose argument is unmodified.
+ * Original signature : OSVR_ReturnCode osvrClientGetViewerPose(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_Pose3*)
+ * @deprecated use the safer methods {@link #osvrClientGetViewerPose(osvrdisplay.OsvrDisplayLibrary.OSVR_DisplayConfig, int, com.sun.jna.Pointer)} and {@link #osvrClientGetViewerPose(com.sun.jna.Pointer, int, com.sun.jna.Pointer)} instead
+ */
+ @Deprecated
+ public static native byte osvrClientGetViewerPose(Pointer disp, int viewer, Pointer pose);
+ /**
+ * @brief Get the pose of a viewer in a display config.
+ * Note that there may not necessarily be any surfaces rendered from this pose
+ * (it's the unused "center" eye in a stereo configuration, for instance) so
+ * only use this if it makes integration into your engine or existing
+ * applications (not originally designed for stereo) easier.
+ * Will only succeed if osvrClientCheckDisplayStartup() succeeds.
+ * @return OSVR_RETURN_FAILURE if invalid parameters were passed or no pose was
+ * yet available, in which case the pose argument is unmodified.
+ * Original signature : OSVR_ReturnCode osvrClientGetViewerPose(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_Pose3*)
+ */
+ public static native byte osvrClientGetViewerPose(OsvrDisplayLibrary.OSVR_DisplayConfig disp, int viewer, Pointer pose);
+ /**
+ * @brief Each viewer in a display config can have one or more "eyes" which
+ * have a substantially similar pose: get the count.
+ * @param disp Display config object.
+ * @param viewer Viewer ID
+ * @param[out] eyes Number of eyes for this viewer in the logical display
+ * topology, **constant** throughout the active, valid lifetime of a display
+ * config object
+ * @sa OSVR_EyeCount
+ * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in which case
+ * the output argument is unmodified.
+ * Original signature : OSVR_ReturnCode osvrClientGetNumEyesForViewer(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount*)
+ * @deprecated use the safer methods {@link #osvrClientGetNumEyesForViewer(osvrdisplay.OsvrDisplayLibrary.OSVR_DisplayConfig, int, java.nio.ByteBuffer)} and {@link #osvrClientGetNumEyesForViewer(com.sun.jna.Pointer, int, com.sun.jna.Pointer)} instead
+ */
+ @Deprecated
+ public static native byte osvrClientGetNumEyesForViewer(Pointer disp, int viewer, Pointer eyes);
+ /**
+ * @brief Each viewer in a display config can have one or more "eyes" which
+ * have a substantially similar pose: get the count.
+ * @param disp Display config object.
+ * @param viewer Viewer ID
+ * @param[out] eyes Number of eyes for this viewer in the logical display
+ * topology, **constant** throughout the active, valid lifetime of a display
+ * config object
+ * @sa OSVR_EyeCount
+ * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in which case
+ * the output argument is unmodified.
+ * Original signature : OSVR_ReturnCode osvrClientGetNumEyesForViewer(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount*)
+ */
+ public static native byte osvrClientGetNumEyesForViewer(OsvrDisplayLibrary.OSVR_DisplayConfig disp, int viewer, ByteBuffer eyes);
+ /**
+ * @brief Get the "viewpoint" for the given eye of a viewer in a display
+ * config.
+ * Will only succeed if osvrClientCheckDisplayStartup() succeeds.
+ * @param disp Display config object
+ * @param viewer Viewer ID
+ * @param eye Eye ID
+ * @param[out] pose Room-space pose (not relative to pose of the viewer)
+ * @return OSVR_RETURN_FAILURE if invalid parameters were passed or no pose was
+ * yet available, in which case the pose argument is unmodified.
+ * Original signature : OSVR_ReturnCode osvrClientGetViewerEyePose(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_Pose3*)
+ * @deprecated use the safer methods {@link #osvrClientGetViewerEyePose(osvrdisplay.OsvrDisplayLibrary.OSVR_DisplayConfig, int, byte, com.sun.jna.Pointer)} and {@link #osvrClientGetViewerEyePose(com.sun.jna.Pointer, int, byte, com.sun.jna.Pointer)} instead
+ */
+ @Deprecated
+ public static native byte osvrClientGetViewerEyePose(Pointer disp, int viewer, byte eye, Pointer pose);
+ /**
+ * @brief Get the "viewpoint" for the given eye of a viewer in a display
+ * config.
+ * Will only succeed if osvrClientCheckDisplayStartup() succeeds.
+ * @param disp Display config object
+ * @param viewer Viewer ID
+ * @param eye Eye ID
+ * @param[out] pose Room-space pose (not relative to pose of the viewer)
+ * @return OSVR_RETURN_FAILURE if invalid parameters were passed or no pose was
+ * yet available, in which case the pose argument is unmodified.
+ * Original signature : OSVR_ReturnCode osvrClientGetViewerEyePose(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_Pose3*)
+ */
+ public static native byte osvrClientGetViewerEyePose(OsvrDisplayLibrary.OSVR_DisplayConfig disp, int viewer, byte eye, Pointer pose);
+ /**
+ * @brief Get the view matrix (inverse of pose) for the given eye of a
+ * viewer in a display config - matrix of **doubles**.
+ * Will only succeed if osvrClientCheckDisplayStartup() succeeds.
+ * @param disp Display config object
+ * @param viewer Viewer ID
+ * @param eye Eye ID
+ * @param flags Bitwise OR of matrix convention flags (see @ref MatrixFlags)
+ * @param[out] mat Pass a double[::OSVR_MATRIX_SIZE] to get the transformation
+ * matrix from room space to eye space (not relative to pose of the viewer)
+ * @return OSVR_RETURN_FAILURE if invalid parameters were passed or no pose was
+ * yet available, in which case the output argument is unmodified.
+ * Original signature : OSVR_ReturnCode osvrClientGetViewerEyeViewMatrixd(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_MatrixConventions, double*)
+ * @deprecated use the safer methods {@link #osvrClientGetViewerEyeViewMatrixd(osvrdisplay.OsvrDisplayLibrary.OSVR_DisplayConfig, int, byte, short, java.nio.DoubleBuffer)} and {@link #osvrClientGetViewerEyeViewMatrixd(com.sun.jna.Pointer, int, byte, short, com.sun.jna.ptr.DoubleByReference)} instead
+ */
+ @Deprecated
+ public static native byte osvrClientGetViewerEyeViewMatrixd(Pointer disp, int viewer, byte eye, short flags, DoubleByReference mat);
+ /**
+ * @brief Get the view matrix (inverse of pose) for the given eye of a
+ * viewer in a display config - matrix of **doubles**.
+ * Will only succeed if osvrClientCheckDisplayStartup() succeeds.
+ * @param disp Display config object
+ * @param viewer Viewer ID
+ * @param eye Eye ID
+ * @param flags Bitwise OR of matrix convention flags (see @ref MatrixFlags)
+ * @param[out] mat Pass a double[::OSVR_MATRIX_SIZE] to get the transformation
+ * matrix from room space to eye space (not relative to pose of the viewer)
+ * @return OSVR_RETURN_FAILURE if invalid parameters were passed or no pose was
+ * yet available, in which case the output argument is unmodified.
+ * Original signature : OSVR_ReturnCode osvrClientGetViewerEyeViewMatrixd(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_MatrixConventions, double*)
+ */
+ public static native byte osvrClientGetViewerEyeViewMatrixd(OsvrDisplayLibrary.OSVR_DisplayConfig disp, int viewer, byte eye, short flags, DoubleBuffer mat);
+ /**
+ * @brief Get the view matrix (inverse of pose) for the given eye of a
+ * viewer in a display config - matrix of **floats**.
+ * Will only succeed if osvrClientCheckDisplayStartup() succeeds.
+ * @param disp Display config object
+ * @param viewer Viewer ID
+ * @param eye Eye ID
+ * @param flags Bitwise OR of matrix convention flags (see @ref MatrixFlags)
+ * @param[out] mat Pass a float[::OSVR_MATRIX_SIZE] to get the transformation
+ * matrix from room space to eye space (not relative to pose of the viewer)
+ * @return OSVR_RETURN_FAILURE if invalid parameters were passed or no pose was
+ * yet available, in which case the output argument is unmodified.
+ * Original signature : OSVR_ReturnCode osvrClientGetViewerEyeViewMatrixf(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_MatrixConventions, float*)
+ * @deprecated use the safer methods {@link #osvrClientGetViewerEyeViewMatrixf(osvrdisplay.OsvrDisplayLibrary.OSVR_DisplayConfig, int, byte, short, java.nio.FloatBuffer)} and {@link #osvrClientGetViewerEyeViewMatrixf(com.sun.jna.Pointer, int, byte, short, com.sun.jna.ptr.FloatByReference)} instead
+ */
+ @Deprecated
+ public static native byte osvrClientGetViewerEyeViewMatrixf(Pointer disp, int viewer, byte eye, short flags, FloatByReference mat);
+ /**
+ * @brief Get the view matrix (inverse of pose) for the given eye of a
+ * viewer in a display config - matrix of **floats**.
+ * Will only succeed if osvrClientCheckDisplayStartup() succeeds.
+ * @param disp Display config object
+ * @param viewer Viewer ID
+ * @param eye Eye ID
+ * @param flags Bitwise OR of matrix convention flags (see @ref MatrixFlags)
+ * @param[out] mat Pass a float[::OSVR_MATRIX_SIZE] to get the transformation
+ * matrix from room space to eye space (not relative to pose of the viewer)
+ * @return OSVR_RETURN_FAILURE if invalid parameters were passed or no pose was
+ * yet available, in which case the output argument is unmodified.
+ * Original signature : OSVR_ReturnCode osvrClientGetViewerEyeViewMatrixf(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_MatrixConventions, float*)
+ */
+ public static native byte osvrClientGetViewerEyeViewMatrixf(OsvrDisplayLibrary.OSVR_DisplayConfig disp, int viewer, byte eye, short flags, FloatBuffer mat);
+ /**
+ * @brief Each eye of each viewer in a display config has one or more surfaces
+ * (aka "screens") on which content should be rendered.
+ * @param disp Display config object
+ * @param viewer Viewer ID
+ * @param eye Eye ID
+ * @param[out] surfaces Number of surfaces (numbered [0, surfaces - 1]) for the
+ * given viewer and eye. **Constant** throughout the active, valid lifetime of
+ * a display config object.
+ * @sa OSVR_SurfaceCount
+ * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in which case
+ * the output argument is unmodified.
+ * Original signature : OSVR_ReturnCode osvrClientGetNumSurfacesForViewerEye(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_SurfaceCount*)
+ * @deprecated use the safer methods {@link #osvrClientGetNumSurfacesForViewerEye(osvrdisplay.OsvrDisplayLibrary.OSVR_DisplayConfig, int, byte, java.nio.IntBuffer)} and {@link #osvrClientGetNumSurfacesForViewerEye(com.sun.jna.Pointer, int, byte, com.sun.jna.ptr.IntByReference)} instead
+ */
+ @Deprecated
+ public static native byte osvrClientGetNumSurfacesForViewerEye(Pointer disp, int viewer, byte eye, IntByReference surfaces);
+ /**
+ * @brief Each eye of each viewer in a display config has one or more surfaces
+ * (aka "screens") on which content should be rendered.
+ * @param disp Display config object
+ * @param viewer Viewer ID
+ * @param eye Eye ID
+ * @param[out] surfaces Number of surfaces (numbered [0, surfaces - 1]) for the
+ * given viewer and eye. **Constant** throughout the active, valid lifetime of
+ * a display config object.
+ * @sa OSVR_SurfaceCount
+ * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in which case
+ * the output argument is unmodified.
+ * Original signature : OSVR_ReturnCode osvrClientGetNumSurfacesForViewerEye(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_SurfaceCount*)
+ */
+ public static native byte osvrClientGetNumSurfacesForViewerEye(OsvrDisplayLibrary.OSVR_DisplayConfig disp, int viewer, byte eye, IntBuffer surfaces);
+ /**
+ * @brief Get the dimensions/location of the viewport **within the display
+ * input** for a surface seen by an eye of a viewer in a display config. (This
+ * does not include other video inputs that may be on a single virtual desktop,
+ * etc. or explicitly account for display configurations that use multiple
+ * video inputs. It does not necessarily indicate that a viewport in the sense
+ * of glViewport must be created with these parameters, though the parameter
+ * order matches for convenience.)
+ * @param disp Display config object
+ * @param viewer Viewer ID
+ * @param eye Eye ID
+ * @param surface Surface ID
+ * @param[out] left Output: Distance in pixels from the left of the video input
+ * to the left of the viewport.
+ * @param[out] bottom Output: Distance in pixels from the bottom of the video
+ * input to the bottom of the viewport.
+ * @param[out] width Output: Width of viewport in pixels.
+ * @param[out] height Output: Height of viewport in pixels.
+ * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in which case
+ * the output arguments are unmodified.
+ * Original signature : OSVR_ReturnCode osvrClientGetRelativeViewportForViewerEyeSurface(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_SurfaceCount, OSVR_ViewportDimension*, OSVR_ViewportDimension*, OSVR_ViewportDimension*, OSVR_ViewportDimension*)
+ * @deprecated use the safer methods {@link #osvrClientGetRelativeViewportForViewerEyeSurface(osvrdisplay.OsvrDisplayLibrary.OSVR_DisplayConfig, int, byte, int, java.nio.IntBuffer, java.nio.IntBuffer, java.nio.IntBuffer, java.nio.IntBuffer)} and {@link #osvrClientGetRelativeViewportForViewerEyeSurface(com.sun.jna.Pointer, int, byte, int, com.sun.jna.ptr.IntByReference, com.sun.jna.ptr.IntByReference, com.sun.jna.ptr.IntByReference, com.sun.jna.ptr.IntByReference)} instead
+ */
+ @Deprecated
+ public static native byte osvrClientGetRelativeViewportForViewerEyeSurface(Pointer disp, int viewer, byte eye, int surface, IntByReference left, IntByReference bottom, IntByReference width, IntByReference height);
+ /**
+ * @brief Get the dimensions/location of the viewport **within the display
+ * input** for a surface seen by an eye of a viewer in a display config. (This
+ * does not include other video inputs that may be on a single virtual desktop,
+ * etc. or explicitly account for display configurations that use multiple
+ * video inputs. It does not necessarily indicate that a viewport in the sense
+ * of glViewport must be created with these parameters, though the parameter
+ * order matches for convenience.)
+ * @param disp Display config object
+ * @param viewer Viewer ID
+ * @param eye Eye ID
+ * @param surface Surface ID
+ * @param[out] left Output: Distance in pixels from the left of the video input
+ * to the left of the viewport.
+ * @param[out] bottom Output: Distance in pixels from the bottom of the video
+ * input to the bottom of the viewport.
+ * @param[out] width Output: Width of viewport in pixels.
+ * @param[out] height Output: Height of viewport in pixels.
+ * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in which case
+ * the output arguments are unmodified.
+ * Original signature : OSVR_ReturnCode osvrClientGetRelativeViewportForViewerEyeSurface(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_SurfaceCount, OSVR_ViewportDimension*, OSVR_ViewportDimension*, OSVR_ViewportDimension*, OSVR_ViewportDimension*)
+ */
+ public static native byte osvrClientGetRelativeViewportForViewerEyeSurface(OsvrDisplayLibrary.OSVR_DisplayConfig disp, int viewer, byte eye, int surface, IntBuffer left, IntBuffer bottom, IntBuffer width, IntBuffer height);
+ /**
+ * @brief Get the index of the display input for a surface seen by an eye of a
+ * viewer in a display config.
+ * This is the OSVR-assigned display input: it may not (and in practice,
+ * usually will not) match any platform-specific display indices. This function
+ * exists to associate surfaces with video inputs as enumerated by
+ * osvrClientGetNumDisplayInputs().
+ * @param disp Display config object
+ * @param viewer Viewer ID
+ * @param eye Eye ID
+ * @param surface Surface ID
+ * @param[out] displayInput Zero-based index of the display input pixels for
+ * this surface are tranmitted over.
+ * This association is **constant** throughout the active, valid lifetime of a
+ * display config object.
+ * @sa osvrClientGetNumDisplayInputs(),
+ * osvrClientGetRelativeViewportForViewerEyeSurface()
+ * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in which
+ * case the output argument is unmodified.
+ * Original signature : OSVR_ReturnCode osvrClientGetViewerEyeSurfaceDisplayInputIndex(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_SurfaceCount, OSVR_DisplayInputCount*)
+ * @deprecated use the safer methods {@link #osvrClientGetViewerEyeSurfaceDisplayInputIndex(osvrdisplay.OsvrDisplayLibrary.OSVR_DisplayConfig, int, byte, int, java.nio.ByteBuffer)} and {@link #osvrClientGetViewerEyeSurfaceDisplayInputIndex(com.sun.jna.Pointer, int, byte, int, com.sun.jna.Pointer)} instead
+ */
+ @Deprecated
+ public static native byte osvrClientGetViewerEyeSurfaceDisplayInputIndex(Pointer disp, int viewer, byte eye, int surface, Pointer displayInput);
+ /**
+ * @brief Get the index of the display input for a surface seen by an eye of a
+ * viewer in a display config.
+ * This is the OSVR-assigned display input: it may not (and in practice,
+ * usually will not) match any platform-specific display indices. This function
+ * exists to associate surfaces with video inputs as enumerated by
+ * osvrClientGetNumDisplayInputs().
+ * @param disp Display config object
+ * @param viewer Viewer ID
+ * @param eye Eye ID
+ * @param surface Surface ID
+ * @param[out] displayInput Zero-based index of the display input pixels for
+ * this surface are tranmitted over.
+ * This association is **constant** throughout the active, valid lifetime of a
+ * display config object.
+ * @sa osvrClientGetNumDisplayInputs(),
+ * osvrClientGetRelativeViewportForViewerEyeSurface()
+ * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in which
+ * case the output argument is unmodified.
+ * Original signature : OSVR_ReturnCode osvrClientGetViewerEyeSurfaceDisplayInputIndex(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_SurfaceCount, OSVR_DisplayInputCount*)
+ */
+ public static native byte osvrClientGetViewerEyeSurfaceDisplayInputIndex(OsvrDisplayLibrary.OSVR_DisplayConfig disp, int viewer, byte eye, int surface, ByteBuffer displayInput);
+ /**
+ * @brief Get the projection matrix for a surface seen by an eye of a viewer
+ * in a display config. (double version)
+ * @param disp Display config object
+ * @param viewer Viewer ID
+ * @param eye Eye ID
+ * @param surface Surface ID
+ * @param near Distance from viewpoint to near clipping plane - must be
+ * positive.
+ * @param far Distance from viewpoint to far clipping plane - must be positive
+ * and not equal to near, typically greater than near.
+ * @param flags Bitwise OR of matrix convention flags (see @ref MatrixFlags)
+ * @param[out] matrix Output projection matrix: supply an array of 16
+ * (::OSVR_MATRIX_SIZE) doubles.
+ * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in which case
+ * the output argument is unmodified.
+ * Original signature : OSVR_ReturnCode osvrClientGetViewerEyeSurfaceProjectionMatrixd(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_SurfaceCount, double, double, OSVR_MatrixConventions, double*)
+ * @deprecated use the safer methods {@link #osvrClientGetViewerEyeSurfaceProjectionMatrixd(osvrdisplay.OsvrDisplayLibrary.OSVR_DisplayConfig, int, byte, int, double, double, short, java.nio.DoubleBuffer)} and {@link #osvrClientGetViewerEyeSurfaceProjectionMatrixd(com.sun.jna.Pointer, int, byte, int, double, double, short, com.sun.jna.ptr.DoubleByReference)} instead
+ */
+ @Deprecated
+ public static native byte osvrClientGetViewerEyeSurfaceProjectionMatrixd(Pointer disp, int viewer, byte eye, int surface, double near, double far, short flags, DoubleByReference matrix);
+ /**
+ * @brief Get the projection matrix for a surface seen by an eye of a viewer
+ * in a display config. (double version)
+ * @param disp Display config object
+ * @param viewer Viewer ID
+ * @param eye Eye ID
+ * @param surface Surface ID
+ * @param near Distance from viewpoint to near clipping plane - must be
+ * positive.
+ * @param far Distance from viewpoint to far clipping plane - must be positive
+ * and not equal to near, typically greater than near.
+ * @param flags Bitwise OR of matrix convention flags (see @ref MatrixFlags)
+ * @param[out] matrix Output projection matrix: supply an array of 16
+ * (::OSVR_MATRIX_SIZE) doubles.
+ * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in which case
+ * the output argument is unmodified.
+ * Original signature : OSVR_ReturnCode osvrClientGetViewerEyeSurfaceProjectionMatrixd(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_SurfaceCount, double, double, OSVR_MatrixConventions, double*)
+ */
+ public static native byte osvrClientGetViewerEyeSurfaceProjectionMatrixd(OsvrDisplayLibrary.OSVR_DisplayConfig disp, int viewer, byte eye, int surface, double near, double far, short flags, DoubleBuffer matrix);
+ /**
+ * @brief Get the projection matrix for a surface seen by an eye of a viewer
+ * in a display config. (float version)
+ * @param disp Display config object
+ * @param viewer Viewer ID
+ * @param eye Eye ID
+ * @param surface Surface ID
+ * @param near Distance to near clipping plane - must be nonzero, typically
+ * positive.
+ * @param far Distance to far clipping plane - must be nonzero, typically
+ * positive and greater than near.
+ * @param flags Bitwise OR of matrix convention flags (see @ref MatrixFlags)
+ * @param[out] matrix Output projection matrix: supply an array of 16
+ * (::OSVR_MATRIX_SIZE) floats.
+ * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in which case
+ * the output argument is unmodified.
+ * Original signature : OSVR_ReturnCode osvrClientGetViewerEyeSurfaceProjectionMatrixf(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_SurfaceCount, float, float, OSVR_MatrixConventions, float*)
+ * @deprecated use the safer methods {@link #osvrClientGetViewerEyeSurfaceProjectionMatrixf(osvrdisplay.OsvrDisplayLibrary.OSVR_DisplayConfig, int, byte, int, float, float, short, java.nio.FloatBuffer)} and {@link #osvrClientGetViewerEyeSurfaceProjectionMatrixf(com.sun.jna.Pointer, int, byte, int, float, float, short, com.sun.jna.ptr.FloatByReference)} instead
+ */
+ @Deprecated
+ public static native byte osvrClientGetViewerEyeSurfaceProjectionMatrixf(Pointer disp, int viewer, byte eye, int surface, float near, float far, short flags, FloatByReference matrix);
+ /**
+ * @brief Get the projection matrix for a surface seen by an eye of a viewer
+ * in a display config. (float version)
+ * @param disp Display config object
+ * @param viewer Viewer ID
+ * @param eye Eye ID
+ * @param surface Surface ID
+ * @param near Distance to near clipping plane - must be nonzero, typically
+ * positive.
+ * @param far Distance to far clipping plane - must be nonzero, typically
+ * positive and greater than near.
+ * @param flags Bitwise OR of matrix convention flags (see @ref MatrixFlags)
+ * @param[out] matrix Output projection matrix: supply an array of 16
+ * (::OSVR_MATRIX_SIZE) floats.
+ * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in which case
+ * the output argument is unmodified.
+ * Original signature : OSVR_ReturnCode osvrClientGetViewerEyeSurfaceProjectionMatrixf(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_SurfaceCount, float, float, OSVR_MatrixConventions, float*)
+ */
+ public static native byte osvrClientGetViewerEyeSurfaceProjectionMatrixf(OsvrDisplayLibrary.OSVR_DisplayConfig disp, int viewer, byte eye, int surface, float near, float far, short flags, FloatBuffer matrix);
+ /**
+ * @brief Get the clipping planes (positions at unit distance) for a surface
+ * seen by an eye of a viewer
+ * in a display config.
+ * This is only for use in integrations that cannot accept a fully-formulated
+ * projection matrix as returned by
+ * osvrClientGetViewerEyeSurfaceProjectionMatrixf() or
+ * osvrClientGetViewerEyeSurfaceProjectionMatrixd(), and may not necessarily
+ * provide the same optimizations.
+ * As all the planes are given at unit (1) distance, before passing these
+ * planes to a consuming function in your application/engine, you will typically
+ * divide them by your near clipping plane distance.
+ * @param disp Display config object
+ * @param viewer Viewer ID
+ * @param eye Eye ID
+ * @param surface Surface ID
+ * @param[out] left Distance to left clipping plane
+ * @param[out] right Distance to right clipping plane
+ * @param[out] bottom Distance to bottom clipping plane
+ * @param[out] top Distance to top clipping plane
+ * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in which case
+ * the output arguments are unmodified.
+ * Original signature : OSVR_ReturnCode osvrClientGetViewerEyeSurfaceProjectionClippingPlanes(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_SurfaceCount, double*, double*, double*, double*)
+ * @deprecated use the safer methods {@link #osvrClientGetViewerEyeSurfaceProjectionClippingPlanes(osvrdisplay.OsvrDisplayLibrary.OSVR_DisplayConfig, int, byte, int, java.nio.DoubleBuffer, java.nio.DoubleBuffer, java.nio.DoubleBuffer, java.nio.DoubleBuffer)} and {@link #osvrClientGetViewerEyeSurfaceProjectionClippingPlanes(com.sun.jna.Pointer, int, byte, int, com.sun.jna.ptr.DoubleByReference, com.sun.jna.ptr.DoubleByReference, com.sun.jna.ptr.DoubleByReference, com.sun.jna.ptr.DoubleByReference)} instead
+ */
+ @Deprecated
+ public static native byte osvrClientGetViewerEyeSurfaceProjectionClippingPlanes(Pointer disp, int viewer, byte eye, int surface, DoubleByReference left, DoubleByReference right, DoubleByReference bottom, DoubleByReference top);
+ /**
+ * @brief Get the clipping planes (positions at unit distance) for a surface
+ * seen by an eye of a viewer
+ * in a display config.
+ * This is only for use in integrations that cannot accept a fully-formulated
+ * projection matrix as returned by
+ * osvrClientGetViewerEyeSurfaceProjectionMatrixf() or
+ * osvrClientGetViewerEyeSurfaceProjectionMatrixd(), and may not necessarily
+ * provide the same optimizations.
+ * As all the planes are given at unit (1) distance, before passing these
+ * planes to a consuming function in your application/engine, you will typically
+ * divide them by your near clipping plane distance.
+ * @param disp Display config object
+ * @param viewer Viewer ID
+ * @param eye Eye ID
+ * @param surface Surface ID
+ * @param[out] left Distance to left clipping plane
+ * @param[out] right Distance to right clipping plane
+ * @param[out] bottom Distance to bottom clipping plane
+ * @param[out] top Distance to top clipping plane
+ * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in which case
+ * the output arguments are unmodified.
+ * Original signature : OSVR_ReturnCode osvrClientGetViewerEyeSurfaceProjectionClippingPlanes(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_SurfaceCount, double*, double*, double*, double*)
+ */
+ public static native byte osvrClientGetViewerEyeSurfaceProjectionClippingPlanes(OsvrDisplayLibrary.OSVR_DisplayConfig disp, int viewer, byte eye, int surface, DoubleBuffer left, DoubleBuffer right, DoubleBuffer bottom, DoubleBuffer top);
+ /**
+ * @brief Determines if a surface seen by an eye of a viewer in a display
+ * config requests some distortion to be performed.
+ * This simply reports true or false, and does not specify which kind of
+ * distortion implementations have been parameterized for this display. For
+ * each distortion implementation your application supports, you'll want to
+ * call the corresponding priority function to find out if it is available.
+ * @param disp Display config object
+ * @param viewer Viewer ID
+ * @param eye Eye ID
+ * @param surface Surface ID
+ * @param[out] distortionRequested Output parameter: whether distortion is
+ * requested. **Constant** throughout the active, valid lifetime of a display
+ * config object.
+ * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in which case
+ * the output argument is unmodified.
+ * Original signature : OSVR_ReturnCode osvrClientDoesViewerEyeSurfaceWantDistortion(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_SurfaceCount, OSVR_CBool*)
+ * @deprecated use the safer methods {@link #osvrClientDoesViewerEyeSurfaceWantDistortion(osvrdisplay.OsvrDisplayLibrary.OSVR_DisplayConfig, int, byte, int, java.nio.ByteBuffer)} and {@link #osvrClientDoesViewerEyeSurfaceWantDistortion(com.sun.jna.Pointer, int, byte, int, com.sun.jna.Pointer)} instead
+ */
+ @Deprecated
+ public static native byte osvrClientDoesViewerEyeSurfaceWantDistortion(Pointer disp, int viewer, byte eye, int surface, Pointer distortionRequested);
+ /**
+ * @brief Determines if a surface seen by an eye of a viewer in a display
+ * config requests some distortion to be performed.
+ * This simply reports true or false, and does not specify which kind of
+ * distortion implementations have been parameterized for this display. For
+ * each distortion implementation your application supports, you'll want to
+ * call the corresponding priority function to find out if it is available.
+ * @param disp Display config object
+ * @param viewer Viewer ID
+ * @param eye Eye ID
+ * @param surface Surface ID
+ * @param[out] distortionRequested Output parameter: whether distortion is
+ * requested. **Constant** throughout the active, valid lifetime of a display
+ * config object.
+ * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in which case
+ * the output argument is unmodified.
+ * Original signature : OSVR_ReturnCode osvrClientDoesViewerEyeSurfaceWantDistortion(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_SurfaceCount, OSVR_CBool*)
+ */
+ public static native byte osvrClientDoesViewerEyeSurfaceWantDistortion(OsvrDisplayLibrary.OSVR_DisplayConfig disp, int viewer, byte eye, int surface, ByteBuffer distortionRequested);
+ /**
+ * @brief Returns the priority/availability of radial distortion parameters for
+ * a surface seen by an eye of a viewer in a display config.
+ * If osvrClientDoesViewerEyeSurfaceWantDistortion() reports false, then the
+ * display does not request distortion of any sort, and thus neither this nor
+ * any other distortion strategy priority function will report an "available"
+ * priority.
+ * @param disp Display config object
+ * @param viewer Viewer ID
+ * @param eye Eye ID
+ * @param surface Surface ID
+ * @param[out] priority Output: the priority level. Negative values
+ * (canonically OSVR_DISTORTION_PRIORITY_UNAVAILABLE) indicate this technique
+ * not available, higher values indicate higher preference for the given
+ * technique based on the device's description. **Constant** throughout the
+ * active, valid lifetime of a display config object.
+ * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in which case
+ * the output argument is unmodified.
+ * Original signature : OSVR_ReturnCode osvrClientGetViewerEyeSurfaceRadialDistortionPriority(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_SurfaceCount, OSVR_DistortionPriority*)
+ * @deprecated use the safer methods {@link #osvrClientGetViewerEyeSurfaceRadialDistortionPriority(osvrdisplay.OsvrDisplayLibrary.OSVR_DisplayConfig, int, byte, int, java.nio.IntBuffer)} and {@link #osvrClientGetViewerEyeSurfaceRadialDistortionPriority(com.sun.jna.Pointer, int, byte, int, com.sun.jna.ptr.IntByReference)} instead
+ */
+ @Deprecated
+ public static native byte osvrClientGetViewerEyeSurfaceRadialDistortionPriority(Pointer disp, int viewer, byte eye, int surface, IntByReference priority);
+ /**
+ * @brief Returns the priority/availability of radial distortion parameters for
+ * a surface seen by an eye of a viewer in a display config.
+ * If osvrClientDoesViewerEyeSurfaceWantDistortion() reports false, then the
+ * display does not request distortion of any sort, and thus neither this nor
+ * any other distortion strategy priority function will report an "available"
+ * priority.
+ * @param disp Display config object
+ * @param viewer Viewer ID
+ * @param eye Eye ID
+ * @param surface Surface ID
+ * @param[out] priority Output: the priority level. Negative values
+ * (canonically OSVR_DISTORTION_PRIORITY_UNAVAILABLE) indicate this technique
+ * not available, higher values indicate higher preference for the given
+ * technique based on the device's description. **Constant** throughout the
+ * active, valid lifetime of a display config object.
+ * @return OSVR_RETURN_FAILURE if invalid parameters were passed, in which case
+ * the output argument is unmodified.
+ * Original signature : OSVR_ReturnCode osvrClientGetViewerEyeSurfaceRadialDistortionPriority(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_SurfaceCount, OSVR_DistortionPriority*)
+ */
+ public static native byte osvrClientGetViewerEyeSurfaceRadialDistortionPriority(OsvrDisplayLibrary.OSVR_DisplayConfig disp, int viewer, byte eye, int surface, IntBuffer priority);
+ /**
+ * @brief Returns the radial distortion parameters, if known/requested, for a
+ * surface seen by an eye of a viewer in a display config.
+ * Will only succeed if osvrClientGetViewerEyeSurfaceRadialDistortionPriority()
+ * reports a non-negative priority.
+ * @param disp Display config object
+ * @param viewer Viewer ID
+ * @param eye Eye ID
+ * @param surface Surface ID
+ * @param[out] params Output: the parameters for radial distortion
+ * @return OSVR_RETURN_FAILURE if this surface does not have these parameters
+ * described, or if invalid parameters were passed, in which case the output
+ * argument is unmodified.
+ * Original signature : OSVR_ReturnCode osvrClientGetViewerEyeSurfaceRadialDistortion(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_SurfaceCount, OSVR_RadialDistortionParameters*)
+ * @deprecated use the safer methods {@link #osvrClientGetViewerEyeSurfaceRadialDistortion(osvrdisplay.OsvrDisplayLibrary.OSVR_DisplayConfig, int, byte, int, com.sun.jna.Pointer)} and {@link #osvrClientGetViewerEyeSurfaceRadialDistortion(com.sun.jna.Pointer, int, byte, int, com.sun.jna.Pointer)} instead
+ */
+ @Deprecated
+ public static native byte osvrClientGetViewerEyeSurfaceRadialDistortion(Pointer disp, int viewer, byte eye, int surface, Pointer params);
+ /**
+ * @brief Returns the radial distortion parameters, if known/requested, for a
+ * surface seen by an eye of a viewer in a display config.
+ * Will only succeed if osvrClientGetViewerEyeSurfaceRadialDistortionPriority()
+ * reports a non-negative priority.
+ * @param disp Display config object
+ * @param viewer Viewer ID
+ * @param eye Eye ID
+ * @param surface Surface ID
+ * @param[out] params Output: the parameters for radial distortion
+ * @return OSVR_RETURN_FAILURE if this surface does not have these parameters
+ * described, or if invalid parameters were passed, in which case the output
+ * argument is unmodified.
+ * Original signature : OSVR_ReturnCode osvrClientGetViewerEyeSurfaceRadialDistortion(OSVR_DisplayConfig, OSVR_ViewerCount, OSVR_EyeCount, OSVR_SurfaceCount, OSVR_RadialDistortionParameters*)
+ */
+ public static native byte osvrClientGetViewerEyeSurfaceRadialDistortion(OsvrDisplayLibrary.OSVR_DisplayConfig disp, int viewer, byte eye, int surface, Pointer params);
+ public static class OSVR_ClientContext extends PointerType {
+ public OSVR_ClientContext(Pointer address) {
+ super(address);
+ }
+ public OSVR_ClientContext() {
+ super();
+ }
+ };
+ public static class OSVR_DisplayConfig extends PointerType {
+ public OSVR_DisplayConfig(Pointer address) {
+ super(address);
+ }
+ public OSVR_DisplayConfig() {
+ super();
+ }
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrinterface/OsvrInterfaceLibrary.java b/jme3-vr/src/main/java/osvrinterface/OsvrInterfaceLibrary.java
new file mode 100644
index 000000000..bf9b614b8
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrinterface/OsvrInterfaceLibrary.java
@@ -0,0 +1,24 @@
+package osvrinterface;
+import com.sun.jna.Library;
+import com.sun.jna.Native;
+import com.sun.jna.NativeLibrary;
+import osvrclientkit.OsvrClientKitLibrary.OSVR_ClientInterface;
+import osvrclientreporttypes.OSVR_Pose3;
+import osvrtimevalue.OSVR_TimeValue;
+/**
+ * JNA Wrapper for library osvrInterface
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OsvrInterfaceLibrary implements Library {
+ public static final String JNA_LIBRARY_NAME = "osvrClientKit";
+ public static final NativeLibrary JNA_NATIVE_LIB = NativeLibrary.getInstance(OsvrInterfaceLibrary.JNA_LIBRARY_NAME);
+ static {
+ Native.register(OsvrInterfaceLibrary.class, OsvrInterfaceLibrary.JNA_NATIVE_LIB);
+ }
+
+ /** Manually added */
+ public static native byte osvrGetPoseState(OSVR_ClientInterface iface, OSVR_TimeValue timestamp, OSVR_Pose3 state);
+
+}
diff --git a/jme3-vr/src/main/java/osvrmatrixconventions/OSVR_Pose3.java b/jme3-vr/src/main/java/osvrmatrixconventions/OSVR_Pose3.java
new file mode 100644
index 000000000..dd3b250dc
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrmatrixconventions/OSVR_Pose3.java
@@ -0,0 +1,40 @@
+package osvrmatrixconventions;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_Pose3 extends Structure {
+ /** C type : OSVR_Vec3 */
+ public OSVR_Vec3 translation;
+ /** C type : OSVR_Quaternion */
+ public OSVR_Quaternion rotation;
+ public OSVR_Pose3() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("translation", "rotation");
+ }
+ /**
+ * @param translation C type : OSVR_Vec3
+ * @param rotation C type : OSVR_Quaternion
+ */
+ public OSVR_Pose3(OSVR_Vec3 translation, OSVR_Quaternion rotation) {
+ super();
+ this.translation = translation;
+ this.rotation = rotation;
+ }
+ public OSVR_Pose3(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_Pose3 implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_Pose3 implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrmatrixconventions/OSVR_Quaternion.java b/jme3-vr/src/main/java/osvrmatrixconventions/OSVR_Quaternion.java
new file mode 100644
index 000000000..07b83b1e5
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrmatrixconventions/OSVR_Quaternion.java
@@ -0,0 +1,36 @@
+package osvrmatrixconventions;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_Quaternion extends Structure {
+ /** C type : double[4] */
+ public double[] data = new double[4];
+ public OSVR_Quaternion() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("data");
+ }
+ /** @param data C type : double[4] */
+ public OSVR_Quaternion(double data[]) {
+ super();
+ if ((data.length != this.data.length))
+ throw new IllegalArgumentException("Wrong array size !");
+ this.data = data;
+ }
+ public OSVR_Quaternion(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_Quaternion implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_Quaternion implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrmatrixconventions/OSVR_Vec3.java b/jme3-vr/src/main/java/osvrmatrixconventions/OSVR_Vec3.java
new file mode 100644
index 000000000..62733630a
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrmatrixconventions/OSVR_Vec3.java
@@ -0,0 +1,36 @@
+package osvrmatrixconventions;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_Vec3 extends Structure {
+ /** C type : double[3] */
+ public double[] data = new double[3];
+ public OSVR_Vec3() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("data");
+ }
+ /** @param data C type : double[3] */
+ public OSVR_Vec3(double data[]) {
+ super();
+ if ((data.length != this.data.length))
+ throw new IllegalArgumentException("Wrong array size !");
+ this.data = data;
+ }
+ public OSVR_Vec3(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_Vec3 implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_Vec3 implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrmatrixconventions/OsvrMatrixConventionsLibrary.java b/jme3-vr/src/main/java/osvrmatrixconventions/OsvrMatrixConventionsLibrary.java
new file mode 100644
index 000000000..04330c772
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrmatrixconventions/OsvrMatrixConventionsLibrary.java
@@ -0,0 +1,182 @@
+package osvrmatrixconventions;
+import com.sun.jna.Library;
+import com.sun.jna.Native;
+import com.sun.jna.NativeLibrary;
+import com.sun.jna.Pointer;
+import com.sun.jna.PointerType;
+import com.sun.jna.ptr.DoubleByReference;
+import com.sun.jna.ptr.FloatByReference;
+import java.nio.DoubleBuffer;
+import java.nio.FloatBuffer;
+/**
+ * JNA Wrapper for library osvrMatrixConventions
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OsvrMatrixConventionsLibrary implements Library {
+ public static final String JNA_LIBRARY_NAME = "osvrUtil";
+ public static final NativeLibrary JNA_NATIVE_LIB = NativeLibrary.getInstance(OsvrMatrixConventionsLibrary.JNA_LIBRARY_NAME);
+ static {
+ Native.register(OsvrMatrixConventionsLibrary.class, OsvrMatrixConventionsLibrary.JNA_NATIVE_LIB);
+ }
+ /** enum values */
+ public static interface OSVR_MatrixMasks {
+ public static final int OSVR_MATRIX_MASK_ROWMAJOR = 0x1;
+ public static final int OSVR_MATRIX_MASK_ROWVECTORS = 0x2;
+ public static final int OSVR_MATRIX_MASK_LHINPUT = 0x4;
+ public static final int OSVR_MATRIX_MASK_UNSIGNEDZ = 0x8;
+ };
+ /** enum values */
+ public static interface OSVR_MatrixOrderingFlags {
+ public static final int OSVR_MATRIX_COLMAJOR = 0x0;
+ public static final int OSVR_MATRIX_ROWMAJOR = (int)OsvrMatrixConventionsLibrary.OSVR_MatrixMasks.OSVR_MATRIX_MASK_ROWMAJOR;
+ };
+ /** enum values */
+ public static interface OSVR_MatrixVectorFlags {
+ public static final int OSVR_MATRIX_COLVECTORS = 0x0;
+ public static final int OSVR_MATRIX_ROWVECTORS = (int)OsvrMatrixConventionsLibrary.OSVR_MatrixMasks.OSVR_MATRIX_MASK_ROWVECTORS;
+ };
+ /** enum values */
+ public static interface OSVR_ProjectionMatrixInputFlags {
+ public static final int OSVR_MATRIX_RHINPUT = 0x0;
+ public static final int OSVR_MATRIX_LHINPUT = (int)OsvrMatrixConventionsLibrary.OSVR_MatrixMasks.OSVR_MATRIX_MASK_LHINPUT;
+ };
+ /** enum values */
+ public static interface OSVR_ProjectionMatrixZFlags {
+ public static final int OSVR_MATRIX_SIGNEDZ = 0x0;
+ public static final int OSVR_MATRIX_UNSIGNEDZ = (int)OsvrMatrixConventionsLibrary.OSVR_MatrixMasks.OSVR_MATRIX_MASK_UNSIGNEDZ;
+ };
+ public static final int OSVR_MATRIX_SIZE = 16;
+ public static final int OSVR_RETURN_SUCCESS = (int)(0);
+ public static final int OSVR_RETURN_FAILURE = (int)(1);
+ /** Original signature : double osvrVec3GetX(const OSVR_Vec3*)
*/
+ public static native double osvrVec3GetX(OSVR_Vec3 v);
+ /** Original signature : void osvrVec3SetX(OSVR_Vec3*, double)
*/
+ public static native void osvrVec3SetX(OSVR_Vec3 v, double val);
+ /** Original signature : double osvrVec3GetY(const OSVR_Vec3*)
*/
+ public static native double osvrVec3GetY(OSVR_Vec3 v);
+ /** Original signature : void osvrVec3SetY(OSVR_Vec3*, double)
*/
+ public static native void osvrVec3SetY(OSVR_Vec3 v, double val);
+ /** Original signature : double osvrVec3GetZ(const OSVR_Vec3*)
*/
+ public static native double osvrVec3GetZ(OSVR_Vec3 v);
+ /** Original signature : void osvrVec3SetZ(OSVR_Vec3*, double)
*/
+ public static native void osvrVec3SetZ(OSVR_Vec3 v, double val);
+ /**
+ * @brief Set a Vec3 to the zero vector
+ * Original signature : void osvrVec3Zero(OSVR_Vec3*)
+ */
+ public static native void osvrVec3Zero(OSVR_Vec3 v);
+ /** Original signature : double osvrQuatGetW(const OSVR_Quaternion*)
*/
+ public static native double osvrQuatGetW(OSVR_Quaternion q);
+ /** Original signature : void osvrQuatSetW(OSVR_Quaternion*, double)
*/
+ public static native void osvrQuatSetW(OSVR_Quaternion q, double val);
+ /** Original signature : double osvrQuatGetX(const OSVR_Quaternion*)
*/
+ public static native double osvrQuatGetX(OSVR_Quaternion q);
+ /** Original signature : void osvrQuatSetX(OSVR_Quaternion*, double)
*/
+ public static native void osvrQuatSetX(OSVR_Quaternion q, double val);
+ /** Original signature : double osvrQuatGetY(const OSVR_Quaternion*)
*/
+ public static native double osvrQuatGetY(OSVR_Quaternion q);
+ /** Original signature : void osvrQuatSetY(OSVR_Quaternion*, double)
*/
+ public static native void osvrQuatSetY(OSVR_Quaternion q, double val);
+ /** Original signature : double osvrQuatGetZ(const OSVR_Quaternion*)
*/
+ public static native double osvrQuatGetZ(OSVR_Quaternion q);
+ /** Original signature : void osvrQuatSetZ(OSVR_Quaternion*, double)
*/
+ public static native void osvrQuatSetZ(OSVR_Quaternion q, double val);
+ /**
+ * @brief Set a quaternion to the identity rotation
+ * Original signature : void osvrQuatSetIdentity(OSVR_Quaternion*)
+ */
+ public static native void osvrQuatSetIdentity(OSVR_Quaternion q);
+ /**
+ * @brief Set a pose to identity
+ * Original signature : void osvrPose3SetIdentity(OSVR_Pose3*)
+ */
+ public static native void osvrPose3SetIdentity(OSVR_Pose3 pose);
+ /**
+ * @brief Set a matrix of doubles based on a Pose3.
+ * @param pose The Pose3 to convert
+ * @param flags Memory ordering flag - see @ref MatrixFlags
+ * @param[out] mat an array of 16 doubles
+ * Original signature : OSVR_ReturnCode osvrPose3ToMatrixd(const OSVR_Pose3*, OSVR_MatrixConventions, double*)
+ * @deprecated use the safer methods {@link #osvrPose3ToMatrixd(osvrmatrixconventions.OSVR_Pose3, short, java.nio.DoubleBuffer)} and {@link #osvrPose3ToMatrixd(osvrmatrixconventions.OSVR_Pose3, short, com.sun.jna.ptr.DoubleByReference)} instead
+ */
+ @Deprecated
+ public static native byte osvrPose3ToMatrixd(OSVR_Pose3 pose, short flags, DoubleByReference mat);
+ /**
+ * @brief Set a matrix of doubles based on a Pose3.
+ * @param pose The Pose3 to convert
+ * @param flags Memory ordering flag - see @ref MatrixFlags
+ * @param[out] mat an array of 16 doubles
+ * Original signature : OSVR_ReturnCode osvrPose3ToMatrixd(const OSVR_Pose3*, OSVR_MatrixConventions, double*)
+ */
+ public static native byte osvrPose3ToMatrixd(OSVR_Pose3 pose, short flags, DoubleBuffer mat);
+ /**
+ * @brief Set a matrix of floats based on a Pose3.
+ * @param pose The Pose3 to convert
+ * @param flags Memory ordering flag - see @ref MatrixFlags
+ * @param[out] mat an array of 16 floats
+ * Original signature : OSVR_ReturnCode osvrPose3ToMatrixf(const OSVR_Pose3*, OSVR_MatrixConventions, float*)
+ * @deprecated use the safer methods {@link #osvrPose3ToMatrixf(osvrmatrixconventions.OSVR_Pose3, short, java.nio.FloatBuffer)} and {@link #osvrPose3ToMatrixf(osvrmatrixconventions.OSVR_Pose3, short, com.sun.jna.ptr.FloatByReference)} instead
+ */
+ @Deprecated
+ public static native byte osvrPose3ToMatrixf(OSVR_Pose3 pose, short flags, FloatByReference mat);
+ /**
+ * @brief Set a matrix of floats based on a Pose3.
+ * @param pose The Pose3 to convert
+ * @param flags Memory ordering flag - see @ref MatrixFlags
+ * @param[out] mat an array of 16 floats
+ * Original signature : OSVR_ReturnCode osvrPose3ToMatrixf(const OSVR_Pose3*, OSVR_MatrixConventions, float*)
+ */
+ public static native byte osvrPose3ToMatrixf(OSVR_Pose3 pose, short flags, FloatBuffer mat);
+ /**
+ * @brief Set a matrix based on a Pose3. (C++-only overload - detecting scalar
+ * type)
+ * Original signature : OSVR_ReturnCode osvrPose3ToMatrix(const OSVR_Pose3*, OSVR_MatrixConventions, double*)
+ * @deprecated use the safer methods {@link #osvrPose3ToMatrix(osvrmatrixconventions.OSVR_Pose3, short, java.nio.DoubleBuffer)} and {@link #osvrPose3ToMatrix(osvrmatrixconventions.OSVR_Pose3, short, com.sun.jna.ptr.DoubleByReference)} instead
+ */
+ @Deprecated
+ public static native byte osvrPose3ToMatrix(OSVR_Pose3 pose, short flags, DoubleByReference mat);
+ /**
+ * @brief Set a matrix based on a Pose3. (C++-only overload - detecting scalar
+ * type)
+ * Original signature : OSVR_ReturnCode osvrPose3ToMatrix(const OSVR_Pose3*, OSVR_MatrixConventions, double*)
+ */
+ public static native byte osvrPose3ToMatrix(OSVR_Pose3 pose, short flags, DoubleBuffer mat);
+ /**
+ * @brief Set a matrix based on a Pose3. (C++-only overload - detecting scalar
+ * type)
+ * Original signature : OSVR_ReturnCode osvrPose3ToMatrix(const OSVR_Pose3*, OSVR_MatrixConventions, float*)
+ * @deprecated use the safer methods {@link #osvrPose3ToMatrix(osvrmatrixconventions.OSVR_Pose3, short, java.nio.FloatBuffer)} and {@link #osvrPose3ToMatrix(osvrmatrixconventions.OSVR_Pose3, short, com.sun.jna.ptr.FloatByReference)} instead
+ */
+ @Deprecated
+ public static native byte osvrPose3ToMatrix(OSVR_Pose3 pose, short flags, FloatByReference mat);
+ /**
+ * @brief Set a matrix based on a Pose3. (C++-only overload - detecting scalar
+ * type)
+ * Original signature : OSVR_ReturnCode osvrPose3ToMatrix(const OSVR_Pose3*, OSVR_MatrixConventions, float*)
+ */
+ public static native byte osvrPose3ToMatrix(OSVR_Pose3 pose, short flags, FloatBuffer mat);
+ /**
+ * @brief Set a matrix based on a Pose3. (C++-only overload - detects scalar
+ * and takes array rather than pointer)
+ * Original signature : OSVR_ReturnCode osvrPose3ToMatrix(const OSVR_Pose3*, OSVR_MatrixConventions, Scalar[OSVR_MATRIX_SIZE])
+ * @deprecated use the safer methods {@link #osvrPose3ToMatrix(osvrmatrixconventions.OSVR_Pose3, short, osvrmatrixconventions.OsvrMatrixConventionsLibrary.Scalar[])} and {@link #osvrPose3ToMatrix(osvrmatrixconventions.OSVR_Pose3, short, com.sun.jna.Pointer)} instead
+ */
+ @Deprecated
+ public static native byte osvrPose3ToMatrix(OSVR_Pose3 pose, short flags, Pointer mat);
+ /**
+ * @brief Set a matrix based on a Pose3. (C++-only overload - detects scalar
+ * and takes array rather than pointer)
+ * Original signature : OSVR_ReturnCode osvrPose3ToMatrix(const OSVR_Pose3*, OSVR_MatrixConventions, Scalar[OSVR_MATRIX_SIZE])
+ */
+ public static native byte osvrPose3ToMatrix(OSVR_Pose3 pose, short flags, OsvrMatrixConventionsLibrary.Scalar mat[]);
+ public static class Scalar extends PointerType {
+ public Scalar(Pointer address) {
+ super(address);
+ }
+ public Scalar() {
+ super();
+ }
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrrendermanager/OSVR_ProjectionMatrix.java b/jme3-vr/src/main/java/osvrrendermanager/OSVR_ProjectionMatrix.java
new file mode 100644
index 000000000..fe7880289
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrrendermanager/OSVR_ProjectionMatrix.java
@@ -0,0 +1,44 @@
+package osvrrendermanager;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_ProjectionMatrix extends Structure {
+ public double left;
+ public double right;
+ public double top;
+ public double bottom;
+ /** < Cannot name "near" because Visual Studio keyword */
+ public double nearClip;
+ public double farClip;
+ public OSVR_ProjectionMatrix() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("left", "right", "top", "bottom", "nearClip", "farClip");
+ }
+ /** @param nearClip < Cannot name "near" because Visual Studio keyword */
+ public OSVR_ProjectionMatrix(double left, double right, double top, double bottom, double nearClip, double farClip) {
+ super();
+ this.left = left;
+ this.right = right;
+ this.top = top;
+ this.bottom = bottom;
+ this.nearClip = nearClip;
+ this.farClip = farClip;
+ }
+ public OSVR_ProjectionMatrix(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_ProjectionMatrix implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_ProjectionMatrix implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrrendermanager/OSVR_RGB.java b/jme3-vr/src/main/java/osvrrendermanager/OSVR_RGB.java
new file mode 100644
index 000000000..d4b96fefe
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrrendermanager/OSVR_RGB.java
@@ -0,0 +1,36 @@
+package osvrrendermanager;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_RGB extends Structure {
+ public float r;
+ public float g;
+ public float b;
+ public OSVR_RGB() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("r", "g", "b");
+ }
+ public OSVR_RGB(float r, float g, float b) {
+ super();
+ this.r = r;
+ this.g = g;
+ this.b = b;
+ }
+ public OSVR_RGB(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_RGB implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_RGB implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrrendermanager/OSVR_RenderParams.java b/jme3-vr/src/main/java/osvrrendermanager/OSVR_RenderParams.java
new file mode 100644
index 000000000..6ecd5f5a8
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrrendermanager/OSVR_RenderParams.java
@@ -0,0 +1,52 @@
+package osvrrendermanager;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_RenderParams extends Structure {
+ /**
+ * < Room space to insert
+ * C type : OSVR_PoseState*
+ */
+ public Pointer worldFromRoomAppend;
+ /**
+ * < Overrides head space
+ * C type : OSVR_PoseState*
+ */
+ public Pointer roomFromHeadReplace;
+ public double nearClipDistanceMeters;
+ public double farClipDistanceMeters;
+ public OSVR_RenderParams() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("worldFromRoomAppend", "roomFromHeadReplace", "nearClipDistanceMeters", "farClipDistanceMeters");
+ }
+ /**
+ * @param worldFromRoomAppend < Room space to insert
+ * C type : OSVR_PoseState*
+ * @param roomFromHeadReplace < Overrides head space
+ * C type : OSVR_PoseState*
+ */
+ public OSVR_RenderParams(Pointer worldFromRoomAppend, Pointer roomFromHeadReplace, double nearClipDistanceMeters, double farClipDistanceMeters) {
+ super();
+ this.worldFromRoomAppend = worldFromRoomAppend;
+ this.roomFromHeadReplace = roomFromHeadReplace;
+ this.nearClipDistanceMeters = nearClipDistanceMeters;
+ this.farClipDistanceMeters = farClipDistanceMeters;
+ }
+ public OSVR_RenderParams(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_RenderParams implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_RenderParams implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrrendermanager/OSVR_ViewportDescription.java b/jme3-vr/src/main/java/osvrrendermanager/OSVR_ViewportDescription.java
new file mode 100644
index 000000000..c29f5db02
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrrendermanager/OSVR_ViewportDescription.java
@@ -0,0 +1,48 @@
+package osvrrendermanager;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_ViewportDescription extends Structure {
+ /** < Left side of the viewport in pixels */
+ public double left;
+ /** < First pixel in the viewport at the bottom. */
+ public double lower;
+ /** < Last pixel in the viewport at the top */
+ public double width;
+ /** < Last pixel on the right of the viewport in pixels */
+ public double height;
+ public OSVR_ViewportDescription() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("left", "lower", "width", "height");
+ }
+ /**
+ * @param left < Left side of the viewport in pixels
+ * @param lower < First pixel in the viewport at the bottom.
+ * @param width < Last pixel in the viewport at the top
+ * @param height < Last pixel on the right of the viewport in pixels
+ */
+ public OSVR_ViewportDescription(double left, double lower, double width, double height) {
+ super();
+ this.left = left;
+ this.lower = lower;
+ this.width = width;
+ this.height = height;
+ }
+ public OSVR_ViewportDescription(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_ViewportDescription implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_ViewportDescription implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrrendermanager/OsvrRenderManagerLibrary.java b/jme3-vr/src/main/java/osvrrendermanager/OsvrRenderManagerLibrary.java
new file mode 100644
index 000000000..577ecae24
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrrendermanager/OsvrRenderManagerLibrary.java
@@ -0,0 +1,117 @@
+package osvrrendermanager;
+import com.ochafik.lang.jnaerator.runtime.NativeSizeByReference;
+import com.sun.jna.Library;
+import com.sun.jna.Native;
+import com.sun.jna.NativeLibrary;
+import com.sun.jna.Pointer;
+import com.sun.jna.ptr.DoubleByReference;
+import com.sun.jna.ptr.FloatByReference;
+import com.sun.jna.ptr.PointerByReference;
+import java.nio.DoubleBuffer;
+import java.nio.FloatBuffer;
+/**
+ * JNA Wrapper for library osvrRenderManager
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OsvrRenderManagerLibrary implements Library {
+ public static final String JNA_LIBRARY_NAME = "osvrRenderManager";
+ public static final NativeLibrary JNA_NATIVE_LIB = NativeLibrary.getInstance(OsvrRenderManagerLibrary.JNA_LIBRARY_NAME);
+ static {
+ Native.register(OsvrRenderManagerLibrary.class, OsvrRenderManagerLibrary.JNA_NATIVE_LIB);
+ }
+ /** enum values */
+ public static interface OSVR_OpenStatus {
+ public static final int OSVR_OPEN_STATUS_FAILURE = 0;
+ public static final int OSVR_OPEN_STATUS_PARTIAL = 1;
+ public static final int OSVR_OPEN_STATUS_COMPLETE = 2;
+ };
+ /**
+ * @todo OSVR_RenderTimingInfo
+ * Original signature : OSVR_ReturnCode osvrDestroyRenderManager(OSVR_RenderManager)
+ */
+ public static native byte osvrDestroyRenderManager(Pointer renderManager);
+ /**
+ * @todo Make this actually cache, for now it does not.
+ * Original signature : OSVR_ReturnCode osvrRenderManagerGetNumRenderInfo(OSVR_RenderManager, OSVR_RenderParams, OSVR_RenderInfoCount*)
+ */
+ public static native byte osvrRenderManagerGetNumRenderInfo(Pointer renderManager, OSVR_RenderParams.ByValue renderParams, NativeSizeByReference numRenderInfoOut);
+ /** Original signature : OSVR_ReturnCode osvrRenderManagerGetDoingOkay(OSVR_RenderManager)
*/
+ public static native byte osvrRenderManagerGetDoingOkay(Pointer renderManager);
+ /** Original signature : OSVR_ReturnCode osvrRenderManagerGetDefaultRenderParams(OSVR_RenderParams*)
*/
+ public static native byte osvrRenderManagerGetDefaultRenderParams(OSVR_RenderParams renderParamsOut);
+ /**
+ * must be registered before they are presented.
+ * Original signature : OSVR_ReturnCode osvrRenderManagerStartPresentRenderBuffers(OSVR_RenderManagerPresentState*)
+ */
+ public static native byte osvrRenderManagerStartPresentRenderBuffers(PointerByReference presentStateOut);
+ /**
+ * buffers for a single frame. This sequence starts with the Start function.
+ * Original signature : OSVR_ReturnCode osvrRenderManagerFinishPresentRenderBuffers(OSVR_RenderManager, OSVR_RenderManagerPresentState, OSVR_RenderParams, OSVR_CBool)
+ */
+ public static native byte osvrRenderManagerFinishPresentRenderBuffers(Pointer renderManager, Pointer presentState, OSVR_RenderParams.ByValue renderParams, byte shouldFlipY);
+ /**
+ * must be registered before they are presented.
+ * Original signature : OSVR_ReturnCode osvrRenderManagerStartRegisterRenderBuffers(OSVR_RenderManagerRegisterBufferState*)
+ */
+ public static native byte osvrRenderManagerStartRegisterRenderBuffers(PointerByReference registerBufferStateOut);
+ /**
+ * buffers for a single frame. This sequence starts with the Start function.
+ * Original signature : OSVR_ReturnCode osvrRenderManagerFinishRegisterRenderBuffers(OSVR_RenderManager, OSVR_RenderManagerRegisterBufferState, OSVR_CBool)
+ */
+ public static native byte osvrRenderManagerFinishRegisterRenderBuffers(Pointer renderManager, Pointer registerBufferState, byte appWillNotOverwriteBeforeNewPresent);
+ /** Original signature : OSVR_ReturnCode osvrRenderManagerPresentSolidColorf(OSVR_RenderManager, OSVR_RGB_FLOAT)
*/
+ public static native byte osvrRenderManagerPresentSolidColorf(Pointer renderManager, osvrrendermanager.OSVR_RGB.ByValue rgb);
+ /**
+ * when you're done.
+ * Original signature : OSVR_ReturnCode osvrRenderManagerGetRenderInfoCollection(OSVR_RenderManager, OSVR_RenderParams, OSVR_RenderInfoCollection*)
+ */
+ public static native byte osvrRenderManagerGetRenderInfoCollection(Pointer renderManager, OSVR_RenderParams.ByValue renderParams, PointerByReference renderInfoCollectionOut);
+ /**
+ * Releases the OSVR_RenderInfoCollection.
+ * Original signature : OSVR_ReturnCode osvrRenderManagerReleaseRenderInfoCollection(OSVR_RenderInfoCollection)
+ */
+ public static native byte osvrRenderManagerReleaseRenderInfoCollection(Pointer renderInfoCollection);
+ /**
+ * Get the size of the OSVR_RenderInfoCollection.
+ * Original signature : OSVR_ReturnCode osvrRenderManagerGetNumRenderInfoInCollection(OSVR_RenderInfoCollection, OSVR_RenderInfoCount*)
+ */
+ public static native byte osvrRenderManagerGetNumRenderInfoInCollection(Pointer renderInfoCollection, NativeSizeByReference countOut);
+ /**
+ * @return True on success, false on failure (null pointer).
+ * Original signature : OSVR_ReturnCode OSVR_Projection_to_OpenGL(double*, OSVR_ProjectionMatrix)
+ * @deprecated use the safer methods {@link #OSVR_Projection_to_OpenGL(java.nio.DoubleBuffer, osvrrendermanager.OSVR_ProjectionMatrix.ByValue)} and {@link #OSVR_Projection_to_OpenGL(com.sun.jna.ptr.DoubleByReference, osvrrendermanager.OSVR_ProjectionMatrix.ByValue)} instead
+ */
+ @Deprecated
+ public static native byte OSVR_Projection_to_OpenGL(DoubleByReference OpenGL_out, osvrrendermanager.OSVR_ProjectionMatrix.ByValue projection_in);
+ /**
+ * @return True on success, false on failure (null pointer).
+ * Original signature : OSVR_ReturnCode OSVR_Projection_to_OpenGL(double*, OSVR_ProjectionMatrix)
+ */
+ public static native byte OSVR_Projection_to_OpenGL(DoubleBuffer OpenGL_out, osvrrendermanager.OSVR_ProjectionMatrix.ByValue projection_in);
+ /**
+ * @return True on success, false on failure (null pointer).
+ * Original signature : OSVR_ReturnCode OSVR_Projection_to_D3D(float[16], OSVR_ProjectionMatrix)
+ * @deprecated use the safer methods {@link #OSVR_Projection_to_D3D(java.nio.FloatBuffer, osvrrendermanager.OSVR_ProjectionMatrix.ByValue)} and {@link #OSVR_Projection_to_D3D(com.sun.jna.ptr.FloatByReference, osvrrendermanager.OSVR_ProjectionMatrix.ByValue)} instead
+ */
+ @Deprecated
+ public static native byte OSVR_Projection_to_D3D(FloatByReference D3D_out, osvrrendermanager.OSVR_ProjectionMatrix.ByValue projection_in);
+ /**
+ * @return True on success, false on failure (null pointer).
+ * Original signature : OSVR_ReturnCode OSVR_Projection_to_D3D(float[16], OSVR_ProjectionMatrix)
+ */
+ public static native byte OSVR_Projection_to_D3D(FloatBuffer D3D_out, osvrrendermanager.OSVR_ProjectionMatrix.ByValue projection_in);
+ /**
+ * @return True on success, false on failure (null pointer).
+ * Original signature : OSVR_ReturnCode OSVR_Projection_to_Unreal(float[16], OSVR_ProjectionMatrix)
+ * @deprecated use the safer methods {@link #OSVR_Projection_to_Unreal(java.nio.FloatBuffer, osvrrendermanager.OSVR_ProjectionMatrix.ByValue)} and {@link #OSVR_Projection_to_Unreal(com.sun.jna.ptr.FloatByReference, osvrrendermanager.OSVR_ProjectionMatrix.ByValue)} instead
+ */
+ @Deprecated
+ public static native byte OSVR_Projection_to_Unreal(FloatByReference Unreal_out, osvrrendermanager.OSVR_ProjectionMatrix.ByValue projection_in);
+ /**
+ * @return True on success, false on failure (null pointer).
+ * Original signature : OSVR_ReturnCode OSVR_Projection_to_Unreal(float[16], OSVR_ProjectionMatrix)
+ */
+ public static native byte OSVR_Projection_to_Unreal(FloatBuffer Unreal_out, osvrrendermanager.OSVR_ProjectionMatrix.ByValue projection_in);
+}
diff --git a/jme3-vr/src/main/java/osvrrendermanageropengl/OSVR_GraphicsLibraryOpenGL.java b/jme3-vr/src/main/java/osvrrendermanageropengl/OSVR_GraphicsLibraryOpenGL.java
new file mode 100644
index 000000000..800723c27
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrrendermanageropengl/OSVR_GraphicsLibraryOpenGL.java
@@ -0,0 +1,34 @@
+package osvrrendermanageropengl;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_GraphicsLibraryOpenGL extends Structure {
+ /** C type : const OSVR_OpenGLToolkitFunctions* */
+ public osvrrendermanageropengl.OSVR_OpenGLToolkitFunctions.ByReference toolkit;
+ public OSVR_GraphicsLibraryOpenGL() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("toolkit");
+ }
+ /** @param toolkit C type : const OSVR_OpenGLToolkitFunctions* */
+ public OSVR_GraphicsLibraryOpenGL(osvrrendermanageropengl.OSVR_OpenGLToolkitFunctions.ByReference toolkit) {
+ super();
+ this.toolkit = toolkit;
+ }
+ public OSVR_GraphicsLibraryOpenGL(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_GraphicsLibraryOpenGL implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_GraphicsLibraryOpenGL implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrrendermanageropengl/OSVR_OpenGLContextParams.java b/jme3-vr/src/main/java/osvrrendermanageropengl/OSVR_OpenGLContextParams.java
new file mode 100644
index 000000000..67726b8e2
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrrendermanageropengl/OSVR_OpenGLContextParams.java
@@ -0,0 +1,56 @@
+package osvrrendermanageropengl;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_OpenGLContextParams extends Structure {
+ /** C type : const char* */
+ public Pointer windowTitle;
+ /** C type : OSVR_CBool */
+ public byte fullScreen;
+ public int width;
+ public int height;
+ public int xPos;
+ public int yPos;
+ public int bitsPerPixel;
+ public int numBuffers;
+ /** C type : OSVR_CBool */
+ public byte visible;
+ public OSVR_OpenGLContextParams() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("windowTitle", "fullScreen", "width", "height", "xPos", "yPos", "bitsPerPixel", "numBuffers", "visible");
+ }
+ /**
+ * @param windowTitle C type : const char*
+ * @param fullScreen C type : OSVR_CBool
+ * @param visible C type : OSVR_CBool
+ */
+ public OSVR_OpenGLContextParams(Pointer windowTitle, byte fullScreen, int width, int height, int xPos, int yPos, int bitsPerPixel, int numBuffers, byte visible) {
+ super();
+ this.windowTitle = windowTitle;
+ this.fullScreen = fullScreen;
+ this.width = width;
+ this.height = height;
+ this.xPos = xPos;
+ this.yPos = yPos;
+ this.bitsPerPixel = bitsPerPixel;
+ this.numBuffers = numBuffers;
+ this.visible = visible;
+ }
+ public OSVR_OpenGLContextParams(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_OpenGLContextParams implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_OpenGLContextParams implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrrendermanageropengl/OSVR_OpenGLToolkitFunctions.java b/jme3-vr/src/main/java/osvrrendermanageropengl/OSVR_OpenGLToolkitFunctions.java
new file mode 100644
index 000000000..fcc6d94a4
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrrendermanageropengl/OSVR_OpenGLToolkitFunctions.java
@@ -0,0 +1,91 @@
+package osvrrendermanageropengl;
+import com.ochafik.lang.jnaerator.runtime.NativeSize;
+import com.sun.jna.Callback;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import com.sun.jna.ptr.IntByReference;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_OpenGLToolkitFunctions extends Structure {
+ public NativeSize size;
+ /** C type : void* */
+ public Pointer data;
+ /** C type : create_callback* */
+ public OSVR_OpenGLToolkitFunctions.create_callback create;
+ /** C type : destroy_callback* */
+ public OSVR_OpenGLToolkitFunctions.destroy_callback destroy;
+ /** C type : handleEvents_callback* */
+ public OSVR_OpenGLToolkitFunctions.handleEvents_callback handleEvents;
+ /** C type : getDisplayFrameBuffer_callback* */
+ public OSVR_OpenGLToolkitFunctions.getDisplayFrameBuffer_callback getDisplayFrameBuffer;
+ /** C type : getDisplaySizeOverride_callback* */
+ public OSVR_OpenGLToolkitFunctions.getDisplaySizeOverride_callback getDisplaySizeOverride;
+ public interface create_callback extends Callback {
+ void apply(Pointer data);
+ };
+ public interface destroy_callback extends Callback {
+ void apply(Pointer data);
+ };
+ public interface OSVR_CBool_callback extends Callback {
+ int apply(Pointer data, OSVR_OpenGLContextParams p);
+ };
+ public interface OSVR_CBool_callback2 extends Callback {
+ int apply(Pointer data);
+ };
+ public interface OSVR_CBool_callback3 extends Callback {
+ int apply(Pointer data, NativeSize display);
+ };
+ public interface OSVR_CBool_callback4 extends Callback {
+ int apply(Pointer data, NativeSize display);
+ };
+ public interface OSVR_CBool_callback5 extends Callback {
+ int apply(Pointer data, byte verticalSync);
+ };
+ public interface handleEvents_callback extends Callback {
+ byte apply(Pointer data);
+ };
+ public interface getDisplayFrameBuffer_callback extends Callback {
+ byte apply(Pointer data, NativeSize display, IntByReference frameBufferOut);
+ };
+ public interface getDisplaySizeOverride_callback extends Callback {
+ byte apply(Pointer data, NativeSize display, IntByReference width, IntByReference height);
+ };
+ public OSVR_OpenGLToolkitFunctions() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("size", "data", "create", "destroy", "handleEvents", "getDisplayFrameBuffer", "getDisplaySizeOverride");
+ }
+ /**
+ * @param data C type : void*
+ * @param create C type : create_callback*
+ * @param destroy C type : destroy_callback*
+ * @param handleEvents C type : handleEvents_callback*
+ * @param getDisplayFrameBuffer C type : getDisplayFrameBuffer_callback*
+ * @param getDisplaySizeOverride C type : getDisplaySizeOverride_callback*
+ */
+ public OSVR_OpenGLToolkitFunctions(NativeSize size, Pointer data, OSVR_OpenGLToolkitFunctions.create_callback create, OSVR_OpenGLToolkitFunctions.destroy_callback destroy, OSVR_OpenGLToolkitFunctions.handleEvents_callback handleEvents, OSVR_OpenGLToolkitFunctions.getDisplayFrameBuffer_callback getDisplayFrameBuffer, OSVR_OpenGLToolkitFunctions.getDisplaySizeOverride_callback getDisplaySizeOverride) {
+ super();
+ this.size = size;
+ this.data = data;
+ this.create = create;
+ this.destroy = destroy;
+ this.handleEvents = handleEvents;
+ this.getDisplayFrameBuffer = getDisplayFrameBuffer;
+ this.getDisplaySizeOverride = getDisplaySizeOverride;
+ }
+ public OSVR_OpenGLToolkitFunctions(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_OpenGLToolkitFunctions implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_OpenGLToolkitFunctions implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrrendermanageropengl/OSVR_OpenResultsOpenGL.java b/jme3-vr/src/main/java/osvrrendermanageropengl/OSVR_OpenResultsOpenGL.java
new file mode 100644
index 000000000..1bb1a3427
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrrendermanageropengl/OSVR_OpenResultsOpenGL.java
@@ -0,0 +1,48 @@
+package osvrrendermanageropengl;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_OpenResultsOpenGL extends Structure {
+ /**
+ * @see OSVR_OpenStatus
+ * C type : OSVR_OpenStatus
+ */
+ public int status;
+ /** C type : OSVR_GraphicsLibraryOpenGL */
+ public OSVR_GraphicsLibraryOpenGL library;
+ /** C type : OSVR_RenderBufferOpenGL */
+ public OSVR_RenderBufferOpenGL buffers;
+ public OSVR_OpenResultsOpenGL() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("status", "library", "buffers");
+ }
+ /**
+ * @param status @see OSVR_OpenStatus
+ * C type : OSVR_OpenStatus
+ * @param library C type : OSVR_GraphicsLibraryOpenGL
+ * @param buffers C type : OSVR_RenderBufferOpenGL
+ */
+ public OSVR_OpenResultsOpenGL(int status, OSVR_GraphicsLibraryOpenGL library, OSVR_RenderBufferOpenGL buffers) {
+ super();
+ this.status = status;
+ this.library = library;
+ this.buffers = buffers;
+ }
+ public OSVR_OpenResultsOpenGL(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_OpenResultsOpenGL implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_OpenResultsOpenGL implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrrendermanageropengl/OSVR_ProjectionMatrix.java b/jme3-vr/src/main/java/osvrrendermanageropengl/OSVR_ProjectionMatrix.java
new file mode 100644
index 000000000..0a300d47a
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrrendermanageropengl/OSVR_ProjectionMatrix.java
@@ -0,0 +1,44 @@
+package osvrrendermanageropengl;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_ProjectionMatrix extends Structure {
+ public double left;
+ public double right;
+ public double top;
+ public double bottom;
+ /** < Cannot name "near" because Visual Studio keyword */
+ public double nearClip;
+ public double farClip;
+ public OSVR_ProjectionMatrix() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("left", "right", "top", "bottom", "nearClip", "farClip");
+ }
+ /** @param nearClip < Cannot name "near" because Visual Studio keyword */
+ public OSVR_ProjectionMatrix(double left, double right, double top, double bottom, double nearClip, double farClip) {
+ super();
+ this.left = left;
+ this.right = right;
+ this.top = top;
+ this.bottom = bottom;
+ this.nearClip = nearClip;
+ this.farClip = farClip;
+ }
+ public OSVR_ProjectionMatrix(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_ProjectionMatrix implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_ProjectionMatrix implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrrendermanageropengl/OSVR_RGB.java b/jme3-vr/src/main/java/osvrrendermanageropengl/OSVR_RGB.java
new file mode 100644
index 000000000..6e9af7239
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrrendermanageropengl/OSVR_RGB.java
@@ -0,0 +1,36 @@
+package osvrrendermanageropengl;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_RGB extends Structure {
+ public float r;
+ public float g;
+ public float b;
+ public OSVR_RGB() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("r", "g", "b");
+ }
+ public OSVR_RGB(float r, float g, float b) {
+ super();
+ this.r = r;
+ this.g = g;
+ this.b = b;
+ }
+ public OSVR_RGB(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_RGB implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_RGB implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrrendermanageropengl/OSVR_RenderBufferOpenGL.java b/jme3-vr/src/main/java/osvrrendermanageropengl/OSVR_RenderBufferOpenGL.java
new file mode 100644
index 000000000..6cfd0b693
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrrendermanageropengl/OSVR_RenderBufferOpenGL.java
@@ -0,0 +1,34 @@
+package osvrrendermanageropengl;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_RenderBufferOpenGL extends Structure {
+ public int colorBufferName;
+ public int depthStencilBufferName;
+ public OSVR_RenderBufferOpenGL() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("colorBufferName", "depthStencilBufferName");
+ }
+ public OSVR_RenderBufferOpenGL(int colorBufferName, int depthStencilBufferName) {
+ super();
+ this.colorBufferName = colorBufferName;
+ this.depthStencilBufferName = depthStencilBufferName;
+ }
+ public OSVR_RenderBufferOpenGL(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_RenderBufferOpenGL implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_RenderBufferOpenGL implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrrendermanageropengl/OSVR_RenderInfoOpenGL.java b/jme3-vr/src/main/java/osvrrendermanageropengl/OSVR_RenderInfoOpenGL.java
new file mode 100644
index 000000000..1c1eeea14
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrrendermanageropengl/OSVR_RenderInfoOpenGL.java
@@ -0,0 +1,47 @@
+package osvrrendermanageropengl;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+import osvrmatrixconventions.OSVR_Pose3;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public /*abstract*/ class OSVR_RenderInfoOpenGL extends Structure {
+ /** C type : OSVR_GraphicsLibraryOpenGL */
+ public OSVR_GraphicsLibraryOpenGL library;
+ /** C type : OSVR_ViewportDescription */
+ public OSVR_ViewportDescription viewport;
+ public OSVR_Pose3 pose;
+ /** C type : OSVR_ProjectionMatrix */
+ public OSVR_ProjectionMatrix projection;
+ public OSVR_RenderInfoOpenGL() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("library", "viewport", "pose", "projection");
+ }
+ /**
+ * @param library C type : OSVR_GraphicsLibraryOpenGL
+ * @param viewport C type : OSVR_ViewportDescription
+ * @param projection C type : OSVR_ProjectionMatrix
+ */
+ public OSVR_RenderInfoOpenGL(OSVR_GraphicsLibraryOpenGL library, OSVR_ViewportDescription viewport, OSVR_Pose3 pose, OSVR_ProjectionMatrix projection) {
+ super();
+ this.library = library;
+ this.viewport = viewport;
+ this.pose = pose;
+ this.projection = projection;
+ }
+ public OSVR_RenderInfoOpenGL(Pointer peer) {
+ super(peer);
+ }
+ public static /*abstract*/ class ByReference extends OSVR_RenderInfoOpenGL implements Structure.ByReference {
+
+ };
+ public static /*abstract*/ class ByValue extends OSVR_RenderInfoOpenGL implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrrendermanageropengl/OSVR_RenderParams.java b/jme3-vr/src/main/java/osvrrendermanageropengl/OSVR_RenderParams.java
new file mode 100644
index 000000000..02453f47b
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrrendermanageropengl/OSVR_RenderParams.java
@@ -0,0 +1,52 @@
+package osvrrendermanageropengl;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_RenderParams extends Structure {
+ /**
+ * < Room space to insert
+ * C type : OSVR_PoseState*
+ */
+ public Pointer worldFromRoomAppend;
+ /**
+ * < Overrides head space
+ * C type : OSVR_PoseState*
+ */
+ public Pointer roomFromHeadReplace;
+ public double nearClipDistanceMeters;
+ public double farClipDistanceMeters;
+ public OSVR_RenderParams() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("worldFromRoomAppend", "roomFromHeadReplace", "nearClipDistanceMeters", "farClipDistanceMeters");
+ }
+ /**
+ * @param worldFromRoomAppend < Room space to insert
+ * C type : OSVR_PoseState*
+ * @param roomFromHeadReplace < Overrides head space
+ * C type : OSVR_PoseState*
+ */
+ public OSVR_RenderParams(Pointer worldFromRoomAppend, Pointer roomFromHeadReplace, double nearClipDistanceMeters, double farClipDistanceMeters) {
+ super();
+ this.worldFromRoomAppend = worldFromRoomAppend;
+ this.roomFromHeadReplace = roomFromHeadReplace;
+ this.nearClipDistanceMeters = nearClipDistanceMeters;
+ this.farClipDistanceMeters = farClipDistanceMeters;
+ }
+ public OSVR_RenderParams(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_RenderParams implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_RenderParams implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrrendermanageropengl/OSVR_ViewportDescription.java b/jme3-vr/src/main/java/osvrrendermanageropengl/OSVR_ViewportDescription.java
new file mode 100644
index 000000000..bb209c059
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrrendermanageropengl/OSVR_ViewportDescription.java
@@ -0,0 +1,48 @@
+package osvrrendermanageropengl;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_ViewportDescription extends Structure {
+ /** < Left side of the viewport in pixels */
+ public double left;
+ /** < First pixel in the viewport at the bottom. */
+ public double lower;
+ /** < Last pixel in the viewport at the top */
+ public double width;
+ /** < Last pixel on the right of the viewport in pixels */
+ public double height;
+ public OSVR_ViewportDescription() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("left", "lower", "width", "height");
+ }
+ /**
+ * @param left < Left side of the viewport in pixels
+ * @param lower < First pixel in the viewport at the bottom.
+ * @param width < Last pixel in the viewport at the top
+ * @param height < Last pixel on the right of the viewport in pixels
+ */
+ public OSVR_ViewportDescription(double left, double lower, double width, double height) {
+ super();
+ this.left = left;
+ this.lower = lower;
+ this.width = width;
+ this.height = height;
+ }
+ public OSVR_ViewportDescription(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_ViewportDescription implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_ViewportDescription implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrrendermanageropengl/OsvrRenderManagerOpenGLLibrary.java b/jme3-vr/src/main/java/osvrrendermanageropengl/OsvrRenderManagerOpenGLLibrary.java
new file mode 100644
index 000000000..08f3a2a27
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrrendermanageropengl/OsvrRenderManagerOpenGLLibrary.java
@@ -0,0 +1,167 @@
+package osvrrendermanageropengl;
+import com.ochafik.lang.jnaerator.runtime.NativeSize;
+import com.ochafik.lang.jnaerator.runtime.NativeSizeByReference;
+import com.sun.jna.Library;
+import com.sun.jna.Native;
+import com.sun.jna.NativeLibrary;
+import com.sun.jna.Pointer;
+import com.sun.jna.PointerType;
+import com.sun.jna.ptr.DoubleByReference;
+import com.sun.jna.ptr.FloatByReference;
+import com.sun.jna.ptr.IntByReference;
+import com.sun.jna.ptr.PointerByReference;
+import java.nio.DoubleBuffer;
+import java.nio.FloatBuffer;
+import java.nio.IntBuffer;
+import osvrclientkit.OsvrClientKitLibrary;
+/**
+ * JNA Wrapper for library osvrRenderManagerOpenGL
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OsvrRenderManagerOpenGLLibrary implements Library {
+ public static final String JNA_LIBRARY_NAME = "osvrRenderManager";
+ public static final NativeLibrary JNA_NATIVE_LIB = NativeLibrary.getInstance(OsvrRenderManagerOpenGLLibrary.JNA_LIBRARY_NAME);
+ static {
+ Native.register(OsvrRenderManagerOpenGLLibrary.class, OsvrRenderManagerOpenGLLibrary.JNA_NATIVE_LIB);
+ }
+ /** enum values */
+ public static interface OSVR_OpenStatus {
+ public static final int OSVR_OPEN_STATUS_FAILURE = 0;
+ public static final int OSVR_OPEN_STATUS_PARTIAL = 1;
+ public static final int OSVR_OPEN_STATUS_COMPLETE = 2;
+ };
+ /**
+ * @todo OSVR_RenderTimingInfo
+ * Original signature : OSVR_ReturnCode osvrDestroyRenderManager(OSVR_RenderManager)
+ */
+ public static native byte osvrDestroyRenderManager(Pointer renderManager);
+ /**
+ * @todo Make this actually cache, for now it does not.
+ * Original signature : OSVR_ReturnCode osvrRenderManagerGetNumRenderInfo(OSVR_RenderManager, OSVR_RenderParams, OSVR_RenderInfoCount*)
+ */
+ public static native byte osvrRenderManagerGetNumRenderInfo(Pointer renderManager, OSVR_RenderParams.ByValue renderParams, NativeSizeByReference numRenderInfoOut);
+ /** Original signature : OSVR_ReturnCode osvrRenderManagerGetDoingOkay(OSVR_RenderManager)
*/
+ public static native byte osvrRenderManagerGetDoingOkay(Pointer renderManager);
+ /** Original signature : OSVR_ReturnCode osvrRenderManagerGetDefaultRenderParams(OSVR_RenderParams*)
*/
+ public static native byte osvrRenderManagerGetDefaultRenderParams(OSVR_RenderParams renderParamsOut);
+ /**
+ * must be registered before they are presented.
+ * Original signature : OSVR_ReturnCode osvrRenderManagerStartPresentRenderBuffers(OSVR_RenderManagerPresentState*)
+ */
+ public static native byte osvrRenderManagerStartPresentRenderBuffers(PointerByReference presentStateOut);
+ /**
+ * buffers for a single frame. This sequence starts with the Start function.
+ * Original signature : OSVR_ReturnCode osvrRenderManagerFinishPresentRenderBuffers(OSVR_RenderManager, OSVR_RenderManagerPresentState, OSVR_RenderParams, OSVR_CBool)
+ */
+ public static native byte osvrRenderManagerFinishPresentRenderBuffers(Pointer renderManager, Pointer presentState, OSVR_RenderParams.ByValue renderParams, byte shouldFlipY);
+ /**
+ * must be registered before they are presented.
+ * Original signature : OSVR_ReturnCode osvrRenderManagerStartRegisterRenderBuffers(OSVR_RenderManagerRegisterBufferState*)
+ */
+ public static native byte osvrRenderManagerStartRegisterRenderBuffers(PointerByReference registerBufferStateOut);
+ /**
+ * buffers for a single frame. This sequence starts with the Start function.
+ * Original signature : OSVR_ReturnCode osvrRenderManagerFinishRegisterRenderBuffers(OSVR_RenderManager, OSVR_RenderManagerRegisterBufferState, OSVR_CBool)
+ */
+ public static native byte osvrRenderManagerFinishRegisterRenderBuffers(Pointer renderManager, Pointer registerBufferState, byte appWillNotOverwriteBeforeNewPresent);
+ /** Original signature : OSVR_ReturnCode osvrRenderManagerPresentSolidColorf(OSVR_RenderManager, OSVR_RGB_FLOAT)
*/
+ public static native byte osvrRenderManagerPresentSolidColorf(Pointer renderManager, osvrrendermanageropengl.OSVR_RGB.ByValue rgb);
+ /**
+ * when you're done.
+ * Original signature : OSVR_ReturnCode osvrRenderManagerGetRenderInfoCollection(OSVR_RenderManager, OSVR_RenderParams, OSVR_RenderInfoCollection*)
+ */
+ public static native byte osvrRenderManagerGetRenderInfoCollection(Pointer renderManager, OSVR_RenderParams.ByValue renderParams, PointerByReference renderInfoCollectionOut);
+ /**
+ * Releases the OSVR_RenderInfoCollection.
+ * Original signature : OSVR_ReturnCode osvrRenderManagerReleaseRenderInfoCollection(OSVR_RenderInfoCollection)
+ */
+ public static native byte osvrRenderManagerReleaseRenderInfoCollection(Pointer renderInfoCollection);
+ /**
+ * Get the size of the OSVR_RenderInfoCollection.
+ * Original signature : OSVR_ReturnCode osvrRenderManagerGetNumRenderInfoInCollection(OSVR_RenderInfoCollection, OSVR_RenderInfoCount*)
+ */
+ public static native byte osvrRenderManagerGetNumRenderInfoInCollection(Pointer renderInfoCollection, NativeSizeByReference countOut);
+ /**
+ * @return True on success, false on failure (null pointer).
+ * Original signature : OSVR_ReturnCode OSVR_Projection_to_OpenGL(double*, OSVR_ProjectionMatrix)
+ * @deprecated use the safer methods {@link #OSVR_Projection_to_OpenGL(java.nio.DoubleBuffer, osvrrendermanageropengl.OSVR_ProjectionMatrix.ByValue)} and {@link #OSVR_Projection_to_OpenGL(com.sun.jna.ptr.DoubleByReference, osvrrendermanageropengl.OSVR_ProjectionMatrix.ByValue)} instead
+ */
+ @Deprecated
+ public static native byte OSVR_Projection_to_OpenGL(DoubleByReference OpenGL_out, osvrrendermanageropengl.OSVR_ProjectionMatrix.ByValue projection_in);
+ /**
+ * @return True on success, false on failure (null pointer).
+ * Original signature : OSVR_ReturnCode OSVR_Projection_to_OpenGL(double*, OSVR_ProjectionMatrix)
+ */
+ public static native byte OSVR_Projection_to_OpenGL(DoubleBuffer OpenGL_out, osvrrendermanageropengl.OSVR_ProjectionMatrix.ByValue projection_in);
+ /**
+ * @return True on success, false on failure (null pointer).
+ * Original signature : OSVR_ReturnCode OSVR_Projection_to_D3D(float[16], OSVR_ProjectionMatrix)
+ * @deprecated use the safer methods {@link #OSVR_Projection_to_D3D(java.nio.FloatBuffer, osvrrendermanageropengl.OSVR_ProjectionMatrix.ByValue)} and {@link #OSVR_Projection_to_D3D(com.sun.jna.ptr.FloatByReference, osvrrendermanageropengl.OSVR_ProjectionMatrix.ByValue)} instead
+ */
+ @Deprecated
+ public static native byte OSVR_Projection_to_D3D(FloatByReference D3D_out, osvrrendermanageropengl.OSVR_ProjectionMatrix.ByValue projection_in);
+ /**
+ * @return True on success, false on failure (null pointer).
+ * Original signature : OSVR_ReturnCode OSVR_Projection_to_D3D(float[16], OSVR_ProjectionMatrix)
+ */
+ public static native byte OSVR_Projection_to_D3D(FloatBuffer D3D_out, osvrrendermanageropengl.OSVR_ProjectionMatrix.ByValue projection_in);
+ /**
+ * @return True on success, false on failure (null pointer).
+ * Original signature : OSVR_ReturnCode OSVR_Projection_to_Unreal(float[16], OSVR_ProjectionMatrix)
+ * @deprecated use the safer methods {@link #OSVR_Projection_to_Unreal(java.nio.FloatBuffer, osvrrendermanageropengl.OSVR_ProjectionMatrix.ByValue)} and {@link #OSVR_Projection_to_Unreal(com.sun.jna.ptr.FloatByReference, osvrrendermanageropengl.OSVR_ProjectionMatrix.ByValue)} instead
+ */
+ @Deprecated
+ public static native byte OSVR_Projection_to_Unreal(FloatByReference Unreal_out, osvrrendermanageropengl.OSVR_ProjectionMatrix.ByValue projection_in);
+ /**
+ * @return True on success, false on failure (null pointer).
+ * Original signature : OSVR_ReturnCode OSVR_Projection_to_Unreal(float[16], OSVR_ProjectionMatrix)
+ */
+ public static native byte OSVR_Projection_to_Unreal(FloatBuffer Unreal_out, osvrrendermanageropengl.OSVR_ProjectionMatrix.ByValue projection_in);
+ /**
+ * Original signature : OSVR_ReturnCode osvrCreateRenderManagerOpenGL(OSVR_ClientContext, const char[], OSVR_GraphicsLibraryOpenGL, OSVR_RenderManager*, OSVR_RenderManagerOpenGL*)
+ * @deprecated use the safer methods {@link #osvrCreateRenderManagerOpenGL(osvrrendermanageropengl.OsvrRenderManagerOpenGLLibrary.OSVR_ClientContext, byte[], osvrrendermanageropengl.OSVR_GraphicsLibraryOpenGL.ByValue, com.sun.jna.ptr.PointerByReference, com.sun.jna.ptr.PointerByReference)} and {@link #osvrCreateRenderManagerOpenGL(com.sun.jna.Pointer, com.sun.jna.Pointer, osvrrendermanageropengl.OSVR_GraphicsLibraryOpenGL.ByValue, com.sun.jna.ptr.PointerByReference, com.sun.jna.ptr.PointerByReference)} instead
+ */
+ @Deprecated
+ public static native byte osvrCreateRenderManagerOpenGL(Pointer clientContext, Pointer graphicsLibraryName, osvrrendermanageropengl.OSVR_GraphicsLibraryOpenGL.ByValue graphicsLibrary, PointerByReference renderManagerOut, PointerByReference renderManagerOpenGLOut);
+ /** Original signature : OSVR_ReturnCode osvrCreateRenderManagerOpenGL(OSVR_ClientContext, const char[], OSVR_GraphicsLibraryOpenGL, OSVR_RenderManager*, OSVR_RenderManagerOpenGL*)
*/
+ public static native byte osvrCreateRenderManagerOpenGL(OsvrClientKitLibrary.OSVR_ClientContext clientContext, byte graphicsLibraryName[], osvrrendermanageropengl.OSVR_GraphicsLibraryOpenGL.ByValue graphicsLibrary, PointerByReference renderManagerOut, PointerByReference renderManagerOpenGLOut);
+ /** Original signature : OSVR_ReturnCode osvrRenderManagerGetRenderInfoOpenGL(OSVR_RenderManagerOpenGL, OSVR_RenderInfoCount, OSVR_RenderParams, OSVR_RenderInfoOpenGL*)
*/
+ public static native byte osvrRenderManagerGetRenderInfoOpenGL(Pointer renderManager, NativeSize renderInfoIndex, OSVR_RenderParams.ByValue renderParams, OSVR_RenderInfoOpenGL renderInfoOut);
+ /** Original signature : OSVR_ReturnCode osvrRenderManagerOpenDisplayOpenGL(OSVR_RenderManagerOpenGL, OSVR_OpenResultsOpenGL*)
*/
+ public static native byte osvrRenderManagerOpenDisplayOpenGL(Pointer renderManager, OSVR_OpenResultsOpenGL openResultsOut);
+ /** Original signature : OSVR_ReturnCode osvrRenderManagerPresentRenderBufferOpenGL(OSVR_RenderManagerPresentState, OSVR_RenderBufferOpenGL, OSVR_RenderInfoOpenGL, OSVR_ViewportDescription)
*/
+ public static native byte osvrRenderManagerPresentRenderBufferOpenGL(Pointer presentState, osvrrendermanageropengl.OSVR_RenderBufferOpenGL.ByValue buffer, OSVR_RenderInfoOpenGL.ByValue renderInfoUsed, osvrrendermanageropengl.OSVR_ViewportDescription.ByValue normalizedCroppingViewport);
+ /** Original signature : OSVR_ReturnCode osvrRenderManagerRegisterRenderBufferOpenGL(OSVR_RenderManagerRegisterBufferState, OSVR_RenderBufferOpenGL)
*/
+ public static native byte osvrRenderManagerRegisterRenderBufferOpenGL(Pointer registerBufferState, osvrrendermanageropengl.OSVR_RenderBufferOpenGL.ByValue renderBuffer);
+ /**
+ * Gets a given OSVR_RenderInfoOpenGL from an OSVR_RenderInfoCollection.
+ * Original signature : OSVR_ReturnCode osvrRenderManagerGetRenderInfoFromCollectionOpenGL(OSVR_RenderInfoCollection, OSVR_RenderInfoCount, OSVR_RenderInfoOpenGL*)
+ */
+ public static native byte osvrRenderManagerGetRenderInfoFromCollectionOpenGL(Pointer renderInfoCollection, NativeSize index, OSVR_RenderInfoOpenGL renderInfoOut);
+ /**
+ * Original signature : OSVR_ReturnCode osvrRenderManagerCreateColorBufferOpenGL(GLsizei, GLsizei, GLenum, GLuint*)
+ * @deprecated use the safer methods {@link #osvrRenderManagerCreateColorBufferOpenGL(int, int, int, java.nio.IntBuffer)} and {@link #osvrRenderManagerCreateColorBufferOpenGL(int, int, int, com.sun.jna.ptr.IntByReference)} instead
+ */
+ @Deprecated
+ public static native byte osvrRenderManagerCreateColorBufferOpenGL(int width, int height, int format, IntByReference colorBufferNameOut);
+ /** Original signature : OSVR_ReturnCode osvrRenderManagerCreateColorBufferOpenGL(GLsizei, GLsizei, GLenum, GLuint*)
*/
+ public static native byte osvrRenderManagerCreateColorBufferOpenGL(int width, int height, int format, IntBuffer colorBufferNameOut);
+ /**
+ * Original signature : OSVR_ReturnCode osvrRenderManagerCreateDepthBufferOpenGL(GLsizei, GLsizei, GLuint*)
+ * @deprecated use the safer methods {@link #osvrRenderManagerCreateDepthBufferOpenGL(int, int, java.nio.IntBuffer)} and {@link #osvrRenderManagerCreateDepthBufferOpenGL(int, int, com.sun.jna.ptr.IntByReference)} instead
+ */
+ @Deprecated
+ public static native byte osvrRenderManagerCreateDepthBufferOpenGL(int width, int height, IntByReference depthBufferNameOut);
+ /** Original signature : OSVR_ReturnCode osvrRenderManagerCreateDepthBufferOpenGL(GLsizei, GLsizei, GLuint*)
*/
+ public static native byte osvrRenderManagerCreateDepthBufferOpenGL(int width, int height, IntBuffer depthBufferNameOut);
+ public static class OSVR_ClientContext extends PointerType {
+ public OSVR_ClientContext(Pointer address) {
+ super(address);
+ }
+ public OSVR_ClientContext() {
+ super();
+ }
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrtimevalue/OSVR_TimeValue.java b/jme3-vr/src/main/java/osvrtimevalue/OSVR_TimeValue.java
new file mode 100644
index 000000000..61c111f3f
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrtimevalue/OSVR_TimeValue.java
@@ -0,0 +1,40 @@
+package osvrtimevalue;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import java.util.Arrays;
+import java.util.List;
+/**
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OSVR_TimeValue extends Structure {
+ /** C type : OSVR_TimeValue_Seconds */
+ public long seconds;
+ /** C type : OSVR_TimeValue_Microseconds */
+ public int microseconds;
+ public OSVR_TimeValue() {
+ super();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList("seconds", "microseconds");
+ }
+ /**
+ * @param seconds C type : OSVR_TimeValue_Seconds
+ * @param microseconds C type : OSVR_TimeValue_Microseconds
+ */
+ public OSVR_TimeValue(long seconds, int microseconds) {
+ super();
+ this.seconds = seconds;
+ this.microseconds = microseconds;
+ }
+ public OSVR_TimeValue(Pointer peer) {
+ super(peer);
+ }
+ public static class ByReference extends OSVR_TimeValue implements Structure.ByReference {
+
+ };
+ public static class ByValue extends OSVR_TimeValue implements Structure.ByValue {
+
+ };
+}
diff --git a/jme3-vr/src/main/java/osvrtimevalue/OsvrTimeValueLibrary.java b/jme3-vr/src/main/java/osvrtimevalue/OsvrTimeValueLibrary.java
new file mode 100644
index 000000000..6f9f2c0b2
--- /dev/null
+++ b/jme3-vr/src/main/java/osvrtimevalue/OsvrTimeValueLibrary.java
@@ -0,0 +1,119 @@
+package osvrtimevalue;
+import com.sun.jna.Library;
+import com.sun.jna.Native;
+import com.sun.jna.NativeLibrary;
+import com.sun.jna.Pointer;
+import com.sun.jna.PointerType;
+/**
+ * JNA Wrapper for library osvrTimeValue
+ * This file was autogenerated by JNAerator ,
+ * a tool written by Olivier Chafik that uses a few opensource projects. .
+ * For help, please visit NativeLibs4Java , Rococoa , or JNA .
+ */
+public class OsvrTimeValueLibrary implements Library {
+ public static final String JNA_LIBRARY_NAME = "osvrClientKit";
+ public static final NativeLibrary JNA_NATIVE_LIB = NativeLibrary.getInstance(OsvrTimeValueLibrary.JNA_LIBRARY_NAME);
+ static {
+ Native.register(OsvrTimeValueLibrary.class, OsvrTimeValueLibrary.JNA_NATIVE_LIB);
+ }
+ public static final int OSVR_TRUE = (int)(1);
+ public static final int OSVR_FALSE = (int)(0);
+ /**
+ * @brief Gets the current time in the TimeValue. Parallel to gettimeofday.
+ * Original signature : void osvrTimeValueGetNow(OSVR_TimeValue*)
+ */
+ public static native void osvrTimeValueGetNow(OSVR_TimeValue dest);
+ /**
+ * @brief Converts from a TimeValue struct to your system's struct timeval.
+ * @param dest Pointer to an empty struct timeval for your platform.
+ * @param src A pointer to an OSVR_TimeValue you'd like to convert from.
+ * If either parameter is NULL, the function will return without doing
+ * anything.
+ * Original signature : void osvrTimeValueToStructTimeval(timeval*, const OSVR_TimeValue*)
+ */
+ public static native void osvrTimeValueToStructTimeval(OsvrTimeValueLibrary.timeval dest, OSVR_TimeValue src);
+ /**
+ * @brief Converts from a TimeValue struct to your system's struct timeval.
+ * @param dest An OSVR_TimeValue destination pointer.
+ * @param src Pointer to a struct timeval you'd like to convert from.
+ * The result is normalized.
+ * If either parameter is NULL, the function will return without doing
+ * anything.
+ * Original signature : void osvrStructTimevalToTimeValue(OSVR_TimeValue*, timeval*)
+ */
+ public static native void osvrStructTimevalToTimeValue(OSVR_TimeValue dest, OsvrTimeValueLibrary.timeval src);
+ /**
+ * @brief "Normalizes" a time value so that the absolute number of microseconds
+ * is less than 1,000,000, and that the sign of both components is the same.
+ * @param tv Address of a struct TimeValue to normalize in place.
+ * If the given pointer is NULL, this function returns without doing anything.
+ * Original signature : void osvrTimeValueNormalize(OSVR_TimeValue*)
+ */
+ public static native void osvrTimeValueNormalize(OSVR_TimeValue tv);
+ /**
+ * @brief Sums two time values, replacing the first with the result.
+ * @param tvA Destination and first source.
+ * @param tvB second source
+ * If a given pointer is NULL, this function returns without doing anything.
+ * Both parameters are expected to be in normalized form.
+ * Original signature : void osvrTimeValueSum(OSVR_TimeValue*, const OSVR_TimeValue*)
+ */
+ public static native void osvrTimeValueSum(OSVR_TimeValue tvA, OSVR_TimeValue tvB);
+ /**
+ * @brief Computes the difference between two time values, replacing the first
+ * with the result.
+ * Effectively, `*tvA = *tvA - *tvB`
+ * @param tvA Destination and first source.
+ * @param tvB second source
+ * If a given pointer is NULL, this function returns without doing anything.
+ * Both parameters are expected to be in normalized form.
+ * Original signature : void osvrTimeValueDifference(OSVR_TimeValue*, const OSVR_TimeValue*)
+ */
+ public static native void osvrTimeValueDifference(OSVR_TimeValue tvA, OSVR_TimeValue tvB);
+ /**
+ * @brief Compares two time values (assumed to be normalized), returning
+ * the same values as strcmp
+ * @return <0 if A is earlier than B, 0 if they are the same, and >0 if A
+ * is later than B.
+ * Original signature : int osvrTimeValueCmp(const OSVR_TimeValue*, const OSVR_TimeValue*)
+ */
+ public static native int osvrTimeValueCmp(OSVR_TimeValue tvA, OSVR_TimeValue tvB);
+ /**
+ * @brief Compute the difference between the two time values, returning the
+ * duration as a double-precision floating-point number of seconds.
+ * Effectively, `ret = *tvA - *tvB`
+ * @param tvA first source.
+ * @param tvB second source
+ * @return Duration of timespan in seconds (floating-point)
+ * Original signature : double osvrTimeValueDurationSeconds(const OSVR_TimeValue*, const OSVR_TimeValue*)
+ */
+ public static native double osvrTimeValueDurationSeconds(OSVR_TimeValue tvA, OSVR_TimeValue tvB);
+ /**
+ * @brief True if A is later than B
+ * Original signature : OSVR_CBool osvrTimeValueGreater(const OSVR_TimeValue*, const OSVR_TimeValue*)
+ */
+ public static native byte osvrTimeValueGreater(OSVR_TimeValue tvA, OSVR_TimeValue tvB);
+ /**
+ * Returns true if the time value is normalized. Typically used in assertions.
+ * Original signature : bool osvrTimeValueIsNormalized(const OSVR_TimeValue&)
+ */
+ public static native byte osvrTimeValueIsNormalized(OSVR_TimeValue tv);
+ /**
+ * Operator > overload for time values
+ * Original signature : bool operator>(const OSVR_TimeValue&, const OSVR_TimeValue&)
+ */
+ public static native byte operatorGreater(OSVR_TimeValue tvA, OSVR_TimeValue tvB);
+ /**
+ * Operator == overload for time values
+ * Original signature : bool operator==(const OSVR_TimeValue&, const OSVR_TimeValue&)
+ */
+ public static native byte operatorIsEqual(OSVR_TimeValue tvA, OSVR_TimeValue tvB);
+ public static class timeval extends PointerType {
+ public timeval(Pointer address) {
+ super(address);
+ }
+ public timeval() {
+ super();
+ }
+ };
+}
diff --git a/jme3-vr/src/main/resources/Common/MatDefs/VR/CartoonSSAO.frag b/jme3-vr/src/main/resources/Common/MatDefs/VR/CartoonSSAO.frag
new file mode 100644
index 000000000..5d121019f
--- /dev/null
+++ b/jme3-vr/src/main/resources/Common/MatDefs/VR/CartoonSSAO.frag
@@ -0,0 +1,109 @@
+//#define FRAGMENT_SHADER
+#import "Common/ShaderLib/GLSLCompat.glsllib"
+
+uniform vec2 g_ResolutionInverse;
+uniform vec2 m_FrustumNearFar;
+uniform sampler2D m_Texture;
+uniform sampler2D m_Normals;
+uniform sampler2D m_DepthTexture;
+uniform vec3 m_FrustumCorner;
+uniform float m_Distance;
+
+varying vec2 texCoord;
+
+#define m_Scale 3.15
+#define m_Bias 0.025
+#define m_SampleRadius 200.0
+
+vec4 fetchNormalDepth(vec2 tc){
+ vec4 nd;
+ nd.xyz = texture2D(m_Normals, tc).rgb;
+ nd.w = 150.0 * texture2D(m_DepthTexture, tc).r;
+ return nd;
+}
+
+vec3 getPosition(in vec2 uv){
+ float depth= (2.0 * m_FrustumNearFar.x) / (m_FrustumNearFar.y + m_FrustumNearFar.x - texture2D(m_DepthTexture,uv).r * (m_FrustumNearFar.y-m_FrustumNearFar.x));
+#ifdef INSTANCING
+ float x = mix(-m_FrustumCorner.x, m_FrustumCorner.x, (uv.x - (uv.x > 0.5 ? 0.5 : 0.0)) * 2.0);
+#else
+ float x = mix(-m_FrustumCorner.x, m_FrustumCorner.x, uv.x);
+#endif
+ float y = mix(-m_FrustumCorner.y, m_FrustumCorner.y, uv.y);
+ return depth* vec3(x, y, m_FrustumCorner.z);
+}
+
+vec3 getPosition(in vec2 uv, in float indepth){
+ float depth= (2.0 * m_FrustumNearFar.x) / (m_FrustumNearFar.y + m_FrustumNearFar.x - indepth * (m_FrustumNearFar.y-m_FrustumNearFar.x));
+#ifdef INSTANCING
+ float x = mix(-m_FrustumCorner.x, m_FrustumCorner.x, (uv.x - (uv.x > 0.5 ? 0.5 : 0.0)) * 2.0);
+#else
+ float x = mix(-m_FrustumCorner.x, m_FrustumCorner.x, uv.x);
+#endif
+ float y = mix(-m_FrustumCorner.y, m_FrustumCorner.y, uv.y);
+ return depth* vec3(x, y, m_FrustumCorner.z);
+}
+
+float doAmbientOcclusion(in vec2 tc, in vec3 pos, in vec3 norm){
+ vec3 diff = getPosition(tc)- pos;
+ float d = length(diff) * m_Scale;
+ vec3 v = normalize(diff);
+ return step(0.00002,d)*max(0.0, dot(norm, v) - m_Bias) * ( 1.0/(1.0 + d) ) * smoothstep(0.00002,0.0027,d);
+}
+
+void main(){
+ float result;
+
+ float firstdepth = texture2D(m_DepthTexture,texCoord).r;
+ vec4 color = texture2D(m_Texture, texCoord);
+
+ if( firstdepth == 1.0 ) {
+ gl_FragColor = color;
+ return;
+ }
+
+ vec3 position = getPosition(texCoord, firstdepth);
+ vec3 normal = texture2D(m_Normals, texCoord).xyz * 2.0 - 1.0;
+
+ vec2 rad = m_SampleRadius * g_ResolutionInverse / max(16.0, position.z);
+
+ float ao = doAmbientOcclusion(texCoord + vec2( rad.x, rad.y), position, normal);
+ ao += doAmbientOcclusion(texCoord + vec2(-rad.x, rad.y), position, normal);
+ ao += doAmbientOcclusion(texCoord + vec2( rad.x, -rad.y), position, normal);
+ ao += doAmbientOcclusion(texCoord + vec2(-rad.x, -rad.y), position, normal);
+
+ ao += doAmbientOcclusion(texCoord + vec2(-rad.x, 0.0), position, normal);
+ ao += doAmbientOcclusion(texCoord + vec2( rad.x, 0.0), position, normal);
+ ao += doAmbientOcclusion(texCoord + vec2(0.0, -rad.y), position, normal);
+ ao += doAmbientOcclusion(texCoord + vec2(0.0, rad.y), position, normal);
+
+ rad *= 0.7;
+
+ ao += doAmbientOcclusion(texCoord + vec2(-rad.x, -rad.y), position, normal);
+ ao += doAmbientOcclusion(texCoord + vec2( rad.x, -rad.y), position, normal);
+ ao += doAmbientOcclusion(texCoord + vec2(-rad.x, rad.y), position, normal);
+ ao += doAmbientOcclusion(texCoord + vec2( rad.x, rad.y), position, normal);
+
+ result = 1.0 - clamp(ao * 0.4 - position.z * m_Distance * 2.5, 0.0, 0.6);
+
+#ifndef NO_OUTLINE
+ // ok, done with ambient occlusion, do cartoon edge
+
+ vec2 mv = 0.5 * g_ResolutionInverse;
+
+ vec4 n1 = fetchNormalDepth(texCoord + vec2(-mv.x, -mv.y));
+ vec4 n2 = fetchNormalDepth(texCoord + vec2( mv.x, mv.y));
+ vec4 n3 = fetchNormalDepth(texCoord + vec2(-mv.x, mv.y));
+ vec4 n4 = fetchNormalDepth(texCoord + vec2( mv.x, -mv.y));
+
+ // Work out how much the normal and depth values are changing.
+ vec4 diagonalDelta = abs(n1 - n2) + abs(n3 - n4);
+
+ float normalDelta = dot(diagonalDelta.xyz, vec3(1.0));
+ float totalDelta = (diagonalDelta.w + normalDelta * 0.4) - position.z * m_Distance;
+
+ gl_FragColor = color * vec4(result, result, result, 1.0) * (1.0 - clamp(totalDelta, 0.0, 1.0));
+#else
+ gl_FragColor = color * vec4(result, result, result, 1.0);
+#endif
+}
diff --git a/jme3-vr/src/main/resources/Common/MatDefs/VR/CartoonSSAO.j3md b/jme3-vr/src/main/resources/Common/MatDefs/VR/CartoonSSAO.j3md
new file mode 100644
index 000000000..5faaf9260
--- /dev/null
+++ b/jme3-vr/src/main/resources/Common/MatDefs/VR/CartoonSSAO.j3md
@@ -0,0 +1,47 @@
+MaterialDef CartoonSSAO {
+
+ MaterialParameters {
+ Int NumSamples
+ Int NumSamplesDepth
+ Texture2D DepthTexture
+ Texture2D Texture
+ Texture2D Normals
+ Vector3 FrustumCorner
+ Float Distance
+ Boolean disableOutline
+ Boolean useInstancing
+ Vector2 FrustumNearFar
+ }
+
+ Technique {
+ VertexShader GLSL150: Common/MatDefs/Post/Post15.vert
+ FragmentShader GLSL150: Common/MatDefs/VR/CartoonSSAO.frag
+
+ WorldParameters {
+ WorldViewProjectionMatrix
+ WorldViewMatrix
+ ResolutionInverse
+ }
+
+ Defines {
+ NO_OUTLINE : disableOutline
+ INSTANCING : useInstancing
+ }
+ }
+
+ Technique {
+ VertexShader GLSL100: Common/MatDefs/Post/Post.vert
+ FragmentShader GLSL100: Common/MatDefs/VR/CartoonSSAO.frag
+
+ WorldParameters {
+ WorldViewProjectionMatrix
+ WorldViewMatrix
+ ResolutionInverse
+ }
+
+ Defines {
+ NO_OUTLINE : disableOutline
+ INSTANCING : useInstancing
+ }
+ }
+}
diff --git a/jme3-vr/src/main/resources/Common/MatDefs/VR/GuiOverlay.frag b/jme3-vr/src/main/resources/Common/MatDefs/VR/GuiOverlay.frag
new file mode 100644
index 000000000..555ef3eb4
--- /dev/null
+++ b/jme3-vr/src/main/resources/Common/MatDefs/VR/GuiOverlay.frag
@@ -0,0 +1,10 @@
+#import "Common/ShaderLib/GLSLCompat.glsllib"
+
+uniform sampler2D m_ColorMap;
+
+varying vec2 texCoord1;
+
+void main(){
+ gl_FragColor = texture2D(m_ColorMap, texCoord1);
+ gl_FragColor.a *= 12.0 / (1.0 + gl_FragColor.a * 11.0 );
+}
\ No newline at end of file
diff --git a/jme3-vr/src/main/resources/Common/MatDefs/VR/GuiOverlay.j3md b/jme3-vr/src/main/resources/Common/MatDefs/VR/GuiOverlay.j3md
new file mode 100644
index 000000000..79b775923
--- /dev/null
+++ b/jme3-vr/src/main/resources/Common/MatDefs/VR/GuiOverlay.j3md
@@ -0,0 +1,38 @@
+MaterialDef GuiOverlay {
+
+ MaterialParameters {
+ Texture2D ColorMap
+
+ // For VR instancing
+ Matrix4 RightEyeViewProjectionMatrix
+ }
+
+ Technique {
+ VertexShader GLSL150: Common/MatDefs/VR/GuiOverlay15.vert
+ FragmentShader GLSL150: Common/MatDefs/VR/GuiOverlay15.frag
+
+ WorldParameters {
+ WorldViewProjectionMatrix
+ ViewProjectionMatrix // needed for VR instancing
+ }
+
+ Defines {
+ INSTANCING : RightEyeViewProjectionMatrix // For VR instancing
+ }
+ }
+
+ Technique {
+ VertexShader GLSL100: Common/MatDefs/VR/GuiOverlay.vert
+ FragmentShader GLSL100: Common/MatDefs/VR/GuiOverlay.frag
+
+ WorldParameters {
+ WorldViewProjectionMatrix
+ ViewProjectionMatrix // needed for VR instancing
+ }
+
+ Defines {
+ INSTANCING : RightEyeViewProjectionMatrix // For VR instancing
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/jme3-vr/src/main/resources/Common/MatDefs/VR/GuiOverlay.vert b/jme3-vr/src/main/resources/Common/MatDefs/VR/GuiOverlay.vert
new file mode 100644
index 000000000..8b0507196
--- /dev/null
+++ b/jme3-vr/src/main/resources/Common/MatDefs/VR/GuiOverlay.vert
@@ -0,0 +1,12 @@
+// import the following for VR instancing
+#import "Common/ShaderLib/InstanceVR.glsllib"
+
+attribute vec3 inPosition;
+attribute vec2 inTexCoord;
+varying vec2 texCoord1;
+
+void main(){
+ texCoord1 = inTexCoord;
+ vec4 modelSpacePos = vec4(inPosition, 1.0);
+ gl_Position = TransformWorldViewProjectionVR(modelSpacePos);
+}
\ No newline at end of file
diff --git a/jme3-vr/src/main/resources/Common/MatDefs/VR/GuiOverlay15.frag b/jme3-vr/src/main/resources/Common/MatDefs/VR/GuiOverlay15.frag
new file mode 100644
index 000000000..efaca8436
--- /dev/null
+++ b/jme3-vr/src/main/resources/Common/MatDefs/VR/GuiOverlay15.frag
@@ -0,0 +1,13 @@
+//#define FRAGMENT_SHADER
+#import "Common/ShaderLib/GLSLCompat.glsllib"
+
+uniform sampler2D m_ColorMap;
+
+in vec2 texCoord1;
+
+out vec4 outColor;
+
+void main(){
+ outColor = texture2D(m_ColorMap, texCoord1);
+ outColor.a *= 12.0 / (1.0 + outColor.a * 11.0 );
+}
\ No newline at end of file
diff --git a/jme3-vr/src/main/resources/Common/MatDefs/VR/GuiOverlay15.vert b/jme3-vr/src/main/resources/Common/MatDefs/VR/GuiOverlay15.vert
new file mode 100644
index 000000000..cb505d5cf
--- /dev/null
+++ b/jme3-vr/src/main/resources/Common/MatDefs/VR/GuiOverlay15.vert
@@ -0,0 +1,14 @@
+// import the following for VR instancing
+//#define VERTEX_SHADER
+#import "Common/ShaderLib/GLSLCompat.glsllib"
+#import "Common/ShaderLib/InstanceVR.glsllib"
+
+in vec3 inPosition;
+in vec2 inTexCoord;
+out vec2 texCoord1;
+
+void main(){
+ texCoord1 = inTexCoord;
+ vec4 modelSpacePos = vec4(inPosition, 1.0);
+ gl_Position = TransformWorldViewProjectionVR(modelSpacePos);
+}
\ No newline at end of file
diff --git a/jme3-vr/src/main/resources/Common/MatDefs/VR/OpenVR.frag b/jme3-vr/src/main/resources/Common/MatDefs/VR/OpenVR.frag
new file mode 100644
index 000000000..03a81aa32
--- /dev/null
+++ b/jme3-vr/src/main/resources/Common/MatDefs/VR/OpenVR.frag
@@ -0,0 +1,21 @@
+uniform sampler2D m_Texture;
+
+varying vec2 UVred;
+varying vec2 UVgreen;
+varying vec2 UVblue;
+
+void main() {
+ // performance & FOV experiment by removing bounds check
+ //float fBoundsCheck = ( (dot( vec2( lessThan( UVgreen.xy, vec2(0.05, 0.05)) ), vec2(1.0, 1.0))+dot( vec2( greaterThan( UVgreen.xy, vec2( 0.95, 0.95)) ), vec2(1.0, 1.0))) );
+ //
+ //if( fBoundsCheck > 1.0 ) {
+ // gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
+ //} else {
+
+ float red = texture2D(m_Texture, UVred).x;
+ float green = texture2D(m_Texture, UVgreen).y;
+ float blue = texture2D(m_Texture, UVblue).z;
+ gl_FragColor = vec4( red, green, blue, 1.0 );
+
+ //}
+}
diff --git a/jme3-vr/src/main/resources/Common/MatDefs/VR/OpenVR.j3md b/jme3-vr/src/main/resources/Common/MatDefs/VR/OpenVR.j3md
new file mode 100644
index 000000000..7cadd0af0
--- /dev/null
+++ b/jme3-vr/src/main/resources/Common/MatDefs/VR/OpenVR.j3md
@@ -0,0 +1,33 @@
+MaterialDef OpenVR {
+ MaterialParameters {
+ Int NumSamples
+ Texture2D Texture
+
+ Vector2 inUVred
+ Vector2 inUVblue
+ Vector2 inUVgreen
+ }
+
+ Technique {
+ VertexShader GLSL150: Common/MatDefs/VR/OpenVR15.vert
+ FragmentShader GLSL150: Common/MatDefs/VR/OpenVR15.frag
+
+ WorldParameters {
+ }
+
+ Defines {
+ }
+
+ }
+
+ Technique {
+ VertexShader GLSL100: Common/MatDefs/VR/OpenVR.vert
+ FragmentShader GLSL100: Common/MatDefs/VR/OpenVR.frag
+
+ WorldParameters {
+ }
+
+ Defines {
+ }
+ }
+}
\ No newline at end of file
diff --git a/jme3-vr/src/main/resources/Common/MatDefs/VR/OpenVR.vert b/jme3-vr/src/main/resources/Common/MatDefs/VR/OpenVR.vert
new file mode 100644
index 000000000..080df41a1
--- /dev/null
+++ b/jme3-vr/src/main/resources/Common/MatDefs/VR/OpenVR.vert
@@ -0,0 +1,16 @@
+attribute vec4 inPosition;
+
+attribute vec2 inTexCoord; // m_inUVred
+attribute vec2 inTexCoord2; // m_inUVgreen
+attribute vec2 inTexCoord3; // m_inUVblue
+
+varying vec2 UVred;
+varying vec2 UVgreen;
+varying vec2 UVblue;
+
+void main() {
+ gl_Position = inPosition;
+ UVred = inTexCoord;
+ UVgreen = inTexCoord2;
+ UVblue = inTexCoord3;
+}
\ No newline at end of file
diff --git a/jme3-vr/src/main/resources/Common/MatDefs/VR/OpenVR15.frag b/jme3-vr/src/main/resources/Common/MatDefs/VR/OpenVR15.frag
new file mode 100644
index 000000000..f5d6e7da0
--- /dev/null
+++ b/jme3-vr/src/main/resources/Common/MatDefs/VR/OpenVR15.frag
@@ -0,0 +1,23 @@
+uniform sampler2D m_Texture;
+
+in vec2 UVred;
+in vec2 UVgreen;
+in vec2 UVblue;
+
+out vec4 outColor;
+
+void main() {
+ // performance & FOV improvement by removing bounds check
+ //float fBoundsCheck = ( (dot( vec2( lessThan( UVgreen.xy, vec2(0.05, 0.05)) ), vec2(1.0, 1.0))+dot( vec2( greaterThan( UVgreen.xy, vec2( 0.95, 0.95)) ), vec2(1.0, 1.0))) );
+ //
+ //if( fBoundsCheck > 1.0 ) {
+ // gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
+ //} else {
+
+ float red = texture2D(m_Texture, UVred).x;
+ float green = texture2D(m_Texture, UVgreen).y;
+ float blue = texture2D(m_Texture, UVblue).z;
+ outColor = vec4( red, green, blue, 1.0 );
+
+ //}
+}
diff --git a/jme3-vr/src/main/resources/Common/MatDefs/VR/OpenVR15.vert b/jme3-vr/src/main/resources/Common/MatDefs/VR/OpenVR15.vert
new file mode 100644
index 000000000..b8627c032
--- /dev/null
+++ b/jme3-vr/src/main/resources/Common/MatDefs/VR/OpenVR15.vert
@@ -0,0 +1,16 @@
+in vec4 inPosition;
+
+in vec2 inTexCoord; // m_inUVred
+in vec2 inTexCoord2; // m_inUVgreen
+in vec2 inTexCoord3; // m_inUVblue
+
+out vec2 UVred;
+out vec2 UVgreen;
+out vec2 UVblue;
+
+void main() {
+ gl_Position = inPosition;
+ UVred = inTexCoord;
+ UVgreen = inTexCoord2;
+ UVblue = inTexCoord3;
+}
\ No newline at end of file
diff --git a/jme3-vr/src/main/resources/Common/MatDefs/VR/PostShadowFilter.frag b/jme3-vr/src/main/resources/Common/MatDefs/VR/PostShadowFilter.frag
new file mode 100644
index 000000000..09b4c9fb9
--- /dev/null
+++ b/jme3-vr/src/main/resources/Common/MatDefs/VR/PostShadowFilter.frag
@@ -0,0 +1,183 @@
+#import "Common/ShaderLib/MultiSample.glsllib"
+#import "Common/ShaderLib/Shadows.glsllib"
+
+
+uniform COLORTEXTURE m_Texture;
+uniform DEPTHTEXTURE m_DepthTexture;
+uniform mat4 m_ViewProjectionMatrixInverse;
+uniform vec4 m_ViewProjectionMatrixRow2;
+
+#ifdef INSTANCING
+ uniform mat4 m_ViewProjectionMatrixInverseRight;
+ uniform vec4 m_ViewProjectionMatrixRow2Right;
+#endif
+
+in vec2 texCoord;
+out vec4 outFragColor;
+
+const mat4 biasMat = mat4(0.5, 0.0, 0.0, 0.0,
+ 0.0, 0.5, 0.0, 0.0,
+ 0.0, 0.0, 0.5, 0.0,
+ 0.5, 0.5, 0.5, 1.0);
+
+uniform mat4 m_LightViewProjectionMatrix0;
+uniform mat4 m_LightViewProjectionMatrix1;
+uniform mat4 m_LightViewProjectionMatrix2;
+uniform mat4 m_LightViewProjectionMatrix3;
+
+uniform vec2 g_ResolutionInverse;
+
+#ifdef POINTLIGHT
+ uniform vec3 m_LightPos;
+ uniform mat4 m_LightViewProjectionMatrix4;
+ uniform mat4 m_LightViewProjectionMatrix5;
+#else
+ uniform vec3 m_LightDir;
+ #ifndef PSSM
+ uniform vec3 m_LightPos;
+ #endif
+#endif
+
+#ifdef FADE
+uniform vec2 m_FadeInfo;
+#endif
+
+vec3 getPosition(in float depth, in vec2 uv){
+ #ifdef INSTANCING
+ vec4 pos;
+ mat4 usemat;
+ uv.x *= 2.0;
+ if( uv.x > 1.0 ) {
+ // right eye
+ uv.x -= 1.0;
+ usemat = m_ViewProjectionMatrixInverseRight;
+ } else {
+ // left eye
+ usemat = m_ViewProjectionMatrixInverse;
+ }
+ pos = vec4(uv, depth, 1.0) * 2.0 - 1.0;
+ pos = usemat * pos;
+ #else
+ vec4 pos = vec4(uv, depth, 1.0) * 2.0 - 1.0;
+ pos = m_ViewProjectionMatrixInverse * pos;
+ #endif
+ return pos.xyz / pos.w;
+}
+
+#ifndef BACKFACE_SHADOWS
+ vec3 approximateNormal(in float depth,in vec4 worldPos,in vec2 texCoord, in int numSample){
+ float step = g_ResolutionInverse.x ;
+ float stepy = g_ResolutionInverse.y ;
+ float depth1 = fetchTextureSample(m_DepthTexture,texCoord + vec2(-step,stepy),numSample).r;
+ float depth2 = fetchTextureSample(m_DepthTexture,texCoord + vec2(step,stepy),numSample).r;
+ vec3 v1, v2;
+ vec4 worldPos1 = vec4(getPosition(depth1,texCoord + vec2(-step,stepy)),1.0);
+ vec4 worldPos2 = vec4(getPosition(depth2,texCoord + vec2(step,stepy)),1.0);
+
+ v1 = normalize((worldPos1 - worldPos)).xyz;
+ v2 = normalize((worldPos2 - worldPos)).xyz;
+ return normalize(cross(v2, v1));
+
+ }
+#endif
+
+vec4 main_multiSample(in int numSample){
+ float depth = fetchTextureSample(m_DepthTexture,texCoord,numSample).r;//getDepth(m_DepthTexture,texCoord).r;
+ vec4 color = fetchTextureSample(m_Texture,texCoord,numSample);
+
+ //Discard shadow computation on the sky
+ if(depth == 1.0){
+ return color;
+ }
+
+ // get the vertex in world space
+ vec4 worldPos = vec4(getPosition(depth,texCoord),1.0);
+
+
+ vec3 lightDir;
+ #ifdef PSSM
+ lightDir = m_LightDir;
+ #else
+ lightDir = worldPos.xyz - m_LightPos;
+ #endif
+
+ #ifndef BACKFACE_SHADOWS
+ vec3 normal = approximateNormal(depth, worldPos, texCoord, numSample);
+ float ndotl = dot(normal, lightDir);
+ if(ndotl > 0.0){
+ return color;
+ }
+ #endif
+
+ #if (!defined(POINTLIGHT) && !defined(PSSM))
+ if( dot(m_LightDir,lightDir)<0){
+ return color;
+ }
+ #endif
+
+ // populate the light view matrices array and convert vertex to light viewProj space
+ vec4 projCoord0 = biasMat * m_LightViewProjectionMatrix0 * worldPos;
+ vec4 projCoord1 = biasMat * m_LightViewProjectionMatrix1 * worldPos;
+ vec4 projCoord2 = biasMat * m_LightViewProjectionMatrix2 * worldPos;
+ vec4 projCoord3 = biasMat * m_LightViewProjectionMatrix3 * worldPos;
+ #ifdef POINTLIGHT
+ vec4 projCoord4 = biasMat * m_LightViewProjectionMatrix4 * worldPos;
+ vec4 projCoord5 = biasMat * m_LightViewProjectionMatrix5 * worldPos;
+ #endif
+
+ float shadow = 1.0;
+
+ #if defined(PSSM) || defined(FADE)
+ #ifdef INSTANCING
+ vec4 useMat = (texCoord.x > 0.5 ? m_ViewProjectionMatrixRow2Right : m_ViewProjectionMatrixRow2);
+ float shadowPosition = useMat.x * worldPos.x + useMat.y * worldPos.y + useMat.z * worldPos.z + useMat.w;
+ #else
+ float shadowPosition = m_ViewProjectionMatrixRow2.x * worldPos.x + m_ViewProjectionMatrixRow2.y * worldPos.y + m_ViewProjectionMatrixRow2.z * worldPos.z + m_ViewProjectionMatrixRow2.w;
+ #endif
+ #endif
+
+ #ifdef POINTLIGHT
+ shadow = getPointLightShadows(worldPos, m_LightPos,
+ m_ShadowMap0,m_ShadowMap1,m_ShadowMap2,m_ShadowMap3,m_ShadowMap4,m_ShadowMap5,
+ projCoord0, projCoord1, projCoord2, projCoord3, projCoord4, projCoord5);
+ #else
+ #ifdef PSSM
+ shadow = getDirectionalLightShadows(m_Splits, shadowPosition,
+ m_ShadowMap0,m_ShadowMap1,m_ShadowMap2,m_ShadowMap3,
+ projCoord0, projCoord1, projCoord2, projCoord3);
+ #else
+ //spotlight
+ shadow = getSpotLightShadows(m_ShadowMap0,projCoord0);
+ #endif
+ #endif
+
+
+ #ifdef FADE
+ shadow = clamp(max(0.0,mix(shadow, 1.0 ,(shadowPosition - m_FadeInfo.x) * m_FadeInfo.y)),0.0,1.0);
+ #endif
+
+ shadow= shadow * m_ShadowIntensity + (1.0 - m_ShadowIntensity);
+ return color * vec4(shadow, shadow, shadow, 1.0);
+}
+
+void main(){
+
+ #if !defined( RENDER_SHADOWS )
+ outFragColor = fetchTextureSample(m_Texture,texCoord,0);
+ return;
+ #endif
+
+ #ifdef RESOLVE_MS
+ vec4 color = vec4(0.0);
+ for (int i = 0; i < m_NumSamples; i++){
+ color += main_multiSample(i);
+ }
+ outFragColor = color / m_NumSamples;
+ #else
+ outFragColor = main_multiSample(0);
+ #endif
+
+}
+
+
+
diff --git a/jme3-vr/src/main/resources/Common/MatDefs/VR/PostShadowFilter.j3md b/jme3-vr/src/main/resources/Common/MatDefs/VR/PostShadowFilter.j3md
new file mode 100644
index 000000000..3bdd5b2ea
--- /dev/null
+++ b/jme3-vr/src/main/resources/Common/MatDefs/VR/PostShadowFilter.j3md
@@ -0,0 +1,99 @@
+MaterialDef Post Shadow {
+
+ MaterialParameters {
+ Int FilterMode
+ Boolean HardwareShadows
+
+ Texture2D ShadowMap0
+ Texture2D ShadowMap1
+ Texture2D ShadowMap2
+ Texture2D ShadowMap3
+ //pointLights
+ Texture2D ShadowMap4
+ Texture2D ShadowMap5
+
+ Float ShadowIntensity
+ Vector4 Splits
+ Vector2 FadeInfo
+
+ Matrix4 LightViewProjectionMatrix0
+ Matrix4 LightViewProjectionMatrix1
+ Matrix4 LightViewProjectionMatrix2
+ Matrix4 LightViewProjectionMatrix3
+ //pointLight
+ Matrix4 LightViewProjectionMatrix4
+ Matrix4 LightViewProjectionMatrix5
+ Vector3 LightPos
+ Vector3 LightDir
+
+ Float PCFEdge
+
+ Float ShadowMapSize
+
+ Matrix4 ViewProjectionMatrixInverse
+ Vector4 ViewProjectionMatrixRow2
+
+ Int NumSamples
+ Int NumSamplesDepth
+ Texture2D Texture
+ Texture2D DepthTexture
+
+ // is VR instancing?
+ Matrix4 ViewProjectionMatrixInverseRight
+ Vector4 ViewProjectionMatrixRow2Right
+
+ Boolean BackfaceShadows: true
+ }
+
+ Technique {
+ VertexShader GLSL150: Common/MatDefs/VR/PostShadowFilter.vert
+ FragmentShader GLSL150: Common/MatDefs/VR/PostShadowFilter.frag
+
+ WorldParameters {
+ ResolutionInverse
+ }
+
+ Defines {
+ RESOLVE_MS : NumSamples
+ RESOLVE_DEPTH_MS : NumSamplesDepth
+ HARDWARE_SHADOWS : HardwareShadows
+ FILTER_MODE : FilterMode
+ PCFEDGE : PCFEdge
+ SHADOWMAP_SIZE : ShadowMapSize
+ FADE : FadeInfo
+ PSSM : Splits
+ POINTLIGHT : LightViewProjectionMatrix5
+ //if no shadow map don't render shadows
+ RENDER_SHADOWS : ShadowMap0
+ INSTANCING : ViewProjectionMatrixInverseRight
+ BACKFACE_SHADOWS : BackfaceShadows
+ }
+
+ }
+
+ Technique {
+ VertexShader GLSL100: Common/MatDefs/Shadow/PostShadowFilter.vert
+ FragmentShader GLSL100: Common/MatDefs/Shadow/PostShadowFilter.frag
+
+ WorldParameters {
+ ResolutionInverse
+ }
+
+ Defines {
+ HARDWARE_SHADOWS : HardwareShadows
+ FILTER_MODE : FilterMode
+ PCFEDGE : PCFEdge
+ SHADOWMAP_SIZE : ShadowMapSize
+ FADE : FadeInfo
+ PSSM : Splits
+ POINTLIGHT : LightViewProjectionMatrix5
+ INSTANCING : ViewProjectionMatrixInverseRight
+ BACKFACE_SHADOWS : BackfaceShadows
+ }
+
+ }
+
+
+
+
+}
\ No newline at end of file
diff --git a/jme3-vr/src/main/resources/Common/MatDefs/VR/PostShadowFilter.vert b/jme3-vr/src/main/resources/Common/MatDefs/VR/PostShadowFilter.vert
new file mode 100644
index 000000000..d8ffbbfcb
--- /dev/null
+++ b/jme3-vr/src/main/resources/Common/MatDefs/VR/PostShadowFilter.vert
@@ -0,0 +1,11 @@
+//#define VERTEX_SHADER
+#import "Common/ShaderLib/GLSLCompat.glsllib"
+
+attribute vec4 inPosition;
+attribute vec2 inTexCoord;
+varying vec2 texCoord;
+
+void main() {
+ gl_Position = vec4(inPosition.xy * 2.0 - 1.0, 0.0, 1.0);
+ texCoord = inTexCoord;
+}
\ No newline at end of file
diff --git a/jme3-vr/src/main/resources/Common/MatDefs/VR/Unshaded.frag b/jme3-vr/src/main/resources/Common/MatDefs/VR/Unshaded.frag
new file mode 100644
index 000000000..14217abc4
--- /dev/null
+++ b/jme3-vr/src/main/resources/Common/MatDefs/VR/Unshaded.frag
@@ -0,0 +1,21 @@
+//#define FRAGMENT_SHADER
+#import "Common/ShaderLib/GLSLCompat.glsllib"
+
+uniform vec4 m_Color;
+uniform sampler2D m_ColorMap;
+
+varying vec2 texCoord1;
+
+void main(){
+ vec4 color = vec4(1.0);
+
+ #ifdef HAS_COLORMAP
+ color *= texture2D(m_ColorMap, texCoord1);
+ #endif
+
+ #ifdef HAS_COLOR
+ color *= m_Color;
+ #endif
+
+ gl_FragColor = color;
+}
\ No newline at end of file
diff --git a/jme3-vr/src/main/resources/Common/MatDefs/VR/Unshaded.j3md b/jme3-vr/src/main/resources/Common/MatDefs/VR/Unshaded.j3md
new file mode 100644
index 000000000..81e1ebecc
--- /dev/null
+++ b/jme3-vr/src/main/resources/Common/MatDefs/VR/Unshaded.j3md
@@ -0,0 +1,45 @@
+MaterialDef Unshaded {
+
+ MaterialParameters {
+ Texture2D ColorMap
+ Color Color (Color)
+
+ // For VR instancing
+ Matrix4 RightEyeViewProjectionMatrix
+ }
+
+ Technique {
+ VertexShader GLSL150: Common/MatDefs/VR/Unshaded.vert
+ FragmentShader GLSL150: Common/MatDefs/VR/Unshaded.frag
+
+ WorldParameters {
+ WorldViewProjectionMatrix
+ ViewProjectionMatrix // needed for VR instancing
+ ViewMatrix
+ }
+
+ Defines {
+ INSTANCING : RightEyeViewProjectionMatrix // For VR instancing
+ HAS_COLORMAP : ColorMap
+ HAS_COLOR : Color
+ }
+ }
+
+ Technique {
+ VertexShader GLSL100: Common/MatDefs/VR/Unshaded.vert
+ FragmentShader GLSL100: Common/MatDefs/VR/Unshaded.frag
+
+ WorldParameters {
+ WorldViewProjectionMatrix
+ ViewProjectionMatrix // needed for VR instancing
+ ViewMatrix
+ }
+
+ Defines {
+ INSTANCING : RightEyeViewProjectionMatrix // For VR instancing
+ HAS_COLORMAP : ColorMap
+ HAS_COLOR : Color
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/jme3-vr/src/main/resources/Common/MatDefs/VR/Unshaded.vert b/jme3-vr/src/main/resources/Common/MatDefs/VR/Unshaded.vert
new file mode 100644
index 000000000..6e72b10e7
--- /dev/null
+++ b/jme3-vr/src/main/resources/Common/MatDefs/VR/Unshaded.vert
@@ -0,0 +1,27 @@
+//#define VERTEX_SHADER
+#import "Common/ShaderLib/GLSLCompat.glsllib"
+
+// import the following for VR instancing
+#import "Common/ShaderLib/InstanceVR.glsllib"
+
+attribute vec3 inPosition;
+
+#if defined(HAS_COLORMAP) || (defined(HAS_LIGHTMAP) && !defined(SEPARATE_TEXCOORD))
+ #define NEED_TEXCOORD1
+#endif
+
+attribute vec2 inTexCoord;
+attribute vec4 inColor;
+
+varying vec2 texCoord1;
+
+void main(){
+ #ifdef NEED_TEXCOORD1
+ texCoord1 = inTexCoord;
+ #endif
+
+ vec4 modelSpacePos = vec4(inPosition, 1.0);
+
+ // use the following transform function for VR instancing
+ gl_Position = TransformWorldViewProjectionVR(modelSpacePos);
+}
\ No newline at end of file
diff --git a/jme3-vr/src/main/resources/Common/MatDefs/VR/normal.frag b/jme3-vr/src/main/resources/Common/MatDefs/VR/normal.frag
new file mode 100644
index 000000000..16d32cedc
--- /dev/null
+++ b/jme3-vr/src/main/resources/Common/MatDefs/VR/normal.frag
@@ -0,0 +1,9 @@
+//#define FRAGMENT_SHADER
+#import "Common/ShaderLib/GLSLCompat.glsllib"
+
+varying vec3 normal;
+
+void main(void)
+{
+ gl_FragColor = vec4(normal.xy* 0.5 + 0.5,-normal.z* 0.5 + 0.5, 1.0);
+}
diff --git a/jme3-vr/src/main/resources/Common/MatDefs/VR/normal.vert b/jme3-vr/src/main/resources/Common/MatDefs/VR/normal.vert
new file mode 100644
index 000000000..3f590101f
--- /dev/null
+++ b/jme3-vr/src/main/resources/Common/MatDefs/VR/normal.vert
@@ -0,0 +1,19 @@
+//#define VERTEX_SHADER
+#import "Common/ShaderLib/GLSLCompat.glsllib"
+
+// import the following for VR instancing
+#import "Common/ShaderLib/InstanceVR.glsllib"
+
+attribute vec3 inPosition;
+attribute vec3 inNormal;
+
+varying vec3 normal;
+
+void main(void)
+{
+ vec4 modelSpacePos = vec4(inPosition, 1.0);
+ normal = normalize(TransformNormal(inNormal));
+
+ // use the following transform function for VR instancing
+ gl_Position = TransformWorldViewProjectionVR(modelSpacePos);
+}
\ No newline at end of file
diff --git a/jme3-vr/src/main/resources/Common/ShaderLib/InstanceVR.glsllib b/jme3-vr/src/main/resources/Common/ShaderLib/InstanceVR.glsllib
new file mode 100644
index 000000000..9294488af
--- /dev/null
+++ b/jme3-vr/src/main/resources/Common/ShaderLib/InstanceVR.glsllib
@@ -0,0 +1,121 @@
+// Instancing GLSL library. Modified for VR use.
+//
+// When the INSTANCING define is set in the shader,
+// all global matrices are replaced with "instanced" versions.
+// One exception is g_NormalMatrix which becomes unusable,
+// instead the function ApplyNormalTransform is used to transform
+// the normal and tangent vectors into world view space.
+
+// The world matrix and normal transform quaternion need to be passed
+// as vertex attributes "inWorldMatrix" and "inNormalRotationQuaternion"
+// respectively.
+// The VertexBuffers for those two attributes
+// need to be configured into instanced mode (VertexBuffer.setInstanced(true)).
+// - inWorldMatrix should have 12 * numInstances floats.
+// - inNormalRotationQuaternion should have 4 * numInstances.
+// Thus, instancing data occupies 4 vertex attributes (16 / 4 = 4).
+//
+// The GL_ARB_draw_instanced and GL_ARB_instanced_arrays extensions
+// are required (OGL 3.3).
+
+#if defined INSTANCING
+
+uniform mat4 g_ViewProjectionMatrix;
+uniform mat4 g_ViewMatrix;
+uniform mat4 m_RightEyeViewProjectionMatrix;
+
+// World Matrix + Normal Rotation Quaternion.
+// The World Matrix is the top 3 rows -
+// since the bottom row is always 0,0,0,1 for this transform.
+// The bottom row is the transpose of the inverse of WorldView Transform
+// as a quaternion. i.e. g_NormalMatrix converted to a quaternion.
+//
+// Using a quaternion instead of a matrix here allows saving approximately
+// 2 vertex attributes which now can be used for additional per-vertex data.
+attribute mat4 inInstanceData;
+
+// Extract the world matrix out of the instance data, leaving out the
+// quaternion at the end.
+mat4 worldMatrix = mat4(vec4(inInstanceData[0].xyz, 0.0),
+ vec4(inInstanceData[1].xyz, 0.0),
+ vec4(inInstanceData[2].xyz, 0.0),
+ vec4(inInstanceData[3].xyz, 1.0));
+
+vec4 TransformWorld(vec4 position)
+{
+ return (worldMatrix * position);
+}
+
+vec4 TransformWorldView(vec4 position)
+{
+ return g_ViewMatrix * TransformWorld(position);
+}
+
+vec4 TransformWorldViewProjection(vec4 position)
+{
+ return g_ViewProjectionMatrix * TransformWorld(position);
+}
+
+// VR specific variables
+const float EyeOffsetScale[2] = float[](-0.5, 0.5);
+const vec4 EyeClipEdge[2] = vec4[](vec4(-1.0,0.0,0.0,1.0), vec4(1.0,0.0,0.0,1.0));
+out float gl_ClipDistance[1];
+in int gl_InstanceID;
+
+vec4 TransformWorldViewProjectionVR(vec4 position)
+{
+ vec4 clipPos = (gl_InstanceID == 0 ? g_ViewProjectionMatrix : m_RightEyeViewProjectionMatrix) * TransformWorld(position);
+ gl_ClipDistance[0] = dot(clipPos, EyeClipEdge[gl_InstanceID]);
+ clipPos.x *= 0.5; // shrink to half of the screen
+ clipPos.x += EyeOffsetScale[gl_InstanceID] * clipPos.w; // scoot left or right.
+ return clipPos;
+}
+
+vec3 TransformNormal(vec3 vec)
+{
+ vec4 quat = vec4(inInstanceData[0].w, inInstanceData[1].w,
+ inInstanceData[2].w, inInstanceData[3].w);
+
+ vec3 worldNormal = vec + vec3(2.0) * cross(cross(vec, quat.xyz) + vec3(quat.w) * vec, quat.xyz);
+
+ return (g_ViewMatrix * vec4(worldNormal, 0.0)).xyz;
+}
+
+// Prevent user from using g_** matrices which will have invalid data in this case.
+#define g_WorldMatrix use_TransformWorld_not_gWorldMatrix
+#define g_WorldViewMatrix use_TransformWorldView_not_gWorldMatrix
+#define g_WorldViewProjectionMatrix use_TransformWorldViewProjectionVR_not_gWorldViewProjectionMatrix
+#define g_NormalMatrix use_TransformNormal_not_gNormalMatrix
+
+#else
+
+uniform mat4 g_WorldMatrix;
+uniform mat4 g_WorldViewMatrix;
+uniform mat4 g_WorldViewProjectionMatrix;
+uniform mat3 g_NormalMatrix;
+
+vec4 TransformWorld(vec4 position)
+{
+ return g_WorldMatrix * position;
+}
+
+vec4 TransformWorldView(vec4 position)
+{
+ return g_WorldViewMatrix * position;
+}
+
+vec4 TransformWorldViewProjection(vec4 position)
+{
+ return g_WorldViewProjectionMatrix * position;
+}
+
+vec4 TransformWorldViewProjectionVR(vec4 position)
+{
+ return g_WorldViewProjectionMatrix * position;
+}
+
+vec3 TransformNormal(vec3 normal) {
+ return g_NormalMatrix * normal;
+}
+
+#endif
diff --git a/jme3-vr/src/main/resources/darwin/libopenvr_api.dylib.dSYM/Contents/Info.plist b/jme3-vr/src/main/resources/darwin/libopenvr_api.dylib.dSYM/Contents/Info.plist
new file mode 100644
index 000000000..60ac3d69b
--- /dev/null
+++ b/jme3-vr/src/main/resources/darwin/libopenvr_api.dylib.dSYM/Contents/Info.plist
@@ -0,0 +1,20 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ English
+ CFBundleIdentifier
+ com.apple.xcode.dsym.libopenvr_api.dylib
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundlePackageType
+ dSYM
+ CFBundleSignature
+ ????
+ CFBundleShortVersionString
+ 1.0
+ CFBundleVersion
+ 1
+
+
diff --git a/jme3-vr/src/main/resources/darwin/libopenvr_api.dylib.dSYM/libopenvr_api.dylib.dSYM/Contents/Info.plist b/jme3-vr/src/main/resources/darwin/libopenvr_api.dylib.dSYM/libopenvr_api.dylib.dSYM/Contents/Info.plist
new file mode 100644
index 000000000..60ac3d69b
--- /dev/null
+++ b/jme3-vr/src/main/resources/darwin/libopenvr_api.dylib.dSYM/libopenvr_api.dylib.dSYM/Contents/Info.plist
@@ -0,0 +1,20 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ English
+ CFBundleIdentifier
+ com.apple.xcode.dsym.libopenvr_api.dylib
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundlePackageType
+ dSYM
+ CFBundleSignature
+ ????
+ CFBundleShortVersionString
+ 1.0
+ CFBundleVersion
+ 1
+
+
diff --git a/jme3-vr/src/main/resources/linux-x86-64/libopenvr_api.so.dbg b/jme3-vr/src/main/resources/linux-x86-64/libopenvr_api.so.dbg
new file mode 100644
index 000000000..ca9c9af89
Binary files /dev/null and b/jme3-vr/src/main/resources/linux-x86-64/libopenvr_api.so.dbg differ
diff --git a/jme3-vr/src/main/resources/linux-x86/libopenvr_api.so.dbg b/jme3-vr/src/main/resources/linux-x86/libopenvr_api.so.dbg
new file mode 100644
index 000000000..a26ac1c1f
Binary files /dev/null and b/jme3-vr/src/main/resources/linux-x86/libopenvr_api.so.dbg differ
diff --git a/jme3-vr/src/main/resources/win32-x86-64/LICENSE.txt b/jme3-vr/src/main/resources/win32-x86-64/LICENSE.txt
new file mode 100644
index 000000000..ee83337d7
--- /dev/null
+++ b/jme3-vr/src/main/resources/win32-x86-64/LICENSE.txt
@@ -0,0 +1,27 @@
+Copyright (c) 2015, Valve Corporation
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions and the following disclaimer in the documentation and/or
+other materials provided with the distribution.
+
+3. Neither the name of the copyright holder nor the names of its contributors
+may be used to endorse or promote products derived from this software without
+specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/jme3-vr/src/main/resources/win32-x86-64/openvr_api.pdb b/jme3-vr/src/main/resources/win32-x86-64/openvr_api.pdb
new file mode 100644
index 000000000..8a2095e9a
Binary files /dev/null and b/jme3-vr/src/main/resources/win32-x86-64/openvr_api.pdb differ
diff --git a/jme3-vr/src/main/resources/win32-x86/openvr_api.pdb b/jme3-vr/src/main/resources/win32-x86/openvr_api.pdb
new file mode 100644
index 000000000..a2c9adc39
Binary files /dev/null and b/jme3-vr/src/main/resources/win32-x86/openvr_api.pdb differ
diff --git a/settings.gradle b/settings.gradle
index 36e8b58f4..e6298b482 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -17,6 +17,7 @@ include 'jme3-jogl'
include 'jme3-lwjgl'
if (JavaVersion.current().isJava8Compatible()) {
include 'jme3-lwjgl3'
+ include 'jme3-vr'
}
// Other external dependencies