Skip to main content
Up and Coming
April 5, 2013

Java Wrapper. First Version!

Hi There,
As a first note: I don't have my rift yet, so I have been writing this Java wrapper for the OR blindly. I would be cool if someone with a Rift and interest in Java could test it out:
https://dl.dropbox.com/u/8241387/OVR/JRift_alpha.zip

It is compiled for a 32-bit Java Runtime. And you can just call the contained JRift.bat to make it start a loop to read from the Rift sensors:

OculusRift or = new OculusRift();
or.init();

HMDInfo hmdInfo = or.getHMDInfo();
System.out.println(hmdInfo);

while (or.isInitialized()) {
or.poll();

System.out.println("Yaw: " + or.getYaw() + " Pitch: " + or.getPitch() + " Roll: " + or.getRoll());

try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
}

or.destroy();


Any comment is welcome.

Cheers,
Daniel

    43 replies

    Up and Coming
    April 5, 2013
    Thanks for your efforts. I'm going to need this too as soon as I get my dev kit.
    Up and Coming
    April 5, 2013
    Nice now this will pave the way for making Minecraft work with the Rift! wow thatd be awesome if by the time i get the Rift someone would have it working :-D wheee! Minecraft really is one of my favorite games as how open and creative it can be and how fun it is just exploring other servers online :-).
    Up and Coming
    April 5, 2013
    Sweet, so this is a JNI bridge to the oculus SDK source?
    "It's like Homeworld in first person." Disable Aero and vSync for a completely simulator sickness free experience with 2xHz FPS. Keep the config utility open for tracking to work.
    Participant
    April 6, 2013
    Would be nice if this had the source with it :roll:
    38leinaDAuthor
    Up and Coming
    April 6, 2013
    You are right. Might even be easier to get it working if you have the sources.
    https://github.com/38leinaD/JRift

    Cheers,
    Daniel
    Participant
    April 8, 2013
    "38leinaD" wrote:
    You are right. Might even be easier to get it working if you have the sources.
    https://github.com/38leinaD/JRift

    Cheers,
    Daniel

    Thanks for delivering! It appears you have forgotten a license. I hope you consider a BSD style one. :)
    Inspiring
    April 9, 2013
    Awesome!
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    Participant
    April 14, 2013
    Really sweet stuff!

    I've begun using some of your things to implement Rift support for jMonkeyEngine.

    Cheers,
    Rickard
    "The television screen has become the retina of the minds eye."
    38leinaDAuthor
    Up and Coming
    May 1, 2013
    As i did not get any feedback before and now my rift arrived, I was able to test what I have been coding. So, the head tracking data is actually returned correctly; as well as the HDMInfo. So, if you want to tinker with the Rift in Java (e.g. LWJGL or JMonkey): let me know if works for you as well.

    cheers,
    daniel
    Participant
    May 2, 2013
    I would have loved to test it out, but i will have to wait until my 49xxx order arrives :P
    In the end, i went about and created my own JNI. A great learning experience, both for c++ and the oculus sdk.

    I'll probably lay low for a bit since it'll take quite some time before i can do some testing anyway.
    "The television screen has become the retina of the minds eye."