diff --git a/src/aentity-components.js b/src/aentity-components.js deleted file mode 100644 index b99ec501d4d483880e1a30fe59212332d9adbe92..0000000000000000000000000000000000000000 --- a/src/aentity-components.js +++ /dev/null @@ -1,3 +0,0 @@ -export default function registerComponents() { - AFRAME.AGLTFEntity.registerComponent("scale-audio-feedback", "scale-audio-feedback"); -} diff --git a/src/assets/avatars/BotDefault_Avatar_Unlit.glb b/src/assets/avatars/BotDefault_Avatar_Unlit.glb new file mode 100644 index 0000000000000000000000000000000000000000..ba33589d4c42fe6bf9756d5164f331e9830dab91 Binary files /dev/null and b/src/assets/avatars/BotDefault_Avatar_Unlit.glb differ diff --git a/src/assets/avatars/Bot_SkinnedWithAnim.glb b/src/assets/avatars/Bot_SkinnedWithAnim.glb deleted file mode 100644 index 8a35a19cc7be87c50aea6afe924e7bdef1b922cc..0000000000000000000000000000000000000000 Binary files a/src/assets/avatars/Bot_SkinnedWithAnim.glb and /dev/null differ diff --git a/src/assets/avatars/Bot_With_Components.json b/src/assets/avatars/Bot_With_Components.json deleted file mode 100644 index cdc4814bd2d5a51d83454ddcd4fefbdac4f14476..0000000000000000000000000000000000000000 --- a/src/assets/avatars/Bot_With_Components.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "components": { - "Head": { - "scale-audio-feedback": "" - } - } -} diff --git a/src/elements/a-gltf-entity.js b/src/elements/a-gltf-entity.js index c232c510ef383f36024473de92ef41e5b12564af..0a4bbe41e3c395bc72197323ca29057d12096e8e 100644 --- a/src/elements/a-gltf-entity.js +++ b/src/elements/a-gltf-entity.js @@ -1,7 +1,7 @@ const GLTFCache = {}; AFRAME.AGLTFEntity = { - defaultDeserializer(el, componentName, componentData) { + defaultInflator(el, componentName, componentData) { if (AFRAME.components[componentName].multiple && Array.isArray(componentData)) { for (let i = 0; i < componentData.length; i++) { el.setAttribute(componentName + "__" + i, componentData[i]); @@ -10,9 +10,9 @@ AFRAME.AGLTFEntity = { el.setAttribute(componentName, componentData); } }, - registerComponent(componentKey, componentName, deserializer) { + registerComponent(componentKey, componentName, inflator) { AFRAME.AGLTFEntity.components[componentKey] = { - deserializer: deserializer || AFRAME.AGLTFEntity.defaultDeserializer, + inflator: inflator || AFRAME.AGLTFEntity.defaultInflator, componentName }; }, @@ -102,15 +102,15 @@ const inflateEntities = function(classPrefix, parentEl, node) { el.setObject3D(node.type.toLowerCase(), node); - const entityComponents = node.userData; + const entityComponents = node.userData.components; if (entityComponents) { for (const prop in entityComponents) { if (entityComponents.hasOwnProperty(prop)) { - const { deserializer, componentName } = AFRAME.AGLTFEntity.components[prop]; + const { inflator, componentName } = AFRAME.AGLTFEntity.components[prop]; - if (deserializer) { - deserializer(el, componentName, entityComponents[prop]); + if (inflator) { + inflator(el, componentName, entityComponents[prop]); } } } diff --git a/src/gltf-component-mappings.js b/src/gltf-component-mappings.js new file mode 100644 index 0000000000000000000000000000000000000000..e73692a8ff9270985f3b533ff8bd1f8fdc0cb835 --- /dev/null +++ b/src/gltf-component-mappings.js @@ -0,0 +1,3 @@ +import "./elements/a-gltf-entity"; + +AFRAME.AGLTFEntity.registerComponent("scale-audio-feedback", "scale-audio-feedback"); diff --git a/src/room.html b/src/room.html index 944cfe9a4c7e94a40c466b95017105d45136d9d9..a372db51e7b146a31627bcaeddbe8e6a47d8006f 100644 --- a/src/room.html +++ b/src/room.html @@ -26,7 +26,7 @@ light="defaultLightsEnabled: false"> <a-assets> - <a-asset-item id="bot-skinned-mesh" response-type="arraybuffer" src="./assets/avatars/Bot_SkinnedWithAnim.glb"></a-asset-item> + <a-asset-item id="bot-skinned-mesh" response-type="arraybuffer" src="./assets/avatars/BotDefault_Avatar_Unlit.glb"></a-asset-item> <a-asset-item id="watch-model" response-type="arraybuffer" src="./assets/hud/watch.glb"></a-asset-item> <a-asset-item id="meeting-space1-mesh" response-type="arraybuffer" src="./assets/environments/MeetingSpace1_mesh.glb"></a-asset-item> diff --git a/src/room.js b/src/room.js index c9ef29a94148ab200535e57894268e41ca454030..b5ca383104fb212d53af4517a9a4e4cb1cd4a5ca 100644 --- a/src/room.js +++ b/src/room.js @@ -41,9 +41,7 @@ import "./components/spawn-controller"; import "./systems/personal-space-bubble"; -import registerComponents from "./aentity-components"; -import "./elements/a-gltf-entity"; -registerComponents(); +import "./gltf-component-mappings"; import { promptForName, getCookie, parseJwt } from "./utils/identity"; import registerNetworkSchemas from "./network-schemas";