mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
Draw civil flights from an icon set moved on the GPU
Every flight is now a row in the layer's icon set. Its motion segment follows the same regime `_deadReckon` picks (interpolate between fixes, warm up backward from the oldest, coast forward from the newest), and one shared `_motionRegime` makes that choice for both. The shader moves every untracked contact between polls, so the 12 Hz fleet tick no longer touches each billboard. It now only re-plans expired rows, floors grounded contacts, advances focus while needed, and runs the 3D model regime. Grounded contacts the floor lifts are pinned to a hold at the floored position. Their nose glides on the GPU. Contacts within 50 km re-floor every tick, and farther ones take turns about once a second. Low contacts are judged for the horizon at no lower than 12 m above the ellipsoid, as before. Below hover speed a contact's nose holds. A row whose fleet model is drawn keeps its focus updated, because the model reads it. Untracking re-plans and re-floors the icon from the tracked course. On the same views with about 6,700 OpenSky flights, frame gaps at p95 drop from 28-40 ms to 17 ms, and the fleet tick from 16-37 ms to about 2 ms at most.
This commit is contained in:
1 parent
37dd4058c1
commit
fa3a3a3bca
33 files changed
+1598
-986
No files matched your search
+25
-1
@@ -43,8 +43,14 @@ export const ICON_SHOWN = 1;
|
||||
export const ICON_ROTATES = 2;
|
||||
/** Fade and shrink toward the globe's limb (aircraft recession). */
|
||||
export const ICON_RECEDES = 4;
|
||||
/** Lift the row 12 m along the normal before the horizon test (fixes near the ground). */
|
||||
/**
|
||||
* Judge the row at no lower than ICON_CULL_HEIGHT_M above the ellipsoid in the
|
||||
* horizon test. A fix near or below the ellipsoid (a grounded contact at geoid
|
||||
* −31 m before its floor warms) otherwise reads as beyond the limb.
|
||||
*/
|
||||
export const ICON_CULL_LIFT = 8;
|
||||
/** The ellipsoid height a CULL_LIFT row is raised to for the horizon test. */
|
||||
export const ICON_CULL_HEIGHT_M = 12;
|
||||
|
||||
/** Move the epoch forward once render times pass this many seconds. */
|
||||
const REBASE_AFTER_SEC = 1800;
|
||||
@@ -422,6 +428,24 @@ export function createIconSet({ capacity = 1024, epoch } = {}) {
|
||||
course(row, tau) {
|
||||
return segmentCourse(segments, row, tau);
|
||||
},
|
||||
/** The point the horizon test judges for a row drawn at `position`. */
|
||||
cullPoint(row, position, result = new Cesium.Cartesian3()) {
|
||||
if (!(style[row * STYLE_STRIDE + FLAGS] & ICON_CULL_LIFT))
|
||||
return Cesium.Cartesian3.clone(position, result);
|
||||
// Height above the ellipsoid along the geocentric ray, as the shader
|
||||
// computes it: exact to millimetres this close to the surface.
|
||||
const radius = Cesium.Cartesian3.magnitude(position);
|
||||
Cesium.Cartesian3.multiplyComponents(
|
||||
position,
|
||||
Cesium.Ellipsoid.WGS84.oneOverRadii,
|
||||
result,
|
||||
);
|
||||
const height = radius * (1 - 1 / Cesium.Cartesian3.magnitude(result));
|
||||
const lift = Math.max(0, ICON_CULL_HEIGHT_M - height);
|
||||
Cesium.Cartesian3.normalize(position, result);
|
||||
Cesium.Cartesian3.multiplyByScalar(result, lift, result);
|
||||
return Cesium.Cartesian3.add(position, result, result);
|
||||
},
|
||||
};
|
||||
|
||||
function markRow(row) {
|
||||
|
||||
Reference in new issue
Block a user