mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
Cesium draw port drapes arrows, draws ellipse radii by camera height and classifies volumes
Draped lines take the arrow style. Clamped ellipses with radii by camera height are drawn at the camera's height each frame, drawn alone up to MOVING_SHAPES (counting those a retiring host still draws alone) and rebuilt past that. Extruded shapes that classify their volume draw as a ClassificationPrimitive where the scene supports it, and extruded polygons draw their outline cage. The stub picks clamped rectangles, ellipses and classifying volumes, outside their holes. Conformance checks radii by camera height and classifying volumes on both renderers.
This commit is contained in:
1 parent
561cd8f1cf
commit
1d813a8055
6 files changed
+703
-40
No files matched your search
@@ -141,6 +141,40 @@ test('a draped rectangle across the antimeridian picks on both sides of it, turn
|
||||
r.destroy();
|
||||
});
|
||||
|
||||
test('an extruded volume that classifies picks inside its outer ring and not in its holes', () => {
|
||||
const r = createStubRenderer();
|
||||
r.camera.setView({
|
||||
destination: { lon: 0, lat: 0, height: 20_000 },
|
||||
orientation: { heading: 0, pitch: -Math.PI / 2, roll: 0 },
|
||||
});
|
||||
const shapes = r.draw.shapes({ id: 'volume' });
|
||||
const square = (d) =>
|
||||
[
|
||||
[-d, -d],
|
||||
[d, -d],
|
||||
[d, d],
|
||||
[-d, d],
|
||||
].map(([lon, lat]) => ({ lon, lat, height: -50 }));
|
||||
shapes.set([
|
||||
{
|
||||
id: 'v',
|
||||
geometry: { kind: 'polygon', rings: [square(0.02), square(0.005)] },
|
||||
fill: '#f80',
|
||||
extrudeHeight: 100,
|
||||
height: 'absolute',
|
||||
classifyVolume: true,
|
||||
},
|
||||
]);
|
||||
const picked = (lon, lat) => {
|
||||
const s = r.query.project(toEcef({ lon, lat, height: 0 }));
|
||||
return r.query.drillPick(s.x, s.y).some((hit) => hit.set === 'volume');
|
||||
};
|
||||
assert.ok(picked(0.012, 0), 'between its rings');
|
||||
assert.ok(!picked(0, 0), 'not in its hole');
|
||||
assert.ok(!picked(0.03, 0), 'not outside');
|
||||
r.destroy();
|
||||
});
|
||||
|
||||
test('the stub says where it draws an item, for a camera that is not its own', () => {
|
||||
const r = createStubRenderer();
|
||||
const t0 = r.frame.time();
|
||||
|
||||
Reference in new issue
Block a user