mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
fix(vessels): upload Navara chevrons and restore click focus
Fix delayed and growing mover bank commits, reject stale hidden model picks, and route world-focus through the engine. Strengthen vessel parity and performance checks without changing thresholds.
This commit is contained in:
1 parent
69a78710cc
commit
c8a4f3ed98
10 files changed
+96
-7
No files matched your search
@@ -196,10 +196,11 @@ export function createCpuPicker({ projector, camera, movers, lines }) {
|
||||
const found = movers().find(({ options }) => options.id === owner);
|
||||
if (!found) return true;
|
||||
const { options, store, pickRadiusPx } = found;
|
||||
if (instance < 0 || instance >= store.count || store.shows[instance] !== 1)
|
||||
return false;
|
||||
const modelRadius =
|
||||
options.kind === 'model' ? (pickRadiusPx?.(instance) ?? null) : null;
|
||||
if (options.kind === 'model' && modelRadius == null) return true;
|
||||
if (instance >= store.count) return false;
|
||||
geo.cartesian3.fromElements(
|
||||
store.positions[instance * 3],
|
||||
store.positions[instance * 3 + 1],
|
||||
|
||||
@@ -411,3 +411,26 @@ test('a model hit is checked against its projected position within its drawn rad
|
||||
assert.equal(picking.drillPick({ x: 121, y: 100 })[0]?.id, 'jet');
|
||||
assert.equal(picking.drillPick({ x: 125, y: 100 }).length, 0);
|
||||
});
|
||||
|
||||
test('stale GPU model hits cannot select hidden or removed instances', async () => {
|
||||
const view = fakeView();
|
||||
const model = modelSet('models', [[100, 100, 50, 'jet']], null);
|
||||
const picking = createNavaraPicking({
|
||||
view,
|
||||
projector,
|
||||
camera,
|
||||
movers: () => [model],
|
||||
lines: () => [],
|
||||
resolveBatch: () => ({ set: 'models', instance: 0, pickId: 'jet' }),
|
||||
...timers(),
|
||||
});
|
||||
model.store.set(0, { show: false });
|
||||
const hidden = picking.clickPick({ x: 100, y: 100 });
|
||||
view.emit('featureClick', { batchId: 1 });
|
||||
assert.equal(await hidden, undefined);
|
||||
model.store.setCount(0);
|
||||
const removed = picking.clickPick({ x: 100, y: 100 });
|
||||
view.emit('featureClick', { batchId: 1 });
|
||||
assert.equal(await removed, undefined);
|
||||
picking.destroy();
|
||||
});
|
||||
Reference in new issue
Block a user