diff --git a/src/assets/avatars/avatars.js b/src/assets/avatars/avatars.js index 68d26045503229c4a8bd9d8952b0e032b49b0b29..76533865e81a9e9e54bd98483065b52a9f5a8440 100644 --- a/src/assets/avatars/avatars.js +++ b/src/assets/avatars/avatars.js @@ -1,42 +1,42 @@ export const avatars = [ { id: "botdefault", - model: "https://asset-bundles-dev.reticulum.io/bots/BotDefault_Avatar-9f71f8ff22.gltf" + model: "https://asset-bundles-prod.reticulum.io/bots/BotDefault_Avatar-9f71f8ff22.gltf" }, { id: "botbobo", - model: "https://asset-bundles-dev.reticulum.io/bots/BotBobo_Avatar-f9740a010b.gltf" + model: "https://asset-bundles-prod.reticulum.io/bots/BotBobo_Avatar-f9740a010b.gltf" }, { id: "botdom", - model: "https://asset-bundles-dev.reticulum.io/bots/BotDom_Avatar-6aa1b5d781.gltf" + model: "https://asset-bundles-prod.reticulum.io/bots/BotDom_Avatar-6aa1b5d781.gltf" }, { id: "botgreg", - model: "https://asset-bundles-dev.reticulum.io/bots/BotGreg_Avatar-98d39797bb.gltf" + model: "https://asset-bundles-prod.reticulum.io/bots/BotGreg_Avatar-98d39797bb.gltf" }, { id: "botguest", - model: "https://asset-bundles-dev.reticulum.io/bots/BotGuest_Avatar-78cd857332.gltf" + model: "https://asset-bundles-prod.reticulum.io/bots/BotGuest_Avatar-78cd857332.gltf" }, { id: "botjim", - model: "https://asset-bundles-dev.reticulum.io/bots/BotJim_Avatar-d28005a687.gltf" + model: "https://asset-bundles-prod.reticulum.io/bots/BotJim_Avatar-d28005a687.gltf" }, { id: "botkev", - model: "https://asset-bundles-dev.reticulum.io/bots/BotKev_Avatar-a95787bb51.gltf" + model: "https://asset-bundles-prod.reticulum.io/bots/BotKev_Avatar-a95787bb51.gltf" }, { id: "botpinky", - model: "https://asset-bundles-dev.reticulum.io/bots/BotPinky_Avatar-b0b93f8675.gltf" + model: "https://asset-bundles-prod.reticulum.io/bots/BotPinky_Avatar-b0b93f8675.gltf" }, { id: "botrobert", - model: "https://asset-bundles-dev.reticulum.io/bots/BotRobert_Avatar-e9554880f3.gltf" + model: "https://asset-bundles-prod.reticulum.io/bots/BotRobert_Avatar-e9554880f3.gltf" }, { id: "botwoody", - model: "https://asset-bundles-dev.reticulum.io/bots/BotWoody_Avatar-0140485a23.gltf" + model: "https://asset-bundles-prod.reticulum.io/bots/BotWoody_Avatar-0140485a23.gltf" } ]; diff --git a/src/assets/environments/cliff_meeting_space/CliffVista_mesh.glb b/src/assets/environments/cliff_meeting_space/CliffVista_mesh.glb deleted file mode 100644 index fbd377865a799bb52240155dbe34bf49d699bd97..0000000000000000000000000000000000000000 Binary files a/src/assets/environments/cliff_meeting_space/CliffVista_mesh.glb and /dev/null differ diff --git a/src/assets/environments/cliff_meeting_space/FloorNav_mesh.glb b/src/assets/environments/cliff_meeting_space/FloorNav_mesh.glb deleted file mode 100644 index 0ee9f5067c1492feb2ccb45d8f757bd28a9096c5..0000000000000000000000000000000000000000 Binary files a/src/assets/environments/cliff_meeting_space/FloorNav_mesh.glb and /dev/null differ diff --git a/src/assets/environments/cliff_meeting_space/MeetingSpace1_mesh.glb b/src/assets/environments/cliff_meeting_space/MeetingSpace1_mesh.glb deleted file mode 100644 index e184d5800b35daa15754ba88db845144bcd53309..0000000000000000000000000000000000000000 Binary files a/src/assets/environments/cliff_meeting_space/MeetingSpace1_mesh.glb and /dev/null differ diff --git a/src/assets/environments/cliff_meeting_space/OutdoorFacade_mesh.glb b/src/assets/environments/cliff_meeting_space/OutdoorFacade_mesh.glb deleted file mode 100644 index 05ceb7b09786450daf59833ca10c20fa214ac362..0000000000000000000000000000000000000000 Binary files a/src/assets/environments/cliff_meeting_space/OutdoorFacade_mesh.glb and /dev/null differ diff --git a/src/assets/environments/cliff_meeting_space/bundle.json.tpl b/src/assets/environments/cliff_meeting_space/bundle.json.tpl deleted file mode 100644 index 6c54054858cec5ac982debae6351bfd6fa1664da..0000000000000000000000000000000000000000 --- a/src/assets/environments/cliff_meeting_space/bundle.json.tpl +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "cliff_meeting_space", - "version": "0.1.0", - "meta": { - "title": "Cliffside Meeting Space", - "description": "Enjoy a beautiful vista view while collaborating in Mixed Reality", - "authors": [ - { "name": "Jim Conrad", "github": "j-conrad" } - ], - "images": [ - { "type": "preview-thumbnail", "srcset": "<%= require("./preview-thumbnail.png") %>" } - ] - }, - "assets": [ - { - "name": "space-geometry", "src": "<%= require("./MeetingSpace1_mesh.glb") %>" - }, - { - "name": "outdoor-geometry", "src": "<%= require("./OutdoorFacade_mesh.glb") %>" - }, - { - "name": "cliff-geometry", "src": "<%= require("./CliffVista_mesh.glb") %>" - } - ] -} diff --git a/src/assets/environments/cliff_meeting_space/preview-thumbnail.png b/src/assets/environments/cliff_meeting_space/preview-thumbnail.png deleted file mode 100755 index 050f0e62619b45bb16fdd1bf648a0ba2696a6d46..0000000000000000000000000000000000000000 Binary files a/src/assets/environments/cliff_meeting_space/preview-thumbnail.png and /dev/null differ diff --git a/src/assets/images/default_thumbnail.png b/src/assets/images/default_thumbnail.png new file mode 100644 index 0000000000000000000000000000000000000000..55ae93b221662e08cec3877c5cb5544997f7a8a7 Binary files /dev/null and b/src/assets/images/default_thumbnail.png differ diff --git a/src/assets/stylesheets/hub-create.scss b/src/assets/stylesheets/hub-create.scss index 001ca379bd533abff1765aa117b549037077a2c5..636ab5d656725522d5a407d93c8a1d92361d61ca 100644 --- a/src/assets/stylesheets/hub-create.scss +++ b/src/assets/stylesheets/hub-create.scss @@ -151,7 +151,7 @@ } &__image { - width: 112%; + width: 106%; position: absolute; top: -3%; left: -3%; diff --git a/src/components/gltf-bundle.js b/src/components/gltf-bundle.js index 85238043fb2319dd1a6e55bc953186890fd2e721..ba6f7b3dc6d78aa08646352e49b6e3f91031056a 100644 --- a/src/components/gltf-bundle.js +++ b/src/components/gltf-bundle.js @@ -5,6 +5,7 @@ AFRAME.registerComponent("gltf-bundle", { init: async function() { this._addGltfEntitiesForBundleJson = this._addGltfEntitiesForBundleJson.bind(this); + this.baseURL = new URL(THREE.LoaderUtils.extractUrlBase(this.data.src), window.location.href); const res = await fetch(this.data.src); const data = await res.json(); @@ -16,10 +17,13 @@ AFRAME.registerComponent("gltf-bundle", { for (let i = 0; i < bundleJson.assets.length; i++) { const asset = bundleJson.assets[i]; - const src = asset.src; + + // TODO: for now just skip resources, eventually we will want to hold on to a reference so that we can use them + if (asset.type === "resource") continue; + + const src = new URL(asset.src, this.baseURL).href; const gltfEl = document.createElement("a-entity"); - gltfEl.setAttribute("gltf-model-plus", { src }); - gltfEl.setAttribute("position", "0 0 0"); + gltfEl.setAttribute("gltf-model-plus", { src, inflate: true }); loaded.push(new Promise(resolve => gltfEl.addEventListener("model-loaded", resolve))); this.el.appendChild(gltfEl); } diff --git a/src/hub.html b/src/hub.html index c604547cddc4edd209d2287de919038fb8891c84..8ec10f0c93c79f93102f764559b7fb2ed5952309 100644 --- a/src/hub.html +++ b/src/hub.html @@ -31,20 +31,19 @@ <img id="muted" src="./assets/hud/muted.png" > <img id="avatar" src="./assets/hud/avatar.jpg" > - <a-asset-item id="botdefault" response-type="arraybuffer" src="https://asset-bundles-dev.reticulum.io/bots/BotDefault_Avatar-9f71f8ff22.gltf"></a-asset-item> - <a-asset-item id="botbobo" response-type="arraybuffer" src="https://asset-bundles-dev.reticulum.io/bots/BotBobo_Avatar-f9740a010b.gltf"></a-asset-item> - <a-asset-item id="botdom" response-type="arraybuffer" src="https://asset-bundles-dev.reticulum.io/bots/BotDom_Avatar-6aa1b5d781.gltf"></a-asset-item> - <a-asset-item id="botgreg" response-type="arraybuffer" src="https://asset-bundles-dev.reticulum.io/bots/BotGreg_Avatar-98d39797bb.gltf"></a-asset-item> - <a-asset-item id="botguest" response-type="arraybuffer" src="https://asset-bundles-dev.reticulum.io/bots/BotGuest_Avatar-78cd857332.gltf"></a-asset-item> - <a-asset-item id="botjim" response-type="arraybuffer" src="https://asset-bundles-dev.reticulum.io/bots/BotJim_Avatar-d28005a687.gltf"></a-asset-item> - <a-asset-item id="botkev" response-type="arraybuffer" src="https://asset-bundles-dev.reticulum.io/bots/BotKev_Avatar-a95787bb51.gltf"></a-asset-item> - <a-asset-item id="botpinky" response-type="arraybuffer" src="https://asset-bundles-dev.reticulum.io/bots/BotPinky_Avatar-b0b93f8675.gltf"></a-asset-item> - <a-asset-item id="botrobert" response-type="arraybuffer" src="https://asset-bundles-dev.reticulum.io/bots/BotRobert_Avatar-e9554880f3.gltf"></a-asset-item> - <a-asset-item id="botwoody" response-type="arraybuffer" src="https://asset-bundles-dev.reticulum.io/bots/BotWoody_Avatar-0140485a23.gltf"></a-asset-item> + <a-asset-item id="botdefault" response-type="arraybuffer" src="https://asset-bundles-prod.reticulum.io/bots/BotDefault_Avatar-9f71f8ff22.gltf"></a-asset-item> + <a-asset-item id="botbobo" response-type="arraybuffer" src="https://asset-bundles-prod.reticulum.io/bots/BotBobo_Avatar-f9740a010b.gltf"></a-asset-item> + <a-asset-item id="botdom" response-type="arraybuffer" src="https://asset-bundles-prod.reticulum.io/bots/BotDom_Avatar-6aa1b5d781.gltf"></a-asset-item> + <a-asset-item id="botgreg" response-type="arraybuffer" src="https://asset-bundles-prod.reticulum.io/bots/BotGreg_Avatar-98d39797bb.gltf"></a-asset-item> + <a-asset-item id="botguest" response-type="arraybuffer" src="https://asset-bundles-prod.reticulum.io/bots/BotGuest_Avatar-78cd857332.gltf"></a-asset-item> + <a-asset-item id="botjim" response-type="arraybuffer" src="https://asset-bundles-prod.reticulum.io/bots/BotJim_Avatar-d28005a687.gltf"></a-asset-item> + <a-asset-item id="botkev" response-type="arraybuffer" src="https://asset-bundles-prod.reticulum.io/bots/BotKev_Avatar-a95787bb51.gltf"></a-asset-item> + <a-asset-item id="botpinky" response-type="arraybuffer" src="https://asset-bundles-prod.reticulum.io/bots/BotPinky_Avatar-b0b93f8675.gltf"></a-asset-item> + <a-asset-item id="botrobert" response-type="arraybuffer" src="https://asset-bundles-prod.reticulum.io/bots/BotRobert_Avatar-e9554880f3.gltf"></a-asset-item> + <a-asset-item id="botwoody" response-type="arraybuffer" src="https://asset-bundles-prod.reticulum.io/bots/BotWoody_Avatar-0140485a23.gltf"></a-asset-item> <a-asset-item id="watch-model" response-type="arraybuffer" src="./assets/hud/watch.glb"></a-asset-item> <a-asset-item id="interactable-duck" response-type="arraybuffer" src="./assets/interactables/duck/DuckyMesh.glb"></a-asset-item> - <a-asset-item id="navmesh" response-type="arraybuffer" src="./assets/environments/cliff_meeting_space/FloorNav_mesh.glb"></a-asset-item> <img id="water-normal-map" src="./assets/waternormals.jpg"></a-asset-item> @@ -289,14 +288,6 @@ <!-- Environment --> <a-entity id="environment-root" position="0 0 0"></a-entity> - <a-entity - id="nav-mesh" - gltf-model-plus="src: #navmesh" - nav-mesh - visible="false" - xr="ar: false" - ></a-entity> - <a-entity id="skybox" id="skybox" scale="8000 8000 8000" diff --git a/src/hub.js b/src/hub.js index bb8ae791192f9490f2e785249056f5103140ed26..919b7d00f28846b66e9458016d3a7a789830eb8d 100644 --- a/src/hub.js +++ b/src/hub.js @@ -262,7 +262,12 @@ const onReady = async () => { if (qs.room) { // If ?room is set, this is `yarn start`, so just use a default environment and query string room. uiRoot.setState({ janusRoomId: qs.room && !isNaN(parseInt(qs.room)) ? parseInt(qs.room) : 1 }); - initialEnvironmentEl.setAttribute("gltf-bundle", "src: /assets/environments/cliff_meeting_space/bundle.json"); + initialEnvironmentEl.setAttribute("gltf-bundle", { + src: "https://asset-bundles-prod.reticulum.io/rooms/meetingroom/MeetingRoom.bundle.json" + // src: "https://asset-bundles-prod.reticulum.io/rooms/theater/TheaterMeshes.bundle.json" + // src: "https://asset-bundles-prod.reticulum.io/rooms/atrium/AtriumMeshes.bundle.json" + // src: "https://asset-bundles-prod.reticulum.io/rooms/courtyard/CourtyardMeshes.bundle.json" + }); return; } diff --git a/src/react-components/avatar-selector.js b/src/react-components/avatar-selector.js index 2256845bb5538970c64f83047decb8842a615e7d..d88340f04532b89d07512d38bb3f292c78e4e844 100644 --- a/src/react-components/avatar-selector.js +++ b/src/react-components/avatar-selector.js @@ -4,7 +4,9 @@ import { injectIntl, FormattedMessage } from "react-intl"; import FontAwesomeIcon from "@fortawesome/react-fontawesome"; import faAngleLeft from "@fortawesome/fontawesome-free-solid/faAngleLeft"; import faAngleRight from "@fortawesome/fontawesome-free-solid/faAngleRight"; -import meetingSpace from "../assets/environments/cliff_meeting_space/MeetingSpace1_mesh.glb"; + +// TODO: we should make a bundle for avatar picker with it's own geometry, for now just use the indoor part of the meting room +const meetingSpace = "https://asset-bundles-prod.reticulum.io/rooms/meetingroom/MeetingSpace1_mesh-d48250ebc6.gltf"; class AvatarSelector extends Component { static propTypes = { diff --git a/src/react-components/home-root.js b/src/react-components/home-root.js index 984a3d44c2fbb29973c3f1ed9dee4395d015bfa2..af896b643db9e3cf38ac5403aa58e143f28c58ce 100644 --- a/src/react-components/home-root.js +++ b/src/react-components/home-root.js @@ -16,7 +16,10 @@ addLocaleData([...en]); const messages = localeData[lang] || localeData.en; const ENVIRONMENT_URLS = [ - `${document.location.protocol}//${document.location.host}/assets/environments/cliff_meeting_space/bundle.json` + "https://asset-bundles-prod.reticulum.io/rooms/meetingroom/MeetingRoom.bundle.json", + "https://asset-bundles-prod.reticulum.io/rooms/theater/TheaterMeshes.bundle.json", + "https://asset-bundles-prod.reticulum.io/rooms/atrium/AtriumMeshes.bundle.json", + "https://asset-bundles-prod.reticulum.io/rooms/courtyard/CourtyardMeshes.bundle.json" ]; class HomeRoot extends Component { diff --git a/src/react-components/hub-create-panel.js b/src/react-components/hub-create-panel.js index f117ead03f85bc0116619e14c2c3f3d7505b8ba5..32fd19b4edfcb343b0cada0d4f0abf0052344d8e 100644 --- a/src/react-components/hub-create-panel.js +++ b/src/react-components/hub-create-panel.js @@ -7,6 +7,8 @@ import faAngleLeft from "@fortawesome/fontawesome-free-solid/faAngleLeft"; import faAngleRight from "@fortawesome/fontawesome-free-solid/faAngleRight"; import FontAwesomeIcon from "@fortawesome/react-fontawesome"; +import deafault_scene_preview_thumbnail from "../assets/images/default_thumbnail.png"; + const HUB_NAME_PATTERN = "^[A-Za-z0-9-'\":!@#$%^&*(),.?~ ]{4,64}$"; class HubCreatePanel extends Component { @@ -84,10 +86,13 @@ class HubCreatePanel extends Component { } const environment = this.props.environments[this.state.environmentIndex]; - const environmentImageSrcSet = environment.meta.images.find(i => i.type === "preview-thumbnail").srcset; + const meta = environment.meta || {}; - const environmentTitle = environment.meta.title; - const environmentAuthor = (environment.meta.authors || [])[0]; + const environmentTitle = meta.title || environment.name; + const environmentAuthor = (meta.authors || [])[0]; + const environmentThumbnail = (meta.images || []).find(i => i.type === "preview-thumbnail") || { + srcset: deafault_scene_preview_thumbnail + }; const formNameClassNames = classNames("create-panel__form__name", { "create-panel__form__name--expanded": this.state.expanded @@ -134,7 +139,10 @@ class HubCreatePanel extends Component { {this.state.expanded && ( <div className="create-panel__form__environment"> <div className="create-panel__form__environment__picker"> - <img className="create-panel__form__environment__picker__image" srcSet={environmentImageSrcSet} /> + <img + className="create-panel__form__environment__picker__image" + srcSet={environmentThumbnail.srcset} + /> <div className="create-panel__form__environment__picker__labels"> <div className="create-panel__form__environment__picker__labels__header"> <span className="create-panel__form__environment__picker__labels__header__title"> diff --git a/src/react-components/ui-root.js b/src/react-components/ui-root.js index 946784e9e1f6e18aa6a412a86d350f39a1772a24..3970a2305c4439900b4936f8e465d2d0039a8de0 100644 --- a/src/react-components/ui-root.js +++ b/src/react-components/ui-root.js @@ -60,7 +60,7 @@ class UIRoot extends Component { enableScreenSharing: PropTypes.bool, store: PropTypes.object, scene: PropTypes.object, - htmlPrefix: PropTypes.object + htmlPrefix: PropTypes.string }; state = { diff --git a/webpack.config.js b/webpack.config.js index 56e643a7260f3d8214b116ad83f0aad876c3f4a1..4f9b26d26cab4c3959a5b1796696f7a0b531c086 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -3,7 +3,6 @@ require("dotenv").config(); const fs = require("fs"); const path = require("path"); -const glob = require("glob"); const selfsigned = require("selfsigned"); const webpack = require("webpack"); const HTMLWebpackPlugin = require("html-webpack-plugin"); @@ -190,15 +189,6 @@ const config = { chunks: ["hub"], inject: "head" }), - // Build the GLTF asset bundle json files - ...glob.sync("src/assets/**/*.tpl").map( - f => - new HTMLWebpackPlugin({ - filename: f.replace(".tpl", "").replace("src/", ""), - template: path.join(...[__dirname, ...f.split("/")]), - chunks: [] - }) - ), new HTMLWebpackPlugin({ filename: "avatar-selector.html", template: path.join(__dirname, "src", "avatar-selector.html"),