A transit vehicle back in view is turned for the camera as it is now

Its last turn was kept when it came back into view, so a vehicle that
left the view while the camera moved, and came back after the pass for
the camera's new pose, kept the turn from the old pose until the camera
moved again. Coming back into view now clears its last turn.
This commit is contained in:
Sameh Khamis committed 2026-11-11 08:38:58 -08:00
1 parent 37d44c3364
commit db37617fa6
2 files changed
+5 -1

No files matched your search

+2 -1
View File
@@ -4377,7 +4377,8 @@ test('parked transit reprojects held and reported courses at the bounded camera
// A vehicle coming into view is turned on the next pass, the camera still. // A vehicle coming into view is turned on the next pass, the camera still.
state._visible.delete(held); state._visible.delete(held);
held.marker.rotation = 0.7; held.marker.rotation = 0.7;
held.rotationCourse = undefined; // Its course as last turned: the camera moved while it was out of view.
held.rotationCourse = held.courseDeg;
Object.assign(state, { Object.assign(state, {
_visibilityAt: 0, _visibilityAt: 0,
_stillIcons: { upsert: noop, remove: noop }, _stillIcons: { upsert: noop, remove: noop },
+3
View File
@@ -944,6 +944,9 @@ export function createRendering({ state, services, parts }) {
const wasVisible = state._visible.has(entry); const wasVisible = state._visible.has(entry);
if (visible) state._visible.add(entry); if (visible) state._visible.add(entry);
else state._visible.delete(entry); else state._visible.delete(entry);
// Turned afresh once back in view: the camera may have moved while it
// was out, after the pass that would have turned it.
if (visible && !wasVisible) entry.rotationCourse = undefined;
if (visible && entry.track?.count) { if (visible && entry.track?.count) {
if (!wasVisible && !entry.qaFixture) syncPlayback(entry, now); if (!wasVisible && !entry.qaFixture) syncPlayback(entry, now);
// Re-entry can advance into an unprepared corridor; loaded tiles can // Re-entry can advance into an unprepared corridor; loaded tiles can