Skip to content

Commit

Permalink
add support for arcade and compound-wall
Browse files Browse the repository at this point in the history
  • Loading branch information
kfarr committed Nov 12, 2023
1 parent 913bf1e commit 883f0c6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
15 changes: 12 additions & 3 deletions src/aframe-streetmix-parsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -1143,6 +1143,8 @@ function processBuildings (left, right, streetWidth, showGround, length) {
residential: 'ground-grass-material',
narrow: 'ground-asphalt-material',
wide: 'ground-asphalt-material',
arcade: 'ground-tiled-concrete-material',
'compound-wall': 'ground-asphalt-material'
}

if (currentValue === 'waterfront') {
Expand Down Expand Up @@ -1208,15 +1210,22 @@ function processBuildings (left, right, streetWidth, showGround, length) {
newBuildings.setAttribute('position', buildingPos);
buildingElement.append(newBuildings);

if (currentValue === 'waterfront') {
if (currentValue === 'waterfront' || currentValue === 'compound-wall') {
const objectPositionX = buildingPositionX - (sideMultiplier * 150 / 2);
const placedObjectEl = document.createElement('a-entity');
placedObjectEl.setAttribute('class', 'seawall-parent');
placedObjectEl.setAttribute('position', objectPositionX + ' 0 4.5'); // position="1.043 0.100 -3.463"
placedObjectEl.setAttribute('position', {x: objectPositionX, z: 4.5}); // position="1.043 0.100 -3.463"
let rotationCloneY;
if (currentValue === 'compound-wall') {
placedObjectEl.setAttribute('position', {y: 3});
placedObjectEl.setAttribute('position', {x: objectPositionX + 1.5 * sideMultiplier});
rotationCloneY = (side === 'left') ? 90 : -90;
} else {
rotationCloneY = (side === 'left') ? -90 : 90;
}
placedObjectEl.classList.add('seawall-parent-' + side);
buildingElement.appendChild(placedObjectEl);
// clone a bunch of seawalls under the parent
const rotationCloneY = (side === 'left') ? -90 : 90;
cloneMixinAsChildren({ objectMixinId: 'seawall', parentEl: placedObjectEl, rotation: '0 ' + rotationCloneY + ' 0', step: 15, radius: clonedObjectRadius });
}

Expand Down
2 changes: 1 addition & 1 deletion src/assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ function buildAssetHTML (assetUrl, categories) {
<a-mixin shadow id="ground-grass-material" material="src:#grass-texture;repeat:2.5 5;roughness:${surfacesRoughness}"></a-mixin>
<a-mixin shadow id="ground-parking-lot-material" material="src:#parking-lot-texture;repeat:.5 2;roughness:${surfacesRoughness}"></a-mixin>
<a-mixin shadow id="ground-asphalt-material" material="src:#asphalt-texture;repeat:5 5;roughness:${surfacesRoughness}"></a-mixin>
<a-mixin shadow id="ground-tiled-concrete-material" material="src:#seamless-sidewalk;repeat:5 5;roughness:${surfacesRoughness}"></a-mixin>
<a-mixin shadow id="ground-tiled-concrete-material" material="src:#seamless-sidewalk;repeat:10 20;roughness:${surfacesRoughness}"></a-mixin>
<a-asset-item id="fence-model" src="${assetUrl}sets/fences/gltf-exports/draco/fence4.glb"></a-asset-item>
<a-mixin shadow id="fence" gltf-model="#fence-model" scale="0.1 0.1 0.1"></a-mixin>
Expand Down

0 comments on commit 883f0c6

Please sign in to comment.