Move shared follow offsets and Draw onto the globe contract

Share links read the current follow handle and displayed position through
engine.camera and restore their ENU offset with follow's swingTo option.
Cesium retains its first-frame wait, displayed-position cache, 60-degree
frame limit and range interpolation. Navara and the fake engine apply the
same swing. Cancellation, camera handoff and destruction release it; an
externally tracked Cesium entity keeps its existing handle.

Draw uses one surface with engine input, geodesic lines and point movers.
An exclusive pointer claim suppresses ambient subscriptions and deferred
picks across ownership changes. Cesium owns suspension and exact restoration
of its stock select and track actions. Camera gestures remain enabled.
Detaching releases the sketch and preview and retains shape and colour.
The separate Navara surface and Cesium data-source preview are removed.

Cesium remains the reference for clicked heights, line width and dash,
vertex size and outline, keyboard handling and completed annotations.
One deliberate visual fix is that the occluded rubber band uses the selected
colour instead of retaining the initial amber: it now identifies the same
sketch as its visible segment. Navara adopts Cesium's geodesic preview edges.
Finished annotation drapes are unchanged.

External Cesium import files fall from 7 to 5, viewer lines from 1005 to
953, and engine-name lines from 39 to 37. No coupling metric grows.

The full unit suite, import directions, package boundaries, formatting
and coupling checks pass.

Checked in the browser, keyless: the contract suite passes on Navara and on
Cesium apart from the camera-events check that also fails intermittently
before; qa-navara-draw passes; qa-draw-tool passes apart from its hidden-line
pixel check, which fails the same way before this change. Its destroy check
now expects no preview data source, since the preview has none.
This commit is contained in:
German Khokhlov committed 2026-11-07 14:31:59 +04:00
1 parent 910d693b94
commit dacfd33f10
31 files changed
+1071 -785

No files matched your search

+13
View File
@@ -139,6 +139,11 @@
* @property {() => Cartesian3} position Where the target is (read each frame).
* @property {Cartesian3 | (() => Cartesian3)} viewFrom The camera's offset
* from the target in its east-north-up frame, metres.
* @property {Cartesian3 | null} [swingTo] Desired ENU offset after the first
* follow frame. Turns at most 60 degrees per frame, interpolating range,
* then leaves the offset to user gestures. retarget({ swingTo }) keeps the
* current follow; null cancels a pending swing. Stop or camera handoff
* cancels it as well.
* @property {number} [minRange] Closest the camera comes (150 m).
* @property {'enu'} [frame]
* @property {any} [native] What is followed, as the handle's `native`. On
@@ -175,6 +180,7 @@
* under the position, nearest first.
*
* @typedef {object} InputOptions
* @property {{ release: () => void }} [pointer] The live exclusive pointer claim.
* @property {InputModifier} [modifier]
* @property {boolean} [pick] click, doubleClick and move only. A move
* listener with pick gets at most one payload per frame (the latest).
@@ -300,6 +306,12 @@
* @typedef {{ intensity: number, uniforms: Record<string, number> }} StyleState
*
* @typedef {object} GlobeInput
* @property {() => ({ release: () => void } | null)} acquirePointer Claim
* exclusive screen events, or null while another claim is held. Pass the
* claim as InputOptions.pointer; other subscriptions yield. Release is
* idempotent, and engine destruction releases it. Camera gestures remain
* enabled. Cesium's stock select/track clicks are suspended and restored
* by identity. Deferred picks cannot cross a claim or release.
* @property {(type: InputType, listener: (event: InputEvent) => void, options?: InputOptions) => () => void} on
* As in Cesium, a listener with a modifier fires only while that key is
* held and one without fires only while no modifier is held.
@@ -893,6 +905,7 @@ const SHAPE = {
input: {
on: isFunction,
setCameraInputs: isFunction,
acquirePointer: isFunction,
suspendCameraInputs: isFunction,
cameraInputsEnabled: isFunction,
},