From 1599fc575c3bb500ecf93921369746d9bd8a8724 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Wed, 23 Aug 2023 22:45:39 +0000 Subject: [PATCH] Deleted src/components/anisotropy.js --- src/components/anisotropy.js | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 src/components/anisotropy.js diff --git a/src/components/anisotropy.js b/src/components/anisotropy.js deleted file mode 100644 index 8cc288c96..000000000 --- a/src/components/anisotropy.js +++ /dev/null @@ -1,36 +0,0 @@ -/* global AFRAME */ - -AFRAME.registerComponent('anisotropy', { - schema: { default: 0 }, // default 0 will apply max anisotropy according to hardware - dependencies: ['material', 'geometry'], - init: function () { - this.maxAnisotropy = this.el.sceneEl.renderer.capabilities.getMaxAnisotropy(); - // console.log('this.maxAnisotropy', this.maxAnisotropy); - - ['model-loaded', 'materialtextureloaded'].forEach(evt => - this.el.addEventListener(evt, () => { - const mesh = this.el.getObject3D('mesh'); - // console.log('mesh', mesh); - - var anisotropyTargetValue = this.data; - anisotropyTargetValue = +anisotropyTargetValue || 0; // https://stackoverflow.com/questions/7540397/convert-nan-to-0-in-javascript - // console.log('anisotropyTargetValue', anisotropyTargetValue); - - if (anisotropyTargetValue === 0) { - anisotropyTargetValue = this.maxAnisotropy; - // console.log('anisotropyTargetValue', anisotropyTargetValue); - } - - mesh.traverse((object) => { - if (object.isMesh === true && object.material.map !== null) { - // console.log('object', object); - // console.log('object.material.map.anisotropy', object.material.map.anisotropy); - object.material.map.anisotropy = anisotropyTargetValue; - // console.log('object.material.map.anisotropy', object.material.map.anisotropy); - object.material.map.needsUpdate = true; - } - }); - }, false) - ); - } -});