Skip to content

Commit

Permalink
add ground name
Browse files Browse the repository at this point in the history
  • Loading branch information
kfarr committed Nov 7, 2023
1 parent 974d5ea commit 2f15236
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/aframe-streetmix-parsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -1128,6 +1128,7 @@ function processBuildings (left, right, streetWidth, showGround, length) {
return placedObjectEl;
}

// possible 'block' type input values: grass, fence, narrow, wide, waterfront, residential, parking-lot
buildingsArray.forEach((currentValue, index) => {
if (currentValue.length === 0) { return; } // if empty string then skip
const side = (index === 0) ? 'left' : 'right';
Expand All @@ -1136,6 +1137,7 @@ function processBuildings (left, right, streetWidth, showGround, length) {
const positionX = ((buildingLotWidth / 2) + (streetWidth / 2)) * sideMultiplier;

if (showGround) {
// TODO: consider rewriting this using simple box instead of this json plane method
var groundJSONString = JSON.stringify(streetmixParsersTested.createGroundArray(currentValue, length));

var groundParentEl = document.createElement('a-entity');
Expand All @@ -1146,6 +1148,7 @@ function processBuildings (left, right, streetWidth, showGround, length) {
groundParentEl.setAttribute('position', positionX + 55 + ' 0.2 0');
}
groundParentEl.classList.add('ground-' + side);
groundParentEl.setAttribute('data-layer-name', 'Ground ' + side + ': ' + currentValue);
buildingElement.appendChild(groundParentEl);
}

Expand Down

0 comments on commit 2f15236

Please sign in to comment.