Read the cockpit clouds' camera point from the camera port's pose

The cloud layer takes latitude, longitude and height from pose() and its
angle conversion from geo/vector, so it no longer reaches Cesium and
leaves the Cesium allow-list.
This commit is contained in:
Sameh Khamis committed 2026-11-08 14:49:24 -08:00
1 parent f9749ac83c
commit 75ad7baf13
2 files changed
+7 -8

No files matched your search

+7 -7
View File
@@ -1,5 +1,6 @@
import { applicationServices } from './services/application.js';
import * as Cesium from 'cesium';
import { toRadians } from './geo/vector.js';
import { findCamera } from './render/rendererOf.js';
import { greatCircleMeters } from './geoDistance.js';
import {
deriveWeatherEffectProfile,
@@ -327,15 +328,14 @@ class CockpitCloudEffectsController {
}
cameraPoint() {
const cartographic = this.viewer?.camera?.positionCartographic;
if (!cartographic) return null;
const latitude = Cesium.Math.toDegrees(cartographic.latitude);
const longitude = Cesium.Math.toDegrees(cartographic.longitude);
const pose = this.viewer ? findCamera(this.viewer)?.pose() : null;
if (!pose) return null;
const { lat: latitude, lon: longitude } = pose;
if (![latitude, longitude].every(Number.isFinite)) return null;
return {
latitude,
longitude,
altitudeM: Math.max(0, Number(cartographic.height) || 0),
altitudeM: Math.max(0, Number(pose.height) || 0),
};
}
@@ -528,7 +528,7 @@ class CockpitCloudEffectsController {
render(timeSec) {
const gl = this.gl;
if (!gl || !this.program || !this.locations) return;
const windRadians = Cesium.Math.toRadians(this.windDirectionDeg);
const windRadians = toRadians(this.windDirectionDeg);
const windScale = 0.008 + this.windStrength * 0.022;
gl.useProgram(this.program);
gl.uniform2f(
-1
View File
@@ -4,7 +4,6 @@
"src/app/embed.js",
"src/app/scene.js",
"src/app/viewer.js",
"src/cockpitCloudEffects.js",
"src/cyberSonarGpu.js",
"src/cyberSonarScene.js",
"src/data/geoImportPins.js",