This reverts commit cfe9eaf39440c7b5289b9b4d81bdb03e94065f3c.
@@ -8,7 +8,7 @@ import { Object3D } from './Object3D.js';
import { Matrix4 } from '../math/Matrix4.js';
import { Matrix3 } from '../math/Matrix3.js';
import * as MathUtils from '../math/MathUtils.js';
-import { arrayNeedsUint32, deepClone } from '../utils.js';
+import { arrayNeedsUint32 } from '../utils.js';
let _id = 0;
@@ -1069,7 +1069,7 @@ class BufferGeometry extends EventDispatcher {
// user data
- this.userData = deepClone( source.userData );
+ this.userData = source.userData;
return this;
@@ -6,7 +6,6 @@ import { Euler } from '../math/Euler.js';
import { Layers } from './Layers.js';
-import { deepClone } from '../utils.js';
let _object3DId = 0;
@@ -946,7 +945,7 @@ class Object3D extends EventDispatcher {
this.frustumCulled = source.frustumCulled;
this.renderOrder = source.renderOrder;
+ this.userData = JSON.parse( JSON.stringify( source.userData ) );
if ( recursive === true ) {
@@ -1,7 +1,6 @@
import { EventDispatcher } from '../core/EventDispatcher.js';
import { FrontSide, NormalBlending, LessEqualDepth, AddEquation, OneMinusSrcAlphaFactor, SrcAlphaFactor, AlwaysStencilFunc, KeepStencilOp } from '../constants.js';
let materialId = 0;
@@ -474,7 +473,7 @@ class Material extends EventDispatcher {
this.toneMapped = source.toneMapped;
@@ -14,7 +14,6 @@ import * as MathUtils from '../math/MathUtils.js';
import { Vector2 } from '../math/Vector2.js';
import { Source } from './Source.js';
let textureId = 0;
@@ -139,7 +138,7 @@ class Texture extends EventDispatcher {
this.unpackAlignment = source.unpackAlignment;
this.encoding = source.encoding;
this.needsUpdate = true;
@@ -68,16 +68,4 @@ function createElementNS( name ) {
}
-function deepClone( value ) {
-
- if ( typeof structuredClone === 'function' ) {
- return structuredClone( value );
- }
- return JSON.parse( JSON.stringify( value ) );
-}
-export { arrayMin, arrayMax, arrayNeedsUint32, getTypedArray, createElementNS, deepClone };
+export { arrayMin, arrayMax, arrayNeedsUint32, getTypedArray, createElementNS };