diff options
author | Justin Berger <j.david.berger@gmail.com> | 2018-04-01 16:04:05 -0600 |
---|---|---|
committer | Justin Berger <j.david.berger@gmail.com> | 2018-04-01 16:09:58 -0600 |
commit | 1724abef15a4090640bd82ba408681438316de7e (patch) | |
tree | 129d3eeaabe9d6e011897b33e8d8a2acaaae3ac9 /src/poser_charlesslow.c | |
parent | 5384af65f9d63d095cb9987d36de57ccee323300 (diff) | |
download | libsurvive-1724abef15a4090640bd82ba408681438316de7e.tar.gz libsurvive-1724abef15a4090640bd82ba408681438316de7e.tar.bz2 |
Made calibration on other posers use calibration data
Diffstat (limited to 'src/poser_charlesslow.c')
-rw-r--r-- | src/poser_charlesslow.c | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/src/poser_charlesslow.c b/src/poser_charlesslow.c index bc6683a..b44225e 100644 --- a/src/poser_charlesslow.c +++ b/src/poser_charlesslow.c @@ -1,12 +1,13 @@ +#include "linmath.h" #include "survive_cal.h" +#include <dclapack.h> +#include <linmath.h> #include <math.h> -#include <string.h> -#include "linmath.h" -#include <survive.h> #include <stdio.h> #include <stdlib.h> -#include <dclapack.h> -#include <linmath.h> +#include <string.h> +#include <survive.h> +#include <survive_reproject.h> typedef struct { @@ -255,9 +256,13 @@ static FLT RunOpti( SurviveObject * hmd, PoserDataFullScene * fs, int lh, int pr int dataindex = p*(2*NUM_LIGHTHOUSES)+lh*2; if( fs->lengths[p][lh][0] < 0 || fs->lengths[p][lh][1] < 0 ) continue; + FLT out[2] = {}; + survive_apply_bsd_calibration(hmd->ctx, lh, fs->angles[p][lh], out); + //Find out where our ray shoots forth from. - FLT ax = fs->angles[p][lh][0]; - FLT ay = fs->angles[p][lh][1]; + FLT ax = out[0]; + FLT ay = out[1]; + //NOTE: Inputs may never be output with cross product. //Create a fictitious normalized ray. Imagine the lighthouse is pointed //straight in the +z direction, this is the lighthouse ray to the point. @@ -338,8 +343,13 @@ static FLT RunOpti( SurviveObject * hmd, PoserDataFullScene * fs, int lh, int pr if( fs->lengths[p][lh][0] < 0 || fs->lengths[p][lh][1] < 0 ) continue; //Find out where our ray shoots forth from. - FLT ax = fs->angles[p][lh][0]; - FLT ay = fs->angles[p][lh][1]; + FLT out[2] = {}; + survive_apply_bsd_calibration(hmd->ctx, lh, fs->angles[p][lh], out); + + // Find out where our ray shoots forth from. + FLT ax = out[0]; + FLT ay = out[1]; + FLT RayShootOut[3] = { sin(ax), sin(ay), 0 }; RayShootOut[2] = sqrt( 1 - (RayShootOut[0]*RayShootOut[0] + RayShootOut[1]*RayShootOut[1]) ); |