浏览代码

Cleanup patch

- Parameterized geometry (e.g. BoxGeometry) should not clone the base
properties of Geometry.
- CubeTexture: Clone is parameterless.
dubejf 10 年之前
父节点
当前提交
4278ba2f19

+ 0 - 2
src/extras/geometries/BoxGeometry.js

@@ -135,8 +135,6 @@ THREE.BoxGeometry.prototype.clone = function () {
 		this.parameters.depthSegments
 	);
 
-	THREE.Geometry.prototype.cloneProperties.call( this, geometry );
-
 	return geometry;
 
 };

+ 0 - 2
src/extras/geometries/CircleGeometry.js

@@ -67,8 +67,6 @@ THREE.CircleGeometry.prototype.clone = function () {
 		this.parameters.thetaLength
 	);
 
-	THREE.Geometry.prototype.cloneProperties.call( this, geometry );
-
 	return geometry;
 
 };

+ 0 - 2
src/extras/geometries/CylinderGeometry.js

@@ -184,8 +184,6 @@ THREE.CylinderGeometry.prototype.clone = function () {
 		this.parameters.thetaLength
 	);
 
-	THREE.Geometry.prototype.cloneProperties.call( this, geometry );
-
 	return geometry;
 
 };

+ 0 - 2
src/extras/geometries/PlaneGeometry.js

@@ -32,8 +32,6 @@ THREE.PlaneGeometry.prototype.clone = function () {
 		this.parameters.heightSegments
 	);
 
-	THREE.Geometry.prototype.cloneProperties.call( this, geometry );
-
 	return geometry;
 
 };

+ 0 - 2
src/extras/geometries/RingGeometry.js

@@ -92,8 +92,6 @@ THREE.RingGeometry.prototype.clone = function () {
 		this.parameters.thetaLength
 	);
 
-	THREE.Geometry.prototype.cloneProperties.call( this, geometry );
-
 	return geometry;
 
 };

+ 0 - 2
src/extras/geometries/SphereGeometry.js

@@ -126,8 +126,6 @@ THREE.SphereGeometry.prototype.clone = function () {
 		this.parameters.thetaLength
 	);
 
-	THREE.Geometry.prototype.cloneProperties.call( this, geometry );
-
 	return geometry;
 
 };

+ 0 - 2
src/extras/geometries/TorusGeometry.js

@@ -88,8 +88,6 @@ THREE.TorusGeometry.prototype.clone = function () {
 		this.parameters.arc
 	);
 
-	THREE.Geometry.prototype.cloneProperties.call( this, geometry );
-
 	return geometry;
 
 };

+ 0 - 2
src/extras/geometries/TorusKnotGeometry.js

@@ -124,8 +124,6 @@ THREE.TorusKnotGeometry.prototype.clone = function () {
 		this.parameters.heightScale
 	);
 
-	THREE.Geometry.prototype.cloneProperties.call( this, geometry );
-
 	return geometry;
 
 };

+ 2 - 2
src/textures/CubeTexture.js

@@ -16,9 +16,9 @@ THREE.CubeTexture = function ( images, mapping, wrapS, wrapT, magFilter, minFilt
 THREE.CubeTexture.prototype = Object.create( THREE.Texture.prototype );
 THREE.CubeTexture.prototype.constructor = THREE.CubeTexture;
 
-THREE.CubeTexture.clone = function ( texture ) {
+THREE.CubeTexture.clone = function () {
 
-	if ( texture === undefined ) texture = new THREE.CubeTexture();
+	var texture = new THREE.CubeTexture();
 
 	THREE.Texture.prototype.cloneProperties.call( this, texture );