refactor(launches,cctv,alpr): take vector maths from src/geo

Launches selection/replay/panel/policy/policyHelpers/state/camera, CCTV geometry/model/projection/navigation/cards/geometryQueue/state and ALPR model/visuals now use src/geo for Math, Cartesian2/3, Cartographic, Matrix3/4, Quaternion and ENU frames. launches/paths.js keeps Cesium (EllipsoidGeodesic). In camera.js, EllipsoidGeodesic, BoundingSphere.fromPoints/union and the BoundingSphere constructor stay on Cesium; the geo Cartographics passed into EllipsoidGeodesic are only read field by field and cloned there (computeProperties). The CCTV plane orientation stays a Cesium Quaternion and plane dimensions a Cesium Cartesian2 (entity ConstantProperty values). launches-layer and alpr-cameras own the src/geo files.
This commit is contained in:
German Khokhlov committed 2026-10-15 00:18:35 +04:00
1 parent ee8b94d987
commit a915bdb3e5
17 files changed
+215 -214

No files matched your search

+6 -5
View File
@@ -1,5 +1,6 @@
import { attachCctvVideo } from './videoPlayback.js';
import * as Cesium from 'cesium';
import * as geo from '../../geo/index.js';
import {
CCTV_PROJECTION_OVERLAY_SOURCE_ID,
CCTV_PROJECTION_OVERLAY_SOURCE_OPTIONS,
@@ -77,7 +78,7 @@ export function createProjection({
);
}
if (runtime.labelPosition) {
Cesium.Cartesian3.clone(positions.label, runtime.labelPosition);
geo.cartesian3.clone(positions.label, runtime.labelPosition);
}
}
@@ -124,8 +125,8 @@ export function createProjection({
/** Create the native monitor plane plus its cached host-label presentation. */
function createProjectionPlane(record, runtime, geometry, positions) {
runtime.labelPosition ||= new Cesium.Cartesian3();
Cesium.Cartesian3.clone(positions.label, runtime.labelPosition);
runtime.labelPosition ||= geo.cartesian3.create();
geo.cartesian3.clone(positions.label, runtime.labelPosition);
runtime.cameraId = String(record.camera.id);
runtime.overlayEntry = createCctvProjectionOverlayEntry({
cameraId: runtime.cameraId,
@@ -142,7 +143,7 @@ export function createProjection({
positions.capCenter,
),
plane: {
plane: new Cesium.Plane(Cesium.Cartesian3.UNIT_Z, 0.0),
plane: new Cesium.Plane(geo.cartesian3.UNIT_Z, 0.0),
dimensions: new Cesium.Cartesian2(
geometry.halfW * 2,
geometry.halfH * 2,
@@ -186,7 +187,7 @@ export function createProjection({
video: null,
planeEntity: null,
cameraId: String(record.camera.id),
labelPosition: new Cesium.Cartesian3(),
labelPosition: geo.cartesian3.create(),
overlayEntry: null,
planeMaterial: null,
buffers: null,