From 8de7d73c5a05cdf43e9be8e988a20be3fcb68a9e Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Fri, 6 Dec 2024 20:56:35 -0800 Subject: [PATCH 1/2] do not allow transform of intersection children https://github.com/3DStreet/3dstreet/issues/929 --- src/components/intersection.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/components/intersection.js b/src/components/intersection.js index eab87c89..df7d6874 100644 --- a/src/components/intersection.js +++ b/src/components/intersection.js @@ -81,6 +81,7 @@ AFRAME.registerComponent('intersection', { `repeat: ${repeatCountInter[0]} ${repeatCountInter[1]}` ); sd.setAttribute('data-layer-name', 'Sidewalk • ' + displayName); + sd.setAttribute('data-no-transform', ''); el.appendChild(sd); } @@ -237,6 +238,7 @@ AFRAME.registerComponent('intersection', { stopSignEl.setAttribute('mixin', 'stop_sign'); stopSignEl.classList.add('autocreated'); stopSignEl.setAttribute('data-layer-name', 'Traffic Control • Stop Sign'); + stopSignEl.setAttribute('data-no-transform'); return stopSignEl; } @@ -331,6 +333,7 @@ AFRAME.registerComponent('intersection', { trafficSignalEl.setAttribute('position', params[side].position); trafficSignalEl.setAttribute('rotation', params[side].rotation); trafficSignalEl.setAttribute('mixin', `signal_${side}`); + trafficSignalEl.setAttribute('data-no-transform', ''); trafficSignalEl.classList.add('autocreated'); trafficSignalEl.setAttribute( 'data-layer-name', @@ -354,6 +357,7 @@ AFRAME.registerComponent('intersection', { cw1.setAttribute('scale', { y: intersectDepth / 12 }); cw1.setAttribute('mixin', 'markings crosswalk-zebra'); cw1.setAttribute('data-layer-name', 'Crosswalk • West'); + cw1.setAttribute('data-no-transform', ''); cw1.classList.add('autocreated'); el.appendChild(cw1); } @@ -364,6 +368,7 @@ AFRAME.registerComponent('intersection', { cw2.setAttribute('scale', { y: intersectDepth / 12 }); cw2.setAttribute('mixin', 'markings crosswalk-zebra'); cw2.setAttribute('data-layer-name', 'Crosswalk • East'); + cw2.setAttribute('data-no-transform', ''); cw2.classList.add('autocreated'); el.appendChild(cw2); } @@ -374,6 +379,7 @@ AFRAME.registerComponent('intersection', { cw3.setAttribute('scale', { y: intersectWidth / 12 }); cw3.setAttribute('mixin', 'markings crosswalk-zebra'); cw3.setAttribute('data-layer-name', 'Crosswalk • North'); + cw3.setAttribute('data-no-transform', ''); cw3.classList.add('autocreated'); el.appendChild(cw3); } @@ -381,6 +387,7 @@ AFRAME.registerComponent('intersection', { const cw4 = document.createElement('a-entity'); cw4.setAttribute('position', { y: -intersectDepth / 2 + 2, z: 0.11 }); cw4.setAttribute('data-layer-name', 'Crosswalk • South'); + cw4.setAttribute('data-no-transform', ''); cw4.setAttribute('rotation', { x: 0, y: 0, z: 90 }); cw4.setAttribute('scale', { y: intersectWidth / 12 }); cw4.setAttribute('mixin', 'markings crosswalk-zebra'); From 2f4f66cd644d08fc6001a07554f1049db300abd0 Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Mon, 9 Dec 2024 14:01:02 -0800 Subject: [PATCH 2/2] intersection children not clickable --- src/components/intersection.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/components/intersection.js b/src/components/intersection.js index df7d6874..566af60c 100644 --- a/src/components/intersection.js +++ b/src/components/intersection.js @@ -82,6 +82,7 @@ AFRAME.registerComponent('intersection', { ); sd.setAttribute('data-layer-name', 'Sidewalk • ' + displayName); sd.setAttribute('data-no-transform', ''); + sd.setAttribute('data-ignore-raycaster', ''); el.appendChild(sd); } @@ -239,6 +240,7 @@ AFRAME.registerComponent('intersection', { stopSignEl.classList.add('autocreated'); stopSignEl.setAttribute('data-layer-name', 'Traffic Control • Stop Sign'); stopSignEl.setAttribute('data-no-transform'); + stopSignEl.setAttribute('data-ignore-raycaster'); return stopSignEl; } @@ -334,6 +336,7 @@ AFRAME.registerComponent('intersection', { trafficSignalEl.setAttribute('rotation', params[side].rotation); trafficSignalEl.setAttribute('mixin', `signal_${side}`); trafficSignalEl.setAttribute('data-no-transform', ''); + trafficSignalEl.setAttribute('data-ignore-raycaster', ''); trafficSignalEl.classList.add('autocreated'); trafficSignalEl.setAttribute( 'data-layer-name', @@ -358,6 +361,7 @@ AFRAME.registerComponent('intersection', { cw1.setAttribute('mixin', 'markings crosswalk-zebra'); cw1.setAttribute('data-layer-name', 'Crosswalk • West'); cw1.setAttribute('data-no-transform', ''); + cw1.setAttribute('data-ignore-raycaster', ''); cw1.classList.add('autocreated'); el.appendChild(cw1); } @@ -369,6 +373,7 @@ AFRAME.registerComponent('intersection', { cw2.setAttribute('mixin', 'markings crosswalk-zebra'); cw2.setAttribute('data-layer-name', 'Crosswalk • East'); cw2.setAttribute('data-no-transform', ''); + cw2.setAttribute('data-ignore-raycaster', ''); cw2.classList.add('autocreated'); el.appendChild(cw2); } @@ -380,6 +385,7 @@ AFRAME.registerComponent('intersection', { cw3.setAttribute('mixin', 'markings crosswalk-zebra'); cw3.setAttribute('data-layer-name', 'Crosswalk • North'); cw3.setAttribute('data-no-transform', ''); + cw3.setAttribute('data-ignore-raycaster', ''); cw3.classList.add('autocreated'); el.appendChild(cw3); } @@ -388,6 +394,7 @@ AFRAME.registerComponent('intersection', { cw4.setAttribute('position', { y: -intersectDepth / 2 + 2, z: 0.11 }); cw4.setAttribute('data-layer-name', 'Crosswalk • South'); cw4.setAttribute('data-no-transform', ''); + cw4.setAttribute('data-ignore-raycaster', ''); cw4.setAttribute('rotation', { x: 0, y: 0, z: 90 }); cw4.setAttribute('scale', { y: intersectWidth / 12 }); cw4.setAttribute('mixin', 'markings crosswalk-zebra');