Skip to content
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

Plot trajectories using meshes in scaled space #3303

Merged
merged 34 commits into from
Jan 26, 2022

Conversation

eggrobin
Copy link
Member

As far as performance is concerned, this means that we no longer need to do projection nor hiding in the plot method; further, by directly setting vertices in an array pre-allocated on the C#, we avoid the costly iteration over the RP2Line.
In extremely noodly cases where plotting would drive the frame rate down to 2 or 3 FPS, this improves the framerate by a factor of 4 or 5.

In addition, this means that the trajectories are hidden behind the actual scaled space bodies, and not behind fictitious spheres; this means that in the surface frame, the impact point will be accurately visible (though it still is not indicated by any sort of marker; the impact marker at underground periapsides is unaffected by this change).

This should help with #3035.

ksp_plugin/interface_planetarium.cpp Outdated Show resolved Hide resolved
ksp_plugin/interface_planetarium.cpp Show resolved Hide resolved
ksp_plugin/interface_planetarium.cpp Outdated Show resolved Hide resolved

// Do not plot the past when there is a target vessel as it is misleading.
// TODO(egg): This is the future, not the past!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incomprehensible comment is incomprehensible. If the preceding comment is false, fix it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment is possibly false, but then the code would be false too. This should to be investigated separately.

ksp_plugin/interface_planetarium.cpp Outdated Show resolved Hide resolved
ksp_plugin_adapter/plotter.cs Outdated Show resolved Hide resolved
ksp_plugin_adapter/plotter.cs Show resolved Hide resolved
ksp_plugin_adapter/plotter.cs Outdated Show resolved Hide resolved
ksp_plugin_adapter/plotter.cs Outdated Show resolved Hide resolved
private GLLines.Style target_history_style = GLLines.Style.Faded;
private UnityEngine.Color target_prediction_colour = XKCDColors.LightMauve;
private GLLines.Style target_prediction_style = GLLines.Style.Solid;
// TODO(egg): move all of that to the plotter once the RP2 lines are gone.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When is that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now. But let’s deal with that in another PR.

@pleroy pleroy added the LGTM label Jan 26, 2022
@eggrobin eggrobin merged commit a2e7809 into mockingbirdnest:master Jan 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants