Browse Source

Helpers: Simplify copy() and clone().

Mugen87 5 years ago
parent
commit
4ea8c114bc
3 changed files with 2 additions and 34 deletions
  1. 0 6
      src/helpers/ArrowHelper.js
  2. 0 6
      src/helpers/BoxHelper.js
  3. 2 22
      src/helpers/GridHelper.js

+ 0 - 6
src/helpers/ArrowHelper.js

@@ -126,10 +126,4 @@ ArrowHelper.prototype.copy = function ( source ) {
 
 };
 
-ArrowHelper.prototype.clone = function () {
-
-	return new this.constructor().copy( this );
-
-};
-
 export { ArrowHelper };

+ 0 - 6
src/helpers/BoxHelper.js

@@ -110,10 +110,4 @@ BoxHelper.prototype.copy = function ( source ) {
 
 };
 
-BoxHelper.prototype.clone = function () {
-
-	return new this.constructor().copy( this );
-
-};
-
 export { BoxHelper };

+ 2 - 22
src/helpers/GridHelper.js

@@ -47,27 +47,7 @@ function GridHelper( size, divisions, color1, color2 ) {
 
 }
 
-GridHelper.prototype = Object.assign( Object.create( LineSegments.prototype ), {
-
-	constructor: GridHelper,
-
-	copy: function ( source ) {
-
-		LineSegments.prototype.copy.call( this, source );
-
-		this.geometry.copy( source.geometry );
-		this.material.copy( source.material );
-
-		return this;
-
-	},
-
-	clone: function () {
-
-		return new this.constructor().copy( this );
-
-	}
-
-} );
+GridHelper.prototype = Object.create( LineSegments.prototype );
+GridHelper.prototype.constructor = GridHelper;
 
 export { GridHelper };