Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ClientKit/ClientKit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<Compile Include="Interface.cs" />
<Compile Include="ClientReportTypes.cs" />
<Compile Include="Pose3.cs" />
<Compile Include="SkeletonInterface.cs" />
<Compile Include="Vec2.cs" />
<Compile Include="Vec3.cs" />
<Compile Include="Quaternion.cs" />
Expand Down
69 changes: 67 additions & 2 deletions ClientKit/Interface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,27 @@ override protected bool ReleaseHandle()
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void NaviPositionCallback(IntPtr /*void*/ userdata, ref TimeValue timestamp, ref NaviPositionReport report);

[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void SkeletonJointCallback(IntPtr /*void*/ userdata, ref TimeValue timestamp, ref SkeletonJointReport report);

[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void SkeletonTrimmedCallback(IntPtr /*void*/ userdata, ref TimeValue timestamp, ref SkeletonTrimmedReport report);

[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void SkeletonWholeCallback(IntPtr /*void*/ userdata, ref TimeValue timestamp, ref SkeletonWholeReport report);

[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void SkeletonHandCallback(IntPtr /*void*/ userdata, ref TimeValue timestamp, ref SkeletonHandReport report);

[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void SkeletonArmCallback(IntPtr /*void*/ userdata, ref TimeValue timestamp, ref SkeletonArmReport report);

[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void SkeletonFootCallback(IntPtr /*void*/ userdata, ref TimeValue timestamp, ref SkeletonFootReport report);

[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void SkeletonLegCallback(IntPtr /*void*/ userdata, ref TimeValue timestamp, ref SkeletonLegReport report);

/// @brief Interface handle object. Typically acquired from a ClientContext.
/// @ingroup ClientKitCPP
public class Interface : IDisposable
Expand All @@ -95,7 +116,7 @@ public class Interface : IDisposable
//typedef struct OSVR_ClientInterfaceObject *OSVR_ClientInterface;
//typedef char OSVR_ReturnCode; (0 == OSVR_RETURN_SUCCESS; 1 == OSVR_RETURN_FAILURE)


// Callbacks
[DllImport(OSVR_CORE_DLL, CallingConvention = CallingConvention.Cdecl)]
public extern static Byte osvrRegisterPositionCallback(SafeClientInterfaceHandle iface, [MarshalAs(UnmanagedType.FunctionPtr)] PositionCallback cb, IntPtr /*void**/ userdata);

Expand Down Expand Up @@ -136,8 +157,27 @@ public class Interface : IDisposable
public extern static Byte osvrRegisterNaviPositionCallback(SafeClientInterfaceHandle iface, [MarshalAs(UnmanagedType.FunctionPtr)] NaviPositionCallback cb, IntPtr /*void*/ userdata);

[DllImport(OSVR_CORE_DLL, CallingConvention = CallingConvention.Cdecl)]
public extern static Byte osvrClientGetInterface(SafeClientContextHandle ctx, string path, ref SafeClientInterfaceHandle iface);
public extern static Byte osvrRegisterSkeletonJointCallback(SafeClientInterfaceHandle iface, [MarshalAs(UnmanagedType.FunctionPtr)] SkeletonJointCallback cb, IntPtr /*void*/ userdata);

[DllImport(OSVR_CORE_DLL, CallingConvention = CallingConvention.Cdecl)]
public extern static Byte osvrRegisterSkeletonTrimmedCallback(SafeClientInterfaceHandle iface, [MarshalAs(UnmanagedType.FunctionPtr)] SkeletonTrimmedCallback cb, IntPtr /*void*/ userdata);

[DllImport(OSVR_CORE_DLL, CallingConvention = CallingConvention.Cdecl)]
public extern static Byte osvrRegisterSkeletonWholeCallback(SafeClientInterfaceHandle iface, [MarshalAs(UnmanagedType.FunctionPtr)] SkeletonWholeCallback cb, IntPtr /*void*/ userdata);

[DllImport(OSVR_CORE_DLL, CallingConvention = CallingConvention.Cdecl)]
public extern static Byte osvrRegisterSkeletonHandCallback(SafeClientInterfaceHandle iface, [MarshalAs(UnmanagedType.FunctionPtr)] SkeletonHandCallback cb, IntPtr /*void*/ userdata);

[DllImport(OSVR_CORE_DLL, CallingConvention = CallingConvention.Cdecl)]
public extern static Byte osvrRegisterSkeletonArmCallback(SafeClientInterfaceHandle iface, [MarshalAs(UnmanagedType.FunctionPtr)] SkeletonArmCallback cb, IntPtr /*void*/ userdata);

[DllImport(OSVR_CORE_DLL, CallingConvention = CallingConvention.Cdecl)]
public extern static Byte osvrRegisterSkeletonFootCallback(SafeClientInterfaceHandle iface, [MarshalAs(UnmanagedType.FunctionPtr)] SkeletonFootCallback cb, IntPtr /*void*/ userdata);

[DllImport(OSVR_CORE_DLL, CallingConvention = CallingConvention.Cdecl)]
public extern static Byte osvrRegisterSkeletonLegCallback(SafeClientInterfaceHandle iface, [MarshalAs(UnmanagedType.FunctionPtr)] SkeletonLegCallback cb, IntPtr /*void*/ userdata);

// state functions
[DllImport(OSVR_CORE_DLL, CallingConvention = CallingConvention.Cdecl)]
public extern static Byte osvrGetPoseState(SafeClientInterfaceHandle iface, ref TimeValue timestamp, ref Pose3 state);

Expand Down Expand Up @@ -174,6 +214,31 @@ public class Interface : IDisposable
[DllImport(OSVR_CORE_DLL, CallingConvention = CallingConvention.Cdecl)]
public extern static Byte osvrGetNaviPositionState(SafeClientInterfaceHandle iface, ref TimeValue timestamp, ref Vec2 state);

[DllImport(OSVR_CORE_DLL, CallingConvention = CallingConvention.Cdecl)]
public extern static Byte osvrGetSkeletonJointState(SafeClientInterfaceHandle iface, ref TimeValue timestamp, ref SkeletonJointState state);

[DllImport(OSVR_CORE_DLL, CallingConvention = CallingConvention.Cdecl)]
public extern static Byte osvrGetSkeletonTrimmedState(SafeClientInterfaceHandle iface, ref TimeValue timestamp, ref SkeletonTrimmedState state);

[DllImport(OSVR_CORE_DLL, CallingConvention = CallingConvention.Cdecl)]
public extern static Byte osvrGetSkeletonWholeState(SafeClientInterfaceHandle iface, ref TimeValue timestamp, ref SkeletonWholeState state);

[DllImport(OSVR_CORE_DLL, CallingConvention = CallingConvention.Cdecl)]
public extern static Byte osvrGetSkeletonHandState(SafeClientInterfaceHandle iface, ref TimeValue timestamp, ref SkeletonHandState state);

[DllImport(OSVR_CORE_DLL, CallingConvention = CallingConvention.Cdecl)]
public extern static Byte osvrGetSkeletonArmState(SafeClientInterfaceHandle iface, ref TimeValue timestamp, ref SkeletonArmState state);

[DllImport(OSVR_CORE_DLL, CallingConvention = CallingConvention.Cdecl)]
public extern static Byte osvrGetSkeletonFootState(SafeClientInterfaceHandle iface, ref TimeValue timestamp, ref SkeletonFootState state);

[DllImport(OSVR_CORE_DLL, CallingConvention = CallingConvention.Cdecl)]
public extern static Byte osvrGetSkeletonLegState(SafeClientInterfaceHandle iface, ref TimeValue timestamp, ref SkeletonLegState state);

// other functions
[DllImport(OSVR_CORE_DLL, CallingConvention = CallingConvention.Cdecl)]
public extern static Byte osvrClientGetInterface(SafeClientContextHandle ctx, string path, ref SafeClientInterfaceHandle iface);

[DllImport(OSVR_CORE_DLL, CallingConvention = CallingConvention.Cdecl)]
public extern static Byte osvrClientFreeInterface(IntPtr iface);

Expand Down
Loading