Skip to content

Changes around the extrapolation commit. #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ltlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions src/ltr_srv_slave.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
Expand Down
8 changes: 6 additions & 2 deletions src/xlinuxtrack9.c
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down