Skip to content

Commit

Permalink
fix remaining partial vector in the code base
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentfretin committed Jan 15, 2025
1 parent a57f715 commit ead9fdc
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/aframe-streetmix-parsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ function addLinearStreetAnimation(
easing: 'linear',
loop: 'false',
from: { x: xPos, y: yVal, z: zPos },
to: { z: halfStreet },
to: { x: xPos, y: yVal, z: halfStreet },
dur: startingDuration
};
const animationAttrs2 = {
Expand Down
24 changes: 20 additions & 4 deletions src/components/intersection.js
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,11 @@ AFRAME.registerComponent('intersection', {

if (crosswalkArray[0]) {
const cw1 = document.createElement('a-entity');
cw1.setAttribute('position', { x: -intersectWidth / 2 + 2, z: 0.11 });
cw1.setAttribute('position', {
x: -intersectWidth / 2 + 2,
y: 0,
z: 0.11
});
cw1.setAttribute('mixin', CROSSWALKS_REV[crosswalkArray[0]]);
cw1.setAttribute('data-layer-name', 'Crosswalk • West');
cw1.setAttribute('data-no-transform', '');
Expand All @@ -448,7 +452,11 @@ AFRAME.registerComponent('intersection', {
}
if (crosswalkArray[1]) {
const cw2 = document.createElement('a-entity');
cw2.setAttribute('position', { x: intersectWidth / 2 - 2, z: 0.11 });
cw2.setAttribute('position', {
x: intersectWidth / 2 - 2,
y: 0,
z: 0.11
});
cw2.setAttribute('mixin', CROSSWALKS_REV[crosswalkArray[1]]);
cw2.setAttribute('data-layer-name', 'Crosswalk • East');
cw2.setAttribute('data-no-transform', '');
Expand All @@ -460,7 +468,11 @@ AFRAME.registerComponent('intersection', {
}
if (crosswalkArray[2]) {
const cw3 = document.createElement('a-entity');
cw3.setAttribute('position', { y: intersectDepth / 2 - 2, z: 0.11 });
cw3.setAttribute('position', {
x: 0,
y: intersectDepth / 2 - 2,
z: 0.11
});
cw3.setAttribute('mixin', CROSSWALKS_REV[crosswalkArray[2]]);
cw3.setAttribute('data-layer-name', 'Crosswalk • North');
cw3.setAttribute('data-no-transform', '');
Expand All @@ -472,7 +484,11 @@ AFRAME.registerComponent('intersection', {
}
if (crosswalkArray[3]) {
const cw4 = document.createElement('a-entity');
cw4.setAttribute('position', { y: -intersectDepth / 2 + 2, z: 0.11 });
cw4.setAttribute('position', {
x: 0,
y: -intersectDepth / 2 + 2,
z: 0.11
});
cw4.setAttribute('data-layer-name', 'Crosswalk • South');
cw4.setAttribute('data-no-transform', '');
cw4.setAttribute('data-ignore-raycaster', '');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,11 @@ const createEntity = (mixinId) => {
const segmentElevationPosY = getSegmentElevationPosY(ancestorEl);
// set position y by elevation level of segment
if (customGroupCreated) {
customGroupEl.setAttribute('position', { y: segmentElevationPosY });
customGroupEl.setAttribute('position', {
x: 0,
y: segmentElevationPosY,
z: 0
});
newEntityObject.components.position = { x: 0, y: 0, z: 0 };
} else {
newEntityObject.components.position = {
Expand Down

0 comments on commit ead9fdc

Please sign in to comment.