mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
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:
1 parent
b774bd84c8
commit
0349941b71
14 files changed
+703
-105
No files matched your search
+12
-2
@@ -153,12 +153,22 @@ export function writeArcSegment(out, row, segment) {
|
||||
* @param {number} fromCourseDeg
|
||||
* @param {number} t0
|
||||
* @param {number} rateDps
|
||||
* @param {number} [offsetDeg] The glide's start offset from the segment's
|
||||
* course, when the caller has it (render/motion/iconMotion's
|
||||
* `glideOffset`): its sign then picks the way an exact half turn goes.
|
||||
*/
|
||||
export function writeCourseGlide(out, row, fromCourseDeg, t0, rateDps) {
|
||||
export function writeCourseGlide(
|
||||
out,
|
||||
row,
|
||||
fromCourseDeg,
|
||||
t0,
|
||||
rateDps,
|
||||
offsetDeg,
|
||||
) {
|
||||
const o = row * SEGMENT_STRIDE;
|
||||
out[o + SLEW_OFFSET] = 0;
|
||||
const target = targetCourse(out, o, t0);
|
||||
out[o + SLEW_OFFSET] = norm180(fromCourseDeg - target);
|
||||
out[o + SLEW_OFFSET] = offsetDeg ?? norm180(fromCourseDeg - target);
|
||||
out[o + SLEW_T0] = t0;
|
||||
out[o + SLEW_RATE] = rateDps > 0 ? rateDps : -1;
|
||||
}
|
||||
|
||||
@@ -205,6 +205,7 @@ test('consumer build includes only infrastructure code and resolves assets under
|
||||
'heights.js',
|
||||
'horizon.js',
|
||||
'iconAtlas.js',
|
||||
'iconMotion.js',
|
||||
'iconSegment.js',
|
||||
'iconSet.js',
|
||||
'iconSetPrimitive.js',
|
||||
|
||||
@@ -7,15 +7,12 @@
|
||||
* skylight (https://github.com/cpaczek/skylight, MIT) shared/src/aim.ts.
|
||||
*/
|
||||
import * as Cesium from 'cesium';
|
||||
import { norm180, norm360 } from '../geo/vector.js';
|
||||
|
||||
const DEG = Math.PI / 180;
|
||||
const _mmCarto = new Cesium.Cartographic();
|
||||
const _mmCandidateCarto = new Cesium.Cartographic();
|
||||
|
||||
export function norm360(deg) {
|
||||
return ((deg % 360) + 360) % 360;
|
||||
}
|
||||
|
||||
/**
|
||||
* Lift a repeated grounded fix to a newly resolved render floor without
|
||||
* manufacturing a new source timestamp or changing its reported lat/lon.
|
||||
@@ -49,11 +46,8 @@ export function liftRepeatedGroundFix(newest, candidatePosition, onGround) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Normalize to (−180, 180]. */
|
||||
export function norm180(deg) {
|
||||
const n = norm360(deg);
|
||||
return n > 180 ? n - 360 : n;
|
||||
}
|
||||
/** Degrees in [0, 360) and (−180, 180]. */
|
||||
export { norm180, norm360 };
|
||||
|
||||
/**
|
||||
* Course over ground (deg from north, clockwise) of the chord from → to,
|
||||
|
||||
Reference in new issue
Block a user