mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 01:32:19 +00:00
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:
1 parent
045267c841
commit
6fc3c78e70
3 files changed
+42
-27
No files matched your search
@@ -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;
|
||||
|
||||
|
||||
Reference in new issue
Block a user