Skip to content

Commit

Permalink
Merge pull request #455 from 3DStreet/fix-hash-marks
Browse files Browse the repository at this point in the history
Fix hash marks
  • Loading branch information
kfarr authored Jan 17, 2024
2 parents 85dcdfb + 33cd92d commit 836df72
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
4 changes: 2 additions & 2 deletions dist/aframe-street-component.js

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions src/aframe-streetmix-parsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ function processSegments (segments, showStriping, length, globalAnimated, showVe
// add the safehits to the segment parent
segmentParentEl.append(safehitsParentEl);
repeatCount[0] = 1;
repeatCount[1] = parseInt(length);
repeatCount[1] = parseInt(length) / 4;
} else if (segments[i].type === 'divider' && variantList[0] === 'flowers') {
groundMixinId = 'grass';
segmentParentEl.append(createDividerVariant('flowers', clonedObjectRadius, 2.25));
Expand All @@ -891,7 +891,11 @@ function processSegments (segments, showStriping, length, globalAnimated, showVe
groundMixinId = 'divider';
segmentParentEl.append(createDividerVariant('dome', clonedObjectRadius, 2.25));
repeatCount[0] = 1;
repeatCount[1] = parseInt(length);
repeatCount[1] = parseInt(length) / 4;
} else if (segments[i].type === 'divider') {
groundMixinId = 'divider';
repeatCount[0] = 1;
repeatCount[1] = parseInt(length) / 4;
} else if (segments[i].type === 'temporary' && variantList[0] === 'barricade') {
groundMixinId = 'drive-lane';
segmentParentEl.append(createClonedVariants('temporary-barricade', clonedObjectRadius, 2.25));
Expand Down
8 changes: 5 additions & 3 deletions src/assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,14 @@ function buildAssetHTML (assetUrl, categories) {
<!-- segment mixins with textures -->
<img id="seamless-road" src="${assetUrl}materials/TexturesCom_Roads0086_1_seamless_S_rotate.jpg" crossorigin="anonymous">
<img id="seamless-bright-road" src="${assetUrl}materials/asphalthd_Base_Color.jpg" crossorigin="anonymous">
<img id="hatched-base" src="${assetUrl}materials/hatched_Base_Color.jpg" crossorigin="anonymous">
<img id="hatched-normal" src="${assetUrl}materials/hatched_Normal.jpg" crossorigin="anonymous">
<img id="seamless-sidewalk" src="${assetUrl}materials/TexturesCom_FloorsRegular0301_1_seamless_S.jpg" crossorigin="anonymous">
<img id="seamless-hatch-half" src="${assetUrl}materials/seamless-lane-with-hatch-half.jpg" crossorigin="anonymous">
<a-mixin shadow="cast: false" id="drive-lane" geometry="width:3;height:150;primitive:plane" material="roughness:${surfacesRoughness};repeat:0.3 25;offset:0.55 0;src:#seamless-road;"></a-mixin>
<a-mixin shadow="cast: false" id="bright-lane" geometry="width:3;height:150;primitive:plane" material="roughness:${surfacesRoughness};repeat:0.6 50;offset:0.55 0;src:#seamless-bright-road;color:#dddddd"></a-mixin>
<a-mixin shadow="cast: false" id="bike-lane" geometry="width:1.8;height:150;primitive:plane" material="roughness:${surfacesRoughness};repeat:0.3 25;offset:0.55 0;metalness:0;src:#seamless-road;"></a-mixin>
<a-mixin shadow id="sidewalk" anisotropy geometry="width:3;height:150;primitive:plane" material="roughness:${surfacesRoughness};repeat:1.5 75;src:#seamless-sidewalk;"></a-mixin>
<a-mixin shadow="cast: false" id="bus-lane" geometry="width:3;height:150;primitive:plane" material="roughness:${surfacesRoughness};repeat:0.3 25;offset:0.55 0;src:#seamless-road;"></a-mixin>
<a-mixin shadow="cast: false" id="divider" geometry="width:0.3;height:150;primitive:plane" material="roughness:${surfacesRoughness};repeat:1 150;offset:0.415 0;normalTextureOffset:0.415 0;src:#hatched-base;normalTextureRepeat:0.21 150;normalMap:#hatched-normal"></a-mixin>
<a-mixin shadow="cast: false" id="divider" geometry="width:0.3;height:150;primitive:plane" material="roughness:${surfacesRoughness};src:#seamless-hatch-half;"></a-mixin>
<a-mixin shadow="cast: false" id="grass" geometry="width:0.3;height:150;primitive:plane" material="roughness:${surfacesRoughness};repeat:1 150;offset:0.415 0;src:#grass-texture;"></a-mixin>
`,
'segment-colors': `
Expand Down Expand Up @@ -180,6 +179,9 @@ function buildAssetHTML (assetUrl, categories) {
<a-mixin id="perpendicular-stalls" atlas-uvs="totalRows: 4; totalColumns: 8; column: 5; row: 4" scale="5 10 5"></a-mixin>
<a-mixin id="parking-t" atlas-uvs="totalRows: 8; totalColumns: 16; column: 4; row: 7" scale="1.5 2 2"></a-mixin>
<a-mixin id="painted-safety-zone" atlas-uvs="totalRows: 4; totalColumns: 4; column: 4; row: 4" scale="8 8 8"></a-mixin>
<a-mixin id="hash-left" atlas-uvs="totalRows: 4; totalColumns: 8; column: 7; row: 2" scale="3 6 3"></a-mixin>
<a-mixin id="hash-right" atlas-uvs="totalRows: 4; totalColumns: 8; column: 8; row: 2" scale="3 6 3"></a-mixin>
<a-mixin id="hash-chevron" atlas-uvs="totalRows: 4; totalColumns: 4; column: 4; row: 2" scale="3 3 3"></a-mixin>
`,
'vehicles-transit': `
<!-- vehicles-transit -->
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ AFRAME.registerComponent('street', {

const streetmixSegments = JSON.parse(data.JSON);

// remove .street-parent and .buildings-parent elements, if they exists, with old scene elements.
// remove .street-parent and .buildings-parent elements, if they exists, with old scene elements.
// Because they will be created next in the processSegments and processBuildings functions
const streetParent = this.el.querySelector('.street-parent');
if (streetParent) {
Expand Down

0 comments on commit 836df72

Please sign in to comment.