mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Draw CCTV coverage, viewsheds and the monitor plane through the renderer ports and take projection.js off the Cesium list
The frustum wireframes, viewshed volumes and the active camera's monitor plane are now line, mesh and quad items of the layer's own draw sets (layers/cctv/drawSets.js), written from plain handles only as they change. The plane takes its canvas double buffer or its video as a quad source. Picks of lines and planes are matched by set, item id and the record that draws them. The activation obstruction probe casts through the query port's rayCast; its clamp lands a microtask later, rewrites the geometry and asks again for the footprint ground, and a newer activation, a range edit, a deactivation or a re-init drops an answer still to come.
This commit is contained in:
1 parent
bbad02b73e
commit
2a607ec4d8
20 files changed
+918
-492
No files matched your search
@@ -106,9 +106,9 @@ export function createFrames({ state: layerState, services, parts, source }) {
|
||||
* Blits the latest projection canvas into the next of two alternating
|
||||
* offscreen buffer canvases and returns it (H5).
|
||||
*
|
||||
* Two buffers are required because Cesium's Material image path re-uploads a
|
||||
* canvas texture only when the uniform receives a NEW object reference —
|
||||
* redrawing the same canvas in place is invisible to the GPU. Alternating
|
||||
* Two buffers are required because the plane re-uploads a canvas texture
|
||||
* only when it is given a NEW canvas — redrawing the same canvas in place
|
||||
* is invisible to the GPU. Alternating
|
||||
* references forces a texture recreate, which at <=1Hz and 1080p is cheap.
|
||||
*
|
||||
* @param {Object} runtime - Projection runtime with `.canvas`.
|
||||
@@ -139,8 +139,8 @@ export function createFrames({ state: layerState, services, parts, source }) {
|
||||
* Pushes fresh pixels into the monitor plane material. Called every
|
||||
* projection tick.
|
||||
*
|
||||
* Video feeds are skipped entirely — their HTMLVideoElement uniform is
|
||||
* updated per-frame by Cesium natively (H5). Image/webcam-frame feeds swap
|
||||
* Video feeds are skipped entirely — the renderer reads their
|
||||
* HTMLVideoElement every frame (H5). Image/webcam-frame feeds swap
|
||||
* the double-buffer canvas reference, throttled to PROJECTION_TEXTURE_SWAP_MS.
|
||||
*
|
||||
* @param {Object} record - Camera record with an initialized projection runtime.
|
||||
@@ -156,7 +156,7 @@ export function createFrames({ state: layerState, services, parts, source }) {
|
||||
)
|
||||
return;
|
||||
|
||||
const planeShowing = !!(runtime.planeEntity?.show && runtime.planeMaterial);
|
||||
const planeShowing = !!runtime.plane?.show;
|
||||
if (!planeShowing) return;
|
||||
|
||||
// Only swap when the canvas content actually changed since the last swap.
|
||||
@@ -170,7 +170,7 @@ export function createFrames({ state: layerState, services, parts, source }) {
|
||||
if (!buffer) return;
|
||||
runtime.lastTextureSwapAt = now;
|
||||
runtime.lastSwappedCanvasStamp = runtime.canvasStamp;
|
||||
runtime.planeMaterial.image = buffer;
|
||||
parts.projection.setPlaneSource(runtime, { canvas: buffer });
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -346,7 +346,7 @@ export function createFrames({ state: layerState, services, parts, source }) {
|
||||
// camera republished once in 5 minutes, an Austin one not at all.
|
||||
// Redrawing regardless bumped canvasStamp, which forced a buffer swap
|
||||
// and a fresh 1920x1080 texture upload; the plane renders its white
|
||||
// base color (planeMaterial color = WHITE, alpha .95) for the frame or
|
||||
// base color (white, alpha .95) for the frame or
|
||||
// two Cesium needs to rebind, which IS the periodic white flash from the
|
||||
// owner field tests (2026-07-04 and 2026-07-30).
|
||||
const fit = fitToProjection(
|
||||
|
||||
Reference in new issue
Block a user