Skip to content

Commit

Permalink
Merge pull request #956 from 3DStreet/intersection-child-no-transform
Browse files Browse the repository at this point in the history
do not allow transform of intersection children
  • Loading branch information
kfarr authored Dec 9, 2024
2 parents e4f56e5 + 2f4f66c commit a8b30f1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/components/intersection.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ AFRAME.registerComponent('intersection', {
`repeat: ${repeatCountInter[0]} ${repeatCountInter[1]}`
);
sd.setAttribute('data-layer-name', 'Sidewalk • ' + displayName);
sd.setAttribute('data-no-transform', '');
sd.setAttribute('data-ignore-raycaster', '');
el.appendChild(sd);
}

Expand Down Expand Up @@ -237,6 +239,8 @@ 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');
stopSignEl.setAttribute('data-ignore-raycaster');
return stopSignEl;
}

Expand Down Expand Up @@ -331,6 +335,8 @@ 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.setAttribute('data-ignore-raycaster', '');
trafficSignalEl.classList.add('autocreated');
trafficSignalEl.setAttribute(
'data-layer-name',
Expand All @@ -354,6 +360,8 @@ 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.setAttribute('data-ignore-raycaster', '');
cw1.classList.add('autocreated');
el.appendChild(cw1);
}
Expand All @@ -364,6 +372,8 @@ 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.setAttribute('data-ignore-raycaster', '');
cw2.classList.add('autocreated');
el.appendChild(cw2);
}
Expand All @@ -374,13 +384,17 @@ 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.setAttribute('data-ignore-raycaster', '');
cw3.classList.add('autocreated');
el.appendChild(cw3);
}
if (crosswalklArray[3]) {
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('data-ignore-raycaster', '');
cw4.setAttribute('rotation', { x: 0, y: 0, z: 90 });
cw4.setAttribute('scale', { y: intersectWidth / 12 });
cw4.setAttribute('mixin', 'markings crosswalk-zebra');
Expand Down

0 comments on commit a8b30f1

Please sign in to comment.