Minimal C# wrapper
Hi,
To start, there is a very complete and beautifully written C# wrapper available at https://github.com/SiS-Shadowman/RiftDotNet written by SiSShadowman.
Since I just needed the HMD orientation and didn't want the dependency towards SharpDx, I created a minimal C++ dll and C# assembly. It just fetches 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:
This is just a quick implementation, not even error handling is present. I'm not a very competent coder and my C++ is very rusty, so use at your own risk ;) .
To start, there is a very complete and beautifully written C# wrapper available at https://github.com/SiS-Shadowman/RiftDotNet written by SiSShadowman.
Since I just needed the HMD orientation and didn't want the dependency towards SharpDx, I created a minimal C++ dll and C# assembly. It just fetches 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:
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 and my C++ is very rusty, so use at your own risk ;) .
