mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
Compute street traffic roads, colours and state without Cesium
Road waypoints are plain ECEF points from the geo helpers (the same formulas as before, so every waypoint and segment length is unchanged), and the palette is renderer colours. The style part, still on the point primitives, turns those into the points' colours once per colour and owns the dot painting the model used to do itself; the rendering part converts them for the heat lines. The animation keeps its own lerp scratch, and the ingestion's centre height asks with plain degrees. Ingestion, model, policy, state and timing leave the allow-list.
This commit is contained in:
1 parent
d6f09f9860
commit
10db177251
15 files changed
+247
-73
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import * as Cesium from 'cesium';
|
||||
import { fromDegrees } from '../../geo/ellipsoid.js';
|
||||
import { distance } from '../../geo/vector.js';
|
||||
import { roadSurfaceChunks } from './surface.js';
|
||||
import { TRAFFIC_TIMING_ENABLED, DOT_HEIGHT_OFFSET } from './policy.js';
|
||||
|
||||
@@ -250,13 +251,11 @@ export function createTiming({ state: layerState, services, parts, source }) {
|
||||
(Number.isFinite(floor) && Math.abs(floor) <= 9000
|
||||
? floor
|
||||
: layerState._viewHeightEstimate || 0) + DOT_HEIGHT_OFFSET;
|
||||
return Cesium.Cartesian3.fromDegrees(lng, lat, h);
|
||||
return fromDegrees(lng, lat, h);
|
||||
});
|
||||
const segmentDist = [];
|
||||
for (let i = 0; i < waypoints.length - 1; i++) {
|
||||
segmentDist.push(
|
||||
Cesium.Cartesian3.distance(waypoints[i], waypoints[i + 1]),
|
||||
);
|
||||
segmentDist.push(distance(waypoints[i], waypoints[i + 1]));
|
||||
}
|
||||
/* TRACE_ONLY_BEGIN */
|
||||
_trafficTimingWaypointMaterializationMs +=
|
||||
|
||||
Reference in new issue
Block a user