aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bindings/cs/libsurvive.net/cfunctions.cs24
-rw-r--r--include/libsurvive/survive.h7
-rw-r--r--src/survive.c16
3 files changed, 43 insertions, 4 deletions
diff --git a/bindings/cs/libsurvive.net/cfunctions.cs b/bindings/cs/libsurvive.net/cfunctions.cs
index 6715a36..67812f5 100644
--- a/bindings/cs/libsurvive.net/cfunctions.cs
+++ b/bindings/cs/libsurvive.net/cfunctions.cs
@@ -94,7 +94,29 @@ namespace libsurvive
public static extern int Survive_default_htc_config_process(SurviveObjectPtr so, string ct0conf, int len);
-//#pragma warning restore IDE1006 // Naming Styles
+ [DllImport("libsurvive", CallingConvention = CallingConvention.StdCall, EntryPoint = "survive_object_codename")]
+ public static extern char Survive_object_codename(SurviveObjectPtr so);
+
+
+ [DllImport("libsurvive", CallingConvention = CallingConvention.StdCall, EntryPoint = "survive_object_drivername")]
+ public static extern char Survive_object_drivername(SurviveObject so);
+
+ [DllImport("libsurvive", CallingConvention = CallingConvention.StdCall, EntryPoint = "survive_object_charge")]
+ public static extern byte Survive_object_charge(SurviveObject so);
+
+ [DllImport("libsurvive", CallingConvention = CallingConvention.StdCall, EntryPoint = "survive_object_charging")]
+ public static extern bool Survive_object_charging(SurviveObject so);
+
+ [DllImport("libsurvive", CallingConvention = CallingConvention.StdCall, EntryPoint = "survive_object_pose")]
+ public static extern SurvivePose Survive_object_pose(SurviveObject so);
+
+ [DllImport("libsurvive", CallingConvention = CallingConvention.StdCall, EntryPoint = "survive_object_sensor_locations")]
+ public static extern int 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);
+
+ //#pragma warning restore IDE1006 // Naming Styles
}
diff --git a/include/libsurvive/survive.h b/include/libsurvive/survive.h
index 7248b1c..8a4183e 100644
--- a/include/libsurvive/survive.h
+++ b/include/libsurvive/survive.h
@@ -120,6 +120,13 @@ struct SurviveObject {
// These exports are mostly for language binding against
SURVIVE_EXPORT const char *survive_object_codename(SurviveObject *so);
+
+SURVIVE_EXPORT const char *survive_object_drivername(SurviveObject *so);
+SURVIVE_EXPORT const int8_t *survive_object_charge(SurviveObject *so);
+SURVIVE_EXPORT const bool *survive_object_charging(SurviveObject *so);
+
+SURVIVE_EXPORT const SurvivePose *survive_object_pose(SurviveObject *so);
+
SURVIVE_EXPORT int8_t survive_object_sensor_ct(SurviveObject *so);
SURVIVE_EXPORT const FLT *survive_object_sensor_locations(SurviveObject *so);
SURVIVE_EXPORT const FLT *survive_object_sensor_normals(SurviveObject *so);
diff --git a/src/survive.c b/src/survive.c
index 2a7aad1..e4015de 100644
--- a/src/survive.c
+++ b/src/survive.c
@@ -559,9 +559,19 @@ int survive_simple_inflate(struct SurviveContext *ctx, const char *input, int in
return len;
}
+
+
+#endif
+
+
const char *survive_object_codename(SurviveObject *so) { return so->codename; }
+
+const char *survive_object_drivername(SurviveObject *so) { return so->drivername; }
+const int8_t *survive_object_charge(SurviveObject *so) { return so->charge; }
+const bool *survive_object_charging(SurviveObject *so) { return so->charging; }
+
+const SurvivePose *survive_object_pose(SurviveObject *so) { return &so->OutPose; }
+
int8_t survive_object_sensor_ct(SurviveObject *so) { return so->sensor_ct; }
const FLT *survive_object_sensor_locations(SurviveObject *so) { return so->sensor_locations; }
-const FLT *survive_object_sensor_normals(SurviveObject *so) { return so->sensor_normals; }
-
-#endif
+const FLT *survive_object_sensor_normals(SurviveObject *so) { return so->sensor_normals; } \ No newline at end of file