mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
Keep shape radii, rim gradients, depth-fail looks, sweep cadence and step camera moves out of the renderer contract
Shapes take their radii in metres; the world annotation ring follows the camera height itself (ringRadiusAt), resizing on preRender. The radial rim preset and depthBias go: the launch pad zone draws a canvas image fill made by the layer. Solid and dashed lines take one depthFail look (solid or dash) in place of depthFailColor and depthFailDash. sonarCadenceHz goes from the quality settings: nothing set it, and the sweep moves every 80 ms. Camera move, look, rotateAround and zoom leave the camera port: the app's pans, in-place turns, globe turns and zooms are setView views summed over the pose (geo/eyeMoves), and the Cesium port places a view by direction and up exactly rather than through heading, pitch and roll. The conformance driver runs those script steps through setView; the lookAt script turns in place where it turned about the frame-local axis, and its reference is recorded again.
This commit is contained in:
1 parent
7a376ebefc
commit
c8346c9fda
44 files changed
+810
-799
No files matched your search
Vendored
+7
-7
@@ -208,6 +208,13 @@ export type CameraEvent =
|
||||
|
||||
export interface CameraPort {
|
||||
pose(): CameraPose;
|
||||
/**
|
||||
* Place the eye. A position with a `{direction, up}` orientation is placed
|
||||
* exactly as given (`up` made square to `direction`), never rounded
|
||||
* through heading, pitch and roll: the application's step moves (pans, turns, the
|
||||
* globe turned under the eye, zooms; `geo/eyeMoves`) are such views,
|
||||
* sent many times over.
|
||||
*/
|
||||
setView(view: ViewSpec): void;
|
||||
setFov(fov: { vertical: number }): void;
|
||||
/**
|
||||
@@ -236,13 +243,6 @@ export interface CameraPort {
|
||||
lookAt(target: Ecef, offset: HeadingPitchRange): void;
|
||||
/** Leave `lookAt` for the world frame. */
|
||||
release(): void;
|
||||
move(
|
||||
direction: 'forward' | 'back' | 'left' | 'right' | 'up' | 'down',
|
||||
metres: number,
|
||||
): void;
|
||||
look(direction: 'left' | 'right' | 'up' | 'down', radians: number): void;
|
||||
rotateAround(axis: Vec3, radians: number): void;
|
||||
zoom(metres: number): void;
|
||||
/**
|
||||
* Follow `target`, or stop following with null; `followChanged` fires
|
||||
* whenever `followed` changes, and only then.
|
||||
|
||||
@@ -183,7 +183,7 @@ test('members added to version 0 later are optional, each behind its capability'
|
||||
Object.fromEntries(
|
||||
members(checker.getTypeAtLocation(declared(shape).name)),
|
||||
)[field];
|
||||
assert.equal(optional('LineItem', 'depthFailDash'), true);
|
||||
assert.equal(optional('LineItem', 'depthFail'), true);
|
||||
// And on one kind of a union: the rectangle's rotation.
|
||||
const rectangle = checker
|
||||
.getTypeAtLocation(declared('ShapeGeometry').name)
|
||||
|
||||
Vendored
+18
-27
@@ -212,15 +212,11 @@ export interface LineItem {
|
||||
mode: '3d' | 'geodesic' | 'draped';
|
||||
clampTo?: ClampTarget;
|
||||
style: LineStyle;
|
||||
/** Colour where the line is behind the surface; `null` hides those parts. */
|
||||
depthFailColor?: Color | null;
|
||||
/**
|
||||
* Dash the parts behind the surface, in `depthFailColor`, as a `dash`
|
||||
* style's `length` and `pattern16` dash a line. Omitted, they are solid; a
|
||||
* renderer that predates it draws them solid too. Ignored without a
|
||||
* `depthFailColor`, and on draped lines, which are never behind it.
|
||||
* How the parts behind the surface draw, solid or dashed; omitted or
|
||||
* `null` hides them. Ignored on draped lines, which are never behind it.
|
||||
*/
|
||||
depthFailDash?: { length: number; pattern16?: number };
|
||||
depthFail?: Extract<LineStyle, { kind: 'solid' | 'dash' }> | null;
|
||||
/** Per-segment colours; changing them does not rebuild the line. */
|
||||
segmentColors?: Color[];
|
||||
segmentShow?: boolean[];
|
||||
@@ -233,25 +229,23 @@ export interface LineItem {
|
||||
pickable?: boolean;
|
||||
}
|
||||
|
||||
/** A shape's fill. */
|
||||
export type Fill =
|
||||
| Color
|
||||
| { image: ImageRef; repeat?: [number, number] }
|
||||
| { preset: 'radialRim'; color: Color; rimColor: Color; rimWidth: number };
|
||||
/**
|
||||
* A shape's fill: a colour, or an image stretched over the shape's extent
|
||||
* (`repeat` times across and up). A canvas image sent again with a new
|
||||
* `key` is new content.
|
||||
*/
|
||||
export type Fill = Color | { image: ImageRef; repeat?: [number, number] };
|
||||
|
||||
/** Declarative animation the renderer runs (no per-frame callbacks). */
|
||||
/**
|
||||
* Declarative animation the renderer runs (no per-frame callbacks): the
|
||||
* fill's and outline's alpha swings between `from` and `to` and back every
|
||||
* `periodMs`, forever.
|
||||
*/
|
||||
export interface Pulse {
|
||||
property: 'radius' | 'alpha';
|
||||
property: 'alpha';
|
||||
from: number;
|
||||
to: number;
|
||||
periodMs: number;
|
||||
/** Repeat count; omitted repeats forever. */
|
||||
repeat?: number;
|
||||
}
|
||||
|
||||
/** A radius that follows the camera's height above the ground. */
|
||||
export interface RadiusByCameraHeight {
|
||||
byCameraHeight: { factor: number; min: number; max: number };
|
||||
}
|
||||
|
||||
export type ShapeGeometry =
|
||||
@@ -259,12 +253,11 @@ export type ShapeGeometry =
|
||||
| {
|
||||
kind: 'ellipse';
|
||||
center: Position;
|
||||
semiMajor: number | RadiusByCameraHeight;
|
||||
semiMinor: number | RadiusByCameraHeight;
|
||||
/** Metres. */
|
||||
semiMajor: number;
|
||||
semiMinor: number;
|
||||
/** Radians counter-clockwise from north to the semi-major axis. */
|
||||
rotation?: number;
|
||||
/** Only part of the ellipse, radians from north. */
|
||||
arc?: { start: number; end: number };
|
||||
}
|
||||
/**
|
||||
* `height`: metres above the ellipsoid, for a rectangle not clamped.
|
||||
@@ -292,8 +285,6 @@ export interface ShapeItem {
|
||||
extrudeHeight?: number;
|
||||
height?: 'absolute' | 'clampGround';
|
||||
clampTo?: ClampTarget;
|
||||
/** Pull toward the eye, metres, to win depth against coplanar surfaces. */
|
||||
depthBias?: number;
|
||||
/**
|
||||
* Shaded by the renderer's fixed light (true) or flat colour (false).
|
||||
* Omitted: lit for extruded shapes, flat otherwise. A renderer
|
||||
|
||||
Vendored
+2
-2
@@ -46,8 +46,8 @@ export interface StyleDefinition extends StyleDescriptor {
|
||||
* full inside the band, each by where its anchor is on screen; the map,
|
||||
* lines and shapes draw as they are, and picks are unchanged. A radius of 0
|
||||
* dims every marker to `floor` (the theme on, the sweep off). Setting a
|
||||
* sector, or clearing it, asks for one frame; the app sets it again at
|
||||
* `sonarCadenceHz`.
|
||||
* sector, or clearing it, asks for one frame; the application moves it about every
|
||||
* 80 ms while it sweeps.
|
||||
* `diagnostics().passes` lists `'screenModulation'` while it draws, so a
|
||||
* sector set but not listed is unsupported.
|
||||
*/
|
||||
|
||||
@@ -74,7 +74,6 @@ export const QUALITY_KEYS = Object.freeze([
|
||||
'particles',
|
||||
'models',
|
||||
'postFx',
|
||||
'sonarCadenceHz',
|
||||
'targetFps',
|
||||
]);
|
||||
|
||||
@@ -174,10 +173,6 @@ export const PORTS = deepFreeze({
|
||||
'flying',
|
||||
'lookAt',
|
||||
'release',
|
||||
'move',
|
||||
'look',
|
||||
'rotateAround',
|
||||
'zoom',
|
||||
'follow',
|
||||
'followed',
|
||||
'followFramed',
|
||||
|
||||
Vendored
-2
@@ -26,8 +26,6 @@ export interface QualitySettings {
|
||||
models: { maxInstances: number; maxDistance: number };
|
||||
/** Detail of the post-processing passes; bloom and sharpen are switched in `effects`. */
|
||||
postFx: 'low' | 'high';
|
||||
/** Updates per second of a screen modulation sweep. */
|
||||
sonarCadenceHz: number;
|
||||
targetFps: number;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user