aboutsummaryrefslogtreecommitdiff
path: root/bindings/cs/libsurvive.net/cfunctions.cs
diff options
context:
space:
mode:
authordpeter99 <dpeter99@gmail.com>2018-04-01 18:58:19 +0200
committerJustin Berger <j.david.berger@gmail.com>2018-04-02 00:11:42 -0600
commit0eea189db82fc72463a83a678d9b8d609fd09c6e (patch)
tree80270558b48c6f40ff0f2deb5cae0fda3dab3353 /bindings/cs/libsurvive.net/cfunctions.cs
parentc05e42e756e8e1560adc22aacde87dbdf2e02b45 (diff)
downloadlibsurvive-0eea189db82fc72463a83a678d9b8d609fd09c6e.tar.gz
libsurvive-0eea189db82fc72463a83a678d9b8d609fd09c6e.tar.bz2
Added the API file from Unity
Diffstat (limited to 'bindings/cs/libsurvive.net/cfunctions.cs')
-rw-r--r--bindings/cs/libsurvive.net/cfunctions.cs35
1 files changed, 17 insertions, 18 deletions
diff --git a/bindings/cs/libsurvive.net/cfunctions.cs b/bindings/cs/libsurvive.net/cfunctions.cs
index 67812f5..ab5f7fd 100644
--- a/bindings/cs/libsurvive.net/cfunctions.cs
+++ b/bindings/cs/libsurvive.net/cfunctions.cs
@@ -12,23 +12,16 @@ namespace libsurvive
[StructLayout(LayoutKind.Sequential)]
public class SurvivePose
{
- [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
+ [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public double[] Pos; // Position in the form xyz
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
- public double[] Rot; // Quaternion in the form wxyz
- }
-
- [StructLayout(LayoutKind.Sequential)]
- public class SurviveObject
- {
- [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
- public char[] codename; //3 letters, null-terminated. Currently HMD, WM0, WM1.
+ public double[] Rot; // Quaternion in the form wxyz
}
class cfunctions
{
-//#pragma warning disable IDE1006 // Naming Styles
- [DllImport("libsurvive", CallingConvention = CallingConvention.StdCall, EntryPoint = "survive_init_internal") ]
+ //#pragma warning disable IDE1006 // Naming Styles
+ [DllImport("libsurvive", CallingConvention = CallingConvention.StdCall, EntryPoint = "survive_init_internal")]
public static extern SurviveContextPtr Survive_init_internal(int argc, string[] args);
[DllImport("libsurvive", CallingConvention = CallingConvention.StdCall, EntryPoint = "survive_close")]
@@ -95,26 +88,32 @@ namespace libsurvive
[DllImport("libsurvive", CallingConvention = CallingConvention.StdCall, EntryPoint = "survive_object_codename")]
- public static extern char Survive_object_codename(SurviveObjectPtr so);
+ public static extern string Survive_object_codename(SurviveObjectPtr so);
[DllImport("libsurvive", CallingConvention = CallingConvention.StdCall, EntryPoint = "survive_object_drivername")]
- public static extern char Survive_object_drivername(SurviveObject so);
+ public static extern char Survive_object_drivername(SurviveObjectPtr so);
[DllImport("libsurvive", CallingConvention = CallingConvention.StdCall, EntryPoint = "survive_object_charge")]
- public static extern byte Survive_object_charge(SurviveObject so);
+ public static extern byte Survive_object_charge(SurviveObjectPtr so);
[DllImport("libsurvive", CallingConvention = CallingConvention.StdCall, EntryPoint = "survive_object_charging")]
- public static extern bool Survive_object_charging(SurviveObject so);
+ public static extern bool Survive_object_charging(SurviveObjectPtr so);
[DllImport("libsurvive", CallingConvention = CallingConvention.StdCall, EntryPoint = "survive_object_pose")]
- public static extern SurvivePose Survive_object_pose(SurviveObject so);
+ public static extern SurvivePose Survive_object_pose(SurviveObjectPtr so);
+
[DllImport("libsurvive", CallingConvention = CallingConvention.StdCall, EntryPoint = "survive_object_sensor_locations")]
- public static extern int Survive_object_sensor_locations(SurviveObjectPtr so);
+ public static extern double[] Survive_object_sensor_locations(SurviveObjectPtr so);
[DllImport("libsurvive", CallingConvention = CallingConvention.StdCall, EntryPoint = "survive_object_sensor_normals")]
- public static extern int Survive_object_sensor_normals(SurviveObjectPtr so);
+ public static extern double[] Survive_object_sensor_normals(SurviveObjectPtr so);
+
+
+
+ [DllImport("libsurvive", CallingConvention = CallingConvention.StdCall, EntryPoint = "survive_get_so_by_name")]
+ public static extern IntPtr Survive_get_so_by_name(IntPtr ctx, string name);
//#pragma warning restore IDE1006 // Naming Styles
}