mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Move the transit head across subdivisions in the frame, and keep segmented lines safe beside the draped rework
The transit trail's head is upserted where the vehicle crosses into the next subdivision, so the Cesium draw port moves it there in the same frame instead of building it anew; between crossings a frame changes only how far it is revealed. A test runs the trail through the Cesium draw port across a crossing and a second's fade, with nothing built anew. A segmented line that was replaced by a plain one and moved while its set rebuilds is hidden segment by segment where it was. A segmented line of no length is patched as nothing to draw instead of rebuilt on every upsert, and segmented lines are noted as rebuilt when they move.
This commit is contained in:
1 parent
87c80856c2
commit
e37349a061
3 files changed
+156
-8
No files matched your search
@@ -9,8 +9,8 @@
|
||||
* with its age; both change in place (`segmentShow`, `segmentColors`), so
|
||||
* the body is rebuilt only when the history changes. The head is the
|
||||
* subdivision the vehicle is on, revealed up to the vehicle
|
||||
* (`revealFraction`): it is drawn anew only where the vehicle crosses into
|
||||
* the next subdivision, and a frame writes how far it is revealed.
|
||||
* (`revealFraction`): it moves only where the vehicle crosses into the
|
||||
* next subdivision, and a frame writes how far it is revealed.
|
||||
*/
|
||||
import { cssColor } from '../render/color.js';
|
||||
import { findDraw } from '../render/rendererOf.js';
|
||||
@@ -222,7 +222,9 @@ export function createContactTrailRenderer(viewer) {
|
||||
active = segment;
|
||||
restyled = false;
|
||||
revealed = fraction;
|
||||
headLines?.set(headItems(segment, fraction));
|
||||
// Upserted, not set: a renderer can move a draped line to where it
|
||||
// now runs in the same frame, instead of building it anew.
|
||||
headLines?.upsert(headItems(segment, fraction));
|
||||
} else if (fraction !== revealed) {
|
||||
revealed = fraction;
|
||||
headLines?.upsert(headItems(segment, fraction));
|
||||
|
||||
Reference in new issue
Block a user