From 30c4cd002563c7ff100b67128eb8879b29c6c191 Mon Sep 17 00:00:00 2001 From: Alexander Goryushkin Date: Wed, 4 Oct 2023 21:55:46 -0300 Subject: [PATCH 01/56] add environment option color --- src/index.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index 87aae1a02..d9fdf39e5 100644 --- a/src/index.js +++ b/src/index.js @@ -374,7 +374,8 @@ AFRAME.registerComponent('intersection', { AFRAME.registerComponent('street-environment', { schema: { - preset: { type: 'string', default: 'day', oneOf: ['day', 'night'] } + preset: { type: 'string', default: 'day', oneOf: ['day', 'night', 'color'] }, + backgroundColor: { type: 'color', default: '#FFF' } }, setEnvOption: function () { const sky = this.sky; @@ -384,21 +385,26 @@ AFRAME.registerComponent('street-environment', { if (this.data.preset === 'night') { light1.setAttribute('light', 'intensity', 0.5); light2.setAttribute('light', 'intensity', 0.15); + sky.setAttribute('visible', true); sky.setAttribute('color', '#444'); sky.setAttribute('src', '#sky-night'); sky.setAttribute('rotation', '0 0 0'); - } else { // day + } else if (this.data.preset === 'day') { // TODO: create a parent with children light1.setAttribute('light', 'intensity', 2); light2.setAttribute('light', 'intensity', 0.6); + sky.setAttribute('visible', true); sky.setAttribute('color', '#FFF'); sky.setAttribute('src', '#sky'); sky.setAttribute('rotation', '0 255 0'); + } else { // color + sky.setAttribute('visible', false); + this.scene.setAttribute('background', 'color', this.data.backgroundColor); } }, init: function () { const el = this.el; - + this.scene = document.querySelector('a-scene'); this.light1 = document.createElement('a-entity'); const light1 = this.light1; light1.setAttribute('id', 'env-light1'); From f07eb4e1cb02c2cc7177b6c2207af7e69c9062a7 Mon Sep 17 00:00:00 2001 From: Alexander Goryushkin Date: Wed, 25 Oct 2023 22:00:22 -0300 Subject: [PATCH 02/56] change roughness for all surfaces change roughness for all surfaces to 0.8 --- src/assets.js | 23 ++++++++++--------- src/tested/aframe-streetmix-parsers-tested.js | 2 ++ 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/assets.js b/src/assets.js index 8009be68b..6aecee319 100644 --- a/src/assets.js +++ b/src/assets.js @@ -3,6 +3,7 @@ function buildAssetHTML (assetUrl, categories) { if (!assetUrl) assetUrl = 'https://assets.3dstreet.app/'; console.log('[street]', 'Using street assets from', assetUrl); + const surfacesRoughness = 0.8; var assetsObj = { 'sidewalk-props': ` @@ -126,13 +127,13 @@ function buildAssetHTML (assetUrl, categories) { - - - - - - - + + + + + + + `, 'segment-colors': ` @@ -212,10 +213,10 @@ function buildAssetHTML (assetUrl, categories) { - - - - + + + + diff --git a/src/tested/aframe-streetmix-parsers-tested.js b/src/tested/aframe-streetmix-parsers-tested.js index 64b0470c6..beb44a499 100644 --- a/src/tested/aframe-streetmix-parsers-tested.js +++ b/src/tested/aframe-streetmix-parsers-tested.js @@ -56,6 +56,7 @@ function createBuildingsArray (maxLength = 150, buildingType = 'narrow') { // es buildingEntity.child = { tag: 'a-plane', class: 'driveway', + material: 'roughness:0.8', position: '-6.25 0.6 -8.75', rotation: '-90 0 0', src: '#asphalt-texture', @@ -68,6 +69,7 @@ function createBuildingsArray (maxLength = 150, buildingType = 'narrow') { // es buildingEntity.child = { tag: 'a-plane', class: 'driveway', + material: 'roughness:0.8', position: '-2.5 0.6 -7', rotation: '-90 0 0', src: '#asphalt-texture', From 4ebbcfebd60d02c214f69a2871541bf26c1eac7c Mon Sep 17 00:00:00 2001 From: Alexander Goryushkin Date: Thu, 26 Oct 2023 17:59:29 -0300 Subject: [PATCH 03/56] add self-driving car variant --- src/aframe-streetmix-parsers.js | 9 ++++++++- src/assets.js | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/aframe-streetmix-parsers.js b/src/aframe-streetmix-parsers.js index e4a1acb3d..3c36f1f1a 100644 --- a/src/aframe-streetmix-parsers.js +++ b/src/aframe-streetmix-parsers.js @@ -406,6 +406,13 @@ function createDriveLaneElement (variantList, positionX, segmentWidthInMeters, s wheelDiameter: 1.05, length: 6.95, width: 2.5 + }, + // autonomous vehicle + av: { + mixin: 'self-driving-cruise-car-rig', + wheelDiameter: 0.76, + length: 5.17, + width: 2 } }; @@ -457,7 +464,7 @@ function createDriveLaneElement (variantList, positionX, segmentWidthInMeters, s } }); } else { - createCar(); + createCar(undefined, carType); } return driveLaneParentEl; diff --git a/src/assets.js b/src/assets.js index 8009be68b..c5b6da478 100644 --- a/src/assets.js +++ b/src/assets.js @@ -86,6 +86,7 @@ function buildAssetHTML (assetUrl, categories) { + `, buildings: ` From f5a746e5c034ec9518f9e3d3655487eff374ef17 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 27 Oct 2023 16:38:05 +0000 Subject: [PATCH 04/56] Bump browserify-sign from 4.2.1 to 4.2.2 Bumps [browserify-sign](https://github.com/crypto-browserify/browserify-sign) from 4.2.1 to 4.2.2. - [Changelog](https://github.com/browserify/browserify-sign/blob/main/CHANGELOG.md) - [Commits](https://github.com/crypto-browserify/browserify-sign/compare/v4.2.1...v4.2.2) --- updated-dependencies: - dependency-name: browserify-sign dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 51 +++++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/package-lock.json b/package-lock.json index b7f687cc3..bb53d7e09 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3649,20 +3649,23 @@ } }, "node_modules/browserify-sign": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", - "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.2.tgz", + "integrity": "sha512-1rudGyeYY42Dk6texmv7c4VcQ0EsvVbLwZkA+AQB7SxvXxmcD93jcHie8bzecJ+ChDlmAm2Qyu0+Ccg5uhZXCg==", "dev": true, "dependencies": { - "bn.js": "^5.1.1", - "browserify-rsa": "^4.0.1", + "bn.js": "^5.2.1", + "browserify-rsa": "^4.1.0", "create-hash": "^1.2.0", "create-hmac": "^1.1.7", - "elliptic": "^6.5.3", + "elliptic": "^6.5.4", "inherits": "^2.0.4", - "parse-asn1": "^5.1.5", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" + "parse-asn1": "^5.1.6", + "readable-stream": "^3.6.2", + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">= 4" } }, "node_modules/browserify-zlib": { @@ -13539,9 +13542,9 @@ } }, "node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, "dependencies": { "inherits": "^2.0.3", @@ -19354,20 +19357,20 @@ } }, "browserify-sign": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", - "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.2.tgz", + "integrity": "sha512-1rudGyeYY42Dk6texmv7c4VcQ0EsvVbLwZkA+AQB7SxvXxmcD93jcHie8bzecJ+ChDlmAm2Qyu0+Ccg5uhZXCg==", "dev": true, "requires": { - "bn.js": "^5.1.1", - "browserify-rsa": "^4.0.1", + "bn.js": "^5.2.1", + "browserify-rsa": "^4.1.0", "create-hash": "^1.2.0", "create-hmac": "^1.1.7", - "elliptic": "^6.5.3", + "elliptic": "^6.5.4", "inherits": "^2.0.4", - "parse-asn1": "^5.1.5", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" + "parse-asn1": "^5.1.6", + "readable-stream": "^3.6.2", + "safe-buffer": "^5.2.1" } }, "browserify-zlib": { @@ -27002,9 +27005,9 @@ } }, "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, "requires": { "inherits": "^2.0.3", From e60dc5161e29406e78c664d70dc83a1a2e340152 Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Wed, 1 Nov 2023 15:59:25 -0700 Subject: [PATCH 05/56] update assets submodule for new sky assets --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index 25645ccd4..e9067fc79 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 25645ccd421a7e50682b0e5b4ebe3d22f667dcb3 +Subproject commit e9067fc79e4541a6ed6263a627013c4776ba6d75 From 494fe3be5213767c558e726e035c90fb409c380a Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Wed, 1 Nov 2023 16:07:29 -0700 Subject: [PATCH 06/56] add new sky support tested save / load from JSON file and it appears to work with new presets! --- src/assets.js | 2 +- src/index.js | 47 +++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/src/assets.js b/src/assets.js index 6aecee319..ad6726a5c 100644 --- a/src/assets.js +++ b/src/assets.js @@ -204,7 +204,7 @@ function buildAssetHTML (assetUrl, categories) { `, sky: ` - + `, grounds: ` diff --git a/src/index.js b/src/index.js index feb8cf5b1..404fb23af 100644 --- a/src/index.js +++ b/src/index.js @@ -377,12 +377,13 @@ AFRAME.registerComponent('intersection', { AFRAME.registerComponent('street-environment', { schema: { - preset: { type: 'string', default: 'day', oneOf: ['day', 'night'] } + preset: { type: 'string', default: 'day', oneOf: ['day', 'night', 'sunny-morning', 'cloudy-afternoon', 'sunny-afternoon', 'sunny-noon', 'foggy', 'cloudy'] } }, setEnvOption: function () { const sky = this.sky; const light1 = this.light1; const light2 = this.light2; + const assetsPathRoot = '//assets.3dstreet.app/'; if (this.data.preset === 'night') { light1.setAttribute('light', 'intensity', 0.5); @@ -390,13 +391,55 @@ AFRAME.registerComponent('street-environment', { sky.setAttribute('color', '#444'); sky.setAttribute('src', '#sky-night'); sky.setAttribute('rotation', '0 0 0'); - } else { // day + } else if (this.data.preset === 'day') { // day // TODO: create a parent with children light1.setAttribute('light', 'intensity', 2); light2.setAttribute('light', 'intensity', 0.6); sky.setAttribute('color', '#FFF'); sky.setAttribute('src', '#sky'); sky.setAttribute('rotation', '0 255 0'); + } else if (this.data.preset === 'sunny-morning') { + // copied from day + light1.setAttribute('light', 'intensity', 2); + light2.setAttribute('light', 'intensity', 0.6); + sky.setAttribute('color', '#FFF'); + sky.setAttribute('src', `url(${assetsPathRoot}images/skies/2048-polyhaven-qwantani_puresky-sdr.jpeg)`); + sky.setAttribute('rotation', '0 0 0'); + } else if (this.data.preset === 'cloudy-afternoon') { + // copied from sunny-morning + light1.setAttribute('light', 'intensity', 2); + light2.setAttribute('light', 'intensity', 0.6); + sky.setAttribute('color', '#FFF'); + sky.setAttribute('src', `url(${assetsPathRoot}images/skies/2048-kloofendal_48d_partly_cloudy_puresky-sdr.jpeg)`); + sky.setAttribute('rotation', '0 0 0'); + } else if (this.data.preset === 'sunny-afternoon') { + // copied from sunny-morning + light1.setAttribute('light', 'intensity', 2); + light2.setAttribute('light', 'intensity', 0.6); + sky.setAttribute('color', '#FFF'); + sky.setAttribute('src', `url(${assetsPathRoot}images/skies/2048-kloofendal_43d_clear_puresky-sdr.jpeg)`); + sky.setAttribute('rotation', '0 0 0'); + } else if (this.data.preset === 'sunny-noon') { + // copied from sunny-morning + light1.setAttribute('light', 'intensity', 2); + light2.setAttribute('light', 'intensity', 0.6); + sky.setAttribute('color', '#FFF'); + sky.setAttribute('src', `url(${assetsPathRoot}images/skies/2048-kloppenheim_05_puresky-sdr.jpeg)`); + sky.setAttribute('rotation', '0 0 0'); + } else if (this.data.preset === 'foggy') { + // copied from sunny-morning + light1.setAttribute('light', 'intensity', 2); + light2.setAttribute('light', 'intensity', 0.6); + sky.setAttribute('color', '#FFF'); + sky.setAttribute('src', `url(${assetsPathRoot}images/skies/2048-kloofendal_misty_morning_puresky-sdr.jpeg)`); + sky.setAttribute('rotation', '0 0 0'); + } else if (this.data.preset === 'cloudy') { + // copied from sunny-morning + light1.setAttribute('light', 'intensity', 2); + light2.setAttribute('light', 'intensity', 0.6); + sky.setAttribute('color', '#FFF'); + sky.setAttribute('src', `url(${assetsPathRoot}images/skies/2048-mud_road_puresky-sdr.jpeg)`); + sky.setAttribute('rotation', '0 0 0'); } }, init: function () { From 2eacccb574483e78fcb3cbb5199f5de539cc7c59 Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Wed, 1 Nov 2023 19:04:05 -0700 Subject: [PATCH 07/56] add shadow support to assets and day preset still need to add shadow casting light to other presets --- src/assets.js | 162 +++++++++++++++++++++++++------------------------- src/index.js | 9 ++- 2 files changed, 87 insertions(+), 84 deletions(-) diff --git a/src/assets.js b/src/assets.js index ad6726a5c..3bdf4d0e5 100644 --- a/src/assets.js +++ b/src/assets.js @@ -10,24 +10,24 @@ function buildAssetHTML (assetUrl, categories) { - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + `, people: ` @@ -52,41 +52,41 @@ function buildAssetHTML (assetUrl, categories) { `, 'people-rigged': ` - + - + - + - + - + - + - + - + `, vehicles: ` - - + + - - + + `, 'vehicles-rigged': ` - - - - - - + + + + + + `, buildings: ` @@ -95,22 +95,22 @@ function buildAssetHTML (assetUrl, categories) { - - - - - + + + + + - - - + + + - - - - + + + + `, 'intersection-props': ` @@ -127,13 +127,13 @@ function buildAssetHTML (assetUrl, categories) { - - - - - - - + + + + + + + `, 'segment-colors': ` @@ -144,18 +144,18 @@ function buildAssetHTML (assetUrl, categories) { 'lane-separator': ` - - - - - - - + + + + + + + `, stencils: ` - + @@ -184,23 +184,23 @@ function buildAssetHTML (assetUrl, categories) { - - - + + + `, dividers: ` - - - - - - - - - - + + + + + + + + + + `, sky: ` @@ -213,12 +213,12 @@ function buildAssetHTML (assetUrl, categories) { - - - - + + + + - + `, 'loud-bicycle': ` diff --git a/src/index.js b/src/index.js index 404fb23af..f1e5486b7 100644 --- a/src/index.js +++ b/src/index.js @@ -393,11 +393,14 @@ AFRAME.registerComponent('street-environment', { sky.setAttribute('rotation', '0 0 0'); } else if (this.data.preset === 'day') { // day // TODO: create a parent with children - light1.setAttribute('light', 'intensity', 2); - light2.setAttribute('light', 'intensity', 0.6); + light1.setAttribute('light', 'intensity', 0.8); sky.setAttribute('color', '#FFF'); sky.setAttribute('src', '#sky'); - sky.setAttribute('rotation', '0 255 0'); + sky.setAttribute('rotation', '0 20 0'); + + light2.setAttribute('light', 'intensity: 2.2; castShadow: true; shadowCameraBottom: -20; shadowCameraLeft: -30; shadowCameraRight: 40; shadowCameraTop: 30; shadowMapHeight: 2048; shadowMapWidth: 2048'); + light2.setAttribute('position', '-60 56 -16'); + } else if (this.data.preset === 'sunny-morning') { // copied from day light1.setAttribute('light', 'intensity', 2); From 8c40c308697099f22be84b11a346983230273e33 Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Thu, 2 Nov 2023 12:38:43 -0700 Subject: [PATCH 08/56] box geometry for rails + actual track gauges const railsWidth = { // width as measured from center of rail, so 1/2 actual width "tram": 0.7175, // standard gauge 1,435 mm "trolley": 0.5335 // sf cable car rail gauge 1,067 mm } --- src/aframe-streetmix-parsers.js | 40 ++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/src/aframe-streetmix-parsers.js b/src/aframe-streetmix-parsers.js index e4a1acb3d..48ea31743 100644 --- a/src/aframe-streetmix-parsers.js +++ b/src/aframe-streetmix-parsers.js @@ -142,10 +142,45 @@ function createStencilsParentElement (position) { return placedObjectEl; } -function createTracksParentElement (positionX) { +function createRailsElement(length, positionX) { + const placedObjectEl = document.createElement('a-entity'); + const railsGeometry = { + "primitive": "box", + "depth": length, + "width": 0.1, + "height": 0.2, + + } + const railsMaterial = { // TODO: Add environment map for reflection on metal rails + "color": "#8f8f8f", + "metalness": 1, + "emissive": "#828282", + "emissiveIntensity": 0.5, + "roughness": 0.1 + } + placedObjectEl.setAttribute('geometry', railsGeometry); + placedObjectEl.setAttribute('material', railsMaterial); + placedObjectEl.setAttribute('class', 'rails'); + placedObjectEl.setAttribute('shadow', 'recieve:true; cast: true'); + placedObjectEl.setAttribute('position', positionX + ' 0.2 0'); // position="1.043 0.100 -3.463" + + return placedObjectEl; + +} + +function createTracksParentElement (positionX, length, objectMixinId) { const placedObjectEl = document.createElement('a-entity'); placedObjectEl.setAttribute('class', 'track-parent'); placedObjectEl.setAttribute('position', positionX + ' -0.2 0'); // position="1.043 0.100 -3.463" + // add rails + const railsWidth = { // width as measured from center of rail, so 1/2 actual width + "tram": 0.7175, // standard gauge 1,435 mm + "trolley": 0.5335 // sf cable car rail gauge 1,067 mm + } + const railsPosX = railsWidth[objectMixinId]; + placedObjectEl.append(createRailsElement(length, railsPosX)); + placedObjectEl.append(createRailsElement(length, -railsPosX)); + return placedObjectEl; } @@ -769,8 +804,7 @@ function processSegments (segments, showStriping, length, globalAnimated, showVe // create and append a train element segmentParentEl.append(createChooChooElement(variantList, objectMixinId, positionX, length, showVehicles)); // make the parent for all the objects to be cloned - const tracksParentEl = createTracksParentElement(positionX); - cloneMixinAsChildren({ objectMixinId: 'track', parentEl: tracksParentEl, step: 20.25, radius: clonedObjectRadius }); + const tracksParentEl = createTracksParentElement(positionX, length, objectMixinId); // add these trains to the segment parent segmentParentEl.append(tracksParentEl); } else if (segments[i].type === 'turn-lane') { From 70fc02258c605aa02abab3bce786c672aaa561ab Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Thu, 2 Nov 2023 12:42:46 -0700 Subject: [PATCH 09/56] add dirt box to bottom of street --- src/aframe-streetmix-parsers.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/aframe-streetmix-parsers.js b/src/aframe-streetmix-parsers.js index 48ea31743..edf365a6a 100644 --- a/src/aframe-streetmix-parsers.js +++ b/src/aframe-streetmix-parsers.js @@ -1113,6 +1113,17 @@ function processSegments (segments, showStriping, length, globalAnimated, showVe // append the new surfaceElement to the segmentParentEl streetParentEl.append(segmentParentEl); } + // create new brown box to represent ground underneath street + let dirtBox = document.createElement('a-box'); + const xPos = cumulativeWidthInMeters / 2; + console.log('xPos', xPos) + console.log('`${xPos} -1.1 0`', `${xPos} -1.1 0`) + dirtBox.setAttribute('position', `${xPos} -1.1 0`); // what is x? x = 0 - cumulativeWidthInMeters / 2 + dirtBox.setAttribute('height', 2); // height is 2 meters from y of -0.1 to -y of 2.1 + dirtBox.setAttribute('width', cumulativeWidthInMeters); + dirtBox.setAttribute('depth', length - 0.2); // depth is length - 0.1 on each side + dirtBox.setAttribute('material', 'color: #664B00;'); + streetParentEl.append(dirtBox); return streetParentEl; } module.exports.processSegments = processSegments; From fa8a2c0ba5f42d305a00736072c7177786649936 Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Thu, 2 Nov 2023 13:08:33 -0700 Subject: [PATCH 10/56] fine tune environment settings --- src/index.js | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/src/index.js b/src/index.js index f1e5486b7..c7693f257 100644 --- a/src/index.js +++ b/src/index.js @@ -397,51 +397,46 @@ AFRAME.registerComponent('street-environment', { sky.setAttribute('color', '#FFF'); sky.setAttribute('src', '#sky'); sky.setAttribute('rotation', '0 20 0'); - light2.setAttribute('light', 'intensity: 2.2; castShadow: true; shadowCameraBottom: -20; shadowCameraLeft: -30; shadowCameraRight: 40; shadowCameraTop: 30; shadowMapHeight: 2048; shadowMapWidth: 2048'); - light2.setAttribute('position', '-60 56 -16'); - + light2.setAttribute('position', '-40 56 -16'); } else if (this.data.preset === 'sunny-morning') { - // copied from day - light1.setAttribute('light', 'intensity', 2); - light2.setAttribute('light', 'intensity', 0.6); + light1.setAttribute('light', 'intensity', 0.8); + light2.setAttribute('light', 'intensity: 2.2; castShadow: true; shadowCameraBottom: -20; shadowCameraLeft: -30; shadowCameraRight: 40; shadowCameraTop: 30; shadowMapHeight: 2048; shadowMapWidth: 2048'); + light2.setAttribute('position', '-60 56 -16'); sky.setAttribute('color', '#FFF'); sky.setAttribute('src', `url(${assetsPathRoot}images/skies/2048-polyhaven-qwantani_puresky-sdr.jpeg)`); sky.setAttribute('rotation', '0 0 0'); } else if (this.data.preset === 'cloudy-afternoon') { - // copied from sunny-morning light1.setAttribute('light', 'intensity', 2); light2.setAttribute('light', 'intensity', 0.6); sky.setAttribute('color', '#FFF'); - sky.setAttribute('src', `url(${assetsPathRoot}images/skies/2048-kloofendal_48d_partly_cloudy_puresky-sdr.jpeg)`); + sky.setAttribute('src', `url(${assetsPathRoot}images/skies/2048-mud_road_puresky-sdr.jpeg)`); sky.setAttribute('rotation', '0 0 0'); } else if (this.data.preset === 'sunny-afternoon') { - // copied from sunny-morning light1.setAttribute('light', 'intensity', 2); - light2.setAttribute('light', 'intensity', 0.6); + light2.setAttribute('light', 'intensity: 2.2; castShadow: true; shadowCameraBottom: -20; shadowCameraLeft: -30; shadowCameraRight: 40; shadowCameraTop: 30; shadowMapHeight: 2048; shadowMapWidth: 2048'); + light2.setAttribute('position', '60 56 -16'); sky.setAttribute('color', '#FFF'); sky.setAttribute('src', `url(${assetsPathRoot}images/skies/2048-kloofendal_43d_clear_puresky-sdr.jpeg)`); sky.setAttribute('rotation', '0 0 0'); } else if (this.data.preset === 'sunny-noon') { - // copied from sunny-morning light1.setAttribute('light', 'intensity', 2); - light2.setAttribute('light', 'intensity', 0.6); + light2.setAttribute('light', 'intensity: 2.2; castShadow: true; shadowCameraBottom: -20; shadowCameraLeft: -30; shadowCameraRight: 40; shadowCameraTop: 30; shadowMapHeight: 2048; shadowMapWidth: 2048'); + light2.setAttribute('position', '5 56 -16'); sky.setAttribute('color', '#FFF'); sky.setAttribute('src', `url(${assetsPathRoot}images/skies/2048-kloppenheim_05_puresky-sdr.jpeg)`); sky.setAttribute('rotation', '0 0 0'); } else if (this.data.preset === 'foggy') { - // copied from sunny-morning light1.setAttribute('light', 'intensity', 2); - light2.setAttribute('light', 'intensity', 0.6); + light2.setAttribute('light', 'intensity: 0.6; castShadow: false;'); sky.setAttribute('color', '#FFF'); sky.setAttribute('src', `url(${assetsPathRoot}images/skies/2048-kloofendal_misty_morning_puresky-sdr.jpeg)`); sky.setAttribute('rotation', '0 0 0'); } else if (this.data.preset === 'cloudy') { - // copied from sunny-morning light1.setAttribute('light', 'intensity', 2); light2.setAttribute('light', 'intensity', 0.6); sky.setAttribute('color', '#FFF'); - sky.setAttribute('src', `url(${assetsPathRoot}images/skies/2048-mud_road_puresky-sdr.jpeg)`); + sky.setAttribute('src', `url(${assetsPathRoot}images/skies/2048-kloofendal_48d_partly_cloudy_puresky-sdr.jpeg)`); sky.setAttribute('rotation', '0 0 0'); } }, @@ -457,8 +452,8 @@ AFRAME.registerComponent('street-environment', { this.light2 = document.createElement('a-entity'); const light2 = this.light2; light2.setAttribute('id', 'env-light2'); - light2.setAttribute('position', { x: 0.5, y: 1, z: -1 }); - light2.setAttribute('light', { type: 'directional', color: '#FFF' }); + light2.setAttribute('position', '-60 56 -16'); + light2.setAttribute('light', 'intensity: 2.2; castShadow: true; shadowCameraBottom: -20; shadowCameraLeft: -30; shadowCameraRight: 40; shadowCameraTop: 30; shadowMapHeight: 2048; shadowMapWidth: 2048'); el.appendChild(light2); this.sky = document.createElement('a-sky'); From ca339359e2a59a273f1caaa87ea1db569bd12c65 Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Thu, 2 Nov 2023 15:16:40 -0700 Subject: [PATCH 11/56] add character shadows --- src/assets.js | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/assets.js b/src/assets.js index 3bdf4d0e5..72d2c6b17 100644 --- a/src/assets.js +++ b/src/assets.js @@ -32,23 +32,23 @@ function buildAssetHTML (assetUrl, categories) { people: ` - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + `, 'people-rigged': ` From 0958bbb0823fdfc7a9de2566922d9883caf99fcf Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Thu, 2 Nov 2023 15:17:57 -0700 Subject: [PATCH 12/56] only set x position on segmentParent next to remove positionX variable on functions --- src/aframe-streetmix-parsers.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/aframe-streetmix-parsers.js b/src/aframe-streetmix-parsers.js index edf365a6a..42be52515 100644 --- a/src/aframe-streetmix-parsers.js +++ b/src/aframe-streetmix-parsers.js @@ -761,7 +761,8 @@ function processSegments (segments, showStriping, length, globalAnimated, showVe var scaleX = segmentWidthInMeters / modelWidthInMeters; cumulativeWidthInMeters = cumulativeWidthInMeters + segmentWidthInMeters; - var positionX = cumulativeWidthInMeters - (0.5 * segmentWidthInMeters); + var realPositionX = cumulativeWidthInMeters - (0.5 * segmentWidthInMeters); + const positionX = 0; var positionY = 0; // get variantString @@ -1112,6 +1113,7 @@ function processSegments (segments, showStriping, length, globalAnimated, showVe // returns JSON output instead // append the new surfaceElement to the segmentParentEl streetParentEl.append(segmentParentEl); + segmentParentEl.setAttribute('position', realPositionX + ' 0 0'); } // create new brown box to represent ground underneath street let dirtBox = document.createElement('a-box'); From ca89b15b141213996405c671dfe1116e37b14258 Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Thu, 2 Nov 2023 15:32:22 -0700 Subject: [PATCH 13/56] remove positionX --- src/aframe-streetmix-parsers.js | 198 +++++++++++++++----------------- 1 file changed, 95 insertions(+), 103 deletions(-) diff --git a/src/aframe-streetmix-parsers.js b/src/aframe-streetmix-parsers.js index 42be52515..ee55d6f2b 100644 --- a/src/aframe-streetmix-parsers.js +++ b/src/aframe-streetmix-parsers.js @@ -142,7 +142,7 @@ function createStencilsParentElement (position) { return placedObjectEl; } -function createRailsElement(length, positionX) { +function createRailsElement(length, railsPosX) { const placedObjectEl = document.createElement('a-entity'); const railsGeometry = { "primitive": "box", @@ -162,16 +162,16 @@ function createRailsElement(length, positionX) { placedObjectEl.setAttribute('material', railsMaterial); placedObjectEl.setAttribute('class', 'rails'); placedObjectEl.setAttribute('shadow', 'recieve:true; cast: true'); - placedObjectEl.setAttribute('position', positionX + ' 0.2 0'); // position="1.043 0.100 -3.463" + placedObjectEl.setAttribute('position', railsPosX + ' 0.2 0'); // position="1.043 0.100 -3.463" return placedObjectEl; } -function createTracksParentElement (positionX, length, objectMixinId) { +function createTracksParentElement (length, objectMixinId) { const placedObjectEl = document.createElement('a-entity'); placedObjectEl.setAttribute('class', 'track-parent'); - placedObjectEl.setAttribute('position', positionX + ' -0.2 0'); // position="1.043 0.100 -3.463" + placedObjectEl.setAttribute('position', '0 -0.2 0'); // position="1.043 0.100 -3.463" // add rails const railsWidth = { // width as measured from center of rail, so 1/2 actual width "tram": 0.7175, // standard gauge 1,435 mm @@ -184,28 +184,26 @@ function createTracksParentElement (positionX, length, objectMixinId) { return placedObjectEl; } -function createSafehitsParentElement (positionX) { +function createSafehitsParentElement () { const placedObjectEl = document.createElement('a-entity'); placedObjectEl.setAttribute('class', 'safehit-parent'); - placedObjectEl.setAttribute('position', positionX + ' 0 0'); return placedObjectEl; } -function createParentElement (positionX, className) { +function createParentElement (className) { const parentEl = document.createElement('a-entity'); parentEl.setAttribute('class', className); - parentEl.setAttribute('position', positionX + ' 0 0'); return parentEl; } -function createDividerVariant (variantName, positionX, clonedObjectRadius, step = 2.25) { - const dividerParentEl = createParentElement(positionX, `dividers-${variantName}-parent`); +function createDividerVariant (variantName, clonedObjectRadius, step = 2.25) { + const dividerParentEl = createParentElement(`dividers-${variantName}-parent`); cloneMixinAsChildren({ objectMixinId: `dividers-${variantName}`, parentEl: dividerParentEl, step: step, radius: clonedObjectRadius }); return dividerParentEl; } -function createClonedVariants (variantName, positionX, clonedObjectRadius, step = 2.25, rotation = '0 0 0') { - const dividerParentEl = createParentElement(positionX, `${variantName}-parent`); +function createClonedVariants (variantName, clonedObjectRadius, step = 2.25, rotation = '0 0 0') { + const dividerParentEl = createParentElement(`${variantName}-parent`); cloneMixinAsChildren({ objectMixinId: variantName, parentEl: dividerParentEl, step: step, radius: clonedObjectRadius, rotation: rotation }); return dividerParentEl; } @@ -230,7 +228,7 @@ function getZPositions (start, end, step) { return arr.sort(() => 0.5 - Math.random()); } -function createSidewalkClonedVariants (BasePositionX, segmentWidthInMeters, density, streetLength, direction = 'random', animated = false) { +function createSidewalkClonedVariants (segmentWidthInMeters, density, streetLength, direction = 'random', animated = false) { const xValueRange = [-(0.37 * segmentWidthInMeters), (0.37 * segmentWidthInMeters)]; const zValueRange = getZPositions((-0.5 * streetLength), (0.5 * streetLength), 1.5); const densityFactors = { @@ -240,7 +238,7 @@ function createSidewalkClonedVariants (BasePositionX, segmentWidthInMeters, dens dense: 0.25 }; const totalPedestrianNumber = parseInt(densityFactors[density] * streetLength, 10); - const dividerParentEl = createParentElement(BasePositionX, 'pedestrians-parent'); + const dividerParentEl = createParentElement('pedestrians-parent'); // Randomly generate avatars for (let i = 0; i < totalPedestrianNumber; i++) { const variantName = (animated === true) ? 'a_char' + String(getRandomIntInclusive(1, 8)) : 'char' + String(getRandomIntInclusive(1, 16)); @@ -319,14 +317,13 @@ function randomPosition (entity, axis, length, objSizeAttr = undefined) { return newPosition; } -function createChooChooElement (variantList, objectMixinId, positionX, length, showVehicles) { +function createChooChooElement (variantList, objectMixinId, length, showVehicles) { if (!showVehicles) { return; } const rotationY = (variantList[0] === 'inbound') ? 0 : 180; const placedObjectEl = document.createElement('a-entity'); placedObjectEl.setAttribute('class', objectMixinId); - placedObjectEl.setAttribute('position', positionX + ' 0 0'); placedObjectEl.setAttribute('rotation', '0 ' + rotationY + ' 0'); placedObjectEl.setAttribute('mixin', objectMixinId); placedObjectEl.addEventListener('model-loaded', (model) => { @@ -335,7 +332,7 @@ function createChooChooElement (variantList, objectMixinId, positionX, length, s return placedObjectEl; } -function createBusElement (variantList, positionX, length, showVehicles) { +function createBusElement (variantList, length, showVehicles) { if (!showVehicles) { return; } @@ -346,7 +343,7 @@ function createBusElement (variantList, positionX, length, showVehicles) { busObjectEl.setAttribute('rotation', '0 ' + rotationY + ' 0'); busObjectEl.setAttribute('mixin', 'bus'); const positionZ = randomPosition(busObjectEl, 'z', length, busLength); - busObjectEl.setAttribute('position', positionX + ' 0 ' + positionZ); + busObjectEl.setAttribute('position', '0 0 ' + positionZ); busParentEl.append(busObjectEl); return busParentEl; @@ -383,7 +380,7 @@ function addLinearStreetAnimation (reusableObjectEl, speed, streetLength, xPos, return reusableObjectEl; } -function createDriveLaneElement (variantList, positionX, segmentWidthInMeters, streetLength, animated = false, showVehicles = true, count = 1, carStep = undefined) { +function createDriveLaneElement (variantList, segmentWidthInMeters, streetLength, animated = false, showVehicles = true, count = 1, carStep = undefined) { if (!showVehicles) { return; } @@ -413,7 +410,7 @@ function createDriveLaneElement (variantList, positionX, segmentWidthInMeters, s } if (carType === 'pedestrian') { - return createSidewalkClonedVariants(positionX, segmentWidthInMeters, 'normal', streetLength, lineVariant, animated); + return createSidewalkClonedVariants(segmentWidthInMeters, 'normal', streetLength, lineVariant, animated); } const driveLaneParentEl = document.createElement('a-entity'); @@ -452,7 +449,7 @@ function createDriveLaneElement (variantList, positionX, segmentWidthInMeters, s if (!positionZ) { positionZ = randomPosition(reusableObjectEl, 'z', streetLength, params['length']); } - reusableObjectEl.setAttribute('position', `${positionX} 0 ${positionZ}`); + reusableObjectEl.setAttribute('position', `0 0 ${positionZ}`); reusableObjectEl.setAttribute('mixin', params['mixin']); reusableObjectEl.setAttribute('rotation', `0 ${rotationY} 0`); @@ -461,7 +458,7 @@ function createDriveLaneElement (variantList, positionX, segmentWidthInMeters, s reusableObjectEl.setAttribute('wheel', { speed: speed, wheelDiameter: params['wheelDiameter'] } ); - addLinearStreetAnimation(reusableObjectEl, speed, streetLength, positionX, 0, positionZ, direction); + addLinearStreetAnimation(reusableObjectEl, speed, streetLength, 0, 0, positionZ, direction); } driveLaneParentEl.append(reusableObjectEl); return reusableObjectEl; @@ -498,12 +495,11 @@ function createDriveLaneElement (variantList, positionX, segmentWidthInMeters, s return driveLaneParentEl; } -function createFoodTruckElement (variantList, positionX, length) { +function createFoodTruckElement (variantList, length) { const foodTruckParentEl = document.createElement('a-entity'); const reusableObjectEl = document.createElement('a-entity'); const rotationY = (variantList[0] === 'left') ? 0 : 180; - reusableObjectEl.setAttribute('position', positionX + ' 0 0'); reusableObjectEl.setAttribute('rotation', '0 ' + rotationY + ' 0'); reusableObjectEl.setAttribute('mixin', 'food-trailer-rig'); reusableObjectEl.addEventListener('model-loaded', (model) => { @@ -514,19 +510,19 @@ function createFoodTruckElement (variantList, positionX, length) { return foodTruckParentEl; } -function createMagicCarpetElement (positionX, showVehicles) { +function createMagicCarpetElement (showVehicles) { if (!showVehicles) { return; } const magicCarpetParentEl = document.createElement('a-entity'); const reusableObjectEl1 = document.createElement('a-entity'); - reusableObjectEl1.setAttribute('position', positionX + ' 1.75 0'); + reusableObjectEl1.setAttribute('position', '0 1.75 0'); reusableObjectEl1.setAttribute('rotation', '0 0 0'); reusableObjectEl1.setAttribute('mixin', 'magic-carpet'); magicCarpetParentEl.append(reusableObjectEl1); const reusableObjectEl2 = document.createElement('a-entity'); - reusableObjectEl2.setAttribute('position', positionX + ' 1.75 0'); + reusableObjectEl2.setAttribute('position', '0 1.75 0'); reusableObjectEl2.setAttribute('rotation', '0 0 0'); reusableObjectEl2.setAttribute('mixin', 'Character_1_M'); magicCarpetParentEl.append(reusableObjectEl2); @@ -534,20 +530,20 @@ function createMagicCarpetElement (positionX, showVehicles) { return magicCarpetParentEl; } -function createOutdoorDining (positionX, length) { +function createOutdoorDining (length) { const outdoorDiningParentEl = document.createElement('a-entity'); const reusableObjectEl = document.createElement('a-entity'); reusableObjectEl.setAttribute('mixin', 'outdoor_dining'); const outdorDiningLength = 2.27; const positionZ = randomPosition(reusableObjectEl, 'z', length, outdorDiningLength); - reusableObjectEl.setAttribute('position', positionX + ' 0 ' + positionZ); + reusableObjectEl.setAttribute('position', '0 0 ' + positionZ); outdoorDiningParentEl.append(reusableObjectEl); return outdoorDiningParentEl; } -function createMicroMobilityElement (variantList, positionX, segmentType, length, showVehicles) { +function createMicroMobilityElement (variantList, segmentType, length, showVehicles) { if (!showVehicles) { return; } @@ -563,13 +559,13 @@ function createMicroMobilityElement (variantList, positionX, segmentType, length } const bikeLength = 2.03; const positionZ = randomPosition(reusableObjectEl, 'z', length, bikeLength); - reusableObjectEl.setAttribute('position', positionX + ' 0 ' + positionZ); + reusableObjectEl.setAttribute('position', '0 0 ' + positionZ); microMobilityParentEl.append(reusableObjectEl); return microMobilityParentEl; } -function createFlexZoneElement (variantList, positionX, length, showVehicles = true) { +function createFlexZoneElement (variantList, length, showVehicles = true) { if (!showVehicles) { return; } @@ -584,30 +580,30 @@ function createFlexZoneElement (variantList, positionX, length, showVehicles = t reusableObjectEl.setAttribute('mixin', 'sedan-rig'); } const positionZ = randomPosition(reusableObjectEl, 'z', length, 5); - reusableObjectEl.setAttribute('position', positionX + ' 0 ' + positionZ); + reusableObjectEl.setAttribute('position', '0 0 ' + positionZ); flexZoneParentEl.append(reusableObjectEl); return flexZoneParentEl; } -function createWayfindingElements (positionX) { +function createWayfindingElements () { const wayfindingParentEl = document.createElement('a-entity'); let reusableObjectEl; reusableObjectEl = document.createElement('a-entity'); - reusableObjectEl.setAttribute('position', positionX + ' 1 0'); + reusableObjectEl.setAttribute('position', '0 1 0'); reusableObjectEl.setAttribute('mixin', 'wayfinding-box'); wayfindingParentEl.append(reusableObjectEl); reusableObjectEl = document.createElement('a-entity'); - reusableObjectEl.setAttribute('position', positionX + ' 1.2 0.06'); + reusableObjectEl.setAttribute('position', '0 1.2 0.06'); reusableObjectEl.setAttribute('geometry', 'primitive: plane; width: 0.8; height: 1.6'); reusableObjectEl.setAttribute('material', 'src:#wayfinding-map'); wayfindingParentEl.append(reusableObjectEl); reusableObjectEl = document.createElement('a-entity'); - reusableObjectEl.setAttribute('position', positionX + ' 1.2 -0.06'); + reusableObjectEl.setAttribute('position', '0 1.2 -0.06'); reusableObjectEl.setAttribute('rotation', '0 180 0'); reusableObjectEl.setAttribute('geometry', 'primitive: plane; width: 0.8; height: 1.6'); reusableObjectEl.setAttribute('material', 'src:#wayfinding-map'); @@ -616,70 +612,67 @@ function createWayfindingElements (positionX) { return wayfindingParentEl; } -function createBenchesParentElement (positionX) { +function createBenchesParentElement () { const placedObjectEl = document.createElement('a-entity'); placedObjectEl.setAttribute('class', 'bench-parent'); // y = 0.2 for sidewalk elevation - placedObjectEl.setAttribute('position', positionX + ' 0.2 3.5'); + placedObjectEl.setAttribute('position', '0 0.2 3.5'); return placedObjectEl; } -function createBikeRacksParentElement (positionX) { +function createBikeRacksParentElement () { const placedObjectEl = document.createElement('a-entity'); placedObjectEl.setAttribute('class', 'bikerack-parent'); - placedObjectEl.setAttribute('position', positionX + ' 0 -3.5'); + placedObjectEl.setAttribute('position', '0 0 -3.5'); return placedObjectEl; } -function createBikeShareStationElement (positionX, variantList) { +function createBikeShareStationElement (variantList) { const placedObjectEl = document.createElement('a-entity'); placedObjectEl.setAttribute('class', 'bikeshare'); - placedObjectEl.setAttribute('position', positionX + ' 0 0'); placedObjectEl.setAttribute('mixin', 'bikeshare'); const rotationCloneY = (variantList[0] === 'left') ? 90 : 270; placedObjectEl.setAttribute('rotation', '0 ' + rotationCloneY + ' 0'); return placedObjectEl; } -function createParkletElement (positionX, variantList) { +function createParkletElement (variantList) { const placedObjectEl = document.createElement('a-entity'); placedObjectEl.setAttribute('class', 'parklet'); - placedObjectEl.setAttribute('position', positionX + ' .02 0'); + placedObjectEl.setAttribute('position', '0 .02 0'); placedObjectEl.setAttribute('mixin', 'parklet'); const rotationY = (variantList[0] === 'left') ? 90 : 270; placedObjectEl.setAttribute('rotation', '0 ' + rotationY + ' 0'); return placedObjectEl; } -function createTreesParentElement (positionX) { +function createTreesParentElement () { const placedObjectEl = document.createElement('a-entity'); placedObjectEl.setAttribute('class', 'tree-parent'); // y = 0.2 for sidewalk elevation - placedObjectEl.setAttribute('position', positionX + ' 0.2 7'); + placedObjectEl.setAttribute('position', '0 0.2 7'); return placedObjectEl; } -function createLampsParentElement (positionX) { +function createLampsParentElement () { const placedObjectEl = document.createElement('a-entity'); placedObjectEl.setAttribute('class', 'lamp-parent'); // y = 0.2 for sidewalk elevation - placedObjectEl.setAttribute('position', positionX + ' 0.2 0'); // position="1.043 0.100 -3.463" + placedObjectEl.setAttribute('position', '0 0.2 0'); // position="1.043 0.100 -3.463" return placedObjectEl; } -function createBusStopElement (positionX, rotationBusStopY) { +function createBusStopElement (rotationBusStopY) { const placedObjectEl = document.createElement('a-entity'); placedObjectEl.setAttribute('class', 'bus-stop'); - placedObjectEl.setAttribute('position', positionX + ' 0 0'); placedObjectEl.setAttribute('rotation', '0 ' + rotationBusStopY + ' 0'); placedObjectEl.setAttribute('mixin', 'bus-stop'); return placedObjectEl; } -function createBrtStationElement (positionX) { +function createBrtStationElement () { const placedObjectEl = document.createElement('a-entity'); placedObjectEl.setAttribute('class', 'brt-station'); - placedObjectEl.setAttribute('position', positionX + ' 0 0'); placedObjectEl.setAttribute('mixin', 'brt-station'); return placedObjectEl; } @@ -693,7 +686,7 @@ function createCenteredStreetElement (segments) { return streetEl; } -function createSegmentElement (scaleX, positionX, positionY, rotationY, mixinId, length, repeatCount, elevation = 0) { +function createSegmentElement (scaleX, positionY, rotationY, mixinId, length, repeatCount, elevation = 0) { var segmentEl = document.createElement('a-entity'); const scaleY = length / 150; @@ -716,7 +709,7 @@ function createSegmentElement (scaleX, positionX, positionY, rotationY, mixinId, segmentEl.setAttribute('rotation', '270 ' + rotationY + ' 0'); segmentEl.setAttribute('scale', scalePlane); } - segmentEl.setAttribute('position', positionX + ' ' + positionY + ' 0'); + segmentEl.setAttribute('position', '0 ' + positionY + ' 0'); segmentEl.setAttribute('mixin', mixinId); if (repeatCount.length !== 0) { @@ -761,8 +754,7 @@ function processSegments (segments, showStriping, length, globalAnimated, showVe var scaleX = segmentWidthInMeters / modelWidthInMeters; cumulativeWidthInMeters = cumulativeWidthInMeters + segmentWidthInMeters; - var realPositionX = cumulativeWidthInMeters - (0.5 * segmentWidthInMeters); - const positionX = 0; + var segmentPositionX = cumulativeWidthInMeters - (0.5 * segmentWidthInMeters); var positionY = 0; // get variantString @@ -782,30 +774,30 @@ function processSegments (segments, showStriping, length, globalAnimated, showVe // look at segment type and variant(s) to determine specific cases if (segments[i].type === 'drive-lane' && variantList[1] === 'sharrow') { // make a parent entity for the stencils - const stencilsParentEl = createStencilsParentElement(positionX + ' 0.015 0'); + const stencilsParentEl = createStencilsParentElement('0 0.015 0'); // clone a bunch of stencil entities (note: this is not draw call efficient) cloneMixinAsChildren({ objectMixinId: 'stencils sharrow', parentEl: stencilsParentEl, rotation: '-90 ' + rotationY + ' 0', step: 10, radius: clonedObjectRadius }); // add this stencil stuff to the segment parent segmentParentEl.append(stencilsParentEl); } else if (segments[i].type === 'bike-lane' || segments[i].type === 'scooter') { // make a parent entity for the stencils - const stencilsParentEl = createStencilsParentElement(positionX + ' 0.015 0'); + const stencilsParentEl = createStencilsParentElement('0 0.015 0'); // get the mixin id for a bike lane groundMixinId = getBikeLaneMixin(variantList[1]); // clone a bunch of stencil entities (note: this is not draw call efficient) cloneMixinAsChildren({ objectMixinId: 'stencils bike-arrow', parentEl: stencilsParentEl, rotation: '-90 ' + rotationY + ' 0', step: 20, radius: clonedObjectRadius }); // add this stencil stuff to the segment parent segmentParentEl.append(stencilsParentEl); - segmentParentEl.append(createMicroMobilityElement(variantList, positionX, segments[i].type, length, showVehicles)); + segmentParentEl.append(createMicroMobilityElement(variantList, segments[i].type, length, showVehicles)); } else if (segments[i].type === 'light-rail' || segments[i].type === 'streetcar') { // get the mixin id for a bus lane groundMixinId = getBusLaneMixin(variantList[1]); // get the mixin id for the vehicle (is it a trolley or a tram?) var objectMixinId = (segments[i].type === 'streetcar') ? 'trolley' : 'tram'; // create and append a train element - segmentParentEl.append(createChooChooElement(variantList, objectMixinId, positionX, length, showVehicles)); + segmentParentEl.append(createChooChooElement(variantList, objectMixinId, length, showVehicles)); // make the parent for all the objects to be cloned - const tracksParentEl = createTracksParentElement(positionX, length, objectMixinId); + const tracksParentEl = createTracksParentElement(length, objectMixinId); // add these trains to the segment parent segmentParentEl.append(tracksParentEl); } else if (segments[i].type === 'turn-lane') { @@ -827,13 +819,13 @@ function processSegments (segments, showStriping, length, globalAnimated, showVe var mixinString = 'stencils ' + markerMixinId; // make the parent for all the objects to be cloned - const stencilsParentEl = createStencilsParentElement(positionX + ' 0.015 0'); + const stencilsParentEl = createStencilsParentElement('0 0.015 0'); cloneMixinAsChildren({ objectMixinId: mixinString, parentEl: stencilsParentEl, rotation: '-90 ' + rotationY + ' 0', step: 15, radius: clonedObjectRadius }); // add this stencil stuff to the segment parent segmentParentEl.append(stencilsParentEl); if (variantList[1] === 'shared') { // add an additional marking to represent the opposite turn marking stencil (rotated 180º) - const stencilsParentEl = createStencilsParentElement(positionX + ' 0.015 ' + (-3 * isOutbound)); + const stencilsParentEl = createStencilsParentElement('0 0.015 ' + (-3 * isOutbound)); cloneMixinAsChildren({ objectMixinId: mixinString, parentEl: stencilsParentEl, rotation: '-90 ' + (rotationY + 180) + ' 0', step: 15, radius: clonedObjectRadius }); // add this stencil stuff to the segment parent segmentParentEl.append(stencilsParentEl); @@ -841,7 +833,7 @@ function processSegments (segments, showStriping, length, globalAnimated, showVe } else if (segments[i].type === 'divider' && variantList[0] === 'bollard') { groundMixinId = 'divider'; // make some safehits - const safehitsParentEl = createSafehitsParentElement(positionX); + const safehitsParentEl = createSafehitsParentElement(); cloneMixinAsChildren({ objectMixinId: 'safehit', parentEl: safehitsParentEl, step: 4, radius: clonedObjectRadius }); // add the safehits to the segment parent segmentParentEl.append(safehitsParentEl); @@ -849,95 +841,95 @@ function processSegments (segments, showStriping, length, globalAnimated, showVe repeatCount[1] = parseInt(length); } else if (segments[i].type === 'divider' && variantList[0] === 'flowers') { groundMixinId = 'grass'; - segmentParentEl.append(createDividerVariant('flowers', positionX, clonedObjectRadius, 2.25)); + segmentParentEl.append(createDividerVariant('flowers', clonedObjectRadius, 2.25)); } else if (segments[i].type === 'divider' && variantList[0] === 'planting-strip') { groundMixinId = 'grass'; - segmentParentEl.append(createDividerVariant('planting-strip', positionX, clonedObjectRadius, 2.25)); + segmentParentEl.append(createDividerVariant('planting-strip', clonedObjectRadius, 2.25)); } else if (segments[i].type === 'divider' && variantList[0] === 'planter-box') { groundMixinId = 'grass'; - segmentParentEl.append(createDividerVariant('planter-box', positionX, clonedObjectRadius, 2.45)); + segmentParentEl.append(createDividerVariant('planter-box', clonedObjectRadius, 2.45)); } else if (segments[i].type === 'divider' && variantList[0] === 'palm-tree') { groundMixinId = 'grass'; - const treesParentEl = createTreesParentElement(positionX); + const treesParentEl = createTreesParentElement(); cloneMixinAsChildren({ objectMixinId: 'palm-tree', parentEl: treesParentEl, randomY: true, radius: clonedObjectRadius }); segmentParentEl.append(treesParentEl); } else if (segments[i].type === 'divider' && variantList[0] === 'big-tree') { groundMixinId = 'grass'; - const treesParentEl = createTreesParentElement(positionX); + const treesParentEl = createTreesParentElement(); cloneMixinAsChildren({ objectMixinId: 'tree3', parentEl: treesParentEl, randomY: true, radius: clonedObjectRadius }); segmentParentEl.append(treesParentEl); } else if (segments[i].type === 'divider' && variantList[0] === 'bush') { groundMixinId = 'grass'; - segmentParentEl.append(createDividerVariant('bush', positionX, clonedObjectRadius, 2.25)); + segmentParentEl.append(createDividerVariant('bush', clonedObjectRadius, 2.25)); } else if (segments[i].type === 'divider' && variantList[0] === 'dome') { groundMixinId = 'divider'; - segmentParentEl.append(createDividerVariant('dome', positionX, clonedObjectRadius, 2.25)); + segmentParentEl.append(createDividerVariant('dome', clonedObjectRadius, 2.25)); repeatCount[0] = 1; repeatCount[1] = parseInt(length); } else if (segments[i].type === 'temporary' && variantList[0] === 'barricade') { groundMixinId = 'drive-lane'; - segmentParentEl.append(createClonedVariants('temporary-barricade', positionX, clonedObjectRadius, 2.25)); + segmentParentEl.append(createClonedVariants('temporary-barricade', clonedObjectRadius, 2.25)); } else if (segments[i].type === 'temporary' && variantList[0] === 'traffic-cone') { groundMixinId = 'drive-lane'; - segmentParentEl.append(createClonedVariants('temporary-traffic-cone', positionX, clonedObjectRadius, 2.25)); + segmentParentEl.append(createClonedVariants('temporary-traffic-cone', clonedObjectRadius, 2.25)); } else if (segments[i].type === 'temporary' && variantList[0] === 'jersey-barrier-plastic') { groundMixinId = 'drive-lane'; - segmentParentEl.append(createClonedVariants('temporary-jersey-barrier-plastic', positionX, clonedObjectRadius, 2.25)); + segmentParentEl.append(createClonedVariants('temporary-jersey-barrier-plastic', clonedObjectRadius, 2.25)); } else if (segments[i].type === 'temporary' && variantList[0] === 'jersey-barrier-concrete') { groundMixinId = 'drive-lane'; - segmentParentEl.append(createClonedVariants('temporary-jersey-barrier-concrete', positionX, clonedObjectRadius, 2.93)); + segmentParentEl.append(createClonedVariants('temporary-jersey-barrier-concrete', clonedObjectRadius, 2.93)); } else if (segments[i].type === 'bus-lane' || segments[i].type === 'brt-lane') { groundMixinId = getBusLaneMixin(variantList[1]); - segmentParentEl.append(createBusElement(variantList, positionX, length, showVehicles)); + segmentParentEl.append(createBusElement(variantList, length, showVehicles)); // create parent for the bus lane stencils to rotate the phrase instead of the word let reusableObjectStencilsParentEl; - reusableObjectStencilsParentEl = createStencilsParentElement(positionX + ' 0.015 0'); + reusableObjectStencilsParentEl = createStencilsParentElement('0 0.015 0'); cloneMixinAsChildren({ objectMixinId: 'stencils word-bus', parentEl: reusableObjectStencilsParentEl, rotation: '-90 ' + rotationY + ' 0', step: 50, radius: clonedObjectRadius }); // add this stencil stuff to the segment parent segmentParentEl.append(reusableObjectStencilsParentEl); - reusableObjectStencilsParentEl = createStencilsParentElement(positionX + ' 0.015 10'); + reusableObjectStencilsParentEl = createStencilsParentElement('0 0.015 10'); cloneMixinAsChildren({ objectMixinId: 'stencils word-taxi', parentEl: reusableObjectStencilsParentEl, rotation: '-90 ' + rotationY + ' 0', step: 50, radius: clonedObjectRadius }); // add this stencil stuff to the segment parent segmentParentEl.append(reusableObjectStencilsParentEl); - reusableObjectStencilsParentEl = createStencilsParentElement(positionX + ' 0.015 20'); + reusableObjectStencilsParentEl = createStencilsParentElement('0 0.015 20'); cloneMixinAsChildren({ objectMixinId: 'stencils word-only', parentEl: reusableObjectStencilsParentEl, rotation: '-90 ' + rotationY + ' 0', step: 50, radius: clonedObjectRadius }); // add this stencil stuff to the segment parent segmentParentEl.append(reusableObjectStencilsParentEl); } else if (segments[i].type === 'drive-lane') { var isAnimated = (variantList[2] === 'animated') || globalAnimated; - segmentParentEl.append(createDriveLaneElement(variantList, positionX, segmentWidthInMeters, length, isAnimated, showVehicles)); + segmentParentEl.append(createDriveLaneElement(variantList, segmentWidthInMeters, length, isAnimated, showVehicles)); } else if (segments[i].type === 'food-truck') { groundMixinId = 'drive-lane'; - segmentParentEl.append(createFoodTruckElement(variantList, positionX, length)); + segmentParentEl.append(createFoodTruckElement(variantList, length)); } else if (segments[i].type === 'flex-zone') { groundMixinId = 'bright-lane'; - segmentParentEl.append(createFlexZoneElement(variantList, positionX, length, showVehicles)); + segmentParentEl.append(createFlexZoneElement(variantList, length, showVehicles)); let reusableObjectStencilsParentEl; - reusableObjectStencilsParentEl = createStencilsParentElement(positionX + ' 0.015 5'); + reusableObjectStencilsParentEl = createStencilsParentElement('0 0.015 5'); cloneMixinAsChildren({ objectMixinId: 'stencils word-loading-small', parentEl: reusableObjectStencilsParentEl, rotation: '-90 ' + rotationY + ' 0', step: 50, radius: clonedObjectRadius }); // add this stencil stuff to the segment parent segmentParentEl.append(reusableObjectStencilsParentEl); - reusableObjectStencilsParentEl = createStencilsParentElement(positionX + ' 0.015 -5'); + reusableObjectStencilsParentEl = createStencilsParentElement('0 0.015 -5'); cloneMixinAsChildren({ objectMixinId: 'stencils word-only-small', parentEl: reusableObjectStencilsParentEl, rotation: '-90 ' + rotationY + ' 0', step: 50, radius: clonedObjectRadius }); // add this stencil stuff to the segment parent segmentParentEl.append(reusableObjectStencilsParentEl); } else if (segments[i].type === 'sidewalk' && variantList[0] !== 'empty') { // handles variantString with value sparse, normal, or dense sidewalk const isAnimated = (variantList[1] === 'animated') || globalAnimated; - segmentParentEl.append(createSidewalkClonedVariants(positionX, segmentWidthInMeters, variantList[0], length, 'random', isAnimated)); + segmentParentEl.append(createSidewalkClonedVariants(segmentWidthInMeters, variantList[0], length, 'random', isAnimated)); } else if (segments[i].type === 'sidewalk-wayfinding') { - segmentParentEl.append(createWayfindingElements(positionX)); + segmentParentEl.append(createWayfindingElements()); } else if (segments[i].type === 'sidewalk-bench') { // make the parent for all the benches - const benchesParentEl = createBenchesParentElement(positionX); + const benchesParentEl = createBenchesParentElement(); const rotationCloneY = (variantList[0] === 'right') ? -90 : 90; if (variantList[0] === 'center') { @@ -952,7 +944,7 @@ function processSegments (segments, showStriping, length, globalAnimated, showVe } } else if (segments[i].type === 'sidewalk-bike-rack') { // make the parent for all the bike racks - const bikeRacksParentEl = createBikeRacksParentElement(positionX); + const bikeRacksParentEl = createBikeRacksParentElement(); const rotationCloneY = (variantList[1] === 'sidewalk-parallel') ? 90 : 0; cloneMixinAsChildren({ objectMixinId: 'bikerack', parentEl: bikeRacksParentEl, rotation: '0 ' + rotationCloneY + ' 0', radius: clonedObjectRadius }); @@ -960,23 +952,23 @@ function processSegments (segments, showStriping, length, globalAnimated, showVe segmentParentEl.append(bikeRacksParentEl); } else if (segments[i].type === 'magic-carpet') { groundMixinId = 'drive-lane'; - segmentParentEl.append(createMagicCarpetElement(positionX, showVehicles)); + segmentParentEl.append(createMagicCarpetElement(showVehicles)); } else if (segments[i].type === 'outdoor-dining') { groundMixinId = (variantList[1] === 'road') ? 'drive-lane' : 'sidewalk'; - segmentParentEl.append(createOutdoorDining(positionX, length)); + segmentParentEl.append(createOutdoorDining(length)); } else if (segments[i].type === 'parklet') { groundMixinId = 'drive-lane'; - segmentParentEl.append(createParkletElement(positionX, variantList)); + segmentParentEl.append(createParkletElement(variantList)); } else if (segments[i].type === 'bikeshare') { // make the parent for all the stations - segmentParentEl.append(createBikeShareStationElement(positionX, variantList)); + segmentParentEl.append(createBikeShareStationElement(variantList)); } else if (segments[i].type === 'utilities') { var rotation = (variantList[0] === 'right') ? '0 180 0' : '0 0 0'; - const utilityPoleElems = createClonedVariants('utility_pole', positionX, clonedObjectRadius, 15, rotation); + const utilityPoleElems = createClonedVariants('utility_pole', clonedObjectRadius, 15, rotation); segmentParentEl.append(utilityPoleElems); } else if (segments[i].type === 'sidewalk-tree') { // make the parent for all the trees - const treesParentEl = createTreesParentElement(positionX); + const treesParentEl = createTreesParentElement(); if (variantList[0] === 'palm-tree') { objectMixinId = 'palm-tree'; } else { @@ -987,7 +979,7 @@ function processSegments (segments, showStriping, length, globalAnimated, showVe segmentParentEl.append(treesParentEl); } else if (segments[i].type === 'sidewalk-lamp' && (variantList[1] === 'modern' || variantList[1] === 'pride')) { // Make the parent object for all the lamps - const lampsParentEl = createLampsParentElement(positionX); + const lampsParentEl = createLampsParentElement(); if (variantList[0] === 'both') { cloneMixinAsChildren({ objectMixinId: 'lamp-modern-double', parentEl: lampsParentEl, rotation: '0 0 0', radius: clonedObjectRadius }); segmentParentEl.append(lampsParentEl); @@ -1005,15 +997,15 @@ function processSegments (segments, showStriping, length, globalAnimated, showVe } } else if (segments[i].type === 'sidewalk-lamp' && variantList[1] === 'traditional') { // make the parent for all the lamps - const lampsParentEl = createLampsParentElement(positionX); + const lampsParentEl = createLampsParentElement(); // clone a bunch of lamps under the parent cloneMixinAsChildren({ objectMixinId: 'lamp-traditional', parentEl: lampsParentEl, radius: clonedObjectRadius }); segmentParentEl.append(lampsParentEl); } else if (segments[i].type === 'transit-shelter') { var rotationBusStopY = (variantList[0] === 'left') ? 90 : 270; - segmentParentEl.append(createBusStopElement(positionX, rotationBusStopY)); + segmentParentEl.append(createBusStopElement(rotationBusStopY)); } else if (segments[i].type === 'brt-station') { - segmentParentEl.append(createBrtStationElement(positionX)); + segmentParentEl.append(createBrtStationElement()); } else if (segments[i].type === 'separator' && variantList[0] === 'dashed') { groundMixinId = 'markings dashed-stripe'; positionY = positionY + 0.01; // make sure the lane marker is above the asphalt @@ -1088,10 +1080,10 @@ function processSegments (segments, showStriping, length, globalAnimated, showVe segmentParentEl.append(createDriveLaneElement([...variantList, 'car'], positionX, segmentWidthInMeters, length, false, showVehicles, carCount, carStep)); if (variantList[1] === 'left') { - reusableObjectStencilsParentEl = createStencilsParentElement((positionX) + ' 0.015 0'); + reusableObjectStencilsParentEl = createStencilsParentElement('0 0.015 0'); cloneMixinAsChildren({ objectMixinId: parkingMixin, parentEl: reusableObjectStencilsParentEl, positionXYString: markingPosXY, rotation: '-90 ' + '90 ' + markingsRotZ, length: markingLength, step: carStep, radius: clonedStencilRadius }); } else { - reusableObjectStencilsParentEl = createStencilsParentElement((positionX) + ' 0.015 0'); + reusableObjectStencilsParentEl = createStencilsParentElement('0 0.015 0'); cloneMixinAsChildren({ objectMixinId: parkingMixin, parentEl: reusableObjectStencilsParentEl, positionXYString: markingPosXY, rotation: '-90 ' + '90 ' + markingsRotZ, length: markingLength, step: carStep, radius: clonedStencilRadius }); } // add the stencils to the segment parent @@ -1109,11 +1101,11 @@ function processSegments (segments, showStriping, length, globalAnimated, showVe const elevation = segments[i].elevation; // add new object - segmentParentEl.append(createSegmentElement(scaleX, positionX, positionY, rotationY, groundMixinId, length, repeatCount, elevation)); + segmentParentEl.append(createSegmentElement(scaleX, positionY, rotationY, groundMixinId, length, repeatCount, elevation)); // returns JSON output instead // append the new surfaceElement to the segmentParentEl streetParentEl.append(segmentParentEl); - segmentParentEl.setAttribute('position', realPositionX + ' 0 0'); + segmentParentEl.setAttribute('position', segmentPositionX + ' 0 0'); } // create new brown box to represent ground underneath street let dirtBox = document.createElement('a-box'); From 0afbc14cef85a34d7af40ee25a4d8c4bc40aa16c Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Thu, 2 Nov 2023 15:40:03 -0700 Subject: [PATCH 14/56] Update segment and ground display names --- src/aframe-streetmix-parsers.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/aframe-streetmix-parsers.js b/src/aframe-streetmix-parsers.js index ee55d6f2b..03583a05e 100644 --- a/src/aframe-streetmix-parsers.js +++ b/src/aframe-streetmix-parsers.js @@ -1106,6 +1106,7 @@ function processSegments (segments, showStriping, length, globalAnimated, showVe // append the new surfaceElement to the segmentParentEl streetParentEl.append(segmentParentEl); segmentParentEl.setAttribute('position', segmentPositionX + ' 0 0'); + segmentParentEl.setAttribute('data-layer-name', 'Segment: ' + segments[i].type + ', ' + variantList[0]) } // create new brown box to represent ground underneath street let dirtBox = document.createElement('a-box'); @@ -1117,6 +1118,7 @@ function processSegments (segments, showStriping, length, globalAnimated, showVe dirtBox.setAttribute('width', cumulativeWidthInMeters); dirtBox.setAttribute('depth', length - 0.2); // depth is length - 0.1 on each side dirtBox.setAttribute('material', 'color: #664B00;'); + dirtBox.setAttribute('data-layer-name', 'Underground'); streetParentEl.append(dirtBox); return streetParentEl; } From 9e190c03289365810797efc87afaf9bfed01a9ef Mon Sep 17 00:00:00 2001 From: Alexander Goryushkin Date: Thu, 2 Nov 2023 22:06:10 -0300 Subject: [PATCH 15/56] delete the last positionX --- src/aframe-streetmix-parsers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aframe-streetmix-parsers.js b/src/aframe-streetmix-parsers.js index 03583a05e..3f0c853e7 100644 --- a/src/aframe-streetmix-parsers.js +++ b/src/aframe-streetmix-parsers.js @@ -1078,7 +1078,7 @@ function processSegments (segments, showStriping, length, globalAnimated, showVe markingPosXY = markingPosX + ' 0'; const clonedStencilRadius = length / 2 - carStep; - segmentParentEl.append(createDriveLaneElement([...variantList, 'car'], positionX, segmentWidthInMeters, length, false, showVehicles, carCount, carStep)); + segmentParentEl.append(createDriveLaneElement([...variantList, 'car'], segmentWidthInMeters, length, false, showVehicles, carCount, carStep)); if (variantList[1] === 'left') { reusableObjectStencilsParentEl = createStencilsParentElement('0 0.015 0'); cloneMixinAsChildren({ objectMixinId: parkingMixin, parentEl: reusableObjectStencilsParentEl, positionXYString: markingPosXY, rotation: '-90 ' + '90 ' + markingsRotZ, length: markingLength, step: carStep, radius: clonedStencilRadius }); From bcf6fffe61b31482bf1bb44283e58eb42c1d1843 Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Thu, 2 Nov 2023 22:22:16 -0700 Subject: [PATCH 16/56] updating data-layer-name (display name) --- index.html | 16 ++++++++-------- src/aframe-streetmix-parsers.js | 1 + src/index.js | 2 ++ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/index.html b/index.html index 4af97f277..500a8d7ea 100644 --- a/index.html +++ b/index.html @@ -80,6 +80,14 @@ + + + + + + + + @@ -87,14 +95,6 @@ - - - - - - - - - + diff --git a/src/components/ocean-plane.js b/src/components/ocean.js similarity index 100% rename from src/components/ocean-plane.js rename to src/components/ocean.js From 913bf1ef1813e57c35229dd6851c809e6d9aa2ef Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Sat, 11 Nov 2023 12:32:59 -0800 Subject: [PATCH 40/56] support 6 of 9 block types - change ground presets to material only -- this is a breaking change as old ground planes will not display correctly with this new version of assets.js - tweak seawall z position - half as wide ground - fix fence shadow - working: waterfront, grass, fence, parking-lot, residential, narrow - see remaining to test: https://github.com/3DStreet/3dstreet/issues/379#issuecomment-1806891568 --- src/aframe-streetmix-parsers.js | 23 +++++++++++++++++------ src/assets.js | 12 ++++++------ 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/src/aframe-streetmix-parsers.js b/src/aframe-streetmix-parsers.js index edaf9e9ed..6fe2952f4 100644 --- a/src/aframe-streetmix-parsers.js +++ b/src/aframe-streetmix-parsers.js @@ -1125,24 +1125,33 @@ function processBuildings (left, right, streetWidth, showGround, length) { return placedObjectEl; } - // possible 'block' type input values: grass, fence, narrow, wide, waterfront, residential, parking-lot + // possible 'block' type input values: grass, fence, narrow, wide, waterfront, residential, parking-lot, (new: archway, wall sp?) buildingsArray.forEach((currentValue, index) => { if (currentValue.length === 0) { return; } // if empty string then skip const side = (index === 0) ? 'left' : 'right'; const sideMultiplier = (side === 'left') ? -1 : 1; - const groundPositionX = ((length / 2) + (streetWidth / 2)) * sideMultiplier; + const groundPositionX = ((length / 4) + (streetWidth / 2)) * sideMultiplier; const buildingPositionX = ((150 / 2) + (streetWidth / 2)) * sideMultiplier; // this is the logic to make the ground box if (showGround) { + const variantToMaterialMapping = { + grass: 'ground-grass-material', + fence: 'ground-grass-material', + 'parking-lot': 'ground-parking-lot-material', + residential: 'ground-grass-material', + narrow: 'ground-asphalt-material', + wide: 'ground-asphalt-material', + } + if (currentValue === 'waterfront') { var groundParentEl = document.createElement('a-ocean-box'); groundParentEl.setAttribute('geometry', { primitive: 'box', depth: length, - width: length, + width: length / 2, height: 2, segmentsHeight: 1, segmentsDepth: 10, @@ -1153,12 +1162,14 @@ function processBuildings (left, right, streetWidth, showGround, length) { var groundParentEl = document.createElement('a-box'); groundParentEl.setAttribute('depth', length); groundParentEl.setAttribute('height', 2); - groundParentEl.setAttribute('width', length); + groundParentEl.setAttribute('width', length / 2); groundParentEl.setAttribute('shadow', ''); - groundParentEl.setAttribute('material', 'src:#grass-texture;repeat:5 5;roughness:0.8;'); + // groundParentEl.setAttribute('material', 'src:#grass-texture;repeat:5 5;roughness:0.8;'); + groundParentEl.setAttribute('mixin', variantToMaterialMapping[currentValue]); // case grass, fence groundParentEl.setAttribute('position', { y: -1 }); } + if (side === 'right') { // groundParentEl.setAttribute('position', groundPositionX + ' -1 0'); groundParentEl.setAttribute('position', { x: groundPositionX }); @@ -1201,7 +1212,7 @@ function processBuildings (left, right, streetWidth, showGround, length) { const objectPositionX = buildingPositionX - (sideMultiplier * 150 / 2); const placedObjectEl = document.createElement('a-entity'); placedObjectEl.setAttribute('class', 'seawall-parent'); - placedObjectEl.setAttribute('position', objectPositionX + ' 0 0'); // position="1.043 0.100 -3.463" + placedObjectEl.setAttribute('position', objectPositionX + ' 0 4.5'); // position="1.043 0.100 -3.463" placedObjectEl.classList.add('seawall-parent-' + side); buildingElement.appendChild(placedObjectEl); // clone a bunch of seawalls under the parent diff --git a/src/assets.js b/src/assets.js index 77ca5d316..5459de942 100644 --- a/src/assets.js +++ b/src/assets.js @@ -214,13 +214,13 @@ function buildAssetHTML (assetUrl, categories) { - - - - + + + + - - + + `, 'loud-bicycle': ` From 883f0c697292fe46e3cd4a84de912c587c981c17 Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Sat, 11 Nov 2023 18:14:59 -0800 Subject: [PATCH 41/56] add support for arcade and compound-wall --- src/aframe-streetmix-parsers.js | 15 ++++++++++++--- src/assets.js | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/aframe-streetmix-parsers.js b/src/aframe-streetmix-parsers.js index 6fe2952f4..68dcde30e 100644 --- a/src/aframe-streetmix-parsers.js +++ b/src/aframe-streetmix-parsers.js @@ -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') { @@ -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 }); } diff --git a/src/assets.js b/src/assets.js index 5459de942..1d1e3e101 100644 --- a/src/assets.js +++ b/src/assets.js @@ -217,7 +217,7 @@ function buildAssetHTML (assetUrl, categories) { - + From 5f3d267fbf034efd36221d6bd00df854d8754999 Mon Sep 17 00:00:00 2001 From: Alexander Goryushkin Date: Sun, 12 Nov 2023 17:01:26 -0300 Subject: [PATCH 42/56] add title and logo to screenshot --- src/components/screentock.js | 62 +++++++++++++++++++++++++++++++----- 1 file changed, 54 insertions(+), 8 deletions(-) diff --git a/src/components/screentock.js b/src/components/screentock.js index 7abfea0eb..16e54f212 100644 --- a/src/components/screentock.js +++ b/src/components/screentock.js @@ -28,16 +28,58 @@ AFRAME.registerComponent('screentock', { // hide helpers toggleHelpers(false); - function downloadImage (filename, dataURL) { - downloadImageDataURL(filename, dataURL); - // show helpers - toggleHelpers(true); - } - function toggleHelpers(show) { if (inspector && inspector.opened) inspector.sceneHelpers.visible = show; } + function createCanvasWithScreenshot(aframeCanvas) { + let screenshotCanvas = document.querySelector('#screenshotCanvas'); + if (!screenshotCanvas) { + screenshotCanvas = document.createElement('canvas'); + screenshotCanvas.id = 'screenshotCanvas'; + screenshotCanvas.hidden = true; + document.body.appendChild(screenshotCanvas); + } + screenshotCanvas.width = aframeCanvas.width; + screenshotCanvas.height = aframeCanvas.height; + const ctxScreenshot = screenshotCanvas.getContext("2d"); + + // draw image from Aframe canvas to screenshot canvas + ctxScreenshot.drawImage(aframeCanvas, 0, 0); + // add scene title to screenshot + addTitleToCanvas(ctxScreenshot, screenshotCanvas.width, screenshotCanvas.height); + // add 3DStreet logo + addLogoToCanvas(ctxScreenshot); + return screenshotCanvas; + } + + function addTitleToCanvas (ctx, screenWidth, screenHeight) { + ctx.font = "25px Lato"; + ctx.textAlign = 'center'; + ctx.fillStyle = '#FFF'; + ctx.fillText(STREET.utils.getCurrentSceneTitle(), + screenWidth - screenWidth/2, + screenHeight - 43); + } + + function addLogoToCanvas (ctx) { + ctx.font = "lighter 40px sans-serif"; + ctx.textAlign = 'left'; + ctx.fillStyle = '#FFF'; + ctx.fillText('3D', + 50, + 80); + ctx.font = "Bolder 40px sans-serif"; + ctx.textAlign = 'left'; + ctx.fillStyle = '#FFF'; + ctx.fillText('Street', + 100, + 80); + + //const logoImg = document.querySelector('img.viewer-logo-img'); + //ctx.drawImage(logoImg, 0, 0, 250, 43, 40, 40, 250, 43); + } + function downloadImageDataURL (filename, dataURL) { const element = document.createElement('a'); const url = dataURL.replace(/^data:image\/[^;]/, 'data:application/octet-stream'); @@ -50,17 +92,21 @@ AFRAME.registerComponent('screentock', { } const saveFilename = filename + '.' + type; + // render one frame renderer.render(AFRAME.scenes[0].object3D, AFRAME.scenes[0].camera); + const screenshotCanvas = createCanvasWithScreenshot(renderer.domElement); if (type == 'img') { imgElement.src = renderer.domElement.toDataURL(); return; } if (type == 'png') { - downloadImage(saveFilename, renderer.domElement.toDataURL('image/png')); + downloadImageDataURL(saveFilename, screenshotCanvas.toDataURL('image/png')); } else { - downloadImage(saveFilename, renderer.domElement.toDataURL('image/jpeg', 0.95)); + downloadImageDataURL(saveFilename, screenshotCanvas.toDataURL('image/jpeg', 0.95)); } + // show helpers + toggleHelpers(true); }, update: function () { // this should be paused when not in use. could be throttled too From 5763cef3f2451fa21b9152ab6e2fd31df1c0bfe7 Mon Sep 17 00:00:00 2001 From: Alexander Goryushkin Date: Wed, 15 Nov 2023 16:43:51 -0300 Subject: [PATCH 43/56] take logo for screenshot from svg logo --- src/components/screentock.js | 41 ++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/src/components/screentock.js b/src/components/screentock.js index 16e54f212..a37452177 100644 --- a/src/components/screentock.js +++ b/src/components/screentock.js @@ -21,7 +21,7 @@ AFRAME.registerComponent('screentock', { type: { type: 'string', default: 'jpg' }, // png, jpg, img imgElementSelector: { type: 'selector' } }, - takeScreenshotNow: function (filename, type, imgElement) { + takeScreenshotNow: async function (filename, type, imgElement) { const inspector = AFRAME.INSPECTOR; const renderer = AFRAME.scenes[0].renderer; @@ -32,7 +32,7 @@ AFRAME.registerComponent('screentock', { if (inspector && inspector.opened) inspector.sceneHelpers.visible = show; } - function createCanvasWithScreenshot(aframeCanvas) { + const createCanvasWithScreenshot = async (aframeCanvas) => { let screenshotCanvas = document.querySelector('#screenshotCanvas'); if (!screenshotCanvas) { screenshotCanvas = document.createElement('canvas'); @@ -49,7 +49,7 @@ AFRAME.registerComponent('screentock', { // add scene title to screenshot addTitleToCanvas(ctxScreenshot, screenshotCanvas.width, screenshotCanvas.height); // add 3DStreet logo - addLogoToCanvas(ctxScreenshot); + await addLogoToCanvas(ctxScreenshot); return screenshotCanvas; } @@ -62,25 +62,25 @@ AFRAME.registerComponent('screentock', { screenHeight - 43); } - function addLogoToCanvas (ctx) { - ctx.font = "lighter 40px sans-serif"; - ctx.textAlign = 'left'; - ctx.fillStyle = '#FFF'; - ctx.fillText('3D', - 50, - 80); - ctx.font = "Bolder 40px sans-serif"; - ctx.textAlign = 'left'; - ctx.fillStyle = '#FFF'; - ctx.fillText('Street', - 100, - 80); + const addLogoToCanvas = async (ctx) => { + + const logoImg = document.querySelector('img.viewer-logo-img') + const logoSVG = document.querySelector('#aframeInspector #logoImg svg'); - //const logoImg = document.querySelector('img.viewer-logo-img'); - //ctx.drawImage(logoImg, 0, 0, 250, 43, 40, 40, 250, 43); + if (logoImg) { + ctx.drawImage(logoImg, 0, 0, 135, 43, 40, 30, 135, 43); + } else if (logoSVG) { + const image = new Image(); + image.src = `data:image/svg+xml;base64,${window.btoa(logoSVG.outerHTML)}`; + await new Promise((resolve) => { + image.onload = resolve; + }); + + ctx.drawImage(image, 0, 0, 135, 23, 40, 40, 135, 23); + } } - function downloadImageDataURL (filename, dataURL) { + function downloadImageDataURL (filename, dataURL, scnrenshotCanvas) { const element = document.createElement('a'); const url = dataURL.replace(/^data:image\/[^;]/, 'data:application/octet-stream'); element.setAttribute('href', url); @@ -90,11 +90,12 @@ AFRAME.registerComponent('screentock', { element.click(); document.body.removeChild(element); } + const saveFilename = filename + '.' + type; // render one frame renderer.render(AFRAME.scenes[0].object3D, AFRAME.scenes[0].camera); - const screenshotCanvas = createCanvasWithScreenshot(renderer.domElement); + const screenshotCanvas = await createCanvasWithScreenshot(renderer.domElement); if (type == 'img') { imgElement.src = renderer.domElement.toDataURL(); From 34ad27bf0675825e01c45713ca88c8eb4cc177d6 Mon Sep 17 00:00:00 2001 From: Alexander Goryushkin Date: Thu, 16 Nov 2023 15:30:15 -0300 Subject: [PATCH 44/56] hide also cursor-teleport in screenshot --- src/components/screentock.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/components/screentock.js b/src/components/screentock.js index a37452177..e41261a2b 100644 --- a/src/components/screentock.js +++ b/src/components/screentock.js @@ -30,6 +30,12 @@ AFRAME.registerComponent('screentock', { function toggleHelpers(show) { if (inspector && inspector.opened) inspector.sceneHelpers.visible = show; + if (show) { + document.querySelector('#cameraRig') + .setAttribute('cursor-teleport', "cameraRig: #cameraRig; cameraHead: #camera;"); + } else { + document.querySelector('#cameraRig').removeAttribute('cursor-teleport'); + } } const createCanvasWithScreenshot = async (aframeCanvas) => { @@ -109,7 +115,11 @@ AFRAME.registerComponent('screentock', { // show helpers toggleHelpers(true); }, - update: function () { + update: function (oldData) { + // If `oldData` is empty, then this means we're in the initialization process. + // No need to update. + if (Object.keys(oldData).length === 0) { return; } + // this should be paused when not in use. could be throttled too if (this.data.takeScreenshot) { this.data.takeScreenshot = false; From 4c6dac409b9ad824e623e0b4372a442924157305 Mon Sep 17 00:00:00 2001 From: Alexander Goryushkin Date: Tue, 21 Nov 2023 22:40:49 -0300 Subject: [PATCH 45/56] add more randomly placed elements add more randomly placed elements for these elements: bike-lane, micro-mobility elements, drive-lane, self-driving car, parklet --- src/aframe-streetmix-parsers.js | 112 ++++++++++++++++++++------------ 1 file changed, 71 insertions(+), 41 deletions(-) diff --git a/src/aframe-streetmix-parsers.js b/src/aframe-streetmix-parsers.js index 64fedba8c..9b5db56c9 100644 --- a/src/aframe-streetmix-parsers.js +++ b/src/aframe-streetmix-parsers.js @@ -503,15 +503,29 @@ function createMagicCarpetElement (showVehicles) { return magicCarpetParentEl; } +function randPlacedElements(streetLength, objLength, count) { + const placeLength = objLength / 2 + objLength; + const allPlaces = getZPositions( + -streetLength / 2 + placeLength / 2, + streetLength / 2 - placeLength / 2, + placeLength + ); + return allPlaces.slice(0, count); +} + function createOutdoorDining (length, posY) { const outdoorDiningParentEl = document.createElement('a-entity'); - - const reusableObjectEl = document.createElement('a-entity'); - reusableObjectEl.setAttribute('mixin', 'outdoor_dining'); const outdorDiningLength = 2.27; - const positionZ = randomPosition(reusableObjectEl, 'z', length, outdorDiningLength); - reusableObjectEl.setAttribute('position', {y: posY, z: positionZ}); - outdoorDiningParentEl.append(reusableObjectEl); + + const randPlaces = randPlacedElements(length, outdorDiningLength, 5); + randPlaces.forEach(randPosZ => { + const reusableObjectEl = document.createElement('a-entity'); + reusableObjectEl.setAttribute('mixin', 'outdoor_dining'); + + //const positionZ = randomPosition(reusableObjectEl, 'z', length, outdorDiningLength); + reusableObjectEl.setAttribute('position', {y: posY, z: randPosZ}); + outdoorDiningParentEl.append(reusableObjectEl); + }); return outdoorDiningParentEl; } @@ -522,18 +536,23 @@ function createMicroMobilityElement (variantList, segmentType, posY = 0, length, } const microMobilityParentEl = document.createElement('a-entity'); - const reusableObjectEl = document.createElement('a-entity'); - const rotationY = (variantList[0] === 'inbound') ? 0 : 180; - reusableObjectEl.setAttribute('rotation', '0 ' + rotationY + ' 0'); - if (segmentType === 'bike-lane') { - reusableObjectEl.setAttribute('mixin', 'Bicycle_1'); - } else { - reusableObjectEl.setAttribute('mixin', 'ElectricScooter_1'); - } const bikeLength = 2.03; - const positionZ = randomPosition(reusableObjectEl, 'z', length, bikeLength); - reusableObjectEl.setAttribute('position', {y: posY, z: positionZ}); - microMobilityParentEl.append(reusableObjectEl); + const bikeCount = getRandomIntInclusive(2, 5); + const randPlaces = randPlacedElements(length, bikeLength, bikeCount); + randPlaces.forEach(randPosZ => { + const reusableObjectEl = document.createElement('a-entity'); + const rotationY = (variantList[0] === 'inbound') ? 0 : 180; + reusableObjectEl.setAttribute('rotation', '0 ' + rotationY + ' 0'); + if (segmentType === 'bike-lane') { + reusableObjectEl.setAttribute('mixin', 'Bicycle_1'); + } else { + reusableObjectEl.setAttribute('mixin', 'ElectricScooter_1'); + } + + reusableObjectEl.setAttribute('position', {y: posY, z: randPosZ}); + microMobilityParentEl.append(reusableObjectEl); + }); + return microMobilityParentEl; } @@ -543,19 +562,21 @@ function createFlexZoneElement (variantList, length, showVehicles = true) { return; } const flexZoneParentEl = document.createElement('a-entity'); - - const reusableObjectEl = document.createElement('a-entity'); - const rotationY = (variantList[1] === 'inbound') ? 0 : 180; - reusableObjectEl.setAttribute('rotation', '0 ' + rotationY + ' 0'); - if (variantList[0] === 'taxi') { - reusableObjectEl.setAttribute('mixin', 'sedan-taxi'); - } else if (variantList[0] === 'rideshare') { - reusableObjectEl.setAttribute('mixin', 'sedan-rig'); - } - const positionZ = randomPosition(reusableObjectEl, 'z', length, 5); - reusableObjectEl.setAttribute('position', '0 0 ' + positionZ); - - flexZoneParentEl.append(reusableObjectEl); + const carLength = 5; + const carCount = getRandomIntInclusive(2, 4); + const randPlaces = randPlacedElements(length, carLength, carCount); + randPlaces.forEach(randPosZ => { + const reusableObjectEl = document.createElement('a-entity'); + const rotationY = (variantList[1] === 'inbound') ? 0 : 180; + reusableObjectEl.setAttribute('rotation', '0 ' + rotationY + ' 0'); + if (variantList[0] === 'taxi') { + reusableObjectEl.setAttribute('mixin', 'sedan-taxi-rig'); + } else if (variantList[0] === 'rideshare') { + reusableObjectEl.setAttribute('mixin', 'sedan-rig'); + } + reusableObjectEl.setAttribute('position', {z: randPosZ}); + flexZoneParentEl.append(reusableObjectEl); + }); return flexZoneParentEl; } @@ -610,14 +631,21 @@ function createBikeShareStationElement (variantList, posY) { return placedObjectEl; } -function createParkletElement (variantList) { - const placedObjectEl = document.createElement('a-entity'); - placedObjectEl.setAttribute('class', 'parklet'); - placedObjectEl.setAttribute('position', '0 .02 0'); - placedObjectEl.setAttribute('mixin', 'parklet'); - const rotationY = (variantList[0] === 'left') ? 90 : 270; - placedObjectEl.setAttribute('rotation', '0 ' + rotationY + ' 0'); - return placedObjectEl; +function createParkletElement (length, variantList) { + const parkletParent = document.createElement('a-entity'); + const parkletLength = 4.03; + const parkletCount = 3; + const randPlaces = randPlacedElements(length, parkletLength, parkletCount); + randPlaces.forEach(randPosZ => { + const placedObjectEl = document.createElement('a-entity'); + placedObjectEl.setAttribute('class', 'parklet'); + placedObjectEl.setAttribute('position', {x: 0, y: 0.02, z: randPosZ}); + placedObjectEl.setAttribute('mixin', 'parklet'); + const rotationY = (variantList[0] === 'left') ? 90 : 270; + placedObjectEl.setAttribute('rotation', {y: rotationY}); + parkletParent.append(placedObjectEl); + }); + return parkletParent; } function createTreesParentElement () { @@ -887,8 +915,10 @@ function processSegments (segments, showStriping, length, globalAnimated, showVe // add this stencil stuff to the segment parent segmentParentEl.append(reusableObjectStencilsParentEl); } else if (segments[i].type === 'drive-lane') { - var isAnimated = (variantList[2] === 'animated') || globalAnimated; - segmentParentEl.append(createDriveLaneElement(variantList, segmentWidthInMeters, length, isAnimated, showVehicles)); + const isAnimated = (variantList[2] === 'animated') || globalAnimated; + const count = getRandomIntInclusive(2, 3); + const carStep = 7; + segmentParentEl.append(createDriveLaneElement(variantList, segmentWidthInMeters, length, isAnimated, showVehicles, count, carStep)); } else if (segments[i].type === 'food-truck') { groundMixinId = 'drive-lane'; segmentParentEl.append(createFoodTruckElement(variantList, length)); @@ -944,7 +974,7 @@ function processSegments (segments, showStriping, length, globalAnimated, showVe segmentParentEl.append(createOutdoorDining(length, elevationPosY)); } else if (segments[i].type === 'parklet') { groundMixinId = 'drive-lane'; - segmentParentEl.append(createParkletElement(variantList)); + segmentParentEl.append(createParkletElement(length, variantList)); } else if (segments[i].type === 'bikeshare') { // make the parent for all the stations segmentParentEl.append(createBikeShareStationElement(variantList, elevationPosY)); From 7677cf834f0d9d3b5bed579f0e0b92b606563787 Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Fri, 24 Nov 2023 15:46:50 -0800 Subject: [PATCH 46/56] use new function to generate screenshot to img element --- src/components/screentock.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/screentock.js b/src/components/screentock.js index e41261a2b..74a9de489 100644 --- a/src/components/screentock.js +++ b/src/components/screentock.js @@ -104,7 +104,7 @@ AFRAME.registerComponent('screentock', { const screenshotCanvas = await createCanvasWithScreenshot(renderer.domElement); if (type == 'img') { - imgElement.src = renderer.domElement.toDataURL(); + imgElement.src = screenshotCanvas.toDataURL(); return; } if (type == 'png') { From afe95d81f81eb4a5578d4a83ed7b375eac00a6ab Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Fri, 24 Nov 2023 15:47:32 -0800 Subject: [PATCH 47/56] increase size of logo --- src/components/screentock.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/screentock.js b/src/components/screentock.js index 74a9de489..519369e1f 100644 --- a/src/components/screentock.js +++ b/src/components/screentock.js @@ -74,7 +74,7 @@ AFRAME.registerComponent('screentock', { const logoSVG = document.querySelector('#aframeInspector #logoImg svg'); if (logoImg) { - ctx.drawImage(logoImg, 0, 0, 135, 43, 40, 30, 135, 43); + ctx.drawImage(logoImg, 0, 0, 135, 43, 40, 30, 270, 86); } else if (logoSVG) { const image = new Image(); image.src = `data:image/svg+xml;base64,${window.btoa(logoSVG.outerHTML)}`; @@ -82,7 +82,7 @@ AFRAME.registerComponent('screentock', { image.onload = resolve; }); - ctx.drawImage(image, 0, 0, 135, 23, 40, 40, 135, 23); + ctx.drawImage(image, 0, 0, 135, 23, 40, 40, 270, 86); } } From 79efd0abcdb5e549606ad4d6ac4a20a3843fd389 Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Wed, 29 Nov 2023 20:56:54 -0800 Subject: [PATCH 48/56] fix for legacy scene support - restore legacy plane-based ground mixins to support old scenes - load both rigged and unrigged people --- index.html | 2 +- src/assets.js | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index af89e2629..26a038dae 100644 --- a/index.html +++ b/index.html @@ -78,7 +78,7 @@ - + diff --git a/src/assets.js b/src/assets.js index 1d1e3e101..214a24624 100644 --- a/src/assets.js +++ b/src/assets.js @@ -214,6 +214,13 @@ function buildAssetHTML (assetUrl, categories) { + + + + + + + From 236d5d2ea5a293b7dadc77a1cffcc223c4621a38 Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Thu, 30 Nov 2023 13:25:30 -0800 Subject: [PATCH 49/56] remove animation by default --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 26a038dae..f80c6dffd 100644 --- a/index.html +++ b/index.html @@ -78,11 +78,11 @@ - + - + From 754c8d6d13f46941aed451876f35549d98876fc7 Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Thu, 30 Nov 2023 13:25:49 -0800 Subject: [PATCH 50/56] change street default length to 60 meters --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index db331b4e7..d2ae4424b 100644 --- a/src/index.js +++ b/src/index.js @@ -22,7 +22,7 @@ AFRAME.registerComponent('street', { showStriping: { default: true }, showVehicles: { default: true }, globalAnimated: { default: false }, - length: { default: 150 } + length: { default: 60 } // new default of 60 from 0.4.4 }, update: function (oldData) { // fired once at start and at each subsequent change of a schema value var data = this.data; From 49713ba3713e44fe142d2bfb8368658a235ee753 Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Thu, 30 Nov 2023 13:26:21 -0800 Subject: [PATCH 51/56] version bump and dist bump --- dist/aframe-street-component.js | 4 ++-- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dist/aframe-street-component.js b/dist/aframe-street-component.js index dc67537b5..da9eec133 100644 --- a/dist/aframe-street-component.js +++ b/dist/aframe-street-component.js @@ -1,4 +1,4 @@ -!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var i=e();for(var n in i)("object"==typeof exports?exports:t)[n]=i[n]}}(self,(()=>(()=>{var t={631:t=>{var e=[new THREE.Vector2,new THREE.Vector2,new THREE.Vector2,new THREE.Vector2];function i(t,i,n,a){const r=1/a,s=1/n;return e[0].set(r*i,s*t+s),e[1].set(r*i,s*t),e[2].set(r*i+r,s*t),e[3].set(r*i+r,s*t+s),e}AFRAME.registerComponent("atlas-uvs",{dependencies:["geometry"],schema:{totalColumns:{type:"int",default:1},totalRows:{type:"int",default:1},column:{type:"int",default:1},row:{type:"int",default:1}},update:function(){const t=this.data,e=i(t.row-1,t.column-1,t.totalRows,t.totalColumns),n=this.el.getObject3D("mesh").geometry;var a=new Float32Array([e[0].x,e[0].y,e[3].x,e[3].y,e[1].x,e[1].y,e[2].x,e[2].y]);n.setAttribute("uv",new THREE.BufferAttribute(a,2)),n.uvsNeedUpdate=!0}}),AFRAME.registerComponent("dynamic-texture-atlas",{schema:{canvasId:{default:"dynamicAtlas"},canvasHeight:{default:1024},canvasWidth:{default:1024},debug:{default:!1},numColumns:{default:8},numRows:{default:8}},multiple:!0,init:function(){const t=this.canvas=document.createElement("canvas");t.id=this.data.canvasId,t.height=this.data.canvasHeight,t.width=this.data.canvasWidth,this.ctx=t.getContext("2d"),document.body.appendChild(t),this.data.debug&&(t.style.left=0,t.style.top=0,t.style.position="fixed",t.style.zIndex=9999999999)},drawTexture:function(t,e,n,a,r){const s=this.canvas,o=this.data;t.complete||(t.onload=()=>{this.drawTexture(t,e,n)});const l=r||s.height/o.numRows,c=a||s.width/o.numColumns;return this.ctx.drawImage(t,c*e,c*n,c,l),i(e,n,o.numRows,o.numColumns)}}),t.exports.getGridUvs=i},844:(t,e,i)=>{function n(t){return function(t){if(Array.isArray(t))return s(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||r(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],n=!0,a=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(n=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);n=!0);}catch(t){a=!0,r=t}finally{try{n||null==o.return||o.return()}finally{if(a)throw r}}return i}(t,e)||r(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){if(t){if("string"==typeof t)return s(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?s(t,e):void 0}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i3&&void 0!==arguments[3]?arguments[3]:2.25,a=h(e,"dividers-".concat(t,"-parent"));return d({objectMixinId:"dividers-".concat(t),parentEl:a,step:n,radius:i}),a}function g(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2.25,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"0 0 0",r=h(e,"".concat(t,"-parent"));return d({objectMixinId:t,parentEl:r,step:n,radius:i,rotation:a}),r}function y(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1)+t)}function b(t,e){return Math.random()*(e-t)+t}function x(t,e,i){var n=Math.floor((e-t)/i)+1;return Array(n).fill().map((function(e,n){return t+n*i})).sort((function(){return.5-Math.random()}))}function v(t,e,i,n){for(var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"random",r=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=[-.37*e,.37*e],o=x(-.5*n,.5*n,1.5),l=parseInt({empty:0,sparse:.03,normal:.125,dense:.25}[i]*n,10),c=h(t,"pedestrians-parent"),d=0;d3&&void 0!==arguments[3]?arguments[3]:void 0,l=t.object3D,c=o||(n=l,a=(new THREE.Box3).setFromObject(n),{x:a.max.x-a.min.x,y:a.max.y-a.min.y,z:a.max.z-a.min.z})[e],d={start:-.5*(r=i)+.5*(s=c),end:.5*r-.5*s},u=d.start,m=d.end,p="set".concat(e.toUpperCase()),h=b(u,m);return l.position[p](h),h}function E(t,e,i,n,a){if(a){var r="inbound"===t[0]?0:180,s=document.createElement("a-entity");return s.setAttribute("class",e),s.setAttribute("position",i+" 0 0"),s.setAttribute("rotation","0 "+r+" 0"),s.setAttribute("mixin",e),s.addEventListener("model-loaded",(function(t){w(t.target,"z",n)}),{once:!0}),s}}function _(t,e,i,n){if(n){var a="inbound"===t[0]?0:180,r=document.createElement("a-entity"),s=document.createElement("a-entity");s.setAttribute("rotation","0 "+a+" 0"),s.setAttribute("mixin","bus");var o=w(s,"z",i,12);return s.setAttribute("position",e+" 0 "+o),r.append(s),r}}function k(t,e,i,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5?arguments[5]:void 0,s=i/e*1e3,o="outbound"===(arguments.length>6?arguments[6]:void 0)?-i/2:i/2,l=Math.abs(o-r)/e*1e3,c={property:"position",easing:"linear",loop:"false",from:{x:n,y:a,z:r},to:{z:o},dur:l},d={property:"position",easing:"linear",loop:"true",from:{x:n,y:a,z:-o},to:{x:n,y:a,z:o},delay:l,dur:s};return t.setAttribute("animation__1",c),t.setAttribute("animation__2",d),t}function C(t,e,i,n){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:void 0;if(!(arguments.length>5&&void 0!==arguments[5])||arguments[5]){var l=0,c=a(t,3),d=c[0],u=c[1],m=c[2];2===t.length&&(m=u);var p,h={inbound:0,outbound:180,sideways:{left:-90,right:90},"angled-front-left":-60,"angled-front-right":60,"angled-rear-left":-120,"angled-rear-right":120};if(p="sideways"==d?h.sideways[u]:h[d],"pedestrian"===m)return v(e,i,"normal",n,d,r);var f=document.createElement("a-entity");if(1==t.length)return f;var g={car:{mixin:"sedan-rig",wheelDiameter:.76,length:5.17,width:2},microvan:{mixin:"suv-rig",wheelDiameter:.84,length:5,width:2},truck:{mixin:"box-truck-rig",wheelDiameter:1.05,length:6.95,width:2.5}};if(s>1){var y=n/2,b=o/2+o,A=x(-y+b,y-b,o).slice(0,s),E="sideways"==d||d.includes("angled")?"width":"length",_=g[m][E];A.forEach((function(t){var e=o-_-.2,i=-e/2+e*Math.random();e>0&&C(t+i,m)}))}else C();return f}function C(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,i=g[arguments.length>1&&void 0!==arguments[1]?arguments[1]:"car"],a=document.createElement("a-entity");return t||(t=w(a,"z",n,i.length)),a.setAttribute("position","".concat(e," 0 ").concat(t)),a.setAttribute("mixin",i.mixin),a.setAttribute("rotation","0 ".concat(p," 0")),r&&(l=5,a.setAttribute("wheel",{speed:l,wheelDiameter:i.wheelDiameter}),k(a,l,n,e,0,t,u)),f.append(a),a}}function M(t,e,i){var n=document.createElement("a-entity"),a=document.createElement("a-entity"),r="left"===t[0]?0:180;return a.setAttribute("position",e+" 0 0"),a.setAttribute("rotation","0 "+r+" 0"),a.setAttribute("mixin","food-trailer-rig"),a.addEventListener("model-loaded",(function(t){w(t.target,"z",i)}),{once:!0}),n.append(a),n}function S(t,e){if(e){var i=document.createElement("a-entity"),n=document.createElement("a-entity");n.setAttribute("position",t+" 1.75 0"),n.setAttribute("rotation","0 0 0"),n.setAttribute("mixin","magic-carpet"),i.append(n);var a=document.createElement("a-entity");return a.setAttribute("position",t+" 1.75 0"),a.setAttribute("rotation","0 0 0"),a.setAttribute("mixin","Character_1_M"),i.append(a),i}}function R(t,e){var i=document.createElement("a-entity"),n=document.createElement("a-entity");n.setAttribute("mixin","outdoor_dining");var a=w(n,"z",e,2.27);return n.setAttribute("position",t+" 0 "+a),i.append(n),i}function N(t,e,i,n,a){if(a){var r=document.createElement("a-entity"),s=document.createElement("a-entity"),o="inbound"===t[0]?0:180;s.setAttribute("rotation","0 "+o+" 0"),"bike-lane"===i?s.setAttribute("mixin","Bicycle_1"):s.setAttribute("mixin","ElectricScooter_1");var l=w(s,"z",n,2.03);return s.setAttribute("position",e+" 0 "+l),r.append(s),r}}function j(t,e,i){if(!(arguments.length>3&&void 0!==arguments[3])||arguments[3]){var n=document.createElement("a-entity"),a=document.createElement("a-entity"),r="inbound"===t[1]?0:180;a.setAttribute("rotation","0 "+r+" 0"),"taxi"===t[0]?a.setAttribute("mixin","sedan-taxi"):"rideshare"===t[0]&&a.setAttribute("mixin","sedan-rig");var s=w(a,"z",i,5);return a.setAttribute("position",e+" 0 "+s),n.append(a),n}}function O(t){var e,i=document.createElement("a-entity");return(e=document.createElement("a-entity")).setAttribute("position",t+" 1 0"),e.setAttribute("mixin","wayfinding-box"),i.append(e),(e=document.createElement("a-entity")).setAttribute("position",t+" 1.2 0.06"),e.setAttribute("geometry","primitive: plane; width: 0.8; height: 1.6"),e.setAttribute("material","src:#wayfinding-map"),i.append(e),(e=document.createElement("a-entity")).setAttribute("position",t+" 1.2 -0.06"),e.setAttribute("rotation","0 180 0"),e.setAttribute("geometry","primitive: plane; width: 0.8; height: 1.6"),e.setAttribute("material","src:#wayfinding-map"),i.append(e),i}function T(t){var e=document.createElement("a-entity");return e.setAttribute("class","bench-parent"),e.setAttribute("position",t+" 0.2 3.5"),e}function L(t){var e=document.createElement("a-entity");return e.setAttribute("class","bikerack-parent"),e.setAttribute("position",t+" 0 -3.5"),e}function I(t,e){var i=document.createElement("a-entity");i.setAttribute("class","bikeshare"),i.setAttribute("position",t+" 0 0"),i.setAttribute("mixin","bikeshare");var n="left"===e[0]?90:270;return i.setAttribute("rotation","0 "+n+" 0"),i}function P(t,e){var i=document.createElement("a-entity");i.setAttribute("class","parklet"),i.setAttribute("position",t+" .02 0"),i.setAttribute("mixin","parklet");var n="left"===e[0]?90:270;return i.setAttribute("rotation","0 "+n+" 0"),i}function z(t){var e=document.createElement("a-entity");return e.setAttribute("class","tree-parent"),e.setAttribute("position",t+" 0.2 7"),e}function D(t){var e=document.createElement("a-entity");return e.setAttribute("class","lamp-parent"),e.setAttribute("position",t+" 0.2 0"),e}function B(t,e){var i=document.createElement("a-entity");return i.setAttribute("class","bus-stop"),i.setAttribute("position",t+" 0 0"),i.setAttribute("rotation","0 "+e+" 0"),i.setAttribute("mixin","bus-stop"),i}function F(t){var e=document.createElement("a-entity");return e.setAttribute("class","brt-station"),e.setAttribute("position",t+" 0 0"),e.setAttribute("mixin","brt-station"),e}function H(t,e,i,n,a,r,s){var o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,l=document.createElement("a-entity"),c=t+" "+r/150+" 1",d=t+" 1 1";return"sidewalk"===a||1===o?(l.setAttribute("geometry","primitive","box"),l.setAttribute("geometry","height: 0.4"),l.setAttribute("geometry","depth",r),l.setAttribute("scale",d)):a.match("lane")?(i-=.1,l.setAttribute("geometry","primitive","box"),l.setAttribute("geometry","height: 0.2"),l.setAttribute("geometry","depth",r),l.setAttribute("scale",d)):(l.setAttribute("rotation","270 "+n+" 0"),l.setAttribute("scale",c)),l.setAttribute("position",e+" "+i+" 0"),l.setAttribute("mixin",a),0!==s.length&&l.setAttribute("material","repeat: ".concat(s[0]," ").concat(s[1])),l}t.exports.processSegments=function(t,e,i,a,r){var s=i/2;i>12&&(s=(i-12)/2),e&&(t=function(t){function e(t){return"lane"===t.slice(t.length-4)||"light-rail"===t||"streetcar"===t||"flex-zone"===t}return t.reduce((function(t,i,n,a){if(0===n)return t.concat(i);var r=a[n-1];if(e(i.type)&&e(r.type)){var s="solid";i.type===r.type&&(s="dashed"),("drive-lane"===i.type&&"turn-lane"===r.type||"drive-lane"===r.type&&"turn-lane"===i.type)&&(s="dashed"),i.variantString.split("|")[0]!==r.variantString.split("|")[0]&&(s="doubleyellow","bike-lane"===i.type&&"bike-lane"===r.type&&(s="shortdashedyellow"),"flex-zone"!==i.type&&"flex-zone"!==r.type||(s="solid")),"turn-lane"===i.type&&"shared"===i.variantString.split("|")[1]?s="soliddashedyellow":"turn-lane"===r.type&&"shared"===r.variantString.split("|")[1]&&(s="soliddashedyellowinverted"),"parking-lane"!==i.type&&"parking-lane"!==r.type||(s="invisible"),t.push({type:"separator",variantString:s,width:0})}return(e(i.type)&&"divider"===r.type||e(r.type)&&"divider"===i.type)&&t.push({type:"separator",variantString:"solid",width:0}),t.push(i),t}),[])}(t));var h=function(t){var e=document.createElement("a-entity"),i=0-l.calcStreetWidth(t)/2;return e.setAttribute("position",i+" 0 0"),e}(t);h.classList.add("street-parent");for(var y,b=0,x=0;x{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){for(var i=0;i\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),people:'\n \x3c!-- human characters --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),"people-rigged":' \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),vehicles:'\n \x3c!-- vehicles --\x3e\n \n \n \n \x3c!-- micro mobility vehicles --\x3e\n \n \n \n '),"vehicles-rigged":'\n \x3c!-- vehicles rigged --\x3e\n \n \n \n \n \n \n '),buildings:'\n \x3c!-- blocks --\x3e\n \n \n \n\n \x3c!-- buildings and blocks --\x3e\n \n \n \n \n \n\n \x3c!-- suburban buildings --\x3e\n \n \n \n\n \x3c!-- arched style buildings --\x3e\n \n \n \n \n'),"intersection-props":'\n \n \n \n \n \n \n '),"segment-textures":' \n \x3c!-- segment mixins with textures --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n '),"segment-colors":' \n \x3c!-- segment color modifier mixins --\x3e\n \n \n \n ',"lane-separator":'\n \x3c!-- lane separator markings --\x3e\n \n \n \n \n \n \n \n \n '),stencils:' \n \x3c!-- stencil markings --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),"vehicles-transit":'\n \x3c!-- vehicles-transit --\x3e\n \n \n \n \n \n \n '),dividers:'\n \x3c!-- dividers --\x3e\n \n \n \n \n \n \n \n \n \n \n \n '),sky:'\n \x3c!-- sky --\x3e\n \n \n '),grounds:'\n \x3c!-- grounds --\x3e\n \n \n \n\n \n \n \n \n\n \n \n '),"loud-bicycle":'\n \x3c!-- loud-bicycle-game --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ')};if(e){var n=e.split(" "),a=Object.keys(i).filter((function(t){return n.includes(t)})),r="";for(var s in i)a.includes(s)&&(r+=i[s]);return r}return Object.values(i).join("")}(e,t)),AFRAME.ANode.prototype.load.call(this)}}])&&e(a.prototype,r),s&&e(a,s),l}();customElements.define("street-assets",r);document.addEventListener("DOMSubtreeModified",(function t(e){if("A-SCENE"===e.target.nodeName){var i=e.target.querySelector("a-assets");if(i||(i=document.createElement("a-assets"),e.target.append(i)),i.querySelector("street-assets"))document.removeEventListener("DOMSubtreeModified",t);else{var n=document.createElement("street-assets");i.append(n),document.removeEventListener("DOMSubtreeModified",t)}}}),!1)},51:()=>{AFRAME.registerComponent("anisotropy",{schema:{default:0},dependencies:["material","geometry"],init:function(){var t=this;this.maxAnisotropy=this.el.sceneEl.renderer.capabilities.getMaxAnisotropy(),["model-loaded","materialtextureloaded"].forEach((function(e){return t.el.addEventListener(e,(function(){var e=t.el.getObject3D("mesh"),i=t.data;0===(i=+i||0)&&(i=t.maxAnisotropy),e.traverse((function(t){!0===t.isMesh&&null!==t.material.map&&(t.material.map.anisotropy=i,t.material.map.needsUpdate=!0)}))}),!1)}))}})},391:(t,e,i)=>{var n=i(334);AFRAME.registerComponent("create-from-json",{schema:{jsonString:{type:"string",default:""}},update:function(t){var e=this.data,i=this.el;if(t.string&&e.string!==t.string)for(;i.firstChild;)i.removeChild(i.lastChild);n.appendChildElementsFromArray(JSON.parse(e.jsonString),i)}})},71:()=>{var t={},e={};AFRAME.registerComponent("gltf-part",{schema:{buffer:{default:!0},part:{type:"string"},src:{type:"asset"}},init:function(){this.dracoLoader=document.querySelector("a-scene").systems["gltf-model"].getDRACOLoader()},update:function(){var t=this.el;!this.data.part&&this.data.src||this.getModel((function(e){e&&t.setObject3D("mesh",e)}))},getModel:function(i){var n=this;if(!e[this.data.src])return t[this.data.src]?t[this.data.src].then((function(t){i(n.selectFromModel(t))})):void(t[this.data.src]=new Promise((function(a){var r=new THREE.GLTFLoader;n.dracoLoader&&r.setDRACOLoader(n.dracoLoader),r.load(n.data.src,(function(r){var s=r.scene||r.scenes[0];e[n.data.src]=s,delete t[n.data.src],i(n.selectFromModel(s)),a(s)}),(function(){}),console.error)})));i(this.selectFromModel(e[this.data.src]))},selectFromModel:function(t){var e,i;if(i=t.getObjectByName(this.data.part))return e=i.getObjectByProperty("type","Mesh").clone(!0),this.data.buffer?(e.geometry=e.geometry.toNonIndexed(),e):(e.geometry=(new THREE.Geometry).fromBufferGeometry(e.geometry),e);console.error("[gltf-part] `"+this.data.part+"` not found in model.")}})},247:(t,e,i)=>{var n=i(502).Notyf;AFRAME.registerComponent("notify",{schema:{duration:{type:"number",default:6e3},ripple:{type:"boolean",default:!0},position:{type:"string",default:{x:"center",y:"bottom"}},dismissible:{type:"boolean",default:!1},type:{type:"string",default:"info"},message:{type:"string",default:""}},init:function(){this.notify=new n({types:[{type:"info",background:"blue",icon:!1}],duration:this.data.duration,ripple:this.data.ripple,position:this.data.position,dismissible:this.data.dismissible}),this.types=this.notify.options.types.map((function(t){return t.type}))},message:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info";t&&this.types.includes(e)&&this.notify.open({type:e,message:t})},update:function(t){if(0!==Object.keys(t).length){var e=this.data.message,i=this.data.type;e&&this.types.includes(i)&&(this.message(e,i),this.data.message="")}}})},699:()=>{takeScreenshotNow=function(t,e,i){var n=AFRAME.scenes[0].renderer;function a(t,e){var i=document.createElement("a"),n=e.replace(/^data:image\/[^;]/,"data:application/octet-stream");i.setAttribute("href",n),i.setAttribute("download",t),i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i)}var r=t+"."+e;"img"!=e?a(r,"png"==e?n.domElement.toDataURL("image/png"):n.domElement.toDataURL("image/jpeg",.95)):i.src=n.domElement.toDataURL()},AFRAME.registerComponent("screentock",{schema:{takeScreenshot:{type:"boolean",default:!1},filename:{type:"string",default:"screenshot"},type:{type:"string",default:"jpg"},imgElementSelector:{type:"selector"}},tock:function(){this.data.takeScreenshot&&(this.el.setAttribute("screentock","takeScreenshot",!1),takeScreenshotNow(this.data.filename,this.data.type,this.data.imgElementSelector))}})},54:function(t,e,i){var n,a,r,s;function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}t=i.nmd(t),s=function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var a=e[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,i),a.l=!0,a.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==o(t)&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)i.d(n,a,function(e){return t[e]}.bind(null,a));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=0)}([function(t,e){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");AFRAME.registerComponent("cursor-teleport",{schema:{cameraHead:{type:"selector",default:""},cameraRig:{type:"selector",default:""},collisionEntities:{type:"string",default:""},ignoreEntities:{type:"string",default:""},landingMaxAngle:{default:45,min:0,max:360},landingNormal:{type:"vec3",default:{x:0,y:1,z:0}},transitionSpeed:{type:"number",default:6e-4}},init:function(){var t=this;this.mobile=AFRAME.utils.device.isMobile();var e=this.el.sceneEl;this.canvas=e.renderer.domElement,this.data.cameraHead.object3D.traverse((function(e){e instanceof THREE.Camera&&(t.cam=e)})),this.camRig=this.data.cameraRig.object3D,this.rayCaster=new THREE.Raycaster,this.referenceNormal=new THREE.Vector3,this.rayCastObjects=[],this.referenceNormal.copy(this.data.landingNormal);var i=new THREE.RingGeometry(.25,.3,32,1);i.rotateX(-Math.PI/2),i.translate(0,.02,0);var n=new THREE.MeshBasicMaterial({color:7818734}),a=new THREE.Mesh(i,n),r=new THREE.CylinderGeometry(.3,.3,.5,32,1,!0);r.translate(0,.25,0);var s=(new THREE.TextureLoader).load("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAQCAYAAADXnxW3AAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAADJJREFUeNpEx7ENgDAAAzArK0JA6f8X9oewlcWStU1wBGdwB08wgjeYm79jc2nbYH0DAC/+CORJxO5fAAAAAElFTkSuQmCC"),o=new THREE.MeshBasicMaterial({color:7818734,side:"double",map:s,transparent:!0,depthTest:!1}),l=new THREE.Mesh(r,o),c=new THREE.Group;c.add(a),c.add(l),this.teleportIndicator=c,e.object3D.add(this.teleportIndicator),this.transitioning=!1,this.transitionProgress=0,this.transitionCamPosStart=new THREE.Vector3,this.transitionCamPosEnd=new THREE.Vector3,this.updateRaycastObjects=this.updateRaycastObjects.bind(this),this.getMouseState=this.getMouseState.bind(this),this.getTeleportPosition=this.getTeleportPosition.bind(this),this.isValidNormalsAngle=this.isValidNormalsAngle.bind(this),this.transition=this.transition.bind(this),this.mouseMove=this.mouseMove.bind(this),this.mouseDown=this.mouseDown.bind(this),this.mouseUp=this.mouseUp.bind(this),this.easeInOutQuad=this.easeInOutQuad.bind(this),this.updateRaycastObjects()},remove:function(){this.cam=null,this.canvas=null,this.rayCastObjects.length=0,this.el.sceneEl.object3D.remove(this.teleportIndicator),this.teleportIndicator.children[0].material.dispose(),this.teleportIndicator.children[0].geometry.dispose(),this.teleportIndicator.children[1].material.dispose(),this.teleportIndicator.children[1].geometry.dispose(),this.teleportIndicator=null,this.collisionMesh&&(this.collisionMesh.geometry.dispose(),this.collisionMesh.material.dispose(),this.collisionMesh=null)},play:function(){var t=this.canvas;t.addEventListener("mousedown",this.mouseDown,!1),t.addEventListener("mousemove",this.mouseMove,!1),t.addEventListener("mouseup",this.mouseUp,!1),t.addEventListener("touchstart",this.mouseDown,!1),t.addEventListener("touchmove",this.mouseMove,!1),t.addEventListener("touchend",this.mouseUp,!1)},pause:function(){var t=this.canvas;t.removeEventListener("mousedown",this.mouseDown),t.removeEventListener("mousemove",this.mouseMove),t.removeEventListener("mouseup",this.mouseUp),t.removeEventListener("touchstart",this.mouseDown),t.removeEventListener("touchmove",this.mouseMove),t.removeEventListener("touchend",this.mouseUp)},updateRaycastObjects:function(){var t=this;if(this.rayCastObjects.length=0,""!==this.data.collisionEntities)this.el.sceneEl.querySelectorAll(this.data.collisionEntities).forEach((function(e){e.object3D.traverse((function(e){e.isMesh&&(e.userData.collision=!0,t.rayCastObjects.push(e))}))}));else{if(!this.collisionMesh){var e=new THREE.PlaneGeometry(500,500,1);e.rotateX(-Math.PI/2);var i=new THREE.MeshNormalMaterial,n=new THREE.Mesh(e,i);n.userData.collision=!0,this.collisionMesh=n}this.rayCastObjects.push(this.collisionMesh)}""!==this.data.ignoreEntities&&this.el.sceneEl.querySelectorAll(this.data.ignoreEntities).forEach((function(e){e.object3D.traverse((function(e){e.isMesh&&t.rayCastObjects.push(e)}))}))},getMouseState:function(){var t=new THREE.Vector2;return function(e){var i=this.canvas.getBoundingClientRect();return null!=e.clientX?(t.x=e.clientX-i.left,t.y=e.clientY-i.top,t):null!=e.touches[0]?(t.x=e.touches[0].clientX-i.left,t.y=e.touches[0].clientY-i.top,t):void 0}}(),getTeleportPosition:function(){var t=new THREE.Vector2;return function(e,i){if(0!==this.rayCastObjects.length){if(this.cam&&this.canvas){var n=this.cam,a=this.canvas.getBoundingClientRect();t.x=e/(a.right-a.left)*2-1,t.y=-i/(a.bottom-a.top)*2+1,this.rayCaster.setFromCamera(t,n);var r=this.rayCaster.intersectObjects(this.rayCastObjects);return!(0===r.length||!this.isValidNormalsAngle(r[0].face.normal))&&!0===r[0].object.userData.collision&&r[0].point}return!1}return!1}}(),isValidNormalsAngle:function(t){var e=this.referenceNormal.angleTo(t);return THREE.MathUtils.RAD2DEG*e<=this.data.landingMaxAngle},transition:function(t){this.transitionProgress=0,this.transitionCamPosEnd.copy(t),this.transitionCamPosStart.copy(this.camRig.position),this.transitioning=!0},mouseMove:function(t){var e=this.getMouseState(t);this.mouseX=e.x,this.mouseY=e.y},mouseDown:function(t){this.updateRaycastObjects();var e=this.getMouseState(t);this.mouseX=e.x,this.mouseY=e.y,this.mouseXOrig=e.x,this.mouseYOrig=e.y},mouseUp:function(t){if(this.mouseX===this.mouseXOrig&&this.mouseY===this.mouseYOrig){var e=this.getTeleportPosition(this.mouseX,this.mouseY);e&&(this.teleportIndicator.position.copy(e),this.transition(e))}},easeInOutQuad:function(t){return t<.5?2*t*t:(4-2*t)*t-1},tick:function(t,e){if(!this.transitioning&&!this.mobile){var i=this.getTeleportPosition(this.mouseX,this.mouseY);i&&this.teleportIndicator.position.copy(i)}if(this.transitioning){this.transitionProgress+=e*this.data.transitionSpeed;var n=this.easeInOutQuad(this.transitionProgress),a=n<.5?n:1.5-1*(n+.5);this.teleportIndicator.scale.set(1+a,1,1+a);var r=this.camRig.position;r.x=this.transitionCamPosStart.x+(this.transitionCamPosEnd.x-this.transitionCamPosStart.x)*n,r.y=this.transitionCamPosStart.y+(this.transitionCamPosEnd.y-this.transitionCamPosStart.y)*n,r.z=this.transitionCamPosStart.z+(this.transitionCamPosEnd.z-this.transitionCamPosStart.z)*n,this.transitionProgress>=1&&(this.transitioning=!1,r.copy(this.transitionCamPosEnd))}}})}])},"object"==o(e)&&"object"==o(t)?t.exports=s():(a=[],void 0===(r="function"==typeof(n=s)?n.apply(e,a):n)||(t.exports=r))},475:t=>{var e={once:THREE.LoopOnce,repeat:THREE.LoopRepeat,pingpong:THREE.LoopPingPong};function i(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")}t.exports=AFRAME.registerComponent("animation-mixer",{schema:{clip:{default:"*"},duration:{default:0},clampWhenFinished:{default:!1,type:"boolean"},crossFadeDuration:{default:0},loop:{default:"repeat",oneOf:Object.keys(e)},repetitions:{default:1/0,min:0},timeScale:{default:1},startAt:{default:0}},init:function(){var t=this;this.model=null,this.mixer=null,this.activeActions=[];var e=this.el.getObject3D("mesh");e?this.load(e):this.el.addEventListener("model-loaded",(function(e){t.load(e.detail.model)}))},load:function(t){var e=this.el;this.model=t,this.mixer=new THREE.AnimationMixer(t),this.mixer.addEventListener("loop",(function(t){e.emit("animation-loop",{action:t.action,loopDelta:t.loopDelta})})),this.mixer.addEventListener("finished",(function(t){e.emit("animation-finished",{action:t.action,direction:t.direction})})),this.data.clip&&this.update({})},remove:function(){this.mixer&&this.mixer.stopAllAction()},update:function(t){if(t){var i=this.data,n=AFRAME.utils.diff(i,t);if("clip"in n)return this.stopAction(),void(i.clip&&this.playAction());this.activeActions.forEach((function(t){"duration"in n&&i.duration&&t.setDuration(i.duration),"clampWhenFinished"in n&&(t.clampWhenFinished=i.clampWhenFinished),("loop"in n||"repetitions"in n)&&t.setLoop(e[i.loop],i.repetitions),"timeScale"in n&&t.setEffectiveTimeScale(i.timeScale)}))}},stopAction:function(){for(var t=this.data,e=0;e{"use strict";function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}Object.defineProperty(e,"__esModule",{value:!0}); +!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var i=e();for(var a in i)("object"==typeof exports?exports:t)[a]=i[a]}}(self,(()=>(()=>{var t={631:t=>{var e=[new THREE.Vector2,new THREE.Vector2,new THREE.Vector2,new THREE.Vector2];function i(t,i,a,n){const r=1/n,s=1/a;return e[0].set(r*i,s*t+s),e[1].set(r*i,s*t),e[2].set(r*i+r,s*t),e[3].set(r*i+r,s*t+s),e}AFRAME.registerComponent("atlas-uvs",{dependencies:["geometry"],schema:{totalColumns:{type:"int",default:1},totalRows:{type:"int",default:1},column:{type:"int",default:1},row:{type:"int",default:1}},update:function(){const t=this.data,e=i(t.row-1,t.column-1,t.totalRows,t.totalColumns),a=this.el.getObject3D("mesh").geometry;var n=new Float32Array([e[0].x,e[0].y,e[3].x,e[3].y,e[1].x,e[1].y,e[2].x,e[2].y]);a.setAttribute("uv",new THREE.BufferAttribute(n,2)),a.uvsNeedUpdate=!0}}),AFRAME.registerComponent("dynamic-texture-atlas",{schema:{canvasId:{default:"dynamicAtlas"},canvasHeight:{default:1024},canvasWidth:{default:1024},debug:{default:!1},numColumns:{default:8},numRows:{default:8}},multiple:!0,init:function(){const t=this.canvas=document.createElement("canvas");t.id=this.data.canvasId,t.height=this.data.canvasHeight,t.width=this.data.canvasWidth,this.ctx=t.getContext("2d"),document.body.appendChild(t),this.data.debug&&(t.style.left=0,t.style.top=0,t.style.position="fixed",t.style.zIndex=9999999999)},drawTexture:function(t,e,a,n,r){const s=this.canvas,o=this.data;t.complete||(t.onload=()=>{this.drawTexture(t,e,a)});const l=r||s.height/o.numRows,c=n||s.width/o.numColumns;return this.ctx.drawImage(t,c*e,c*a,c,l),i(e,a,o.numRows,o.numColumns)}}),t.exports.getGridUvs=i},844:(t,e,i)=>{function a(t){return function(t){if(Array.isArray(t))return s(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||r(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],a=!0,n=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(a=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);a=!0);}catch(t){n=!0,r=t}finally{try{a||null==o.return||o.return()}finally{if(n)throw r}}return i}(t,e)||r(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){if(t){if("string"==typeof t)return s(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?s(t,e):void 0}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,a=new Array(e);i2&&void 0!==arguments[2]?arguments[2]:2.25,a=p("dividers-".concat(t,"-parent"));return c({objectMixinId:"dividers-".concat(t),parentEl:a,step:i,radius:e}),a}function f(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2.25,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"0 0 0",n=p("".concat(t,"-parent"));return c({objectMixinId:t,parentEl:n,step:i,radius:e,rotation:a}),n}function g(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1)+t)}function y(t,e){return Math.random()*(e-t)+t}function b(t,e,i){var a=Math.floor((e-t)/i)+1;return Array(a).fill().map((function(e,a){return t+a*i})).sort((function(){return.5-Math.random()}))}function x(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3?arguments[3]:void 0,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"random",r=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=[-.37*t,.37*t],o=b(-.5*a,.5*a,1.5),l=parseInt({empty:0,sparse:.03,normal:.125,dense:.25}[e]*a,10),c=p("pedestrians-parent");c.setAttribute("position",{y:i});for(var d=0;d3&&void 0!==arguments[3]?arguments[3]:void 0,l=t.object3D,c=o||(a=l,n=(new THREE.Box3).setFromObject(a),{x:n.max.x-n.min.x,y:n.max.y-n.min.y,z:n.max.z-n.min.z})[e],d={start:-.5*(r=i)+.5*(s=c),end:.5*r-.5*s},u=d.start,m=d.end,p="set".concat(e.toUpperCase()),h=y(u,m);return l.position[p](h),h}function A(t,e,i,a){if(a){var n="inbound"===t[0]?0:180,r=document.createElement("a-entity");return r.setAttribute("class",e),r.setAttribute("rotation","0 "+n+" 0"),r.setAttribute("mixin",e),r.addEventListener("model-loaded",(function(t){w(t.target,"z",i)}),{once:!0}),r}}function E(t,e,i){if(i){var a="inbound"===t[0]?0:180,n=document.createElement("a-entity"),r=document.createElement("a-entity");r.setAttribute("rotation","0 "+a+" 0"),r.setAttribute("mixin","bus");var s=w(r,"z",e,12);return r.setAttribute("position","0 0 "+s),n.append(r),n}}function _(t,e,i,a){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5?arguments[5]:void 0,s=i/e*1e3,o="outbound"===(arguments.length>6?arguments[6]:void 0)?-i/2:i/2,l=Math.abs(o-r)/e*1e3,c={property:"position",easing:"linear",loop:"false",from:{x:a,y:n,z:r},to:{z:o},dur:l},d={property:"position",easing:"linear",loop:"true",from:{x:a,y:n,z:-o},to:{x:a,y:n,z:o},delay:l,dur:s};return t.setAttribute("animation__1",c),t.setAttribute("animation__2",d),t}function C(t,e,i){var a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:void 0;if(!(arguments.length>4&&void 0!==arguments[4])||arguments[4]){var o=0,l=n(t,3),c=l[0],d=l[1],u=l[2];2===t.length&&(u=d,d=c);var m,p={inbound:0,outbound:180,sideways:{left:-90,right:90},"angled-front-left":-60,"angled-front-right":60,"angled-rear-left":-120,"angled-rear-right":120};m="sideways"==c?p.sideways[d]:p[c];var h=document.createElement("a-entity");if(1==t.length)return h;var f={car:{mixin:"sedan-rig",wheelDiameter:.76,length:5.17,width:2},microvan:{mixin:"suv-rig",wheelDiameter:.84,length:5,width:2},truck:{mixin:"box-truck-rig",wheelDiameter:1.05,length:6.95,width:2.5},av:{mixin:"self-driving-cruise-car-rig",wheelDiameter:.76,length:5.17,width:2}};if(r>1){var g=i/2,y=s/2+s,x=b(-g+y,g-y,s).slice(0,r),v="sideways"==c||c.includes("angled")?"width":"length",A=f[u][v];x.forEach((function(t){var e=s-A-.2,i=-e/2+e*Math.random();e>0&&E(t+i,u)}))}else E(void 0,u);return h}function E(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,e=f[arguments.length>1&&void 0!==arguments[1]?arguments[1]:"car"],n=document.createElement("a-entity");return t||(t=w(n,"z",i,e.length)),n.setAttribute("position","0 0 ".concat(t)),n.setAttribute("mixin",e.mixin),n.setAttribute("rotation","0 ".concat(m," 0")),a&&(o=5,n.setAttribute("wheel",{speed:o,wheelDiameter:e.wheelDiameter}),_(n,o,i,0,0,t,d)),h.append(n),n}}function k(t,e){var i=document.createElement("a-entity"),a=document.createElement("a-entity"),n="left"===t[0]?0:180;return a.setAttribute("rotation","0 "+n+" 0"),a.setAttribute("mixin","food-trailer-rig"),a.addEventListener("model-loaded",(function(t){w(t.target,"z",e)}),{once:!0}),i.append(a),i}function S(t){if(t){var e=document.createElement("a-entity"),i=document.createElement("a-entity");i.setAttribute("position","0 1.75 0"),i.setAttribute("rotation","0 0 0"),i.setAttribute("mixin","magic-carpet"),e.append(i);var a=document.createElement("a-entity");return a.setAttribute("position","0 1.75 0"),a.setAttribute("rotation","0 0 0"),a.setAttribute("mixin","Character_1_M"),e.append(a),e}}function M(t,e,i){var a=e/2+e;return b(-t/2+a/2,t/2-a/2,a).slice(0,i)}function R(t,e){var i=document.createElement("a-entity");return M(t,2.27,5).forEach((function(t){var a=document.createElement("a-entity");a.setAttribute("mixin","outdoor_dining"),a.setAttribute("position",{y:e,z:t}),i.append(a)})),i}function N(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3?arguments[3]:void 0;if(arguments.length>4?arguments[4]:void 0){var n=document.createElement("a-entity");return M(a,2.03,g(2,5)).forEach((function(a){var r=document.createElement("a-entity"),s="inbound"===t[0]?0:180;r.setAttribute("rotation","0 "+s+" 0"),"bike-lane"===e?r.setAttribute("mixin","Bicycle_1"):r.setAttribute("mixin","ElectricScooter_1"),r.setAttribute("position",{y:i,z:a}),n.append(r)})),n}}function j(t,e){if(!(arguments.length>2&&void 0!==arguments[2])||arguments[2]){var i=document.createElement("a-entity");return M(e,5,g(2,4)).forEach((function(e){var a=document.createElement("a-entity"),n="inbound"===t[1]?0:180;a.setAttribute("rotation","0 "+n+" 0"),"taxi"===t[0]?a.setAttribute("mixin","sedan-taxi-rig"):"rideshare"===t[0]&&a.setAttribute("mixin","sedan-rig"),a.setAttribute("position",{z:e}),i.append(a)})),i}}function T(){var t=document.createElement("a-entity");return t.setAttribute("class","bench-parent"),t.setAttribute("position","0 0.2 3.5"),t}function O(t){var e=document.createElement("a-entity");return e.setAttribute("class","bikerack-parent"),e.setAttribute("position",{y:t,z:-3.5}),e}function L(t,e){var i=document.createElement("a-entity");i.setAttribute("class","bikeshare"),i.setAttribute("mixin","bikeshare");var a="left"===t[0]?90:270;return i.setAttribute("rotation","0 "+a+" 0"),i.setAttribute("position",{y:e}),i}function I(t,e){var i=document.createElement("a-entity");return M(t,4.03,3).forEach((function(t){var a=document.createElement("a-entity");a.setAttribute("class","parklet"),a.setAttribute("position",{x:0,y:.02,z:t}),a.setAttribute("mixin","parklet");var n="left"===e[0]?90:270;a.setAttribute("rotation",{y:n}),i.append(a)})),i}function P(){var t=document.createElement("a-entity");return t.setAttribute("class","tree-parent"),t.setAttribute("position","0 0.2 7"),t}function F(){var t=document.createElement("a-entity");return t.setAttribute("class","lamp-parent"),t.setAttribute("position","0 0.2 0"),t}function z(t,e){var i=document.createElement("a-entity");return i.setAttribute("class","bus-stop"),i.setAttribute("rotation","0 "+t+" 0"),i.setAttribute("mixin","bus-stop"),i.setAttribute("position",{y:e}),i}function B(){var t=document.createElement("a-entity");return t.setAttribute("class","brt-station"),t.setAttribute("mixin","brt-station"),t}function D(t,e,i,a,n){var r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,s=document.createElement("a-entity"),o=[.2,.4,.6][r];return 0===r?e=-.1:2===r&&(e=.1),s.setAttribute("geometry","primitive: box; \n height: ".concat(o,"; \n depth: ").concat(a,";\n width: ").concat(t,";")),s.setAttribute("position",{y:e}),s.setAttribute("mixin",i),0!==n.length&&s.setAttribute("material","repeat: ".concat(n[0]," ").concat(n[1])),s}function H(t,e,i,a,n){var r=document.createElement("a-entity"),s="1 "+a/150+" 1";return r.setAttribute("rotation","270 "+e+" 0"),r.setAttribute("scale",s),r.setAttribute("position","0 "+t+" 0"),r.setAttribute("mixin",i),0!==n.length&&r.setAttribute("material","repeat: ".concat(n[0]," ").concat(n[1])),r}t.exports.processSegments=function(t,e,i,n,r){var s=i/2;i>12&&(s=(i-12)/2),e&&(t=function(t){function e(t){return"lane"===t.slice(t.length-4)||"light-rail"===t||"streetcar"===t||"flex-zone"===t}return t.reduce((function(t,i,a,n){if(0===a)return t.concat(i);var r=n[a-1];if(e(i.type)&&e(r.type)){var s="solid";i.type===r.type&&(s="dashed"),("drive-lane"===i.type&&"turn-lane"===r.type||"drive-lane"===r.type&&"turn-lane"===i.type)&&(s="dashed"),i.variantString.split("|")[0]!==r.variantString.split("|")[0]&&(s="doubleyellow","bike-lane"===i.type&&"bike-lane"===r.type&&(s="shortdashedyellow"),"flex-zone"!==i.type&&"flex-zone"!==r.type||(s="solid")),"turn-lane"===i.type&&"shared"===i.variantString.split("|")[1]?s="soliddashedyellow":"turn-lane"===r.type&&"shared"===r.variantString.split("|")[1]&&(s="soliddashedyellowinverted"),"parking-lane"!==i.type&&"parking-lane"!==r.type||(s="invisible"),t.push({type:"separator",variantString:s,width:0,elevation:i.elevation})}return(e(i.type)&&"divider"===r.type||e(r.type)&&"divider"===i.type)&&t.push({type:"separator",variantString:"solid",width:0,elevation:i.elevation}),t.push(i),t}),[])}(t));var u=function(t){var e=document.createElement("a-entity"),i=0-l.calcStreetWidth(t)/2;return e.setAttribute("position",i+" 0 0"),e}(t);u.classList.add("street-parent"),u.setAttribute("data-layer-name","Street Segments Container");for(var p,y,b,w,_=0,M=0;M{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){for(var i=0;i\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),people:'\n \x3c!-- human characters --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),"people-rigged":' \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),vehicles:'\n \x3c!-- vehicles --\x3e\n \n \n \n \x3c!-- micro mobility vehicles --\x3e\n \n \n \n '),"vehicles-rigged":'\n \x3c!-- vehicles rigged --\x3e\n \n \n \n \n \n \n \n '),buildings:'\n \x3c!-- blocks --\x3e\n \n \n \n\n \x3c!-- buildings and blocks --\x3e\n \n \n \n \n \n\n \x3c!-- suburban buildings --\x3e\n \n \n \n\n \x3c!-- arched style buildings --\x3e\n \n \n \n \n'),"intersection-props":'\n \n \n \n \n \n \n '),"segment-textures":' \n \x3c!-- segment mixins with textures --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n '),"segment-colors":' \n \x3c!-- segment color modifier mixins --\x3e\n \n \n \n ',"lane-separator":'\n \x3c!-- lane separator markings --\x3e\n \n \n \n \n \n \n \n \n '),stencils:' \n \x3c!-- stencil markings --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),"vehicles-transit":'\n \x3c!-- vehicles-transit --\x3e\n \n \n \n \n \n \n '),dividers:'\n \x3c!-- dividers --\x3e\n \n \n \n \n \n \n \n \n \n \n \n '),sky:'\n \x3c!-- sky --\x3e\n \n \n '),grounds:'\n \x3c!-- grounds --\x3e\n \n \n \n\n \x3c!-- legacy plane-based grounds for compatibility with 0.4.2 and earlier scenes, not used for new streets --\x3e\n \n \n \n \n\n \x3c!-- new grounds for 0.4.4 and later --\x3e \n \n \n \n \n\n \n \n '),"loud-bicycle":'\n \x3c!-- loud-bicycle-game --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ')};if(e){var n=e.split(" "),r=Object.keys(a).filter((function(t){return n.includes(t)})),s="";for(var o in a)r.includes(o)&&(s+=a[o]);return s}return Object.values(a).join("")}(e,t)),AFRAME.ANode.prototype.load.call(this)}}])&&e(n.prototype,r),s&&e(n,s),l}();customElements.define("street-assets",r);document.addEventListener("DOMSubtreeModified",(function t(e){if("A-SCENE"===e.target.nodeName){var i=e.target.querySelector("a-assets");if(i||(i=document.createElement("a-assets"),e.target.append(i)),i.querySelector("street-assets"))document.removeEventListener("DOMSubtreeModified",t);else{var a=document.createElement("street-assets");i.append(a),document.removeEventListener("DOMSubtreeModified",t)}}}),!1)},51:()=>{AFRAME.registerComponent("anisotropy",{schema:{default:0},dependencies:["material","geometry"],init:function(){var t=this;this.maxAnisotropy=this.el.sceneEl.renderer.capabilities.getMaxAnisotropy(),["model-loaded","materialtextureloaded"].forEach((function(e){return t.el.addEventListener(e,(function(){var e=t.el.getObject3D("mesh"),i=t.data;0===(i=+i||0)&&(i=t.maxAnisotropy),e.traverse((function(t){!0===t.isMesh&&null!==t.material.map&&(t.material.map.anisotropy=i,t.material.map.needsUpdate=!0)}))}),!1)}))}})},391:(t,e,i)=>{var a=i(334);AFRAME.registerComponent("create-from-json",{schema:{jsonString:{type:"string",default:""}},update:function(t){var e=this.data,i=this.el;if(t.string&&e.string!==t.string)for(;i.firstChild;)i.removeChild(i.lastChild);a.appendChildElementsFromArray(JSON.parse(e.jsonString),i)}})},71:()=>{var t={},e={};AFRAME.registerComponent("gltf-part",{schema:{buffer:{default:!0},part:{type:"string"},src:{type:"asset"}},init:function(){this.dracoLoader=document.querySelector("a-scene").systems["gltf-model"].getDRACOLoader()},update:function(){var t=this.el;!this.data.part&&this.data.src||this.getModel((function(e){e&&t.setObject3D("mesh",e)}))},getModel:function(i){var a=this;if(!e[this.data.src])return t[this.data.src]?t[this.data.src].then((function(t){i(a.selectFromModel(t))})):void(t[this.data.src]=new Promise((function(n){var r=new THREE.GLTFLoader;a.dracoLoader&&r.setDRACOLoader(a.dracoLoader),r.load(a.data.src,(function(r){var s=r.scene||r.scenes[0];e[a.data.src]=s,delete t[a.data.src],i(a.selectFromModel(s)),n(s)}),(function(){}),console.error)})));i(this.selectFromModel(e[this.data.src]))},selectFromModel:function(t){var e,i;if(i=t.getObjectByName(this.data.part))return e=i.getObjectByProperty("type","Mesh").clone(!0),this.data.buffer?(e.geometry=e.geometry.toNonIndexed(),e):(e.geometry=(new THREE.Geometry).fromBufferGeometry(e.geometry),e);console.error("[gltf-part] `"+this.data.part+"` not found in model.")}})},247:(t,e,i)=>{var a=i(502).Notyf;AFRAME.registerComponent("notify",{schema:{duration:{type:"number",default:6e3},ripple:{type:"boolean",default:!1},position:{type:"string",default:{x:"center",y:"bottom"}},dismissible:{type:"boolean",default:!1},type:{type:"string",default:"info"},message:{type:"string",default:""}},init:function(){this.notify=new a({types:[{type:"info",background:"blue",icon:!1}],duration:this.data.duration,ripple:this.data.ripple,position:this.data.position,dismissible:this.data.dismissible}),this.types=this.notify.options.types.map((function(t){return t.type}))},message:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info";t&&this.types.includes(e)&&this.notify.open({type:e,message:t})},update:function(t){if(0!==Object.keys(t).length){var e=this.data.message,i=this.data.type;e&&this.types.includes(i)&&(this.message(e,i),this.data.message="")}}})},699:()=>{function t(t,e,i,a,n,r,s){try{var o=t[r](s),l=o.value}catch(t){return void i(t)}o.done?e(l):Promise.resolve(l).then(a,n)}function e(e){return function(){var i=this,a=arguments;return new Promise((function(n,r){var s=e.apply(i,a);function o(e){t(s,n,r,o,l,"next",e)}function l(e){t(s,n,r,o,l,"throw",e)}o(void 0)}))}}var i;AFRAME.registerComponent("screentock",{schema:{takeScreenshot:{type:"boolean",default:!1},filename:{type:"string",default:"screenshot"},type:{type:"string",default:"jpg"},imgElementSelector:{type:"selector"}},takeScreenshotNow:(i=e(regeneratorRuntime.mark((function t(i,a,n){var r,s,o,l,c,d,u,m,p;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=function(t,e,i){var a=document.createElement("a"),n=e.replace(/^data:image\/[^;]/,"data:application/octet-stream");a.setAttribute("href",n),a.setAttribute("download",t),a.style.display="none",document.body.appendChild(a),a.click(),document.body.removeChild(a)},c=function(t,e,i){t.font="25px Lato",t.textAlign="center",t.fillStyle="#FFF",t.fillText(STREET.utils.getCurrentSceneTitle(),e-e/2,i-43)},o=function(t){r&&r.opened&&(r.sceneHelpers.visible=t),t?document.querySelector("#cameraRig").setAttribute("cursor-teleport","cameraRig: #cameraRig; cameraHead: #camera;"):document.querySelector("#cameraRig").removeAttribute("cursor-teleport")},r=AFRAME.INSPECTOR,s=AFRAME.scenes[0].renderer,o(!1),l=function(){var t=e(regeneratorRuntime.mark((function t(e){var i,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(i=document.querySelector("#screenshotCanvas"))||((i=document.createElement("canvas")).id="screenshotCanvas",i.hidden=!0,document.body.appendChild(i)),i.width=e.width,i.height=e.height,(a=i.getContext("2d")).drawImage(e,0,0),c(a,i.width,i.height),t.next=9,d(a);case 9:return t.abrupt("return",i);case 10:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),d=function(){var t=e(regeneratorRuntime.mark((function t(e){var i,a,n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=document.querySelector("img.viewer-logo-img"),a=document.querySelector("#aframeInspector #logoImg svg"),!i){t.next=6;break}e.drawImage(i,0,0,135,43,40,30,270,86),t.next=12;break;case 6:if(!a){t.next=12;break}return(n=new Image).src="data:image/svg+xml;base64,".concat(window.btoa(a.outerHTML)),t.next=11,new Promise((function(t){n.onload=t}));case 11:e.drawImage(n,0,0,135,23,40,40,270,86);case 12:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),m=i+"."+a,s.render(AFRAME.scenes[0].object3D,AFRAME.scenes[0].camera),t.next=12,l(s.domElement);case 12:if(p=t.sent,"img"!=a){t.next=16;break}return n.src=p.toDataURL(),t.abrupt("return");case 16:u(m,"png"==a?p.toDataURL("image/png"):p.toDataURL("image/jpeg",.95)),o(!0);case 18:case"end":return t.stop()}}),t)}))),function(t,e,a){return i.apply(this,arguments)}),update:function(t){0!==Object.keys(t).length&&this.data.takeScreenshot&&(this.data.takeScreenshot=!1,this.takeScreenshotNow(this.data.filename,this.data.type,this.data.imgElementSelector))}})},54:function(t,e,i){var a,n,r,s;function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}t=i.nmd(t),s=function(){return function(t){var e={};function i(a){if(e[a])return e[a].exports;var n=e[a]={i:a,l:!1,exports:{}};return t[a].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.d=function(t,e,a){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:a})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==o(t)&&t&&t.__esModule)return t;var a=Object.create(null);if(i.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(a,n,function(e){return t[e]}.bind(null,n));return a},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=0)}([function(t,e){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");AFRAME.registerComponent("cursor-teleport",{schema:{cameraHead:{type:"selector",default:""},cameraRig:{type:"selector",default:""},collisionEntities:{type:"string",default:""},ignoreEntities:{type:"string",default:""},landingMaxAngle:{default:45,min:0,max:360},landingNormal:{type:"vec3",default:{x:0,y:1,z:0}},transitionSpeed:{type:"number",default:6e-4}},init:function(){var t=this;this.mobile=AFRAME.utils.device.isMobile();var e=this.el.sceneEl;this.canvas=e.renderer.domElement,this.data.cameraHead.object3D.traverse((function(e){e instanceof THREE.Camera&&(t.cam=e)})),this.camRig=this.data.cameraRig.object3D,this.rayCaster=new THREE.Raycaster,this.referenceNormal=new THREE.Vector3,this.rayCastObjects=[],this.referenceNormal.copy(this.data.landingNormal);var i=new THREE.RingGeometry(.25,.3,32,1);i.rotateX(-Math.PI/2),i.translate(0,.02,0);var a=new THREE.MeshBasicMaterial({color:7818734}),n=new THREE.Mesh(i,a),r=new THREE.CylinderGeometry(.3,.3,.5,32,1,!0);r.translate(0,.25,0);var s=(new THREE.TextureLoader).load("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAQCAYAAADXnxW3AAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAADJJREFUeNpEx7ENgDAAAzArK0JA6f8X9oewlcWStU1wBGdwB08wgjeYm79jc2nbYH0DAC/+CORJxO5fAAAAAElFTkSuQmCC"),o=new THREE.MeshBasicMaterial({color:7818734,side:"double",map:s,transparent:!0,depthTest:!1}),l=new THREE.Mesh(r,o),c=new THREE.Group;c.add(n),c.add(l),this.teleportIndicator=c,e.object3D.add(this.teleportIndicator),this.transitioning=!1,this.transitionProgress=0,this.transitionCamPosStart=new THREE.Vector3,this.transitionCamPosEnd=new THREE.Vector3,this.updateRaycastObjects=this.updateRaycastObjects.bind(this),this.getMouseState=this.getMouseState.bind(this),this.getTeleportPosition=this.getTeleportPosition.bind(this),this.isValidNormalsAngle=this.isValidNormalsAngle.bind(this),this.transition=this.transition.bind(this),this.mouseMove=this.mouseMove.bind(this),this.mouseDown=this.mouseDown.bind(this),this.mouseUp=this.mouseUp.bind(this),this.easeInOutQuad=this.easeInOutQuad.bind(this),this.updateRaycastObjects()},remove:function(){this.cam=null,this.canvas=null,this.rayCastObjects.length=0,this.el.sceneEl.object3D.remove(this.teleportIndicator),this.teleportIndicator.children[0].material.dispose(),this.teleportIndicator.children[0].geometry.dispose(),this.teleportIndicator.children[1].material.dispose(),this.teleportIndicator.children[1].geometry.dispose(),this.teleportIndicator=null,this.collisionMesh&&(this.collisionMesh.geometry.dispose(),this.collisionMesh.material.dispose(),this.collisionMesh=null)},play:function(){var t=this.canvas;t.addEventListener("mousedown",this.mouseDown,!1),t.addEventListener("mousemove",this.mouseMove,!1),t.addEventListener("mouseup",this.mouseUp,!1),t.addEventListener("touchstart",this.mouseDown,!1),t.addEventListener("touchmove",this.mouseMove,!1),t.addEventListener("touchend",this.mouseUp,!1)},pause:function(){var t=this.canvas;t.removeEventListener("mousedown",this.mouseDown),t.removeEventListener("mousemove",this.mouseMove),t.removeEventListener("mouseup",this.mouseUp),t.removeEventListener("touchstart",this.mouseDown),t.removeEventListener("touchmove",this.mouseMove),t.removeEventListener("touchend",this.mouseUp)},updateRaycastObjects:function(){var t=this;if(this.rayCastObjects.length=0,""!==this.data.collisionEntities)this.el.sceneEl.querySelectorAll(this.data.collisionEntities).forEach((function(e){e.object3D.traverse((function(e){e.isMesh&&(e.userData.collision=!0,t.rayCastObjects.push(e))}))}));else{if(!this.collisionMesh){var e=new THREE.PlaneGeometry(500,500,1);e.rotateX(-Math.PI/2);var i=new THREE.MeshNormalMaterial,a=new THREE.Mesh(e,i);a.userData.collision=!0,this.collisionMesh=a}this.rayCastObjects.push(this.collisionMesh)}""!==this.data.ignoreEntities&&this.el.sceneEl.querySelectorAll(this.data.ignoreEntities).forEach((function(e){e.object3D.traverse((function(e){e.isMesh&&t.rayCastObjects.push(e)}))}))},getMouseState:function(){var t=new THREE.Vector2;return function(e){var i=this.canvas.getBoundingClientRect();return null!=e.clientX?(t.x=e.clientX-i.left,t.y=e.clientY-i.top,t):null!=e.touches[0]?(t.x=e.touches[0].clientX-i.left,t.y=e.touches[0].clientY-i.top,t):void 0}}(),getTeleportPosition:function(){var t=new THREE.Vector2;return function(e,i){if(0!==this.rayCastObjects.length){if(this.cam&&this.canvas){var a=this.cam,n=this.canvas.getBoundingClientRect();t.x=e/(n.right-n.left)*2-1,t.y=-i/(n.bottom-n.top)*2+1,this.rayCaster.setFromCamera(t,a);var r=this.rayCaster.intersectObjects(this.rayCastObjects);return!(0===r.length||!this.isValidNormalsAngle(r[0].face.normal))&&!0===r[0].object.userData.collision&&r[0].point}return!1}return!1}}(),isValidNormalsAngle:function(t){var e=this.referenceNormal.angleTo(t);return THREE.MathUtils.RAD2DEG*e<=this.data.landingMaxAngle},transition:function(t){this.transitionProgress=0,this.transitionCamPosEnd.copy(t),this.transitionCamPosStart.copy(this.camRig.position),this.transitioning=!0},mouseMove:function(t){var e=this.getMouseState(t);this.mouseX=e.x,this.mouseY=e.y},mouseDown:function(t){this.updateRaycastObjects();var e=this.getMouseState(t);this.mouseX=e.x,this.mouseY=e.y,this.mouseXOrig=e.x,this.mouseYOrig=e.y},mouseUp:function(t){if(this.mouseX===this.mouseXOrig&&this.mouseY===this.mouseYOrig){var e=this.getTeleportPosition(this.mouseX,this.mouseY);e&&(this.teleportIndicator.position.copy(e),this.transition(e))}},easeInOutQuad:function(t){return t<.5?2*t*t:(4-2*t)*t-1},tick:function(t,e){if(!this.transitioning&&!this.mobile){var i=this.getTeleportPosition(this.mouseX,this.mouseY);i&&this.teleportIndicator.position.copy(i)}if(this.transitioning){this.transitionProgress+=e*this.data.transitionSpeed;var a=this.easeInOutQuad(this.transitionProgress),n=a<.5?a:1.5-1*(a+.5);this.teleportIndicator.scale.set(1+n,1,1+n);var r=this.camRig.position;r.x=this.transitionCamPosStart.x+(this.transitionCamPosEnd.x-this.transitionCamPosStart.x)*a,r.y=this.transitionCamPosStart.y+(this.transitionCamPosEnd.y-this.transitionCamPosStart.y)*a,r.z=this.transitionCamPosStart.z+(this.transitionCamPosEnd.z-this.transitionCamPosStart.z)*a,this.transitionProgress>=1&&(this.transitioning=!1,r.copy(this.transitionCamPosEnd))}}})}])},"object"==o(e)&&"object"==o(t)?t.exports=s():(n=[],void 0===(r="function"==typeof(a=s)?a.apply(e,n):a)||(t.exports=r))},475:t=>{var e={once:THREE.LoopOnce,repeat:THREE.LoopRepeat,pingpong:THREE.LoopPingPong};function i(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")}t.exports=AFRAME.registerComponent("animation-mixer",{schema:{clip:{default:"*"},duration:{default:0},clampWhenFinished:{default:!1,type:"boolean"},crossFadeDuration:{default:0},loop:{default:"repeat",oneOf:Object.keys(e)},repetitions:{default:1/0,min:0},timeScale:{default:1},startAt:{default:0}},init:function(){var t=this;this.model=null,this.mixer=null,this.activeActions=[];var e=this.el.getObject3D("mesh");e?this.load(e):this.el.addEventListener("model-loaded",(function(e){t.load(e.detail.model)}))},load:function(t){var e=this.el;this.model=t,this.mixer=new THREE.AnimationMixer(t),this.mixer.addEventListener("loop",(function(t){e.emit("animation-loop",{action:t.action,loopDelta:t.loopDelta})})),this.mixer.addEventListener("finished",(function(t){e.emit("animation-finished",{action:t.action,direction:t.direction})})),this.data.clip&&this.update({})},remove:function(){this.mixer&&this.mixer.stopAllAction()},update:function(t){if(t){var i=this.data,a=AFRAME.utils.diff(i,t);if("clip"in a)return this.stopAction(),void(i.clip&&this.playAction());this.activeActions.forEach((function(t){"duration"in a&&i.duration&&t.setDuration(i.duration),"clampWhenFinished"in a&&(t.clampWhenFinished=i.clampWhenFinished),("loop"in a||"repetitions"in a)&&t.setLoop(e[i.loop],i.repetitions),"timeScale"in a&&t.setEffectiveTimeScale(i.timeScale)}))}},stopAction:function(){for(var t=this.data,e=0;e{"use strict";function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}Object.defineProperty(e,"__esModule",{value:!0}); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. @@ -13,4 +13,4 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ -var n,a=function(){return a=Object.assign||function(t){for(var e,i=1,n=arguments.length;i{t.exports.isSidewalk=function(t){return t.startsWith("sidewalk")||["utilities","scooter-drop-zone","bikeshare","flex-zone-curb","transit-shelter","brt-station"].includes(t)},t.exports.createBuildingsArray=function(){var t,e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:150,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"narrow";if("narrow"===n||"wide"===n)t=[{id:"SM3D_Bld_Mixed_4fl",width:5.251},{id:"SM3D_Bld_Mixed_Double_5fl",width:10.9041},{id:"SM3D_Bld_Mixed_4fl_2",width:5.309},{id:"SM3D_Bld_Mixed_5fl",width:5.903},{id:"SM3D_Bld_Mixed_Corner_4fl",width:5.644}],e="41431323432402434130303230234102402341";else if("residential"===n)t=[{id:"SM_Bld_House_Preset_03_1800",width:20},{id:"SM_Bld_House_Preset_08_1809",width:20},{id:"SM_Bld_House_Preset_09_1845",width:20}],e="12021201210101212021201012012021201210";else{if("arcade"!==n)return[];t=[{id:"arched-building-01",width:9.191},{id:"arched-building-02",width:11.19},{id:"arched-building-03",width:13.191},{id:"arched-building-04",width:15.191}],e="03120223130210321203123023103201232013"}for(var a=0,r=0,s=[];r{function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],n=!0,a=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(n=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);n=!0);}catch(t){a=!0,r=t}finally{try{n||null==o.return||o.return()}finally{if(a)throw r}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i0&&void 0!==arguments[0]?arguments[0]:{},i=document.createElement(t.tag);delete t.tag;for(var n=0,a=Object.entries(t);n1?arguments[1]:void 0;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(e,i){t.appendChild(n(e))})),t}},394:t=>{t.exports.streetmixUserToAPI=function(t){var e=new URL(t).pathname.split("/"),i=e[1],n=e[2];return"-"===i?"https://streetmix.net/api/v1/streets?namespacedId="+n:"https://streetmix.net/api/v1/streets?namespacedId="+n+"&creatorId="+i},t.exports.pathStartsWithAPI=function(t){var e=document.createElement("a");return e.href=t,"api"===e.pathname.split("/")[1]},t.exports.streetmixAPIToUser=function(t){function e(t,e){for(var i=t.split("&"),n=0;n(t.paths=[],t.children||(t.children=[]),t);return(()=>{function t(t,i){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],n=!0,a=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(n=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);n=!0);}catch(t){a=!0,r=t}finally{try{n||null==o.return||o.return()}finally{if(a)throw r}}return i}(t,i)||function(t,i){if(!t)return;if("string"==typeof t)return e(t,i);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,i)}(t,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i=200&&this.status<400){var t,n=JSON.parse(this.response),a=n.data.street.segments,r=n.name;console.log("streetmixName",r),i.setAttribute("streetmix-loader","name",r),AFRAME.scenes[0]&&AFRAME.scenes[0].getAttribute("metadata")&&(t=AFRAME.scenes[0].getAttribute("metadata").sceneTitle),t||(AFRAME.scenes[0].setAttribute("metadata","sceneTitle",r),console.log("therefore setting metadata sceneTitle as streetmixName",r)),e.showBuildings&&(i.setAttribute("street","right",n.data.street.rightBuildingVariant),i.setAttribute("street","left",n.data.street.leftBuildingVariant)),i.setAttribute("street","type","streetmixSegmentsFeet"),i.setAttribute("street","JSON",JSON.stringify({streetmixSegmentsFeet:a})),i.emit("streetmix-loader-street-loaded")}else console.log("[streetmix-loader]","Loading Error: We reached the target server, but it returned an error")},n.onerror=function(){console.log("[streetmix-loader]","Loading Error: There was a connection error of some sort")},n.send()}else{if(e.streetmixStreetURL.length>0){var r=a.streetmixUserToAPI(e.streetmixStreetURL);return console.log("[streetmix-loader]","setting `streetmixAPIURL` to",r),void i.setAttribute("streetmix-loader","streetmixAPIURL",r)}console.log("[streetmix-loader]","Neither `streetmixAPIURL` nor `streetmixStreetURL` properties provided, please provide at least one.")}}}),AFRAME.registerComponent("intersection",{schema:{dimensions:{type:"string",default:"20 20"},sidewalk:{type:"string",default:"0 0 0 0"},northeastcurb:{type:"string",default:"0 0"},southwestcurb:{type:"string",default:"0 0"},southeastcurb:{type:"string",default:"0 0"},northwestcurb:{type:"string",default:"0 0"},stopsign:{type:"string",default:"0 0 0 0"},trafficsignal:{type:"string",default:"0 0 0 0"},crosswalk:{type:"string",default:"0 0 0 0"}},init:function(){for(var e=this.data,i=this.el;i.firstChild;)i.removeChild(i.lastChild);var n=e.dimensions.split(" ").map((function(t){return Number(t)})),a=[this.el.getAttribute("position").x,this.el.getAttribute("position").y,this.el.getAttribute("position").z],r=e.sidewalk.split(" ").map((function(t){return Number(t)})),s=e.northeastcurb.split(" ").map((function(t){return Number(t)})),o=e.southwestcurb.split(" ").map((function(t){return Number(t)})),l=e.southeastcurb.split(" ").map((function(t){return Number(t)})),c=e.northwestcurb.split(" ").map((function(t){return Number(t)})),d=e.stopsign.split(" ").map((function(t){return Number(t)})),u=e.trafficsignal.split(" ").map((function(t){return Number(t)})),m=e.crosswalk.split(" ").map((function(t){return Number(t)})),p=n[0],h=n[1];function f(t){var e=t.length,n=t.width,a=t.positionVec,r=t.scaleVec,s=void 0===r?{x:1,y:1,z:1}:r,o=t.rotationVec,l=document.createElement("a-entity"),c=[];c[0]=n/2,c[1]=parseInt(e/2),l.setAttribute("geometry","primitive","box"),l.setAttribute("geometry","height: 0.4"),l.setAttribute("position",a),l.setAttribute("scale",s),l.setAttribute("geometry","depth",e),l.setAttribute("geometry","width",n),l.setAttribute("rotation",o),l.setAttribute("mixin","sidewalk"),l.setAttribute("material","repeat: ".concat(c[0]," ").concat(c[1])),i.appendChild(l)}this.el.setAttribute("geometry","primitive:box; width: ".concat(p,"; height: ").concat(h,"; depth:0.2")),this.el.setAttribute("position",{x:a[0],y:-.1,z:a[2]}),this.el.setAttribute("rotation","-90 0 0"),this.el.setAttribute("material","src: #asphalt-texture; repeat:5 5; roughness:1");var g={west:{positionVec:{x:p/2-r[0]/2,z:.1},rotationVec:{x:90,y:0,z:0},length:h,width:r[0]},east:{positionVec:{x:-p/2+r[1]/2,z:.1},rotationVec:{x:90,y:0,z:0},length:h,width:r[1]},north:{positionVec:{y:-h/2+r[2]/2,x:r[1]/2-r[0]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:p-r[1]-r[0],width:r[2]},south:{positionVec:{y:h/2-r[3]/2,x:r[1]/2-r[0]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:p-r[1]-r[0],width:r[3]}};Object.keys(g).filter((function(t,e){return r[e]})).forEach((function(t,e){f(g[t])}));for(var y={northeast:{positionVec:{x:p/2-s[0]/2,y:h/2-s[1]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:s[0],width:s[1]},southwest:{positionVec:{x:-p/2+o[0]/2,y:-h/2+o[1]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:o[0],width:o[1]},southeast:{positionVec:{x:p/2-l[0]/2,y:-h/2+l[1]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:l[0],width:l[1]},northwest:{positionVec:{x:-p/2+c[0]/2,y:h/2-c[1]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:c[0],width:c[1]}},b=0,x=Object.entries(y);b{t.exports.isSidewalk=function(t){return t.startsWith("sidewalk")||["utilities","scooter-drop-zone","bikeshare","flex-zone-curb","transit-shelter","brt-station"].includes(t)},t.exports.createBuildingsArray=function(){var t,e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:150,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"narrow";if("narrow"===a||"wide"===a)t=[{id:"SM3D_Bld_Mixed_4fl",width:5.251},{id:"SM3D_Bld_Mixed_Double_5fl",width:10.9041},{id:"SM3D_Bld_Mixed_4fl_2",width:5.309},{id:"SM3D_Bld_Mixed_5fl",width:5.903},{id:"SM3D_Bld_Mixed_Corner_4fl",width:5.644}],e="41431323432402434130303230234102402341";else if("residential"===a)t=[{id:"SM_Bld_House_Preset_03_1800",width:20},{id:"SM_Bld_House_Preset_08_1809",width:20},{id:"SM_Bld_House_Preset_09_1845",width:20}],e="12021201210101212021201012012021201210";else{if("arcade"!==a)return[];t=[{id:"arched-building-01",width:9.191},{id:"arched-building-02",width:11.19},{id:"arched-building-03",width:13.191},{id:"arched-building-04",width:15.191}],e="03120223130210321203123023103201232013"}for(var n=0,r=0,s=[];r{function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],a=!0,n=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(a=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);a=!0);}catch(t){n=!0,r=t}finally{try{a||null==o.return||o.return()}finally{if(n)throw r}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return i(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,a=new Array(e);i0&&void 0!==arguments[0]?arguments[0]:{},i=document.createElement(t.tag);delete t.tag;for(var a=0,n=Object.entries(t);a1?arguments[1]:void 0;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(e,i){t.appendChild(a(e))})),t}},394:t=>{t.exports.streetmixUserToAPI=function(t){var e=new URL(t).pathname.split("/"),i=e[1],a=e[2];return"-"===i?"https://streetmix.net/api/v1/streets?namespacedId="+a:"https://streetmix.net/api/v1/streets?namespacedId="+a+"&creatorId="+i},t.exports.pathStartsWithAPI=function(t){var e=document.createElement("a");return e.href=t,"api"===e.pathname.split("/")[1]},t.exports.streetmixAPIToUser=function(t){function e(t,e){for(var i=t.split("&"),a=0;a(t.paths=[],t.children||(t.children=[]),t);return(()=>{function t(t,i){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],a=!0,n=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(a=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);a=!0);}catch(t){n=!0,r=t}finally{try{a||null==o.return||o.return()}finally{if(n)throw r}}return i}(t,i)||function(t,i){if(!t)return;if("string"==typeof t)return e(t,i);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return e(t,i)}(t,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,a=new Array(e);i=200&&this.status<400){var t,a=JSON.parse(this.response),n=a.data.street.segments,r=a.name;console.log("streetmixName",r),i.setAttribute("streetmix-loader","name",r),AFRAME.scenes[0]&&AFRAME.scenes[0].getAttribute("metadata")&&(t=AFRAME.scenes[0].getAttribute("metadata").sceneTitle),t||(AFRAME.scenes[0].setAttribute("metadata","sceneTitle",r),console.log("therefore setting metadata sceneTitle as streetmixName",r)),i.setAttribute("data-layer-name","Streetmix: "+r),e.showBuildings&&(i.setAttribute("street","right",a.data.street.rightBuildingVariant),i.setAttribute("street","left",a.data.street.leftBuildingVariant)),i.setAttribute("street","type","streetmixSegmentsFeet"),i.setAttribute("street","JSON",JSON.stringify({streetmixSegmentsFeet:n})),i.emit("streetmix-loader-street-loaded")}else console.log("[streetmix-loader]","Loading Error: We reached the target server, but it returned an error")},a.onerror=function(){console.log("[streetmix-loader]","Loading Error: There was a connection error of some sort")},a.send()}else{if(e.streetmixStreetURL.length>0){var r=n.streetmixUserToAPI(e.streetmixStreetURL);return console.log("[streetmix-loader]","setting `streetmixAPIURL` to",r),void i.setAttribute("streetmix-loader","streetmixAPIURL",r)}console.log("[streetmix-loader]","Neither `streetmixAPIURL` nor `streetmixStreetURL` properties provided, please provide at least one.")}}}),AFRAME.registerComponent("intersection",{schema:{dimensions:{type:"string",default:"20 20"},sidewalk:{type:"string",default:"0 0 0 0"},northeastcurb:{type:"string",default:"0 0"},southwestcurb:{type:"string",default:"0 0"},southeastcurb:{type:"string",default:"0 0"},northwestcurb:{type:"string",default:"0 0"},stopsign:{type:"string",default:"0 0 0 0"},trafficsignal:{type:"string",default:"0 0 0 0"},crosswalk:{type:"string",default:"0 0 0 0"}},init:function(){for(var e=this.data,i=this.el;i.firstChild;)i.removeChild(i.lastChild);var a=e.dimensions.split(" ").map((function(t){return Number(t)})),n=[this.el.getAttribute("position").x,this.el.getAttribute("position").y,this.el.getAttribute("position").z],r=e.sidewalk.split(" ").map((function(t){return Number(t)})),s=e.northeastcurb.split(" ").map((function(t){return Number(t)})),o=e.southwestcurb.split(" ").map((function(t){return Number(t)})),l=e.southeastcurb.split(" ").map((function(t){return Number(t)})),c=e.northwestcurb.split(" ").map((function(t){return Number(t)})),d=e.stopsign.split(" ").map((function(t){return Number(t)})),u=e.trafficsignal.split(" ").map((function(t){return Number(t)})),m=e.crosswalk.split(" ").map((function(t){return Number(t)})),p=a[0],h=a[1];function f(t){var e=t.length,a=t.width,n=t.positionVec,r=t.scaleVec,s=void 0===r?{x:1,y:1,z:1}:r,o=t.rotationVec,l=document.createElement("a-entity"),c=[];c[0]=a/2,c[1]=parseInt(e/2),l.setAttribute("geometry","primitive","box"),l.setAttribute("geometry","height: 0.4"),l.setAttribute("position",n),l.setAttribute("scale",s),l.setAttribute("geometry","depth",e),l.setAttribute("geometry","width",a),l.setAttribute("rotation",o),l.setAttribute("mixin","sidewalk"),l.setAttribute("material","repeat: ".concat(c[0]," ").concat(c[1])),i.appendChild(l)}this.el.setAttribute("geometry","primitive:box; width: ".concat(p,"; height: ").concat(h,"; depth:0.2")),this.el.setAttribute("position",{x:n[0],y:-.1,z:n[2]}),this.el.setAttribute("rotation","-90 0 0"),this.el.setAttribute("material","src: #asphalt-texture; repeat:5 5; roughness:1");var g={west:{positionVec:{x:p/2-r[0]/2,z:.1},rotationVec:{x:90,y:0,z:0},length:h,width:r[0]},east:{positionVec:{x:-p/2+r[1]/2,z:.1},rotationVec:{x:90,y:0,z:0},length:h,width:r[1]},north:{positionVec:{y:-h/2+r[2]/2,x:r[1]/2-r[0]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:p-r[1]-r[0],width:r[2]},south:{positionVec:{y:h/2-r[3]/2,x:r[1]/2-r[0]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:p-r[1]-r[0],width:r[3]}};Object.keys(g).filter((function(t,e){return r[e]})).forEach((function(t,e){f(g[t])}));for(var y={northeast:{positionVec:{x:p/2-s[0]/2,y:h/2-s[1]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:s[0],width:s[1]},southwest:{positionVec:{x:-p/2+o[0]/2,y:-h/2+o[1]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:o[0],width:o[1]},southeast:{positionVec:{x:p/2-l[0]/2,y:-h/2+l[1]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:l[0],width:l[1]},northwest:{positionVec:{x:-p/2+c[0]/2,y:h/2-c[1]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:c[0],width:c[1]}},b=0,x=Object.entries(y);b Date: Thu, 30 Nov 2023 14:11:37 -0800 Subject: [PATCH 52/56] use default a-frame enter xr / ar UI for 1.5 can revert to custom buttons later --- index.html | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/index.html b/index.html index 73632e844..73405c502 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@ - + @@ -74,14 +74,10 @@
  • Load Streetmix URL
  • -
  • Enter VR mode
  • -
  • Enter AR mode
  • Date: Thu, 30 Nov 2023 14:17:34 -0800 Subject: [PATCH 53/56] update submodule --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index f724477b2..55165b7e8 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit f724477b28e0867ca3dee08d1d6b11c2aafc2add +Subproject commit 55165b7e8c6cdd6932c5d78e2a5ca4aee5b9de2c From 369171d3352f7d0f3375f851ad52bec1ba3d71dc Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Thu, 30 Nov 2023 14:17:46 -0800 Subject: [PATCH 54/56] update release checklist ever changing! --- CONTRIBUTING.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 018862187..3d409f849 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,13 +3,20 @@ We welcome community contributions to 3DStreet. ## Release checklist for this repo: -- Bump the version on package.json & package-lock.json (for example from 0.4.1 to 0.4.2) -- Update CHANGELOG.md with "Major improvement" changes summary (low level commits will be automatically generated by github in a later step) you can see notes of changes since last release on [this view](https://github.com/3DStreet/3dstreet/releases/tag/0.4.1) +- After all testing is done and things work well enough for a release. +- Bump the version on package.json & package-lock.json (for example from 0.4.2 to 0.4.4) - Re-run npm run dist (rerun the build, it hardcodes the version into global var used for console log) - Commit this all to the repo -- Create a new release here: https://github.com/3DStreet/3dstreet/releases/new. Choose a tag, type in the new version such as "0.4.2" and for the title simply use the new version such as "0.4.2". Click "generate release notes." Copy and paste the "Major improvements" from the above summary above the generated release notes below. +- Use command line to create new tag for new version `git tag 0.4.4` and `git push --tags` +- Create a new release here: https://github.com/3DStreet/3dstreet/releases/new. Choose the tag you just created. (If needed for the title simply use the new version such as "0.4.4") +- Click to automatically "generate release notes." Consider summarizing a few key changes to put at the top. +- Use those summaries to update CHANGELOG.md in this repo with "Major improvement" changes summary and link to the new release for detailed changes +- Update https://www.3dstreet.org/docs/development/releases/ with summary of major improvements and linking back to the new release on github. - Then to run npm publish after all github version stuff works +## Updating assets submodule: +- from the repo's root directory run `git submodule update --remote` to update the assets submodule + ## Contribution Instructions * fork the repo * make your contribution From 3b91c883ce638aa3808db8ba1babfb6e592669c1 Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Thu, 30 Nov 2023 14:18:42 -0800 Subject: [PATCH 55/56] dist bump --- dist/aframe-street-component.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/aframe-street-component.js b/dist/aframe-street-component.js index da9eec133..943a5b5a7 100644 --- a/dist/aframe-street-component.js +++ b/dist/aframe-street-component.js @@ -13,4 +13,4 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ -var a,n=function(){return n=Object.assign||function(t){for(var e,i=1,a=arguments.length;i{t.exports.isSidewalk=function(t){return t.startsWith("sidewalk")||["utilities","scooter-drop-zone","bikeshare","flex-zone-curb","transit-shelter","brt-station"].includes(t)},t.exports.createBuildingsArray=function(){var t,e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:150,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"narrow";if("narrow"===a||"wide"===a)t=[{id:"SM3D_Bld_Mixed_4fl",width:5.251},{id:"SM3D_Bld_Mixed_Double_5fl",width:10.9041},{id:"SM3D_Bld_Mixed_4fl_2",width:5.309},{id:"SM3D_Bld_Mixed_5fl",width:5.903},{id:"SM3D_Bld_Mixed_Corner_4fl",width:5.644}],e="41431323432402434130303230234102402341";else if("residential"===a)t=[{id:"SM_Bld_House_Preset_03_1800",width:20},{id:"SM_Bld_House_Preset_08_1809",width:20},{id:"SM_Bld_House_Preset_09_1845",width:20}],e="12021201210101212021201012012021201210";else{if("arcade"!==a)return[];t=[{id:"arched-building-01",width:9.191},{id:"arched-building-02",width:11.19},{id:"arched-building-03",width:13.191},{id:"arched-building-04",width:15.191}],e="03120223130210321203123023103201232013"}for(var n=0,r=0,s=[];r{function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],a=!0,n=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(a=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);a=!0);}catch(t){n=!0,r=t}finally{try{a||null==o.return||o.return()}finally{if(n)throw r}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return i(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,a=new Array(e);i0&&void 0!==arguments[0]?arguments[0]:{},i=document.createElement(t.tag);delete t.tag;for(var a=0,n=Object.entries(t);a1?arguments[1]:void 0;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(e,i){t.appendChild(a(e))})),t}},394:t=>{t.exports.streetmixUserToAPI=function(t){var e=new URL(t).pathname.split("/"),i=e[1],a=e[2];return"-"===i?"https://streetmix.net/api/v1/streets?namespacedId="+a:"https://streetmix.net/api/v1/streets?namespacedId="+a+"&creatorId="+i},t.exports.pathStartsWithAPI=function(t){var e=document.createElement("a");return e.href=t,"api"===e.pathname.split("/")[1]},t.exports.streetmixAPIToUser=function(t){function e(t,e){for(var i=t.split("&"),a=0;a(t.paths=[],t.children||(t.children=[]),t);return(()=>{function t(t,i){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],a=!0,n=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(a=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);a=!0);}catch(t){n=!0,r=t}finally{try{a||null==o.return||o.return()}finally{if(n)throw r}}return i}(t,i)||function(t,i){if(!t)return;if("string"==typeof t)return e(t,i);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return e(t,i)}(t,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,a=new Array(e);i=200&&this.status<400){var t,a=JSON.parse(this.response),n=a.data.street.segments,r=a.name;console.log("streetmixName",r),i.setAttribute("streetmix-loader","name",r),AFRAME.scenes[0]&&AFRAME.scenes[0].getAttribute("metadata")&&(t=AFRAME.scenes[0].getAttribute("metadata").sceneTitle),t||(AFRAME.scenes[0].setAttribute("metadata","sceneTitle",r),console.log("therefore setting metadata sceneTitle as streetmixName",r)),i.setAttribute("data-layer-name","Streetmix: "+r),e.showBuildings&&(i.setAttribute("street","right",a.data.street.rightBuildingVariant),i.setAttribute("street","left",a.data.street.leftBuildingVariant)),i.setAttribute("street","type","streetmixSegmentsFeet"),i.setAttribute("street","JSON",JSON.stringify({streetmixSegmentsFeet:n})),i.emit("streetmix-loader-street-loaded")}else console.log("[streetmix-loader]","Loading Error: We reached the target server, but it returned an error")},a.onerror=function(){console.log("[streetmix-loader]","Loading Error: There was a connection error of some sort")},a.send()}else{if(e.streetmixStreetURL.length>0){var r=n.streetmixUserToAPI(e.streetmixStreetURL);return console.log("[streetmix-loader]","setting `streetmixAPIURL` to",r),void i.setAttribute("streetmix-loader","streetmixAPIURL",r)}console.log("[streetmix-loader]","Neither `streetmixAPIURL` nor `streetmixStreetURL` properties provided, please provide at least one.")}}}),AFRAME.registerComponent("intersection",{schema:{dimensions:{type:"string",default:"20 20"},sidewalk:{type:"string",default:"0 0 0 0"},northeastcurb:{type:"string",default:"0 0"},southwestcurb:{type:"string",default:"0 0"},southeastcurb:{type:"string",default:"0 0"},northwestcurb:{type:"string",default:"0 0"},stopsign:{type:"string",default:"0 0 0 0"},trafficsignal:{type:"string",default:"0 0 0 0"},crosswalk:{type:"string",default:"0 0 0 0"}},init:function(){for(var e=this.data,i=this.el;i.firstChild;)i.removeChild(i.lastChild);var a=e.dimensions.split(" ").map((function(t){return Number(t)})),n=[this.el.getAttribute("position").x,this.el.getAttribute("position").y,this.el.getAttribute("position").z],r=e.sidewalk.split(" ").map((function(t){return Number(t)})),s=e.northeastcurb.split(" ").map((function(t){return Number(t)})),o=e.southwestcurb.split(" ").map((function(t){return Number(t)})),l=e.southeastcurb.split(" ").map((function(t){return Number(t)})),c=e.northwestcurb.split(" ").map((function(t){return Number(t)})),d=e.stopsign.split(" ").map((function(t){return Number(t)})),u=e.trafficsignal.split(" ").map((function(t){return Number(t)})),m=e.crosswalk.split(" ").map((function(t){return Number(t)})),p=a[0],h=a[1];function f(t){var e=t.length,a=t.width,n=t.positionVec,r=t.scaleVec,s=void 0===r?{x:1,y:1,z:1}:r,o=t.rotationVec,l=document.createElement("a-entity"),c=[];c[0]=a/2,c[1]=parseInt(e/2),l.setAttribute("geometry","primitive","box"),l.setAttribute("geometry","height: 0.4"),l.setAttribute("position",n),l.setAttribute("scale",s),l.setAttribute("geometry","depth",e),l.setAttribute("geometry","width",a),l.setAttribute("rotation",o),l.setAttribute("mixin","sidewalk"),l.setAttribute("material","repeat: ".concat(c[0]," ").concat(c[1])),i.appendChild(l)}this.el.setAttribute("geometry","primitive:box; width: ".concat(p,"; height: ").concat(h,"; depth:0.2")),this.el.setAttribute("position",{x:n[0],y:-.1,z:n[2]}),this.el.setAttribute("rotation","-90 0 0"),this.el.setAttribute("material","src: #asphalt-texture; repeat:5 5; roughness:1");var g={west:{positionVec:{x:p/2-r[0]/2,z:.1},rotationVec:{x:90,y:0,z:0},length:h,width:r[0]},east:{positionVec:{x:-p/2+r[1]/2,z:.1},rotationVec:{x:90,y:0,z:0},length:h,width:r[1]},north:{positionVec:{y:-h/2+r[2]/2,x:r[1]/2-r[0]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:p-r[1]-r[0],width:r[2]},south:{positionVec:{y:h/2-r[3]/2,x:r[1]/2-r[0]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:p-r[1]-r[0],width:r[3]}};Object.keys(g).filter((function(t,e){return r[e]})).forEach((function(t,e){f(g[t])}));for(var y={northeast:{positionVec:{x:p/2-s[0]/2,y:h/2-s[1]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:s[0],width:s[1]},southwest:{positionVec:{x:-p/2+o[0]/2,y:-h/2+o[1]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:o[0],width:o[1]},southeast:{positionVec:{x:p/2-l[0]/2,y:-h/2+l[1]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:l[0],width:l[1]},northwest:{positionVec:{x:-p/2+c[0]/2,y:h/2-c[1]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:c[0],width:c[1]}},b=0,x=Object.entries(y);b{t.exports.isSidewalk=function(t){return t.startsWith("sidewalk")||["utilities","scooter-drop-zone","bikeshare","flex-zone-curb","transit-shelter","brt-station"].includes(t)},t.exports.createBuildingsArray=function(){var t,e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:150,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"narrow";if("narrow"===a||"wide"===a)t=[{id:"SM3D_Bld_Mixed_4fl",width:5.251},{id:"SM3D_Bld_Mixed_Double_5fl",width:10.9041},{id:"SM3D_Bld_Mixed_4fl_2",width:5.309},{id:"SM3D_Bld_Mixed_5fl",width:5.903},{id:"SM3D_Bld_Mixed_Corner_4fl",width:5.644}],e="41431323432402434130303230234102402341";else if("residential"===a)t=[{id:"SM_Bld_House_Preset_03_1800",width:20},{id:"SM_Bld_House_Preset_08_1809",width:20},{id:"SM_Bld_House_Preset_09_1845",width:20}],e="12021201210101212021201012012021201210";else{if("arcade"!==a)return[];t=[{id:"arched-building-01",width:9.191},{id:"arched-building-02",width:11.19},{id:"arched-building-03",width:13.191},{id:"arched-building-04",width:15.191}],e="03120223130210321203123023103201232013"}for(var n=0,r=0,s=[];r{function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],a=!0,n=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(a=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);a=!0);}catch(t){n=!0,r=t}finally{try{a||null==o.return||o.return()}finally{if(n)throw r}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return i(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,a=new Array(e);i0&&void 0!==arguments[0]?arguments[0]:{},i=document.createElement(t.tag);delete t.tag;for(var a=0,n=Object.entries(t);a1?arguments[1]:void 0;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(e,i){t.appendChild(a(e))})),t}},394:t=>{t.exports.streetmixUserToAPI=function(t){var e=new URL(t).pathname.split("/"),i=e[1],a=e[2];return"-"===i?"https://streetmix.net/api/v1/streets?namespacedId="+a:"https://streetmix.net/api/v1/streets?namespacedId="+a+"&creatorId="+i},t.exports.pathStartsWithAPI=function(t){var e=document.createElement("a");return e.href=t,"api"===e.pathname.split("/")[1]},t.exports.streetmixAPIToUser=function(t){function e(t,e){for(var i=t.split("&"),a=0;a(t.paths=[],t.children||(t.children=[]),t);return(()=>{function t(t,i){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],a=!0,n=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(a=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);a=!0);}catch(t){n=!0,r=t}finally{try{a||null==o.return||o.return()}finally{if(n)throw r}}return i}(t,i)||function(t,i){if(!t)return;if("string"==typeof t)return e(t,i);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return e(t,i)}(t,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,a=new Array(e);i=200&&this.status<400){var t,a=JSON.parse(this.response),n=a.data.street.segments,r=a.name;console.log("streetmixName",r),i.setAttribute("streetmix-loader","name",r),AFRAME.scenes[0]&&AFRAME.scenes[0].getAttribute("metadata")&&(t=AFRAME.scenes[0].getAttribute("metadata").sceneTitle),t||(AFRAME.scenes[0].setAttribute("metadata","sceneTitle",r),console.log("therefore setting metadata sceneTitle as streetmixName",r)),i.setAttribute("data-layer-name","Streetmix: "+r),e.showBuildings&&(i.setAttribute("street","right",a.data.street.rightBuildingVariant),i.setAttribute("street","left",a.data.street.leftBuildingVariant)),i.setAttribute("street","type","streetmixSegmentsFeet"),i.setAttribute("street","JSON",JSON.stringify({streetmixSegmentsFeet:n})),i.emit("streetmix-loader-street-loaded")}else console.log("[streetmix-loader]","Loading Error: We reached the target server, but it returned an error")},a.onerror=function(){console.log("[streetmix-loader]","Loading Error: There was a connection error of some sort")},a.send()}else{if(e.streetmixStreetURL.length>0){var r=n.streetmixUserToAPI(e.streetmixStreetURL);return console.log("[streetmix-loader]","setting `streetmixAPIURL` to",r),void i.setAttribute("streetmix-loader","streetmixAPIURL",r)}console.log("[streetmix-loader]","Neither `streetmixAPIURL` nor `streetmixStreetURL` properties provided, please provide at least one.")}}}),AFRAME.registerComponent("intersection",{schema:{dimensions:{type:"string",default:"20 20"},sidewalk:{type:"string",default:"0 0 0 0"},northeastcurb:{type:"string",default:"0 0"},southwestcurb:{type:"string",default:"0 0"},southeastcurb:{type:"string",default:"0 0"},northwestcurb:{type:"string",default:"0 0"},stopsign:{type:"string",default:"0 0 0 0"},trafficsignal:{type:"string",default:"0 0 0 0"},crosswalk:{type:"string",default:"0 0 0 0"}},init:function(){for(var e=this.data,i=this.el;i.firstChild;)i.removeChild(i.lastChild);var a=e.dimensions.split(" ").map((function(t){return Number(t)})),n=[this.el.getAttribute("position").x,this.el.getAttribute("position").y,this.el.getAttribute("position").z],r=e.sidewalk.split(" ").map((function(t){return Number(t)})),s=e.northeastcurb.split(" ").map((function(t){return Number(t)})),o=e.southwestcurb.split(" ").map((function(t){return Number(t)})),l=e.southeastcurb.split(" ").map((function(t){return Number(t)})),c=e.northwestcurb.split(" ").map((function(t){return Number(t)})),d=e.stopsign.split(" ").map((function(t){return Number(t)})),u=e.trafficsignal.split(" ").map((function(t){return Number(t)})),m=e.crosswalk.split(" ").map((function(t){return Number(t)})),p=a[0],h=a[1];function f(t){var e=t.length,a=t.width,n=t.positionVec,r=t.scaleVec,s=void 0===r?{x:1,y:1,z:1}:r,o=t.rotationVec,l=document.createElement("a-entity"),c=[];c[0]=a/2,c[1]=parseInt(e/2),l.setAttribute("geometry","primitive","box"),l.setAttribute("geometry","height: 0.4"),l.setAttribute("position",n),l.setAttribute("scale",s),l.setAttribute("geometry","depth",e),l.setAttribute("geometry","width",a),l.setAttribute("rotation",o),l.setAttribute("mixin","sidewalk"),l.setAttribute("material","repeat: ".concat(c[0]," ").concat(c[1])),i.appendChild(l)}this.el.setAttribute("geometry","primitive:box; width: ".concat(p,"; height: ").concat(h,"; depth:0.2")),this.el.setAttribute("position",{x:n[0],y:-.1,z:n[2]}),this.el.setAttribute("rotation","-90 0 0"),this.el.setAttribute("material","src: #asphalt-texture; repeat:5 5; roughness:1");var g={west:{positionVec:{x:p/2-r[0]/2,z:.1},rotationVec:{x:90,y:0,z:0},length:h,width:r[0]},east:{positionVec:{x:-p/2+r[1]/2,z:.1},rotationVec:{x:90,y:0,z:0},length:h,width:r[1]},north:{positionVec:{y:-h/2+r[2]/2,x:r[1]/2-r[0]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:p-r[1]-r[0],width:r[2]},south:{positionVec:{y:h/2-r[3]/2,x:r[1]/2-r[0]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:p-r[1]-r[0],width:r[3]}};Object.keys(g).filter((function(t,e){return r[e]})).forEach((function(t,e){f(g[t])}));for(var y={northeast:{positionVec:{x:p/2-s[0]/2,y:h/2-s[1]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:s[0],width:s[1]},southwest:{positionVec:{x:-p/2+o[0]/2,y:-h/2+o[1]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:o[0],width:o[1]},southeast:{positionVec:{x:p/2-l[0]/2,y:-h/2+l[1]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:l[0],width:l[1]},northwest:{positionVec:{x:-p/2+c[0]/2,y:h/2-c[1]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:c[0],width:c[1]}},b=0,x=Object.entries(y);b Date: Thu, 30 Nov 2023 14:25:16 -0800 Subject: [PATCH 56/56] remove extraneous logging --- dist/aframe-street-component.js | 2 +- src/json-utils.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dist/aframe-street-component.js b/dist/aframe-street-component.js index 943a5b5a7..67149eae9 100644 --- a/dist/aframe-street-component.js +++ b/dist/aframe-street-component.js @@ -13,4 +13,4 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ -var a,n=function(){return n=Object.assign||function(t){for(var e,i=1,a=arguments.length;i{t.exports.isSidewalk=function(t){return t.startsWith("sidewalk")||["utilities","scooter-drop-zone","bikeshare","flex-zone-curb","transit-shelter","brt-station"].includes(t)},t.exports.createBuildingsArray=function(){var t,e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:150,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"narrow";if("narrow"===a||"wide"===a)t=[{id:"SM3D_Bld_Mixed_4fl",width:5.251},{id:"SM3D_Bld_Mixed_Double_5fl",width:10.9041},{id:"SM3D_Bld_Mixed_4fl_2",width:5.309},{id:"SM3D_Bld_Mixed_5fl",width:5.903},{id:"SM3D_Bld_Mixed_Corner_4fl",width:5.644}],e="41431323432402434130303230234102402341";else if("residential"===a)t=[{id:"SM_Bld_House_Preset_03_1800",width:20},{id:"SM_Bld_House_Preset_08_1809",width:20},{id:"SM_Bld_House_Preset_09_1845",width:20}],e="12021201210101212021201012012021201210";else{if("arcade"!==a)return[];t=[{id:"arched-building-01",width:9.191},{id:"arched-building-02",width:11.19},{id:"arched-building-03",width:13.191},{id:"arched-building-04",width:15.191}],e="03120223130210321203123023103201232013"}for(var n=0,r=0,s=[];r{function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],a=!0,n=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(a=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);a=!0);}catch(t){n=!0,r=t}finally{try{a||null==o.return||o.return()}finally{if(n)throw r}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return i(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,a=new Array(e);i0&&void 0!==arguments[0]?arguments[0]:{},i=document.createElement(t.tag);delete t.tag;for(var a=0,n=Object.entries(t);a1?arguments[1]:void 0;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(e,i){t.appendChild(a(e))})),t}},394:t=>{t.exports.streetmixUserToAPI=function(t){var e=new URL(t).pathname.split("/"),i=e[1],a=e[2];return"-"===i?"https://streetmix.net/api/v1/streets?namespacedId="+a:"https://streetmix.net/api/v1/streets?namespacedId="+a+"&creatorId="+i},t.exports.pathStartsWithAPI=function(t){var e=document.createElement("a");return e.href=t,"api"===e.pathname.split("/")[1]},t.exports.streetmixAPIToUser=function(t){function e(t,e){for(var i=t.split("&"),a=0;a(t.paths=[],t.children||(t.children=[]),t);return(()=>{function t(t,i){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],a=!0,n=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(a=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);a=!0);}catch(t){n=!0,r=t}finally{try{a||null==o.return||o.return()}finally{if(n)throw r}}return i}(t,i)||function(t,i){if(!t)return;if("string"==typeof t)return e(t,i);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return e(t,i)}(t,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,a=new Array(e);i=200&&this.status<400){var t,a=JSON.parse(this.response),n=a.data.street.segments,r=a.name;console.log("streetmixName",r),i.setAttribute("streetmix-loader","name",r),AFRAME.scenes[0]&&AFRAME.scenes[0].getAttribute("metadata")&&(t=AFRAME.scenes[0].getAttribute("metadata").sceneTitle),t||(AFRAME.scenes[0].setAttribute("metadata","sceneTitle",r),console.log("therefore setting metadata sceneTitle as streetmixName",r)),i.setAttribute("data-layer-name","Streetmix: "+r),e.showBuildings&&(i.setAttribute("street","right",a.data.street.rightBuildingVariant),i.setAttribute("street","left",a.data.street.leftBuildingVariant)),i.setAttribute("street","type","streetmixSegmentsFeet"),i.setAttribute("street","JSON",JSON.stringify({streetmixSegmentsFeet:n})),i.emit("streetmix-loader-street-loaded")}else console.log("[streetmix-loader]","Loading Error: We reached the target server, but it returned an error")},a.onerror=function(){console.log("[streetmix-loader]","Loading Error: There was a connection error of some sort")},a.send()}else{if(e.streetmixStreetURL.length>0){var r=n.streetmixUserToAPI(e.streetmixStreetURL);return console.log("[streetmix-loader]","setting `streetmixAPIURL` to",r),void i.setAttribute("streetmix-loader","streetmixAPIURL",r)}console.log("[streetmix-loader]","Neither `streetmixAPIURL` nor `streetmixStreetURL` properties provided, please provide at least one.")}}}),AFRAME.registerComponent("intersection",{schema:{dimensions:{type:"string",default:"20 20"},sidewalk:{type:"string",default:"0 0 0 0"},northeastcurb:{type:"string",default:"0 0"},southwestcurb:{type:"string",default:"0 0"},southeastcurb:{type:"string",default:"0 0"},northwestcurb:{type:"string",default:"0 0"},stopsign:{type:"string",default:"0 0 0 0"},trafficsignal:{type:"string",default:"0 0 0 0"},crosswalk:{type:"string",default:"0 0 0 0"}},init:function(){for(var e=this.data,i=this.el;i.firstChild;)i.removeChild(i.lastChild);var a=e.dimensions.split(" ").map((function(t){return Number(t)})),n=[this.el.getAttribute("position").x,this.el.getAttribute("position").y,this.el.getAttribute("position").z],r=e.sidewalk.split(" ").map((function(t){return Number(t)})),s=e.northeastcurb.split(" ").map((function(t){return Number(t)})),o=e.southwestcurb.split(" ").map((function(t){return Number(t)})),l=e.southeastcurb.split(" ").map((function(t){return Number(t)})),c=e.northwestcurb.split(" ").map((function(t){return Number(t)})),d=e.stopsign.split(" ").map((function(t){return Number(t)})),u=e.trafficsignal.split(" ").map((function(t){return Number(t)})),m=e.crosswalk.split(" ").map((function(t){return Number(t)})),p=a[0],h=a[1];function f(t){var e=t.length,a=t.width,n=t.positionVec,r=t.scaleVec,s=void 0===r?{x:1,y:1,z:1}:r,o=t.rotationVec,l=document.createElement("a-entity"),c=[];c[0]=a/2,c[1]=parseInt(e/2),l.setAttribute("geometry","primitive","box"),l.setAttribute("geometry","height: 0.4"),l.setAttribute("position",n),l.setAttribute("scale",s),l.setAttribute("geometry","depth",e),l.setAttribute("geometry","width",a),l.setAttribute("rotation",o),l.setAttribute("mixin","sidewalk"),l.setAttribute("material","repeat: ".concat(c[0]," ").concat(c[1])),i.appendChild(l)}this.el.setAttribute("geometry","primitive:box; width: ".concat(p,"; height: ").concat(h,"; depth:0.2")),this.el.setAttribute("position",{x:n[0],y:-.1,z:n[2]}),this.el.setAttribute("rotation","-90 0 0"),this.el.setAttribute("material","src: #asphalt-texture; repeat:5 5; roughness:1");var g={west:{positionVec:{x:p/2-r[0]/2,z:.1},rotationVec:{x:90,y:0,z:0},length:h,width:r[0]},east:{positionVec:{x:-p/2+r[1]/2,z:.1},rotationVec:{x:90,y:0,z:0},length:h,width:r[1]},north:{positionVec:{y:-h/2+r[2]/2,x:r[1]/2-r[0]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:p-r[1]-r[0],width:r[2]},south:{positionVec:{y:h/2-r[3]/2,x:r[1]/2-r[0]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:p-r[1]-r[0],width:r[3]}};Object.keys(g).filter((function(t,e){return r[e]})).forEach((function(t,e){f(g[t])}));for(var y={northeast:{positionVec:{x:p/2-s[0]/2,y:h/2-s[1]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:s[0],width:s[1]},southwest:{positionVec:{x:-p/2+o[0]/2,y:-h/2+o[1]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:o[0],width:o[1]},southeast:{positionVec:{x:p/2-l[0]/2,y:-h/2+l[1]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:l[0],width:l[1]},northwest:{positionVec:{x:-p/2+c[0]/2,y:h/2-c[1]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:c[0],width:c[1]}},b=0,x=Object.entries(y);b{t.exports.isSidewalk=function(t){return t.startsWith("sidewalk")||["utilities","scooter-drop-zone","bikeshare","flex-zone-curb","transit-shelter","brt-station"].includes(t)},t.exports.createBuildingsArray=function(){var t,e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:150,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"narrow";if("narrow"===a||"wide"===a)t=[{id:"SM3D_Bld_Mixed_4fl",width:5.251},{id:"SM3D_Bld_Mixed_Double_5fl",width:10.9041},{id:"SM3D_Bld_Mixed_4fl_2",width:5.309},{id:"SM3D_Bld_Mixed_5fl",width:5.903},{id:"SM3D_Bld_Mixed_Corner_4fl",width:5.644}],e="41431323432402434130303230234102402341";else if("residential"===a)t=[{id:"SM_Bld_House_Preset_03_1800",width:20},{id:"SM_Bld_House_Preset_08_1809",width:20},{id:"SM_Bld_House_Preset_09_1845",width:20}],e="12021201210101212021201012012021201210";else{if("arcade"!==a)return[];t=[{id:"arched-building-01",width:9.191},{id:"arched-building-02",width:11.19},{id:"arched-building-03",width:13.191},{id:"arched-building-04",width:15.191}],e="03120223130210321203123023103201232013"}for(var n=0,r=0,s=[];r{function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],a=!0,n=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(a=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);a=!0);}catch(t){n=!0,r=t}finally{try{a||null==o.return||o.return()}finally{if(n)throw r}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return i(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,a=new Array(e);i0&&void 0!==arguments[0]?arguments[0]:{},i=document.createElement(t.tag);delete t.tag;for(var a=0,n=Object.entries(t);a1?arguments[1]:void 0;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(e,i){t.appendChild(a(e))})),t}},394:t=>{t.exports.streetmixUserToAPI=function(t){var e=new URL(t).pathname.split("/"),i=e[1],a=e[2];return"-"===i?"https://streetmix.net/api/v1/streets?namespacedId="+a:"https://streetmix.net/api/v1/streets?namespacedId="+a+"&creatorId="+i},t.exports.pathStartsWithAPI=function(t){var e=document.createElement("a");return e.href=t,"api"===e.pathname.split("/")[1]},t.exports.streetmixAPIToUser=function(t){function e(t,e){for(var i=t.split("&"),a=0;a(t.paths=[],t.children||(t.children=[]),t);return(()=>{function t(t,i){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],a=!0,n=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(a=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);a=!0);}catch(t){n=!0,r=t}finally{try{a||null==o.return||o.return()}finally{if(n)throw r}}return i}(t,i)||function(t,i){if(!t)return;if("string"==typeof t)return e(t,i);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return e(t,i)}(t,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,a=new Array(e);i=200&&this.status<400){var t,a=JSON.parse(this.response),n=a.data.street.segments,r=a.name;console.log("streetmixName",r),i.setAttribute("streetmix-loader","name",r),AFRAME.scenes[0]&&AFRAME.scenes[0].getAttribute("metadata")&&(t=AFRAME.scenes[0].getAttribute("metadata").sceneTitle),t||(AFRAME.scenes[0].setAttribute("metadata","sceneTitle",r),console.log("therefore setting metadata sceneTitle as streetmixName",r)),i.setAttribute("data-layer-name","Streetmix: "+r),e.showBuildings&&(i.setAttribute("street","right",a.data.street.rightBuildingVariant),i.setAttribute("street","left",a.data.street.leftBuildingVariant)),i.setAttribute("street","type","streetmixSegmentsFeet"),i.setAttribute("street","JSON",JSON.stringify({streetmixSegmentsFeet:n})),i.emit("streetmix-loader-street-loaded")}else console.log("[streetmix-loader]","Loading Error: We reached the target server, but it returned an error")},a.onerror=function(){console.log("[streetmix-loader]","Loading Error: There was a connection error of some sort")},a.send()}else{if(e.streetmixStreetURL.length>0){var r=n.streetmixUserToAPI(e.streetmixStreetURL);return console.log("[streetmix-loader]","setting `streetmixAPIURL` to",r),void i.setAttribute("streetmix-loader","streetmixAPIURL",r)}console.log("[streetmix-loader]","Neither `streetmixAPIURL` nor `streetmixStreetURL` properties provided, please provide at least one.")}}}),AFRAME.registerComponent("intersection",{schema:{dimensions:{type:"string",default:"20 20"},sidewalk:{type:"string",default:"0 0 0 0"},northeastcurb:{type:"string",default:"0 0"},southwestcurb:{type:"string",default:"0 0"},southeastcurb:{type:"string",default:"0 0"},northwestcurb:{type:"string",default:"0 0"},stopsign:{type:"string",default:"0 0 0 0"},trafficsignal:{type:"string",default:"0 0 0 0"},crosswalk:{type:"string",default:"0 0 0 0"}},init:function(){for(var e=this.data,i=this.el;i.firstChild;)i.removeChild(i.lastChild);var a=e.dimensions.split(" ").map((function(t){return Number(t)})),n=[this.el.getAttribute("position").x,this.el.getAttribute("position").y,this.el.getAttribute("position").z],r=e.sidewalk.split(" ").map((function(t){return Number(t)})),s=e.northeastcurb.split(" ").map((function(t){return Number(t)})),o=e.southwestcurb.split(" ").map((function(t){return Number(t)})),l=e.southeastcurb.split(" ").map((function(t){return Number(t)})),c=e.northwestcurb.split(" ").map((function(t){return Number(t)})),d=e.stopsign.split(" ").map((function(t){return Number(t)})),u=e.trafficsignal.split(" ").map((function(t){return Number(t)})),m=e.crosswalk.split(" ").map((function(t){return Number(t)})),p=a[0],h=a[1];function f(t){var e=t.length,a=t.width,n=t.positionVec,r=t.scaleVec,s=void 0===r?{x:1,y:1,z:1}:r,o=t.rotationVec,l=document.createElement("a-entity"),c=[];c[0]=a/2,c[1]=parseInt(e/2),l.setAttribute("geometry","primitive","box"),l.setAttribute("geometry","height: 0.4"),l.setAttribute("position",n),l.setAttribute("scale",s),l.setAttribute("geometry","depth",e),l.setAttribute("geometry","width",a),l.setAttribute("rotation",o),l.setAttribute("mixin","sidewalk"),l.setAttribute("material","repeat: ".concat(c[0]," ").concat(c[1])),i.appendChild(l)}this.el.setAttribute("geometry","primitive:box; width: ".concat(p,"; height: ").concat(h,"; depth:0.2")),this.el.setAttribute("position",{x:n[0],y:-.1,z:n[2]}),this.el.setAttribute("rotation","-90 0 0"),this.el.setAttribute("material","src: #asphalt-texture; repeat:5 5; roughness:1");var g={west:{positionVec:{x:p/2-r[0]/2,z:.1},rotationVec:{x:90,y:0,z:0},length:h,width:r[0]},east:{positionVec:{x:-p/2+r[1]/2,z:.1},rotationVec:{x:90,y:0,z:0},length:h,width:r[1]},north:{positionVec:{y:-h/2+r[2]/2,x:r[1]/2-r[0]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:p-r[1]-r[0],width:r[2]},south:{positionVec:{y:h/2-r[3]/2,x:r[1]/2-r[0]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:p-r[1]-r[0],width:r[3]}};Object.keys(g).filter((function(t,e){return r[e]})).forEach((function(t,e){f(g[t])}));for(var y={northeast:{positionVec:{x:p/2-s[0]/2,y:h/2-s[1]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:s[0],width:s[1]},southwest:{positionVec:{x:-p/2+o[0]/2,y:-h/2+o[1]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:o[0],width:o[1]},southeast:{positionVec:{x:p/2-l[0]/2,y:-h/2+l[1]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:l[0],width:l[1]},northwest:{positionVec:{x:-p/2+c[0]/2,y:h/2-c[1]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:c[0],width:c[1]}},b=0,x=Object.entries(y);b