Skip to main content
Inspiring
July 28, 2014

JOVR 0.4.2.0: Java/Maven bindings for 0.4.2 (Updated 09-05)

I've updated my Java bindings for SDK 0.4.2. The source code can be found on Github here. Example code can be found here.

Developers using Maven (or a Maven compatible tool like Gradle) can declare a dependency on the following artifact:


<dependency>
<groupId>org.saintandreas</groupId>
<artifactId>jovr</artifactId>
<version>0.4.2.0</version>
</dependency>


Update 2014-09-05: Release of 0.4.2.0
Changes since 0.4.2.0

  • Updated binaries to SDK 0.4.2

  • Added new HQ distortion flag (currently non-functional in OpenGL)


Update 2014-09-03: Release of 0.4.1.2
Changes since 0.4.1.1

  • Added function to enable/disable HSW rendering by the SDK

Update 2014-08-15: Release of 0.4.1.1
Changes since 0.4.1.0

  • The windows binaries were being built in release mode, but had some debug preprocessor macros enabled, so any asserts you hit would crash the application.


Known issues are unchanged.

Update 2014-08-13: Release of 0.4.1.0

Changes since 0.4.0.1

  • Added ovr_InitializeRenderingShim method to the OvrLibrary type.

  • Updated windows binaries to 0.4.1 SDK

  • Added Mac binaries


Known issues

  • Health and safety warning doesn't display properly for me on OSX

  • Continued issues with OpenGL and Direct HMD mode. I recommend using extended mode for the time being if you're having issues.

  • Judder issues are prominent in OpenGL in all my tests. I recommend running your headset @60Hz until Oculus or the video card manufacturers do whatever is required to resolve the problem.


Update 2014-08-11: Release of 0.4.0.1

Changes since 0.4.0.0

  • Renamed the HmdDesc type to Hmd to more closely match the SDK naming

  • Added some missing functions to Hmd required for client side distortion

  • Added some missing function to Hmd for health and safety warning management

  • Added some missing override annotations


Known issues

  • Unfortunately, like the current SDK release, they are windows only. I've built both the 64 bit and 32 bit DLL versions and they're embedded in the jar file.

  • I've been unable to get OpenGL to work properly with Direct HMD mode. I recommend using extended mode for the time being if you're having issues.

    52 replies

    jhericoAuthor
    Inspiring
    August 4, 2014
    If you're getting exceptions on calling endFrame() you need to make sure that you've validated the values you're passing into endFrame() (are they sane?) and that you've successfully called configureRendering() after creating the OpenGL context but before trying to execute distortion.
    Brad Davis - Developer for High Fidelity Co-author of Oculus Rift in Action
    Up and Coming
    August 4, 2014
    "jherico" wrote:
    If you're getting exceptions on calling endFrame() you need to make sure that you've validated the values you're passing into endFrame() (are they sane?) and that you've successfully called configureRendering() after creating the OpenGL context but before trying to execute distortion.


    I tried at the begin, but I get an exception with your Matrix stack complaining about major/minor version being not compatible.. (damn, I cant reproduce it right now)
    jhericoAuthor
    Inspiring
    August 4, 2014
    "elect" wrote:
    I tried at the begin, but I get an exception with your Matrix stack complaining about major/minor version being not compatible.. (damn, I cant reproduce it right now)


    Make sure you're not attempting to work with DirectHMD mode. I've been completely unable to get any OpenGL code working with DirectHMD.
    Brad Davis - Developer for High Fidelity Co-author of Oculus Rift in Action
    Up and Coming
    August 5, 2014
    "elect" wrote:
    "jherico" wrote:
    If you're getting exceptions on calling endFrame() you need to make sure that you've validated the values you're passing into endFrame() (are they sane?) and that you've successfully called configureRendering() after creating the OpenGL context but before trying to execute distortion.


    I tried at the begin, but I get an exception with your Matrix stack complaining about major/minor version being not compatible.. (damn, I cant reproduce it right now)


    Ok, I get this

    Exception in thread "main-AWTAnimator" java.lang.UnsupportedClassVersionError: org/saintandreas/gl/MatrixStack : Unsupported major.minor version 52.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at joglus.example.GlViewer.display(GlViewer.java:264)
    at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:649)
    at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:633)
    at jogamp.opengl.GLAutoDrawableBase$2.run(GLAutoDrawableBase.java:399)
    at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1103)
    at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:978)
    at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:610)
    at com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:75)
    at com.jogamp.opengl.util.AnimatorBase.display(AnimatorBase.java:416)
    at com.jogamp.opengl.util.Animator$MainLoop.run(Animator.java:188)
    at java.lang.Thread.run(Thread.java:744)


    Whenever I try to use MatrixStack
    Up and Coming
    August 5, 2014
    "jherico" wrote:
    If you're getting exceptions on calling endFrame() you need to make sure that you've validated the values you're passing into endFrame() (are they sane?) and that you've successfully called configureRendering() after creating the OpenGL context but before trying to execute distortion.


    hmdDesc.endFrame(poses, eyeTextures);

    poses is valid, (I also tried to write simple values, such as orientation identity and position origin)

    eyeTextures as well, I get two integers 1 and 3

    configureRendering() is called in the init()... but how can I check if it successful or not?

    I am using Extended Desktop

    I guess the problem comes somewhere else... I even get the memory exception when I call

    HmdDesc.shutdown();

    in the dispose(), commenting out the begin/endFrame
    Up and Coming
    August 7, 2014
    How can I access data in the DistortionMesh?

    Edit: I guess I made it

    Structure[] structures = new Structure[meshData.VertexCount];
    data.toArray(structures);

    short[] indicesData = meshData.pIndexData.getPointer().getShortArray(0, meshData.IndexCount);


    Ps: what about ovrHmd_GetRenderScaleAndOffset?
    New Participant
    August 9, 2014
    Hi, I cant seem to find a prebuilt .jar file, and I have problems building from source as I am not familiar with Maven. Could you add the .jar file to the repo, or put it up somewhere else?
    jhericoAuthor
    Inspiring
    August 9, 2014
    The jars are available in the Maven repository, from which you can download it directly:

    http://repo1.maven.org/maven2/org/saintandreas/jovr/0.4.0.0/
    Brad Davis - Developer for High Fidelity Co-author of Oculus Rift in Action
    jhericoAuthor
    Inspiring
    August 9, 2014
    "elect" wrote:
    Ps: what about ovrHmd_GetRenderScaleAndOffset?


    Looks like some of the client side distortion items were missed in the Hmd class. I'll fix that in the next revision. In the meantime you can still access it directly through the OvrLibrary interface.
    Brad Davis - Developer for High Fidelity Co-author of Oculus Rift in Action
    New Participant
    August 10, 2014
    "jherico" wrote:
    The jars are available in the Maven repository, from which you can download it directly:

    http://repo1.maven.org/maven2/org/saintandreas/jovr/0.4.0.0/



    Thanks :)

    Great work btw. Now I'm able to send the tracking data to the web browser using Websockets in Java so that I can integrate the Oculus with Three.js.