diff options
author | cnlohr <lohr85@gmail.com> | 2017-03-08 01:43:56 -0500 |
---|---|---|
committer | cnlohr <lohr85@gmail.com> | 2017-03-08 01:43:56 -0500 |
commit | c65498054c77192b2a12fdb5ef44439a14110292 (patch) | |
tree | 90120d0a3d529aca81d77fe825229f8a6d641bc6 /src/survive_process.c | |
parent | 2a4a803b2f162692ca11e700b32da0a77049bfd2 (diff) | |
download | libsurvive-c65498054c77192b2a12fdb5ef44439a14110292.tar.gz libsurvive-c65498054c77192b2a12fdb5ef44439a14110292.tar.bz2 |
Architect the way the posers receive data.
Diffstat (limited to 'src/survive_process.c')
-rw-r--r-- | src/survive_process.c | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/src/survive_process.c b/src/survive_process.c index edabfff..2fea99d 100644 --- a/src/survive_process.c +++ b/src/survive_process.c @@ -46,13 +46,34 @@ void survive_default_angle_process( SurviveObject * so, int sensor_id, int acode { survive_cal_angle( so, sensor_id, acode, timecode, length, angle ); } - - //TODO: Writeme! + if( so->PoserFn ) + { + PoserDataLight l = { + .pt = POSERDATA_LIGHT, + .sensor_id = sensor_id, + .acode = acode, + .timecode = timecode, + .length = length, + .angle = angle, + }; + so->PoserFn( so, (PoserData *)&l ); + } } -void survive_default_imu_process( SurviveObject * so, int16_t * accelgyro, uint32_t timecode, int id ) +void survive_default_imu_process( SurviveObject * so, int mask, FLT * accelgyromag, uint32_t timecode, int id ) { - //TODO: Writeme! + if( so->PoserFn ) + { + PoserDataIMU imu = { + .pt = POSERDATA_IMU, + .datamask = mask, + .accel = { accelgyromag[0], accelgyromag[1], accelgyromag[2] }, + .gyro = { accelgyromag[3], accelgyromag[4], accelgyromag[5] }, + .mag = { accelgyromag[6], accelgyromag[7], accelgyromag[8] }, + .timecode = timecode, + }; + so->PoserFn( so, (PoserData *)&imu ); + } } |