Read the awareness layer's camera and frame through ports

The awareness lifecycle and focus parts had left the Cesium allow-list
but still hooked the scene's preRender event and read the Cesium
camera's position and orientation. They now use the frame port and the
camera port's pose, with the same quantized motion signature.
This commit is contained in:
Sameh Khamis committed 2026-11-07 01:04:46 -08:00
1 parent 045267c841
commit 6fc3c78e70
3 files changed
+42 -27

No files matched your search

+2 -2
View File
@@ -1,5 +1,5 @@
import { VESSEL_FOCUS_RADIUS_M } from './policy.js';
import { cameraOf } from '../../render/rendererOf.js';
import { cameraOf, findCamera } from '../../render/rendererOf.js';
import { clone, distance } from '../../geo/index.js';
export function createFocus({ state: layerState, services, parts, source }) {
@@ -113,7 +113,7 @@ export function createFocus({ state: layerState, services, parts, source }) {
function closestToCurrentView(candidates) {
if (!Array.isArray(candidates) || !candidates.length) return null;
const cameraPosition = layerState.viewer?.camera?.positionWC;
const cameraPosition = findCamera(layerState.viewer)?.pose()?.position;
if (!cameraPosition)
return candidates.find((candidate) => candidate?.position) || null;