mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
fix(awareness): keep range pulses out of picking and in the style palette
Review follow-up for the sonar pulses (the non-blocking items). Unpickable pulses: the three pulse lines were polyline entities, which Cesium always picks, so near-miss and touch picks around them became unowned hits. They are now drawn by the pulse disc's shader, which already drew the gradient and is built with allowPicking false. Each line keeps the polyline outline material's look: 3 CSS px wide with a 1 px dark outline in the ring's colours, measured from the screen-space gradient of the disc's radius times czm_pixelRatio, as Cesium's contour material does. Without derivatives only the gradient band is drawn. Disc follow: with the lines on the disc, it is rebuilt after the subject moves 500 m instead of 2 km, so the pulses stay concentric with the ring. A resting disc is hidden and not rebuilt; it catches up when the pulses wake. Camera below the disc: the disc sits 2.5 km above the ellipsoid with faceForward, so from a lower camera it swept across the sky. It is now hidden while the camera is below that height. Echo palette: echo brackets keep the pulse blue on the default detection style and take the style's line colour under NVG, FLIR and CRT. Echo test: the detection renderer's echo maths moves into awarenessEchoBracket and awarenessEchoColor in src/awarenessEcho.js, tested directly instead of running a regex slice of detection.js through vm, and the one-sided spread assert is now two-sided. The positions reuse parameter of awarenessRangeRingPositions and the pulse segment count had no callers left and are removed.
This commit is contained in:
1 parent
0c025987ef
commit
013cfdf91d
7 files changed
+303
-234
No files matched your search
@@ -72,11 +72,17 @@ export const AWARENESS_RANGE_RING_STYLE = Object.freeze({
|
||||
* `periodMs / count`. Each starts at `startFraction` of the radius, fades in
|
||||
* over `fadeInFraction` of its travel, then fades as (1 - travel) to the
|
||||
* `fadeOutPower` down to `endOpacityFraction` of `peakOpacity`, so a pulse
|
||||
* is dim but still visible when it reaches the ring and the ring flashes. Behind each line a radial gradient in the same blue fades
|
||||
* inward over `gradientDepthFraction` of the radius, at most
|
||||
* `gradientOpacity` strong. The gradient disc is rebuilt only after the
|
||||
* subject moves `gradientRebuildM`, since a soft band 2 km off centre on a
|
||||
* 250 km disc does not show. The gradient shader takes at most four pulses.
|
||||
* is dim but still visible when it reaches the ring and the ring flashes.
|
||||
* Each line is `width` CSS pixels wide, its outer `outlineWidth` a dark
|
||||
* halo, in the ring's colours, as Cesium's polyline outline material draws. Behind each line a radial gradient in the same blue
|
||||
* fades inward over `gradientDepthFraction` of the radius, at most
|
||||
* `gradientOpacity` strong. One unpickable disc draws the lines and the
|
||||
* gradient, so pulses never catch a click meant for a contact; its shader
|
||||
* takes at most four pulses. The disc is rebuilt only after the subject
|
||||
* moves `gradientRebuildM`, so the pulses sit at most that far off the ring's
|
||||
* centre, about a pixel when the ring fills the screen; while the pulses
|
||||
* rest the hidden disc is left alone and catches up when they wake. The disc is hidden
|
||||
* while the camera is below its height, where it would sweep the sky.
|
||||
* The pulses run for `activeMs` (three ring flashes) after a selection or
|
||||
* a camera move, fading in and out over `settleMs`, then rest: the ring
|
||||
* stays on screen, static, and nothing asks for frames, so a parked view
|
||||
@@ -98,11 +104,10 @@ export const AWARENESS_RANGE_PULSE = Object.freeze({
|
||||
peakOpacity: 0.6,
|
||||
width: 3,
|
||||
outlineWidth: 1,
|
||||
segments: 96,
|
||||
gradientDepthFraction: 0.35,
|
||||
gradientOpacity: 0.22,
|
||||
gradientGranularityDeg: 0.25,
|
||||
gradientRebuildM: 2000,
|
||||
gradientRebuildM: 500,
|
||||
activeMs: 9000,
|
||||
settleMs: 1200,
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user