Skip to content
Snippets Groups Projects
scene-shadow.js 514 B
Newer Older
/**
 * For use in environment gltf bundles to set scene shadow properties.
 * @namespace environment
 * @component scene-shadow
 */
AFRAME.registerComponent("scene-shadow", {
  schema: {
    type: {
      type: "string",
      default: "pcf"
    }
  },
  init() {
    this.originalShadowProperties = this.el.sceneEl.getAttribute("shadow");
  },
Robert Long's avatar
Robert Long committed
  update() {
    this.el.sceneEl.setAttribute("shadow", this.data);
  },
  remove() {
    this.el.sceneEl.setAttribute("shadow", this.originalShadowProperties);
  }
});