From e86d107aa8f5e77da061b5bc3fe30b500d02000f Mon Sep 17 00:00:00 2001 From: Noeri Huisman <8823461+mrxz@users.noreply.github.com> Date: Sun, 17 Dec 2023 18:25:20 +0100 Subject: [PATCH] Remove unneeded `crossOrigin` configuration for THREE loaders (#5416) Co-authored-by: Noeri Huisman --- src/lib/three.js | 19 ------------------- src/lib/three.module.js | 3 +-- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/src/lib/three.js b/src/lib/three.js index 504e8f5db23..1cd02bf22a9 100644 --- a/src/lib/three.js +++ b/src/lib/three.js @@ -1,27 +1,8 @@ var THREE = require('./three.module.js').default; -// Allow cross-origin images to be loaded. - -// This should not be on `THREE.Loader` nor `THREE.ImageUtils`. -// Must be on `THREE.TextureLoader`. -if (THREE.TextureLoader) { - THREE.TextureLoader.prototype.crossOrigin = 'anonymous'; -} - -// This is for images loaded from the model loaders. -if (THREE.ImageLoader) { - THREE.ImageLoader.prototype.crossOrigin = 'anonymous'; -} - // In-memory caching for XHRs (for images, audio files, textures, etc.). if (THREE.Cache) { THREE.Cache.enabled = true; } -THREE.DRACOLoader.prototype.crossOrigin = 'anonymous'; -THREE.GLTFLoader.prototype.crossOrigin = 'anonymous'; -THREE.KTX2Loader.prototype.crossOrigin = 'anonymous'; -THREE.MTLLoader.prototype.crossOrigin = 'anonymous'; -THREE.OBJLoader.prototype.crossOrigin = 'anonymous'; - module.exports = THREE; diff --git a/src/lib/three.module.js b/src/lib/three.module.js index 2e340523d36..2b495b39cc4 100644 --- a/src/lib/three.module.js +++ b/src/lib/three.module.js @@ -8,8 +8,7 @@ import { MTLLoader } from 'super-three/examples/jsm/loaders/MTLLoader'; import * as BufferGeometryUtils from 'super-three/examples/jsm/utils/BufferGeometryUtils'; import { LightProbeGenerator } from 'super-three/examples/jsm/lights/LightProbeGenerator'; -var objectAssign = require('object-assign'); -var THREE = window.THREE = objectAssign({}, SUPER_THREE); +var THREE = window.THREE = SUPER_THREE; // TODO: Eventually include these only if they are needed by a component. require('../../vendor/DeviceOrientationControls'); // THREE.DeviceOrientationControls