Mr.doob 10 yıl önce
ebeveyn
işleme
5d2ae4bce6
2 değiştirilmiş dosya ile 15 ekleme ve 18 silme
  1. 7 8
      src/objects/LensFlare.js
  2. 8 10
      src/objects/Skeleton.js

+ 7 - 8
src/objects/LensFlare.js

@@ -83,17 +83,16 @@ THREE.LensFlare.prototype.clone = function ( object ) {
 	if ( object === undefined ) object = new THREE.LensFlare();
 
 	THREE.Object3D.prototype.clone.call( this, object );
-	
-	object.positionScreen.copy(this.positionScreen);
+
+	object.positionScreen.copy( this.positionScreen );
 	object.customUpdateCallback = this.customUpdateCallback;
-	
-	object.lensFlares = [];
-	
+
 	for ( var i = 0, l = this.lensFlares.length; i < l; i ++ ) {
-		
-		object.lensFlares.push(this.lensFlares[i]);			
+
+		object.lensFlares.push( this.lensFlares[ i ] );
+
 	}
 
 	return object;
 
-};
+};

+ 8 - 10
src/objects/Skeleton.js

@@ -20,16 +20,16 @@ THREE.Skeleton = function ( bones, boneInverses, useVertexTexture ) {
 	// create a bone texture or an array of floats
 
 	if ( this.useVertexTexture ) {
-		
+
 		// layout (1 matrix = 4 pixels)
 		//      RGBA RGBA RGBA RGBA (=> column1, column2, column3, column4)
 		//  with  8x8  pixel texture max   16 bones * 4 pixels =  (8 * 8)
 		//       16x16 pixel texture max   64 bones * 4 pixels = (16 * 16)
 		//       32x32 pixel texture max  256 bones * 4 pixels = (32 * 32)
 		//       64x64 pixel texture max 1024 bones * 4 pixels = (64 * 64)
-		
+
 		var size = THREE.Math.nextPowerOfTwo( Math.sqrt( this.bones.length * 4 ) ); // 4 pixels needed for 1 matrix
-		
+
 		this.boneTextureWidth = size;
 		this.boneTextureHeight = size;
 
@@ -144,7 +144,7 @@ THREE.Skeleton.prototype.pose = function () {
 THREE.Skeleton.prototype.update = ( function () {
 
 	var offsetMatrix = new THREE.Matrix4();
-	
+
 	return function () {
 
 		// flatten bone matrices to array
@@ -165,15 +165,13 @@ THREE.Skeleton.prototype.update = ( function () {
 			this.boneTexture.needsUpdate = true;
 
 		}
-		
+
 	};
 
 } )();
 
-THREE.Skeleton.prototype.clone = function ( ) {
+THREE.Skeleton.prototype.clone = function () {
 
-	var object = new THREE.Skeleton(this.bones, this.boneInverses, this.useVertexTexture);
-	
-	return object;
+	return new THREE.Skeleton( this.bones, this.boneInverses, this.useVertexTexture );
 
-};
+};