Browse Source

Merge remote branch 'remotes/astrodud/master'

alteredq 14 years ago
parent
commit
5665864605
1 changed files with 4 additions and 9 deletions
  1. 4 9
      src/objects/Object3D.js

+ 4 - 9
src/objects/Object3D.js

@@ -28,31 +28,26 @@ THREE.Object3D.prototype = {
 		var p = this.position, r = this.rotation, s = this.scale, m = this.tmpMatrix;
 		var p = this.position, r = this.rotation, s = this.scale, m = this.tmpMatrix;
 
 
 		this.matrix.setTranslation( p.x, p.y, p.z );
 		this.matrix.setTranslation( p.x, p.y, p.z );
-		this.rotationMatrix.identity();
 
 
-		if ( r.x != 0 ) {
-		       m.setRotX( r.x );
-		       this.matrix.multiplySelf( m );
-		       this.rotationMatrix.multiplySelf( m );
-		}
+		this.rotationMatrix.setRotX( r.x );
 
 
 		if ( r.y != 0 ) {
 		if ( r.y != 0 ) {
 		       m.setRotY( r.y );
 		       m.setRotY( r.y );
-		       this.matrix.multiplySelf( m );
 		       this.rotationMatrix.multiplySelf( m );
 		       this.rotationMatrix.multiplySelf( m );
 		}
 		}
 
 
 		if ( r.z != 0 ) {
 		if ( r.z != 0 ) {
 		       m.setRotZ( r.z );
 		       m.setRotZ( r.z );
-		       this.matrix.multiplySelf( m );
 		       this.rotationMatrix.multiplySelf( m );
 		       this.rotationMatrix.multiplySelf( m );
 		}
 		}
 
 
+		this.matrix.multiplySelf( this.rotationMatrix );
+
 		if ( s.x != 0 || s.y != 0 || s.z != 0 ) {
 		if ( s.x != 0 || s.y != 0 || s.z != 0 ) {
 		       m.setScale( s.x, s.y, s.z );
 		       m.setScale( s.x, s.y, s.z );
 		       this.matrix.multiplySelf( m );
 		       this.matrix.multiplySelf( m );
 		}
 		}
-
+		
 	}
 	}
 
 
 };
 };