From 95eab1b8938e0033a0aa0d10d6ec53d7d2782907 Mon Sep 17 00:00:00 2001 From: Justin Berger Date: Sun, 11 Mar 2018 15:31:28 -0600 Subject: Added callback for lighthouse found; example in test.c --- src/survive.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/survive.c') diff --git a/src/survive.c b/src/survive.c index 5d0d35f..61bfc86 100755 --- a/src/survive.c +++ b/src/survive.c @@ -148,7 +148,7 @@ SurviveContext * survive_init_internal( int headless ) ctx->lightproc = survive_default_light_process; ctx->imuproc = survive_default_imu_process; ctx->angleproc = survive_default_angle_process; - + ctx->lighthouseposeproc = survive_default_lighthouse_pose_process; // initialize the button queue memset(&(ctx->buttonQueue), 0, sizeof(ctx->buttonQueue)); @@ -260,6 +260,14 @@ void survive_install_raw_pose_fn(SurviveContext * ctx, raw_pose_func fbp) else ctx->rawposeproc = survive_default_raw_pose_process; } + +void survive_install_lighthouse_pose_fn(SurviveContext *ctx, lighthouse_pose_func fbp) { + if (fbp) + ctx->lighthouseposeproc = fbp; + else + ctx->lighthouseposeproc = survive_default_lighthouse_pose_process; +} + int survive_add_object( SurviveContext * ctx, SurviveObject * obj ) { int oldct = ctx->objs_ct; -- cgit v1.2.3