1. Reject back-projected 2d objects.
Since the function Gui::Screen::Project does not cull points
(and most likely should not), this must be done manually, as was
done in the SectorView.cpp for labels. Checking z < 1 in the Normalized Device
Coordinates discards points that are further than the zfar clipping plane,
and beyond the center of the camera. The points between the center of the
camera and the znear clipping plane remain. They may be needed.
2. Adjust z-far plane for projection to clip space.
With a severe zooming in, the coordinates of objects can become too large and
fly out of the z-far plane. Therefore, it was done so that the z-far plane
moved away proportionally. But with a severe zooming out, it z-far plane can
become smaller than DEFAULT_VIEW_DISTANCE, and this is also taken into account.
3. Change the axis of rotation when dragging the mouse horizontally.
Set horizontal rotation around the axis of the ecliptic. It seems to me that
it’s more convenient to examine the system. For good, it was necessary to
rename the variable from m_rot_z to m_rot_y, but I did not want to
recompile everything.
4. Do not calculate and draw the player’s orbit when it is docked or landed.
We now load files via Lua 5.2 require() semantics instead of raw paths.
This means we've dropped the current directory implicit lookup, and
instead we use module names to semi-uniquely identify a package.
We mimic the behavior of package.path for the data/libs/ directory,
with an eye to allowing client code to extend that behavior later on.
Loaded modules are cached in a two-stage cache; the first stage maps
module names to file paths to avoid duplicate loads, and the second
stage maps file paths to the return value of a module.
package.reimport(name) can be used to purge the cache of a specific
name and force it to be reimported (as the name suggests). It returns
the imported module, similarly to require().
This implementation deprecates import() and translates old-style calls
to that function to the new module names. It complains loudly in the log
when it does so, so we can keep track of what modules need to be updated.
Was: orbit with 0.9999 < e < 1.0001 forced to e = 1.0001 (hyperbola)
Now: orbit with 0.9999 < e < 1 forced to e = 0.9999 (ellipse)
orbit with 1 <= e < 1.0001 forced to e = 1.0001 (hyperbola)
In an elliptical orbit, when the eccentricity is fixed at 0.9999, and
the speed increases, the semi-major axis shrinks and the apocenter moves
toward the star. Therefore, a condition check has been added that prevents
the ship from shifting in this case.
Rename containsGlyph to isValidGlyph
Change the approach to checking if a font can handle a glyph. The original approach was to pass the valid glyph range to the constructor. When it's not found by ImGui we call AddGlyph where we check if it's valid for the font. In the event where ImGui couldn't handle a glyph that was defined as valid in the constructor, that led to constant re-baking of fonts. The new approach is to change m_ranges (which used to contain valid glyph ranges) to m_invalid_glyphs, which contains only invalid glyphs that we tried to add to the font but failed. The next time AddGlyph is called, we skip the font since it's unable to handle the glyph.
1. Fix orientation matrix calculation
It was found that the orbit orientation matrix is calculated through
the Euler angles, which are calculated from the velocity and position
vectors, and many divisions are made in which the denominator can
unpredictably approach 0. All this was removed since the matrix is
easily calculated directly from the vectors.
2. Transition without distortion from an elliptical orbit to a hyperbolic
When moving from an elliptical orbit to a hyperbolic one, the eccentricity
passes through 1 (parabola), when the average anomaly is zero everywhere,
except for infinity. Therefore, the ship at this time is attracted to
the point of the pericenter, because there is not enough accuracy to
go from the true anomaly to the middle anomaly and back, and stay in
the same coordinates. Therefore, I suggest jumping from an ellipse
with e = 0.9999 to a hyperbole with e = 1.0001. These orbits are
very similar, almost identical. Moreover, ellipses with
0.9999 < e < 1 are also considered as hyperbolas, so that there are
no distortions at a low speed of the ship.
1. Improve numerical method for Kepler's equation
It turned out that numerical methods are implemented with a fixed number of
iterations (5), and they are not always enough. Moreover, testing showed
that in some cases the solution does not converge and even 10,000
iterations are not enough. Therefore, a more slowly converging
bisection method was added, in case the main method fails in 10 iterations.
2. Stabilize low speed orbits
When the ship has low speed, its orbit is a very elongated ellipse,
and its true anomaly is very very close to pi. Trimming the variable to
1 - 1e-6 before taking the arccos does not allow it to get close to pi
enough, so there is a strong shift from the true position. Therefore,
it was removed.
hide comms button in flight, because it duplicates the button function in the upper right corner of the window
hide the system-overview-window when we are not looking into the world