aboutsummaryrefslogtreecommitdiff
path: root/include/libsurvive/poser.h
diff options
context:
space:
mode:
authorCNLohr <charles@cnlohr.com>2018-03-12 12:29:14 -0400
committerGitHub <noreply@github.com>2018-03-12 12:29:14 -0400
commite456a3ec1b0e1f04d55cdad7d95898f20bd26c89 (patch)
treec651c71625a8dbecc0b8293a1701a648eb836984 /include/libsurvive/poser.h
parent7fadeeff29074520224be385ecd6c50271a07220 (diff)
parentee0fd0be34cd6715b704be534b7e97087905571f (diff)
downloadlibsurvive-e456a3ec1b0e1f04d55cdad7d95898f20bd26c89.tar.gz
libsurvive-e456a3ec1b0e1f04d55cdad7d95898f20bd26c89.tar.bz2
Merge pull request #112 from cnlohr/poser_callbacks
Poser callbacks
Diffstat (limited to 'include/libsurvive/poser.h')
-rw-r--r--include/libsurvive/poser.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/include/libsurvive/poser.h b/include/libsurvive/poser.h
index 582590e..57a8599 100644
--- a/include/libsurvive/poser.h
+++ b/include/libsurvive/poser.h
@@ -17,15 +17,23 @@ typedef enum PoserType_t
POSERDATA_DISASSOCIATE, //If you get this, it doesn't contain data. It just tells you to please disassociate from the current SurviveObject and delete your poserdata.
} PoserType;
+typedef void (*poser_raw_pose_func)(SurviveObject *so, uint8_t lighthouse, FLT *pose, void *user);
+typedef void (*poser_lighthouse_pose_func)(SurviveObject *so, uint8_t lighthouse, SurvivePose *pose, void *user);
+
typedef struct
{
PoserType pt;
- uint8_t data[0];
+ poser_raw_pose_func rawposeproc;
+ poser_lighthouse_pose_func lighthouseposeproc;
+ void *userdata;
} PoserData;
+void PoserData_poser_raw_pose_func(PoserData *poser_data, SurviveObject *so, uint8_t lighthouse, FLT *pose);
+void PoserData_lighthouse_pose_func(PoserData *poser_data, SurviveObject *so, uint8_t lighthouse, SurvivePose *pose);
+
typedef struct
{
- PoserType pt;
+ PoserData hdr;
uint8_t datamask; //0 = accel present, 1 = gyro present, 2 = mag present.
FLT accel[3];
FLT gyro[3];
@@ -35,7 +43,7 @@ typedef struct
typedef struct
{
- PoserType pt;
+ PoserData hdr;
int sensor_id;
int acode; //OOTX Code associated with this sweep. bit 1 indicates vertical(1) or horizontal(0) sweep
int lh; //Lighthouse making this sweep
@@ -46,7 +54,7 @@ typedef struct
typedef struct
{
- PoserType pt;
+ PoserData hdr;
//If "lengths[...]" < 0, means not a valid piece of sweep information.
FLT lengths[SENSORS_PER_OBJECT][NUM_LIGHTHOUSES][2];