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

Add fixed_horizon option to the ObserverNavigationNode #379

Merged
merged 1 commit into from
Jul 17, 2024

Conversation

Schneegans
Copy link
Member

This adds a fixed_horizon parameter to the ObserNavigationNode. If this is set to true, the observer is always rotated so that the horizon of the active object is always leveled.

For now, this breaks if we are in outer space or looking straight up or down. But it can already be very useful in cases were we know that the user is always close to a planet.

In the future, we could try making this work in outer space as well by checking the distance to the active object and gradually transitioning to the fixed horizon based on the distance.

You can enable this in DFN like this:

<node name="observer" type="ObserverNavigationNode">
   <param name="fixed_horizon" value="true" />
</node>

@coveralls
Copy link

Pull Request Test Coverage Report for Build 9953781810

Details

  • 0 of 14 (0.0%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.001%) to 1.179%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/cosmoscout/ObserverNavigationNode.cpp 0 14 0.0%
Files with Coverage Reduction New Missed Lines %
src/cosmoscout/ObserverNavigationNode.cpp 1 0.0%
Totals Coverage Status
Change from base Build 9938834494: -0.001%
Covered Lines: 193
Relevant Lines: 16366

💛 - Coveralls

@NXXR
Copy link
Collaborator

NXXR commented Jul 16, 2024

Could we use the ecliptic plane as the horizon in outer space?

Or would this just lead to weird rotations when entering or leaving a planet's frame?

@Schneegans
Copy link
Member Author

Yes, this could be possible. But a smooth transition is definitely non-trivial.

Copy link
Collaborator

@NXXR NXXR left a comment

Choose a reason for hiding this comment

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

Looks interesting.
Some side effects I found to consider:

  • When entering a body's frame the view is snapped to the horizon, since the observer enters the frame quite early (far from the the planet) the view can be snapped to the horizon quite rough, also leading to >90° instant rotations leading to disorientation.
  • When traveling through outer space and clipping through a body's frame, it is possible that the observer is suddenly rotated even though this is unwantd (especially noticeable when approaching a body's frame by strafing up- or downwards).
  • The adjustment of the rotation means that escaping the body's frame by strafing left or right is not possible anymore as this leads to a sideways orbit around the body. Strafing down leads to the observer getting (soft) stuck at the center of the body.

It should be made clear, that this option should only be used in use-cases where the observer is close to a planet's surface for the whole runtime, to avoid any of the mentioned issues.
This feature may also need to be revisited if it should be used in a more general context.

@Schneegans
Copy link
Member Author

Yes, that's why I wrote "this breaks if we are in outer space or looking straight up or down" 😄.

@NXXR
Copy link
Collaborator

NXXR commented Jul 17, 2024

Yes, that's why I wrote "this breaks if we are in outer space or looking straight up or down" 😄.

Ah then I misunderstood.

I thought it meant:

This breaks [the fixed horizon functionality] if we are in outer space.

My recommendation was more along the lines of:

Do not use this when in outer space.
This breaks [Cosmoscout navigation (and the users ability to not puke while using cosmoscout)] if we are [anywhere further away from a planet than a couple hundred thousand kilometers, but mostly] in outer space.

😁 I mean it works fine as a workaround and putting it into the main branch will do nothing if not enabled but I guess we should make a note or an issue somewhere to revisit this if it is supposed to be more than a workaround imho

@Schneegans Schneegans merged commit 04e625f into main Jul 17, 2024
11 of 12 checks passed
@Schneegans Schneegans deleted the feature/fixed-horizon branch July 17, 2024 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants