Skip to content
Snippets Groups Projects
Commit 2b7b51b3 authored by Greg Fodor's avatar Greg Fodor
Browse files

Add object scene

parent 3d27de4f
No related branches found
No related tags found
No related merge requests found
...@@ -72,3 +72,9 @@ AFRAME.GLTFModelPlus.registerComponent("nav-mesh", "nav-mesh", (el, _componentNa ...@@ -72,3 +72,9 @@ AFRAME.GLTFModelPlus.registerComponent("nav-mesh", "nav-mesh", (el, _componentNa
// nav-mesh-helper will query for it later. // nav-mesh-helper will query for it later.
el.setAttribute("nav-mesh"); el.setAttribute("nav-mesh");
}); });
AFRAME.GLTFModelPlus.registerComponent("networked", "networked", (el, componentName, componentData) => {
// Mark this to act as a "full sync" from the GLTF scene itself, to avoid taking ownership.
el.firstUpdateData = componentData;
el.setAttribute(componentName, componentData);
});
...@@ -458,7 +458,12 @@ ...@@ -458,7 +458,12 @@
nav-mesh-helper nav-mesh-helper
static-body="shape: none;" static-body="shape: none;"
> >
<a-entity id="environment-scene"/> <a-entity id="environment-scene"></a-entity>
</a-entity>
<!-- Objects -->
<a-entity id="objects-root">
<a-entity id="objects-scene"></a-entity>
</a-entity> </a-entity>
<a-entity <a-entity
......
...@@ -243,6 +243,12 @@ async function handleHubChannelJoined(entryManager, hubChannel, data) { ...@@ -243,6 +243,12 @@ async function handleHubChannelJoined(entryManager, hubChannel, data) {
console.log(`Scene URL: ${sceneUrl}`); console.log(`Scene URL: ${sceneUrl}`);
const environmentScene = document.querySelector("#environment-scene"); const environmentScene = document.querySelector("#environment-scene");
const objectsScene = document.querySelector("#objects-scene");
const objectsUrl =
"https://farspark-dev.reticulum.io/0/raw/0/0/0/0/aHR0cHM6Ly91cGxvYWRzLWRldi5yZXRpY3VsdW0uaW8vZmlsZXMvMDAxODQ0NmEtY2NjMi00ODczLTkwMDItM2VkZmI4NzEzZTRmLmdsdGY_dG9rZW49MjVmOTVkMjhkODY1NzJhMjRhOTI4ZjJiNDExZTQ1YWE";
const objectsEl = document.createElement("a-entity");
objectsEl.setAttribute("gltf-model-plus", { src: objectsUrl, useCache: false, inflate: true });
objectsScene.appendChild(objectsEl);
if (glbAsset || hasExtension) { if (glbAsset || hasExtension) {
const gltfEl = document.createElement("a-entity"); const gltfEl = document.createElement("a-entity");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment