Skip to content

Commit

Permalink
add default car type for drive-lane segment
Browse files Browse the repository at this point in the history
also return and fix pedestrian variant for drive-lane
  • Loading branch information
Algorush committed Mar 4, 2024
1 parent 34d3119 commit a3ed07d
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/aframe-streetmix-parsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,11 +374,11 @@ function createDriveLaneElement (variantList, segmentWidthInMeters, streetLength
} else {
rotationY = rotationVariants[lineVariant];
}
/*

if (carType === 'pedestrian') {
return createSidewalkClonedVariants(segmentWidthInMeters, 'normal', streetLength, lineVariant, animated);
return createSidewalkClonedVariants(segmentWidthInMeters, 'normal', 0, streetLength, direction, animated);
}
*/

const driveLaneParentEl = document.createElement('a-entity');

if (variantList.length == 1) {
Expand Down Expand Up @@ -413,7 +413,12 @@ function createDriveLaneElement (variantList, segmentWidthInMeters, streetLength
width: 2
}
};


// default drive-lane variant if selected variant (carType) is not supported
if (!carParams[carType]) {
carType = 'car';
}

function createCar (positionZ = undefined, carType = 'car') {
const params = carParams[carType];

Expand Down Expand Up @@ -449,6 +454,7 @@ function createDriveLaneElement (variantList, segmentWidthInMeters, streetLength
);
const randPlaces = allPlaces.slice(0, count);
const carSizeZ = (lineVariant == 'sideways' || lineVariant.includes('angled')) ? 'width' : 'length';

const carSizeValueZ = carParams[carType][carSizeZ];

randPlaces.forEach(randPositionZ => {
Expand Down

0 comments on commit a3ed07d

Please sign in to comment.