The RiftDotNet code looks amazing and very complete, but I also didn't want the dependency toward SharpDx.
So I did a very barebone DLL and C# wrapper, just to extract the HMD orientation.
You can get the code (or contribute) at:
https://github.com/davyloots/riftsharp
I didn't include the actual LibOVR code project from the Oculus SDK because I'm not sure about the licensing, so you'll need to import that lib project before compiling.
If you just want to use it, here's a compiled version:
http://rcdeskpilot.com/system/files/RiftSharp.zip
The RiftSharpDll.dll is the C++ dll, RiftSharp.dll is the wrapper assembly. Just add a reference to that last one and copy the C++ dll to your binary folder.
Code use is as folows:
Code: Select all
using RiftSharp;
//.....
YawPitchRoll ypr = Hmd.Instance.YawPitchRoll;
float yaw=ypr.Yaw;
This is just a quick implementation, not even error handling is present. I'm not a very competent coder, so use at your own risk
.