From 0f8681f46edfe35a24090250f8900b522dcf6441 Mon Sep 17 00:00:00 2001 From: Robert Long <robert@robertlong.me> Date: Fri, 31 Aug 2018 16:02:22 -0700 Subject: [PATCH] Fixed skybox, visible, and interactable components for spoke --- src/components/skybox.js | 2 ++ src/gltf-component-mappings.js | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/components/skybox.js b/src/components/skybox.js index e5f26b12f..08566b88c 100644 --- a/src/components/skybox.js +++ b/src/components/skybox.js @@ -271,6 +271,8 @@ AFRAME.registerComponent("skybox", { const z = distance * Math.sin(phi) * Math.cos(theta); uniforms.sunPosition.value.set(x, y, z).normalize(); + + this.sky.scale.set(distance, distance, distance); } }, diff --git a/src/gltf-component-mappings.js b/src/gltf-component-mappings.js index cb016f74a..71b9cbff5 100644 --- a/src/gltf-component-mappings.js +++ b/src/gltf-component-mappings.js @@ -4,6 +4,9 @@ AFRAME.GLTFModelPlus.registerComponent("quack", "quack"); AFRAME.GLTFModelPlus.registerComponent("sound", "sound"); AFRAME.GLTFModelPlus.registerComponent("collision-filter", "collision-filter"); AFRAME.GLTFModelPlus.registerComponent("css-class", "css-class"); +AFRAME.GLTFModelPlus.registerComponent("interactable", "css-class", (el, componentName) => { + el.setAttribute(componentName, "interactable"); +}); AFRAME.GLTFModelPlus.registerComponent("scene-shadow", "scene-shadow"); AFRAME.GLTFModelPlus.registerComponent("super-spawner", "super-spawner"); AFRAME.GLTFModelPlus.registerComponent("gltf-model-plus", "gltf-model-plus"); @@ -43,7 +46,13 @@ AFRAME.GLTFModelPlus.registerComponent( }; })() ); -AFRAME.GLTFModelPlus.registerComponent("visible", "visible"); +AFRAME.GLTFModelPlus.registerComponent("visible", "visible", (el, componentName, componentData) => { + if (typeof componentData === "object") { + el.setAttribute(componentName, componentData.visible); + } else { + el.setAttribute(componentName, componentData); + } +}); AFRAME.GLTFModelPlus.registerComponent("spawn-point", "spawn-point"); AFRAME.GLTFModelPlus.registerComponent("hoverable", "hoverable"); AFRAME.GLTFModelPlus.registerComponent("sticky-zone", "sticky-zone"); -- GitLab