diff --git a/src/assets/avatars/avatars.js b/src/assets/avatars/avatars.js new file mode 100644 index 0000000000000000000000000000000000000000..f7a5500048710c5bf0910e5bc781000764871312 --- /dev/null +++ b/src/assets/avatars/avatars.js @@ -0,0 +1,65 @@ +export const avatars = [ + { + "id": "botdefault", + "models": { + "low": `${ require("./BotDefault_Avatar_Unlit.glb") }`, + "high": `${ require("./BotDefault_Avatar.glb") }` + } + }, + { + "id": "botbobo", + "models": { + "low": `${ require("./BotBobo_Avatar_Unlit.glb") }`, + "high": `${ require("./BotBobo_Avatar.glb") }` + } + }, + { + "id": "botdom", + "models": { + "low": `${ require("./BotDom_Avatar_Unlit.glb") }`, + "high": `${ require("./BotDom_Avatar.glb") }` + } + }, + { + "id": "botgreg", + "models": { + "low": `${ require("./BotGreg_Avatar_Unlit.glb") }`, + "high": `${ require("./BotGreg_Avatar.glb") }` + } + }, + { + "id": "botguest", + "models": { + "low": `${ require("./BotGuest_Avatar_Unlit.glb") }`, + "high": `${ require("./BotGuest_Avatar.glb") }` + } + }, + { + "id": "botjim", + "models": { + "low": `${ require("./BotJim_Avatar_Unlit.glb") }`, + "high": `${ require("./BotJim_Avatar.glb") }` + } + }, + { + "id": "botpinky", + "models": { + "low": `${ require("./BotPinky_Avatar_Unlit.glb") }`, + "high": `${ require("./BotPinky_Avatar.glb") }` + } + }, + { + "id": "botrobert", + "models": { + "low": `${ require("./BotRobert_Avatar_Unlit.glb") }`, + "high": `${ require("./BotRobert_Avatar.glb") }` + } + }, + { + "id": "botwoody", + "models": { + "low": `${ require("./BotWoody_Avatar_Unlit.glb") }`, + "high": `${ require("./BotWoody_Avatar.glb") }` + } + } +]; diff --git a/src/assets/avatars/avatars.json b/src/assets/avatars/avatars.json deleted file mode 100644 index 8f04c546fbe55d90507ab92ee2e3e599144d7d29..0000000000000000000000000000000000000000 --- a/src/assets/avatars/avatars.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "avatars": [ - { - "id": "botdefault", - "models": { - "low": "BotDefault_Avatar_Unlit.glb", - "high": "BotDefault_Avatar.glb" - } - }, - { - "id": "botbobo", - "models": { - "low": "BotBobo_Avatar_Unlit.glb", - "high": "BotBobo_Avatar.glb" - } - }, - { - "id": "botdom", - "models": { - "low": "BotDom_Avatar_Unlit.glb", - "high": "BotDom_Avatar.glb" - } - }, - { - "id": "botgreg", - "models": { - "low": "BotGreg_Avatar_Unlit.glb", - "high": "BotGreg_Avatar.glb" - } - }, - { - "id": "botguest", - "models": { - "low": "BotGuest_Avatar_Unlit.glb", - "high": "BotGuest_Avatar.glb" - } - }, - { - "id": "botjim", - "models": { - "low": "BotJim_Avatar_Unlit.glb", - "high": "BotJim_Avatar.glb" - } - }, - { - "id": "botpinky", - "models": { - "low": "BotPinky_Avatar_Unlit.glb", - "high": "BotPinky_Avatar.glb" - } - }, - { - "id": "botrobert", - "models": { - "low": "BotRobert_Avatar_Unlit.glb", - "high": "BotRobert_Avatar.glb" - } - }, - { - "id": "botwoody", - "models": { - "low": "BotWoody_Avatar_Unlit.glb", - "high": "BotWoody_Avatar.glb" - } - } - ] -} diff --git a/src/avatar-selector.js b/src/avatar-selector.js index 34731ff37823ba04f3899dd02d34bdc6a8453e4c..6acfe154caebb1c9f799631940aeb918e945fd7e 100644 --- a/src/avatar-selector.js +++ b/src/avatar-selector.js @@ -12,7 +12,7 @@ import "./components/audio-feedback"; import "./components/loop-animation"; import "./elements/a-progressive-asset"; import "./gltf-component-mappings"; -import { avatars } from "./assets/avatars/avatars.json"; +import { avatars } from "./assets/avatars/avatars.js"; import { avatarIds } from "./utils/identity"; import { App } from "./App"; diff --git a/src/react-components/avatar-selector.js b/src/react-components/avatar-selector.js index c534c8ac2ea7997d96ea510649e0735a4f734e57..089885ef6b946ad020c8b559205e7c4c41f4d082 100644 --- a/src/react-components/avatar-selector.js +++ b/src/react-components/avatar-selector.js @@ -4,6 +4,7 @@ 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/MeetingSpace1_mesh.glb'; class AvatarSelector extends Component { static propTypes = { @@ -48,8 +49,8 @@ class AvatarSelector extends Component { id={avatar.id} key={avatar.id} response-type="arraybuffer" - high-src={`./src/assets/avatars/${avatar.models.high}`} - low-src={`./src/assets/avatars/${avatar.models.low}`} + high-src={`/${avatar.models.high}`} + low-src={`/${avatar.models.low}`} ></a-progressive-asset> )); @@ -80,11 +81,11 @@ class AvatarSelector extends Component { <a-asset-item id="meeting-space1-mesh" response-type="arraybuffer" - src="./src/assets/environments/MeetingSpace1_mesh.glb" + src={meetingSpace} ></a-asset-item> </a-assets> - <a-entity data-avatar={this.props.avatarId}> + <a-entity> <a-animation ref={anm => this.animation = anm} attribute="rotation" @@ -92,7 +93,7 @@ class AvatarSelector extends Component { easing="ease-out" to={`0 ${360 * this.getAvatarIndex() / this.props.avatars.length + 180} 0`}> </a-animation> - {avatarEntities} + {avatarEntities} </a-entity> <a-entity position="0 1.5 -5.6" rotation="-10 180 0" camera></a-entity> diff --git a/src/room.html b/src/room.html index 5f63358aa5e17651ee03d9978f098035e533b164..5fc6c309b438a3e7788abb92ff346bdb0ee42754 100644 --- a/src/room.html +++ b/src/room.html @@ -73,9 +73,9 @@ <a-progressive-asset id="botpinky" response-type="arraybuffer" - src="./assets/avatars/BotRobert_Avatar_Unlit.glb" - high-src="./assets/avatars/BotRobert_Avatar.glb" - low-src="./assets/avatars/BotRobert_Avatar_Unlit.glb" + src="./assets/avatars/BotPinky_Avatar_Unlit.glb" + high-src="./assets/avatars/BotPinky_Avatar.glb" + low-src="./assets/avatars/BotPinky_Avatar_Unlit.glb" ></a-progressive-asset> <a-progressive-asset id="botrobert" diff --git a/src/utils/identity.js b/src/utils/identity.js index 727be75580bae2701de1c8ae2c81315d60a635b5..118fe30812c1013cb64c47a335c24465a12f6636 100644 --- a/src/utils/identity.js +++ b/src/utils/identity.js @@ -1,4 +1,4 @@ -import { avatars } from "../assets/avatars/avatars.json"; +import { avatars } from "../assets/avatars/avatars.js"; const names = [ "albattani",