Read a moving icon's position and course through one shared evaluator

render/motion/iconMotion evaluates a draw item's motion segment and course
glide at a time on the set's motion clock, without a renderer: where the
item is drawn, the course it is drawn with, and when its motion ends. The app
can now read a moving icon back (to follow it, label it, judge a pick or
its horizon) the way the renderer draws it.

The stub renderer evaluates its segments with it, in place of its own copy,
and so now steps a lerp with no span 1 ms after t0, as the Cesium renderer
does. The Cesium GPU icon sets read the course shown before a write, a
blend's target and when rows stop moving through it, from copies of what
they wrote, and write each glide with the offset it computes, so an exact
half turn goes the way the app reads it.

norm360/norm180 and Position-to-ECEF move to geo for both to share.
Conformance gains a check that icons are drawn where the evaluator puts
them.
This commit is contained in:
Sameh Khamis committed 2026-11-07 02:36:39 -08:00
1 parent b774bd84c8
commit 0349941b71
14 files changed
+703 -105

No files matched your search

+10
View File
@@ -110,6 +110,16 @@ export function fromRadians(lon, lat, height = 0) {
export const fromDegrees = (lon, lat, height = 0) =>
fromRadians(toRadians(lon), toRadians(lat), height);
/**
* A position as ECEF (a new object): `{lon, lat, height?}` (degrees, metres
* above the ellipsoid) or `{x, y, z}`, the render contract's `Position`.
*/
export function positionToEcef(position) {
if ('lon' in position && 'lat' in position)
return fromDegrees(position.lon, position.lat, position.height ?? 0);
return vec(position.x, position.y, position.z);
}
/** The point on the ellipsoid along the geodetic normal, or null at the centre. */
export function scaleToGeodeticSurface(p, ellipsoid) {
const e = ellipsoidArg(ellipsoid);
+7
View File
@@ -56,6 +56,13 @@ export const DEGREES_PER_RADIAN = 180 / Math.PI;
export const toRadians = (degrees) => degrees * RADIANS_PER_DEGREE;
export const toDegrees = (radians) => radians * DEGREES_PER_RADIAN;
export const clamp = (v, lo, hi) => Math.min(hi, Math.max(lo, v));
/** Degrees in [0, 360). */
export const norm360 = (deg) => ((deg % 360) + 360) % 360;
/** Degrees in (-180, 180]. */
export function norm180(deg) {
const n = norm360(deg);
return n > 180 ? n - 360 : n;
}
export const acosClamped = (v) => Math.acos(clamp(v, -1, 1));
export const equalsEpsilon = (a, b, eps) => Math.abs(a - b) <= eps;