mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 01:32:19 +00:00
fix(local-adsb): a click or double-click on a UAT ring takes its aircraft again
The 978 MHz ring was a point on the aircraft's own entity, so a pick on it was a pick on the aircraft. As a separate points set it was drawn unpickable and a click there fell through to what is under it. The rings are picked again and read as their aircraft.
This commit is contained in:
1 parent
aebb3e79c3
commit
6af4b08293
2 files changed
+33
-5
No files matched your search
@@ -388,8 +388,6 @@ export function createLocalAdsbLayer({
|
||||
scaleByDistance: MARKER_SPRITE.scaleByDistance,
|
||||
disableDepthTest: Number.POSITIVE_INFINITY,
|
||||
displayRange: MARKER_RANGE,
|
||||
// Rings pass picks through to their aircraft.
|
||||
pickable: false,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -647,7 +645,10 @@ export function createLocalAdsbLayer({
|
||||
/** A local aircraft's id when `hit` is one of its markers or models. */
|
||||
function ownHit(hit) {
|
||||
if (!hit || hit.surface || !markers.has(hit.id)) return null;
|
||||
return hit.set === sets?.markers.id || hit.set === models?.setId
|
||||
// A ring is its aircraft's, as the ring was a point on its entity.
|
||||
return hit.set === sets?.markers.id ||
|
||||
hit.set === sets?.rings.id ||
|
||||
hit.set === models?.setId
|
||||
? hit.id
|
||||
: null;
|
||||
}
|
||||
@@ -707,7 +708,9 @@ export function createLocalAdsbLayer({
|
||||
enabled: () => enabled,
|
||||
targetFor: (hit) => {
|
||||
const marker =
|
||||
!hit.surface && hit.set === sets?.markers.id && markers.get(hit.id);
|
||||
!hit.surface &&
|
||||
(hit.set === sets?.markers.id || hit.set === sets?.rings.id) &&
|
||||
markers.get(hit.id);
|
||||
if (!marker?.carrier) return null;
|
||||
return {
|
||||
key: marker.id,
|
||||
@@ -798,7 +801,6 @@ export function createLocalAdsbLayer({
|
||||
id: `${prefix}:rings`,
|
||||
horizonCull: true,
|
||||
show: false,
|
||||
pickable: false,
|
||||
}),
|
||||
};
|
||||
models = createLocalAdsbModels({
|
||||
|
||||
Reference in new issue
Block a user