@@ -185,24 +185,28 @@ THREE.Matrix4.prototype = {
185185			this . n11  *  this . n22  *  this . n33  *  this . n44  ) ; 
186186
187187	} , 
188- 	
189-   transpose : function  ( )  { 
190-     function  swap ( obj ,  p1 ,  p2 )  { 
191-       var  aux  =  obj [ p1 ] ; 
192-       obj [ p1 ]  =  obj [ p2 ] ; 
193-       obj [ p2 ]  =  aux ; 
194-     } 
195-     
196-     swap ( this ,  'n21' ,  'n12' ) ; 
197-     swap ( this ,  'n31' ,  'n13' ) ; 
198-     swap ( this ,  'n32' ,  'n23' ) ; 
199-     swap ( this ,  'n41' ,  'n14' ) ; 
200-     swap ( this ,  'n42' ,  'n24' ) ; 
201-     swap ( this ,  'n43' ,  'n34' ) ; 
202-     return  this ; 
203-     
204-   } , 
205-   
188+ 
189+ 	transpose : function  ( )  { 
190+ 
191+ 		function  swap (  obj ,  p1 ,  p2  )  { 
192+ 
193+ 			var  aux  =  obj [  p1  ] ; 
194+ 			obj [  p1  ]  =  obj [  p2  ] ; 
195+ 			obj [  p2  ]  =  aux ; 
196+ 
197+ 		} 
198+ 
199+ 		swap (  this ,  'n21' ,  'n12'  ) ; 
200+ 		swap (  this ,  'n31' ,  'n13'  ) ; 
201+ 		swap (  this ,  'n32' ,  'n23'  ) ; 
202+ 		swap (  this ,  'n41' ,  'n14'  ) ; 
203+ 		swap (  this ,  'n42' ,  'n24'  ) ; 
204+ 		swap (  this ,  'n43' ,  'n34'  ) ; 
205+ 
206+ 		return  this ; 
207+ 
208+ 	} , 
209+ 
206210	clone : function  ( )  { 
207211
208212		var  m  =  new  THREE . Matrix4 ( ) ; 
@@ -213,14 +217,14 @@ THREE.Matrix4.prototype = {
213217		return  m ; 
214218
215219	} , 
216- 	 
220+ 
217221	flatten : function ( )  { 
218222
219223	  return  [ this . n11 ,  this . n21 ,  this . n31 ,  this . n41 , 
220224	      this . n12 ,  this . n22 ,  this . n32 ,  this . n42 , 
221225	      this . n13 ,  this . n23 ,  this . n33 ,  this . n43 , 
222226	      this . n14 ,  this . n24 ,  this . n34 ,  this . n44 ] ; 
223- 	  
227+ 
224228	} , 
225229
226230	toString : function ( )  { 
@@ -296,25 +300,25 @@ THREE.Matrix4.rotationZMatrix = function ( theta ) {
296300
297301THREE . Matrix4 . rotationAxisAngleMatrix  =  function  (  axis ,  angle  )  { 
298302
299-    //Based on http://www.gamedev.net/reference/articles/article1199.asp 
300-    
301-    var  rot  =  new  THREE . Matrix4 ( ) ; 
302-    var   c  =  Math . cos (  angle  ) ; 
303-    var   s  =  Math . sin (  angle  ) ; 
304-    var   t  =  1  -  c ; 
305-    var   x  =  axis . x ,  y  =  axis . y ,  z  =  axis . z ; 
306- 
307-    rot . n11  =  t  *  x  *  x  +  c ; 
308-    rot . n12  =  t  *  x  *  y  -  s  *  z ; 
309-    rot . n13  =  t  *  x  *  z  +  s  *  y ; 
310-    rot . n21  =  t  *  x  *  y  +  s  *  z ; 
311-    rot . n22  =  t  *  y  *  y  +  c ; 
312-    rot . n23  =  t  *  y  *  z  -  s  *  x ; 
313-    rot . n31  =  t  *  x  *  z  -  s  *  y ; 
314-    rot . n32  =  t  *  y  *  z  +  s  *  x ; 
315-    rot . n33  =  t  *  z  *  z  +  c ; 
316- 
317-    return  rot ; 
303+ 	 //Based on http://www.gamedev.net/reference/articles/article1199.asp 
304+ 
305+ 	 var  rot  =  new  THREE . Matrix4 ( ) , 
306+ 	 c  =  Math . cos (  angle  ) , 
307+ 	 s  =  Math . sin (  angle  ) , 
308+ 	 t  =  1  -  c , 
309+ 	 x  =  axis . x ,  y  =  axis . y ,  z  =  axis . z ; 
310+ 
311+ 	 rot . n11  =  t  *  x  *  x  +  c ; 
312+ 	 rot . n12  =  t  *  x  *  y  -  s  *  z ; 
313+ 	 rot . n13  =  t  *  x  *  z  +  s  *  y ; 
314+ 	 rot . n21  =  t  *  x  *  y  +  s  *  z ; 
315+ 	 rot . n22  =  t  *  y  *  y  +  c ; 
316+ 	 rot . n23  =  t  *  y  *  z  -  s  *  x ; 
317+ 	 rot . n31  =  t  *  x  *  z  -  s  *  y ; 
318+ 	 rot . n32  =  t  *  y  *  z  +  s  *  x ; 
319+ 	 rot . n33  =  t  *  z  *  z  +  c ; 
320+ 
321+ 	 return  rot ; 
318322
319323} ; 
320324
0 commit comments