diff --git a/src/ltlib.c b/src/ltlib.c index 24da73ac..9e057c88 100644 --- a/src/ltlib.c +++ b/src/ltlib.c @@ -98,7 +98,7 @@ static float ltr_int_extrapolation_factor(int t1, int t2, int now) if(dt == 0){ return 0.0f; } - float ext = (float)dt12 / dt; + float ext = (float)dt / dt12; //Should the extrapolation go further than c_EXTRAPOLATION_LIMIT // times the frame interval, start to round out with asymptote // of c_EXTRAPOLATION_ASYMPTOTE. diff --git a/src/ltr_srv_slave.c b/src/ltr_srv_slave.c index 1b1b5b49..d3e5faa5 100644 --- a/src/ltr_srv_slave.c +++ b/src/ltr_srv_slave.c @@ -122,6 +122,7 @@ static bool ltr_int_try_start_master(int *l_master_uplink) return false; } +static linuxtrack_pose_t prev_filtered_pose; static bool ltr_int_process_message(int l_master_uplink) { @@ -154,6 +155,8 @@ static bool ltr_int_process_message(int l_master_uplink) if(msg.pose.pose.status == RUNNING){ //printf("PASSING TO SHM: %f %f %f\n", msg.pose.yaw, msg.pose.pitch, msg.pose.tz); com->full_pose = msg.pose; + com->full_pose.prev_pose = prev_filtered_pose; + prev_filtered_pose = msg.pose.pose; } com->state = msg.pose.pose.status; com->preparing_start = false; diff --git a/src/xlinuxtrack9.c b/src/xlinuxtrack9.c index 09c90ea5..08703091 100644 --- a/src/xlinuxtrack9.c +++ b/src/xlinuxtrack9.c @@ -176,8 +176,12 @@ PLUGIN_API int XPluginStart(char *outName, head_psi = XPLMFindDataRef("sim/graphics/view/pilots_head_psi"); head_the = XPLMFindDataRef("sim/graphics/view/pilots_head_the"); - - head_roll = XPLMFindDataRef("sim/graphics/view/field_of_view_roll_deg"); + + //New in XP11... + head_roll = XPLMFindDataRef("sim/graphics/view/pilots_head_phi"); + if(head_roll == NULL){ + head_roll = XPLMFindDataRef("sim/graphics/view/field_of_view_roll_deg"); + } view = XPLMFindDataRef("sim/graphics/view/view_type"); head_x_out = XPLMRegisterDataAccessor(