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

Get rid of ApparentBubble #2564

Merged
merged 9 commits into from
May 10, 2020
Merged

Conversation

eggrobin
Copy link
Member

Add an ApparentWorld for consistency: uncorrected coordinates come in as ApparentWorld, are converted to Apparent, then to ApparentPileUp via a MechanicalSystem in the PileUp.

The correction produces NonRotatingPileUp coordinates, which eventually make it back to the game in World.

renderer_->WorldToBarycentric(PlanetariumRotation()) *
OrthogonalMap<World, ApparentWorld>::Identity()},
Identity<World, ApparentWorld>()(renderer_->BarycentricToWorld(
PlanetariumRotation())(-angular_velocity_of_world_)),
Copy link
Member

Choose a reason for hiding this comment

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

This - sign is frightening. I wonder if we could hide it in a linear transformation (what it probably does is to convert the angular velocity of A wrt B into the angular velocity of B wrt A).

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah this is the angular velocity of world, but we are giving the angular velocity in world (of apparent which rotates like barycentric).

I think now we have more constructors for RigidTransformation, maybe we can use the angular velocity of world more directly.

@@ -156,7 +156,8 @@ inline not_null<std::unique_ptr<MassiveBody>> MassiveBody::ReadFromMessage(
switch (static_cast<Tag>(enum_value_descriptor->number())) {
ROTATING_BODY_TAG_VALUE_CASE(ALICE_SUN);
ROTATING_BODY_TAG_VALUE_CASE(ALICE_WORLD);
ROTATING_BODY_TAG_VALUE_CASE(APPARENT_BUBBLE);
ROTATING_BODY_TAG_VALUE_CASE(APPARENT);
ROTATING_BODY_TAG_VALUE_CASE(APPARENT_WORLD);
Copy link
Member

Choose a reason for hiding this comment

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

Also add PILE_UP_PRINCIPAL_AXES, it's missing in this statement.

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, but we should probably restrict this if not to the frames we actually want to use for bodies, at least to inertial ones which is a requirement of RotatingBody

@@ -65,7 +65,8 @@ class RigidMotion final {

template<typename F = FromFrame,
typename T = ToFrame,
typename = std::enable_if_t<std::is_same_v<F, T>>>
typename = typename = std::enable_if_t<
F::handedness == T::handedness && F::motion <= T::motion>>
Copy link
Member

Choose a reason for hiding this comment

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

This needs a comment.

@pleroy pleroy added the LGTM label May 10, 2020
@eggrobin eggrobin merged commit 1e25c73 into mockingbirdnest:master May 10, 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.

None yet

2 participants