Open Katniss218 opened 10 months ago
If too far away - disable collisions else - enable again
if landed - pin to the surface (until close to the origin again)
Since vessels will need to act like buildings when too far away from origin, maybe they can be combined into one.
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.
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.
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.
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).