mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
Delete the billboard and model mirrors; models become layer-held records
Aircraft draw from GPU icon sets, so the billboard mirror, the billboard treatment and the aircraft visual-state module had no callers left. 3D models are now records the layer holds under the contact's id (modelRecord.js): show and placement are written through showModel/placeModel and read back from the record; renderer-measured values stay on record.model. The tracked-model click check only matches when a tracked model exists, so an id-only pick is never mistaken for a click on the tracked plane.
This commit is contained in:
1 parent
c9f1fcd425
commit
83ec9473b6
35 files changed
+391
-788
No files matched your search
@@ -1,5 +1,4 @@
|
||||
import * as Cesium from 'cesium';
|
||||
import { modelState } from './modelMirror.js';
|
||||
/**
|
||||
* Model-space visual centres measured from the shipped GLBs' scene-space AABBs.
|
||||
*
|
||||
@@ -107,13 +106,16 @@ const _chainScratch = new Cesium.Matrix4();
|
||||
* here, so exactly one transform — Cesium's own — stands between the table and
|
||||
* the world, and there is no second convention to drift.
|
||||
*
|
||||
* @param {object} model Cesium Model (needs modelMatrix, computedScale, sceneGraph).
|
||||
* @param {import('./modelRecord.js').ModelRecord} record The layer's record of
|
||||
* the model: where it placed it, and the Cesium Model (computedScale,
|
||||
* sceneGraph).
|
||||
* @param {readonly number[]} nativeAnchor Raw glTF `[x, y, z]` native-unit offset.
|
||||
* @param {{x:number,y:number,z:number}} result Mutable Cartesian-like result.
|
||||
* @returns {{x:number,y:number,z:number}|null} World position of the anchor.
|
||||
*/
|
||||
export function modelAnchorWorld(model, nativeAnchor, result) {
|
||||
const modelMatrix = modelState(model)?.modelMatrix;
|
||||
export function modelAnchorWorld(record, nativeAnchor, result) {
|
||||
const modelMatrix = record?.matrix;
|
||||
const model = record?.model;
|
||||
if (!modelMatrix || !nativeAnchor || !result) return null;
|
||||
const scale = Number.isFinite(model.computedScale) ? model.computedScale : 1;
|
||||
_anchorScratch.x = (nativeAnchor[0] || 0) * scale;
|
||||
|
||||
Reference in new issue
Block a user