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

Parachute torque #2644

Merged
merged 3 commits into from
Jul 14, 2020
Merged

Parachute torque #2644

merged 3 commits into from
Jul 14, 2020

Conversation

eggrobin
Copy link
Member

As @ferram4 said,

consider it all cursed.

This fixes #2607.

@eggrobin
Copy link
Member Author

The calculations could probably gain from being done on the C++ side, but they involve only C#-side inputs, so this would have to be a free interface function that takes Δω_world, the two quaternions, and the principal moments of inertia, types all of that, multiplies the inertia tensor by Δω, and untypes and returns ΔL.

// stock, and would orient themselves head-down (and parachute-down)
// with FAR. See #2607.
// To quote ferram4, “consider it all cursed”.
Vector3d Δω_world = part.rb.angularVelocity - old_angular_velocity;
Copy link
Member

Choose a reason for hiding this comment

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

I think I would really prefer if this code was in C++. It's a bit annoying to pass things through the interface and retype all the data, but we would have a better confidence that everything is correct, including when we maintain it. It could live directly in interface.cpp, no point in pushing it to some class.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done. Considering how sloppy our handling of the MTS system was, I am not sure this change is less error-prone. I tried cleaning up the existing conversion constant.


auto const angular_velocity =
FromXYZ<AngularVelocity<World>>(world_angular_velocity);

Copy link
Member

Choose a reason for hiding this comment

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

Remove one empty line.

Sorry, something went wrong.

@pleroy pleroy added the LGTM label Jul 14, 2020
@eggrobin eggrobin merged commit 0e005a0 into mockingbirdnest:master Jul 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parachuting Kerbals behave unphysically in Fuchs
2 participants