mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 08:42:21 +00:00
feat(app): detection and readout on Navara
The shell creates detection and the tracked readout on the engine, so the
Navara mode has them too (before: not created without a viewer). Detection
reads the camera height from the engine. The tracked readout follows
engine.camera.following(): a follow's plain-data label
(FollowOptions.label: { id, model, position }, the readout card's model
and anchor) or, on Cesium, the followed Entity and its gevLabelModel as
before (Cesium layers keep publishing the same). refreshTrackedReadout
takes a follow handle too. A bare viewer without a registered engine
(tests) is still read for its trackedEntity.
In the app on Navara: "[Detection] Initialized", "[TrackedReadout]
Initialized", and a follow with a label paints its card.
This commit is contained in:
1 parent
7d5a484796
commit
e1be2eac19
7 files changed
+129
-20
No files matched your search
@@ -40,11 +40,24 @@ export function normalizeFollowOptions(options) {
|
||||
throw new TypeError(`camera.follow minRange must be >= 0: ${minRange}`);
|
||||
if (options.frame !== undefined && options.frame !== 'enu')
|
||||
throw new TypeError("camera.follow frame must be 'enu'");
|
||||
const { label } = options;
|
||||
if (
|
||||
label !== undefined &&
|
||||
!(
|
||||
label &&
|
||||
typeof label.id === 'string' &&
|
||||
typeof label.position === 'function'
|
||||
)
|
||||
)
|
||||
throw new TypeError(
|
||||
'camera.follow label needs { id, model, position: () => Cartesian3 }',
|
||||
);
|
||||
return {
|
||||
position: options.position,
|
||||
viewFrom: viewFromOf,
|
||||
minRange,
|
||||
native: options.native,
|
||||
label,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -305,6 +318,7 @@ export function createFollowController({
|
||||
const handle = {
|
||||
options,
|
||||
native: options.native,
|
||||
label: options.label,
|
||||
offset: null,
|
||||
previous: null,
|
||||
stop: () => end(handle),
|
||||
@@ -312,6 +326,7 @@ export function createFollowController({
|
||||
const updated = normalizeFollowOptions({ ...options, ...next });
|
||||
handle.options = updated;
|
||||
handle.native = updated.native;
|
||||
handle.label = updated.label;
|
||||
handle.offset = null;
|
||||
handle.previous = null;
|
||||
requestRender();
|
||||
|
||||
Reference in new issue
Block a user