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

Vessels Far from Scene Origin and Physics Accuracy #14

Open
Katniss218 opened this issue Nov 10, 2023 · 6 comments · Fixed by #32
Open

Vessels Far from Scene Origin and Physics Accuracy #14

Katniss218 opened this issue Nov 10, 2023 · 6 comments · Fixed by #32
Labels
bug Part of the HSP isn't working correctly new feature A new addition to HSP
Milestone

Comments

@Katniss218
Copy link
Owner

Katniss218 commented Nov 10, 2023

Current Behaviour:
If a vessel is landed, and you set the scene origin far away from it (eg by switching to a different vessel), the landed vessel will eventually wiggle its way through the planet.

This happens because collisions are calculated in scene space, and when the scene origin is far away, the precision is not adequate.

Expected Behaviour:
Vessels remain where they were left, regardless of how far away the scene origin has gone.

How to Fix:
Vessels that are landed should be locked to their position relative to the landed on body while too far away.
Vessels should have their collisions turned off while too far away (both flying and landed).

@Katniss218 Katniss218 added the bug Part of the HSP isn't working correctly label Nov 10, 2023
@Katniss218
Copy link
Owner Author

Katniss218 commented Nov 10, 2023

If too far away - disable collisions
else - enable again

if landed - pin to the surface (until close to the origin again)

@Katniss218
Copy link
Owner Author

Since vessels will need to act like buildings when too far away from origin, maybe they can be combined into one.

@Katniss218
Copy link
Owner Author

Vessels and buildings are already the same thing, as of 2024/01/11 (and a fair bit before too).

Vessels that are landed far away from the origin (not flying) will need to be pinned, until they come near the origin again.

@Katniss218 Katniss218 added the new feature A new addition to HSP label Jan 14, 2024
@KnedlikMCPE
Copy link

Could it be considered to make use of 64-bit doubles on the simulation side and emulated doubles on the rendering side? It would then be practical to have separate coordinate systems for different distances - 64 bits should(tm) be enough for a solar system, but not for interstellar travel.

@Katniss218
Copy link
Owner Author

Katniss218 commented Jul 11, 2024

Could it be considered to make use of 64-bit doubles on the simulation side and emulated doubles on the rendering side? It would then be practical to have separate coordinate systems for different distances - 64 bits should(tm) be enough for a solar system, but not for interstellar travel.

The issue is with collisions specifically. Collisions happen in unity's scene space. And the proposed solution is to disable physics for objects far away by pinning them to the surface (if they're landed) or by letting them float on their orbits otherwise.

@Katniss218 Katniss218 changed the title Vessels too far away from the active object (and scene origin) Vessels Far from Scene Origin and Physics Accuracy Jul 11, 2024
@Katniss218 Katniss218 added this to the Alpha 0.0.1 milestone Jul 12, 2024
@Katniss218 Katniss218 linked a pull request Nov 17, 2024 that will close this issue
@Katniss218 Katniss218 reopened this Nov 17, 2024
@Katniss218
Copy link
Owner Author

Reopened due to only being partially fixed (disables the 'parts' of vessels that are too far away - so they don't update or render). It still needs to pin the landed vessels since the collision will now be disabled for them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Part of the HSP isn't working correctly new feature A new addition to HSP
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants