diff --git a/src/core/BufferGeometry.js b/src/core/BufferGeometry.js index b5984e1f8fe6983f8708d5f0bbc255b19903ea08..4f6a341f89208124d61df741600e6e12a733f954 100644 --- a/src/core/BufferGeometry.js +++ b/src/core/BufferGeometry.js @@ -1122,8 +1122,7 @@ THREE.BufferGeometry.prototype = { clone: function () { - var geometry = new THREE.BufferGeometry(); - return geometry.copy( this ); + return new THREE.BufferGeometry().copy( this ); }, diff --git a/src/core/Geometry.js b/src/core/Geometry.js index 994483909e8e7b8d9aec82000757b5286fb503c4..92170ef540a1dcfbadb7d2f44879aebb6c7da12a 100644 --- a/src/core/Geometry.js +++ b/src/core/Geometry.js @@ -1052,8 +1052,7 @@ THREE.Geometry.prototype = { clone: function () { - var geometry = new THREE.Geometry(); - return geometry.copy( this ); + return new THREE.Geometry().copy( this ); }, diff --git a/src/core/Object3D.js b/src/core/Object3D.js index 9c64645ce59474ac7a32f52934d4bf70207e7840..67a7d33ad9d7f286aa5fe27a33a15932d51d0b5d 100644 --- a/src/core/Object3D.js +++ b/src/core/Object3D.js @@ -669,8 +669,7 @@ THREE.Object3D.prototype = { clone: function ( recursive ) { - var object = new THREE.Object3D(); - return object.copy( this, recursive ); + return new THREE.Object3D().copy( this, recursive ); }, diff --git a/src/materials/Material.js b/src/materials/Material.js index 58b41a0b12a8a4949664a29c993ed82262b955cc..9414bf83d31e797bf639bb03bef4a9ac2d9acd1b 100644 --- a/src/materials/Material.js +++ b/src/materials/Material.js @@ -169,8 +169,7 @@ THREE.Material.prototype = { clone: function () { - var material = new THREE.Material(); - return material.copy( this ); + return new THREE.Material().copy( this ); }, diff --git a/src/materials/MeshPhongMaterial.js b/src/materials/MeshPhongMaterial.js index efb3474f74b58ae61a76112e1be340581cc2ff53..6cf6320fb876d1a6ddcf16a8642824a32680d74e 100644 --- a/src/materials/MeshPhongMaterial.js +++ b/src/materials/MeshPhongMaterial.js @@ -169,7 +169,6 @@ THREE.MeshPhongMaterial.prototype.copy = function ( source ) { THREE.MeshPhongMaterial.prototype.clone = function () { - var material = new THREE.MeshPhongMaterial(); - return material.copy( this ); + return new THREE.MeshPhongMaterial().copy( this ); }; diff --git a/src/math/Color.js b/src/math/Color.js index 5b049c5059e846859bb829615bf0fa6b27681d74..dd2794649d54a8faaeebebcf508d6da1571e31f6 100644 --- a/src/math/Color.js +++ b/src/math/Color.js @@ -495,7 +495,7 @@ THREE.Color.prototype = { clone: function () { - return new THREE.Color().setRGB( this.r, this.g, this.b ); + return new THREE.Color().copy( this ); } diff --git a/src/textures/Texture.js b/src/textures/Texture.js index 6b86df3d030d131f2513cc301226c8d4b510ddf8..dd90195d4aefa0d194baffd4f4df6d13d8e2e095 100644 --- a/src/textures/Texture.js +++ b/src/textures/Texture.js @@ -57,8 +57,7 @@ THREE.Texture.prototype = { clone: function () { - var texture = new THREE.Texture(); - return texture.copy( this ); + return new THREE.Texture().copy( this ); },