DotNet.Ships.Class.Gunsights - Elite-Dangerous-Almanac/Almanac-Core GitHub Wiki
EliteDangerousAlmanac / Ships / Gunsights
Defined in: dotnet/src/EliteDangerousAlmanac/Ships/Gunsights.cs:36
The fixed-weapon frontal gunsights for every player-flyable ship.
The catalogue keeps only the geometry needed to place each hardpoint at any target range: a horizontal and a vertical offset from the cockpit, both in metres.
A hull's offsets follow its own hardpoints in exactly the same order, which is why this compact catalogue does not repeat the slot names. Pair an offset with the hardpoint at the same position. The number in a journal slot key is not that position: some hulls skip or reorder those numbers, so resolve a journal key through the hull's enumerated slots first.
The offsets are observed in-game. See data/ships/SOURCES.md.
staticAll:IReadOnlyDictionary<string, IReadOnlyList<GunsightOffset>>
Defined in: dotnet/src/EliteDangerousAlmanac/Ships/Gunsights.cs:46
Every hull's fixed-weapon offsets, keyed by hull symbol.
It covers every hardpoint of every player-flyable hull. The map and its lists refuse mutation.
staticFind(shipSymbol):IReadOnlyList<GunsightOffset>?
Defined in: dotnet/src/EliteDangerousAlmanac/Ships/Gunsights.cs:53
Looks up a hull's gunsight by its internal symbol, ignoring case.
string?
The hull symbol. Leading and trailing whitespace and letter case are ignored.
IReadOnlyList<GunsightOffset>?
The hull's offsets, or null where the hull is unknown.
staticProject(gunsight,targetRangeMetres):IReadOnlyList<GunsightPoint>
Defined in: dotnet/src/EliteDangerousAlmanac/Ships/Gunsights.cs:72
Projects a gunsight onto a target plane at a chosen range.
IReadOnlyList<GunsightOffset>
The camera-relative hardpoint offsets, in metres.
double
The target-plane distance, in metres, which must be above zero.
IReadOnlyList<GunsightPoint>
One angular-tangent point per offset, in the order the offsets came. To place a point on a perspective display, divide each tangent by the tangent of the corresponding half field of view, and invert the vertical result where screen coordinates increase downwards.
This is fixed, ship-forward geometry. It does not model gimbal or turret tracking, projectile travel, target motion, or head-look.
ArgumentNullException
gunsight is null.
ArgumentOutOfRangeException
The target range is not a finite number above zero.