Prechádzať zdrojové kódy

Simplify copy invocation

dubejf 10 rokov pred
rodič
commit
309ef4a729

+ 1 - 1
src/cameras/OrthographicCamera.js

@@ -40,7 +40,7 @@ THREE.OrthographicCamera.prototype.clone = function () {
 
 	var camera = new THREE.OrthographicCamera();
 
-	THREE.Camera.prototype.copy.call( camera, this );
+	camera.copy( this );
 
 	camera.zoom = this.zoom;
 

+ 1 - 1
src/cameras/PerspectiveCamera.js

@@ -126,7 +126,7 @@ THREE.PerspectiveCamera.prototype.clone = function () {
 
 	var camera = new THREE.PerspectiveCamera();
 
-	THREE.Camera.prototype.copy.call( camera, this );
+	camera.copy( this );
 
 	camera.zoom = this.zoom;
 

+ 1 - 1
src/extras/geometries/CircleBufferGeometry.js

@@ -77,7 +77,7 @@ THREE.CircleBufferGeometry.prototype.clone = function () {
 		this.parameters.thetaLength
 	);
 
-	THREE.BufferGeometry.prototype.copy.call( geometry, this );
+	geometry.copy( this );
 
 	return geometry;
 

+ 1 - 1
src/extras/geometries/DodecahedronGeometry.js

@@ -64,7 +64,7 @@ THREE.DodecahedronGeometry.prototype.clone = function () {
 		this.parameters.detail
 	);
 
-	THREE.PolyhedronGeometry.prototype.copy.call( geometry, this );
+	geometry.copy( this );
 
 	return geometry;
 

+ 1 - 1
src/extras/geometries/IcosahedronGeometry.js

@@ -39,7 +39,7 @@ THREE.IcosahedronGeometry.prototype.clone = function () {
 		this.parameters.detail
 	);
 
-	THREE.PolyhedronGeometry.prototype.copy.call( geometry, this );
+	geometry.copy( this );
 
 	return geometry;
 

+ 1 - 1
src/extras/geometries/OctahedronGeometry.js

@@ -32,7 +32,7 @@ THREE.OctahedronGeometry.prototype.clone = function () {
 		this.parameters.detail
 	);
 
-	THREE.PolyhedronGeometry.prototype.copy.call( geometry, this );
+	geometry.copy( this );
 
 	return geometry;
 

+ 1 - 1
src/extras/geometries/PlaneBufferGeometry.js

@@ -104,7 +104,7 @@ THREE.PlaneBufferGeometry.prototype.clone = function () {
 		this.parameters.heightSegments
 	);
 
-	THREE.BufferGeometry.prototype.copy.call( geometry, this );
+	geometry.copy( this );
 
 	return geometry;
 

+ 1 - 1
src/extras/geometries/SphereBufferGeometry.js

@@ -112,7 +112,7 @@ THREE.SphereBufferGeometry.prototype.clone = function () {
 		this.parameters.thetaLength
 	);
 
-	THREE.BufferGeometry.prototype.copy.call( geometry, this );
+	geometry.copy( this );
 
 	return geometry;
 

+ 1 - 1
src/extras/geometries/TetrahedronGeometry.js

@@ -33,7 +33,7 @@ THREE.TetrahedronGeometry.prototype.clone = function () {
 		this.parameters.detail
 	);
 
-	THREE.PolyhedronGeometry.prototype.copy.call( geometry, this );
+	geometry.copy( this );
 
 	return geometry;
 

+ 1 - 1
src/lights/AmbientLight.js

@@ -17,7 +17,7 @@ THREE.AmbientLight.prototype.clone = function () {
 
 	var light = new THREE.AmbientLight();
 
-	THREE.Light.prototype.copy.call( light, this );
+	light.copy( this );
 
 	return light;
 

+ 1 - 1
src/lights/AreaLight.js

@@ -31,7 +31,7 @@ THREE.AreaLight.prototype.clone = function () {
 
 	var light = new THREE.AreaLight();
 
-	THREE.Light.prototype.copy.call( light, this );
+	light.copy( this );
 
 	light.normal.copy(this.normal);
 	light.right.copy(this.right);

+ 1 - 1
src/lights/DirectionalLight.js

@@ -67,7 +67,7 @@ THREE.DirectionalLight.prototype.clone = function () {
 
 	var light = new THREE.DirectionalLight();
 
-	THREE.Light.prototype.copy.call( light, this );
+	light.copy( this );
 
 	light.target = this.target.clone();
 

+ 1 - 1
src/lights/HemisphereLight.js

@@ -22,7 +22,7 @@ THREE.HemisphereLight.prototype.clone = function () {
 
 	var light = new THREE.HemisphereLight();
 
-	THREE.Light.prototype.copy.call( light, this );
+	light.copy( this );
 
 	light.groundColor.copy( this.groundColor );
 	light.intensity = this.intensity;

+ 1 - 1
src/lights/PointLight.js

@@ -21,7 +21,7 @@ THREE.PointLight.prototype.clone = function () {
 
 	var light = new THREE.PointLight();
 
-	THREE.Light.prototype.copy.call( light, this );
+	light.copy( this );
 
 	light.intensity = this.intensity;
 	light.distance = this.distance;

+ 1 - 1
src/lights/SpotLight.js

@@ -50,7 +50,7 @@ THREE.SpotLight.prototype.clone = function () {
 
 	var light = new THREE.SpotLight();
 
-	THREE.Light.prototype.copy.call( light, this );
+	light.copy( this );
 
 	light.target = this.target.clone();
 

+ 1 - 1
src/materials/LineBasicMaterial.js

@@ -47,7 +47,7 @@ THREE.LineBasicMaterial.prototype.clone = function () {
 
 	var material = new THREE.LineBasicMaterial();
 
-	THREE.Material.prototype.copy.call( material, this );
+	material.copy( this );
 
 	material.color.copy( this.color );
 

+ 1 - 1
src/materials/LineDashedMaterial.js

@@ -50,7 +50,7 @@ THREE.LineDashedMaterial.prototype.clone = function () {
 
 	var material = new THREE.LineDashedMaterial();
 
-	THREE.Material.prototype.copy.call( material, this );
+	material.copy( this );
 
 	material.color.copy( this.color );
 

+ 1 - 1
src/materials/MeshBasicMaterial.js

@@ -83,7 +83,7 @@ THREE.MeshBasicMaterial.prototype.clone = function () {
 
 	var material = new THREE.MeshBasicMaterial();
 
-	THREE.Material.prototype.copy.call( material, this );
+	material.copy( this );
 
 	material.color.copy( this.color );
 

+ 1 - 1
src/materials/MeshDepthMaterial.js

@@ -35,7 +35,7 @@ THREE.MeshDepthMaterial.prototype.clone = function () {
 
 	var material = new THREE.MeshDepthMaterial();
 
-	THREE.Material.prototype.copy.call( material, this );
+	material.copy( this );
 
 	material.wireframe = this.wireframe;
 	material.wireframeLinewidth = this.wireframeLinewidth;

+ 1 - 1
src/materials/MeshLambertMaterial.js

@@ -82,7 +82,7 @@ THREE.MeshLambertMaterial.prototype.clone = function () {
 
 	var material = new THREE.MeshLambertMaterial();
 
-	THREE.Material.prototype.copy.call( material, this );
+	material.copy( this );
 
 	material.color.copy( this.color );
 	material.emissive.copy( this.emissive );

+ 1 - 1
src/materials/MeshNormalMaterial.js

@@ -36,7 +36,7 @@ THREE.MeshNormalMaterial.prototype.clone = function () {
 
 	var material = new THREE.MeshNormalMaterial();
 
-	THREE.Material.prototype.copy.call( material, this );
+	material.copy( this );
 
 	material.wireframe = this.wireframe;
 	material.wireframeLinewidth = this.wireframeLinewidth;

+ 1 - 1
src/materials/MeshPhongMaterial.js

@@ -116,7 +116,7 @@ THREE.MeshPhongMaterial.prototype.clone = function () {
 
 	var material = new THREE.MeshPhongMaterial();
 
-	THREE.Material.prototype.copy.call( material, this );
+	material.copy( this );
 
 	material.color.copy( this.color );
 	material.emissive.copy( this.emissive );

+ 1 - 1
src/materials/PointCloudMaterial.js

@@ -48,7 +48,7 @@ THREE.PointCloudMaterial.prototype.clone = function () {
 
 	var material = new THREE.PointCloudMaterial();
 
-	THREE.Material.prototype.copy.call( material, this );
+	material.copy( this );
 
 	material.color.copy( this.color );
 

+ 1 - 1
src/materials/RawShaderMaterial.js

@@ -17,7 +17,7 @@ THREE.RawShaderMaterial.prototype.clone = function () {
 
 	var material = new THREE.RawShaderMaterial();
 
-	THREE.ShaderMaterial.prototype.copy.call( material, this );
+	material.copy( this );
 
 	return material;
 

+ 1 - 1
src/materials/SpriteMaterial.js

@@ -43,7 +43,7 @@ THREE.SpriteMaterial.prototype.clone = function () {
 
 	var material = new THREE.SpriteMaterial();
 
-	THREE.Material.prototype.copy.call( material, this );
+	material.copy( this );
 
 	material.color.copy( this.color );
 	material.map = this.map;

+ 1 - 1
src/objects/LineSegments.js

@@ -17,7 +17,7 @@ THREE.LineSegments.prototype.clone = function () {
 
 	var line = new THREE.LineSegments( this.geometry, this.material );
 
-	THREE.Line.prototype.copy.call( line, this );
+	line.copy( this );
 
 	return line;
 

+ 1 - 1
src/textures/CompressedTexture.js

@@ -28,7 +28,7 @@ THREE.CompressedTexture.prototype.clone = function () {
 
 	var texture = new THREE.CompressedTexture();
 
-	THREE.Texture.prototype.copy.call( texture, this );
+	texture.copy( this );
 
 	return texture;
 

+ 1 - 1
src/textures/CubeTexture.js

@@ -20,7 +20,7 @@ THREE.CubeTexture.clone = function () {
 
 	var texture = new THREE.CubeTexture();
 
-	THREE.Texture.prototype.copy.call( texture, this );
+	texture.copy( this );
 
 	texture.images = this.images;
 

+ 1 - 1
src/textures/DataTexture.js

@@ -17,7 +17,7 @@ THREE.DataTexture.prototype.clone = function () {
 
 	var texture = new THREE.DataTexture();
 
-	THREE.Texture.prototype.copy.call( texture, this );
+	texture.copy( this );
 
 	return texture;