mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Draw CCTV and data packs through engine.meshes
Add indexed world triangles to the required globe contract on Cesium, Navara and the fake engine. Own geometry, textures, visibility, depth tests, pick identities and teardown inside each engine. Reused canvas images request another frame until their new pixels upload. Move obstruction rays and owned mesh, line and mover exclusions into the Cesium surface adapter. Draw CCTV monitor planes and viewshed volumes through shared mesh handles. Draw data-pack points, straight lines, raised polygons, image rectangles and media captions through movers, lines and meshes. Delete the feature renderers for each engine and retain decoded assets across scene rebinds. Register the modules, dependency, format scope and reduced coupling baseline. Cesium is the reference for geometry, colours, image placement, marker sizes, caption offsets, picking and resource ownership. Navara now uses straight pack lines and per-position polygon heights without edge densification. Navara meshes draw in the transparent pass after the effects, with the scene-depth test and the view's exposure undone, as the pack meshes did: in the scene pass the landscape look's exposure washed a red pack image to white. The scene-depth helper moves into the Navara engine, and the stems helper that only its test still used is deleted. The mesh picker takes the globe when Navara's depth read answers with the camera itself, which it does right after another click and which hid a polygon from a quick second click. The 256 px media caption is not pickable: its transparent square took clicks meant for nearby pack features, and no action targets it. Annotation drapes remain on their existing renderers because bounded building classification, animated fills and wire cages need a separate contract extension to preserve Cesium behaviour. Coupling falls from 344 to 210 Cesium layer-renderer lines, 1294 to 794 Navara layer-renderer lines, 9 to 7 external Cesium import files, 1026 to 1005 viewer lines, 9 to 6 extension reads and 42 to 39 engine-name lines. Other counts do not grow. The full unit suite, import directions, package boundaries, formatting and coupling checks pass. No user-visible strings change. In the browser, keyless: the contract suite passes on Navara and on Cesium apart from the camera-events check that also fails intermittently before this change; CCTV v2 (58 checks), the CCTV and director engine switches pass, with the pack image at the same pixel as before on both engines. The mesh contract fixture now sits at 3 km, above the terrain Navara draws there. The director interactions script starts at its view in the link so the app's arrival flight no longer lands after the shot, and waits for the click's asynchronous pick; its last step, the next-shot action, fails the same way before this change.
This commit is contained in:
1 parent
3907b7084e
commit
f4b83a3a31
57 files changed
+1891
-1588
No files matched your search
+30
-5
@@ -198,8 +198,8 @@
|
||||
* sampleHeight with the answer's quality (src/globe/surfaceDetail.js):
|
||||
* from the tiles drawn now (Navara: where they miss, the finest loaded
|
||||
* ones; Cesium samples what it has loaded). Where no tile answers, the
|
||||
* terrain. `exclude` takes this engine's mover sets as well as engine
|
||||
* objects.
|
||||
* terrain. `exclude` takes this engine's mover sets, lines and meshes as
|
||||
* well as native engine objects.
|
||||
* @property {boolean} supported Whether sampleHeight works.
|
||||
* @property {(cartographic: Cartographic) => (number | undefined)} terrainHeight
|
||||
* Height of the terrain/globe surface only (Cesium's globe.getHeight).
|
||||
@@ -209,7 +209,8 @@
|
||||
* @property {boolean} clampToHeightSupported
|
||||
* @property {() => boolean} tilesLoaded
|
||||
* @property {(ray: { origin: Cartesian3, direction: Cartesian3, far: number, exclude?: any[] }) => ({ position: Cartesian3, distance: number, object: any } | undefined)} [raycast]
|
||||
* Nearest visible tile triangle within finite positive `far` metres. Direction
|
||||
* Nearest visible scene object within finite positive `far` metres (Navara:
|
||||
* loaded tile triangles). Direction
|
||||
* is normalized by the adapter. Excluded roots/meshes and hidden objects do
|
||||
* not obstruct; a miss or unsupported geometry returns undefined, not terrain.
|
||||
*
|
||||
@@ -641,6 +642,28 @@
|
||||
* now: the globe, 3D tiles, or nothing (a Cesium stack with neither
|
||||
* draws no imagery until one shows; the layers wait).
|
||||
*
|
||||
* @typedef {object} MeshOptions
|
||||
* @property {string} id Unique within the engine.
|
||||
* @property {ArrayLike<number>} positions Flat Earth-fixed xyz metres, copied.
|
||||
* @property {ArrayLike<number>} indices Triangle vertex indices, copied.
|
||||
* @property {ArrayLike<number>} [uv] Texture coordinates, (0,0) at bottom left.
|
||||
* @property {number[]} [color] RGBA in 0..1, white by default; multiplies image.
|
||||
* @property {object|null} [image] Canvas, image or video; caller owns its lifetime.
|
||||
* @property {boolean} [show=true]
|
||||
* @property {'normal'|'always'} [depthTest='normal']
|
||||
* @property {any} [pickId] Null disables picking. Both faces draw and pick.
|
||||
*
|
||||
* @typedef {object} GlobeMesh
|
||||
* @property {string} id
|
||||
* @property {(patch: Partial<MeshOptions>) => void} update Updates geometry or style.
|
||||
* Repeating an image uploads changed pixels. Omitted fields retain their values.
|
||||
* @property {(visible?: boolean) => (boolean|void)} show Read or set visibility.
|
||||
* @property {() => void} destroy Idempotent; releases engine-owned resources.
|
||||
*
|
||||
* @typedef {object} GlobeMeshes
|
||||
* @property {(options: MeshOptions) => GlobeMesh} createMesh
|
||||
* @property {() => string[]} list Live mesh ids in creation order.
|
||||
*
|
||||
* @typedef {object} GlobeEngine
|
||||
* @property {'cesium'|'navara'} kind
|
||||
* @property {{ container: object, canvas: object, size: () => { width: number, height: number } }} host
|
||||
@@ -662,6 +685,7 @@
|
||||
* @property {GlobeMovers} movers The layers' moving objects (sprites,
|
||||
* points, models), drawn by the engine.
|
||||
* @property {GlobeLines} lines The layers' dynamic polylines.
|
||||
* @property {GlobeMeshes} meshes World triangles.
|
||||
* @property {GlobeGround} ground The layers' fills on the ground.
|
||||
* @property {GlobeImagery} imagery The layers' rasters on the ground.
|
||||
* @property {() => void} destroy
|
||||
@@ -876,6 +900,7 @@ const SHAPE = {
|
||||
clock: { now: isFunction, frameTime: isFunction },
|
||||
movers: { createSet: isFunction, list: isFunction },
|
||||
lines: { createLine: isFunction, list: isFunction },
|
||||
meshes: { createMesh: isFunction, list: isFunction },
|
||||
ground: { createSet: isFunction, list: isFunction },
|
||||
imagery: {
|
||||
createLayer: isFunction,
|
||||
@@ -924,7 +949,7 @@ const OPTIONAL_SHAPE = {
|
||||
|
||||
// Required capabilities engineCapabilities reports as well: true for an
|
||||
// engine that has them whole, as every valid engine does.
|
||||
const REPORTED_REQUIRED = ['movers', 'lines', 'ground', 'imagery'];
|
||||
const REPORTED_REQUIRED = ['movers', 'lines', 'ground', 'imagery', 'meshes'];
|
||||
|
||||
const memberAt = (engine, path) =>
|
||||
path.split('.').reduce((value, key) => value?.[key], engine);
|
||||
@@ -934,7 +959,7 @@ const memberAt = (engine, path) =>
|
||||
* booleans. A caller that refuses a feature on an engine without one
|
||||
* (voice, say) asks here. Cesium and Navara draw the styles, bloom and
|
||||
* contact sonar; only Navara has cloudCover. `movers`, `lines`, `ground`
|
||||
* and `imagery` are required; they are reported too, true for every valid
|
||||
* and `imagery`, plus `meshes`, are required; they are reported too, true for every valid
|
||||
* engine.
|
||||
*/
|
||||
export function engineCapabilities(engine) {
|
||||
|
||||
Reference in new issue
Block a user