cosmoscout / cosmoscout-vr

:milky_way: A virtual universe which lets you explore, analyze and present huge planetary datasets and large simulation data in real-time.
Other
351 stars 27 forks source link

Add fixed_horizon option to the ObserverNavigationNode #379

Closed Schneegans closed 2 months ago

Schneegans commented 2 months ago

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 commented 2 months ago

Pull Request Test Coverage Report for Build 9953781810

Details


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

💛 - Coveralls
NXXR commented 2 months ago

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 commented 2 months ago

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

Schneegans commented 2 months ago

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

NXXR commented 2 months ago

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