u s i n g   S y s t e m ; 
 u s i n g   j p . n y a t l a . n y a r t o o l k i t . c s . c o r e ; 
 u s i n g   U n i t y E n g i n e ; 
 n a m e s p a c e   N y A R U n i t y U t i l s 
 { 
 	 p u b l i c   s t a t i c   c l a s s   N y A R U n i t y U t i l 
 	 { 
 	 	 / * * 
 	 	   *   N y A R T o o l K i t   2 . 5 3 NMRn0000h0Nc'`0c_0[00_00n00000$P0
 	 	   *   { @ l i n k   # t o C a m e r a F r u s t u m R H } n0i _ s c a l e k0-[Y00S0h0g00NMRn000000n0pe$P|h0Nc'`0Oa0~0Y00
 	 	   * / 
 	 	 p u b l i c   c o n s t   d o u b l e   S C A L E _ F A C T O R _ t o C a m e r a F r u s t u m R H _ N Y A R 2 = 1 . 0 ; 
 	 	 / * * 
 	 	   *   N y A R T o o l K i t   2 . 5 3 NMRn0000h0Nc'`0c_0[00_00n00000$P0
 	 	   *   { @ l i n k   # t o C a m e r a V i e w R H } n0i _ s c a l e k0-[Y00S0h0g00NMRn000000n0pe$P|h0Nc'`0Oa0~0Y00
 	 	   * / 
 	 	 p u b l i c   c o n s t   d o u b l e   S C A L E _ F A C T O R _ t o C a m e r a V i e w R H _ N Y A R 2 = 1 / 0 . 0 2 5 ; 
 	 
 	 
 	 	 / * * 
 	 	   *   S0n0peo00A R T o o l K i t 0000n000000000K000  C a m e r a F r u s t a m 0{W0~0Y00
 	 	   *   00000000n0 }n0F0a00P r o j e c t i o n M a t r i x bRn000OD0~0Y00
 	 	   *   @ p a r a m   i _ a r p a r a m 
 	 	   *   A R T o o l K i t 0000n0000000000
 	 	   *   @ p a r a m   i _ s c a l e 
 	 	   *   0000$P0c[W0~0Y001 = 1 m m g0Y001 0 j00p01 = 1 c m , 1 0 0 0 j00p01 = 1 m g0Y00
 	 	   *   2 . 5 3 NMRn0N y A R T o o l k i t h0Nc'`0c_0[00h0M0o00{ @ l i n k   # S C A L E _ F A C T O R _ t o C a m e r a F r u s t u m R H _ N Y A R 2 } 0c[W0f0O0`0U0D00
 	 	   *   @ p a r a m   i _ n e a r 
 	 	   *   SOn0n e a r P o i n t 0c[W0~0Y00XSMOo00i _ s c a l e k0-[W0_0$Pg0zl~00~0Y00
 	 	   *   @ p a r a m   i _ f a r 
 	 	   *   SOn0f a r P o i n t 0c[W0~0Y00XSMOo00i _ s c a l e k0-[W0_0$Pg0zl~00~0Y00
 	 	   *   @ p a r a m   o _ g l _ p r o j e c t i o n 
 	 	   *   O p e n G L 0000n0P r o j e c t i o n M a t r i x g0Y00d o u b l e [ 1 6 ] 0c[W0~0Y00
 	 	   * / 
 	 	 p u b l i c   s t a t i c   v o i d   t o C a m e r a F r u s t u m R H ( N y A R P a r a m   i _ a r p a r a m , d o u b l e   i _ s c a l e , d o u b l e   i _ n e a r , d o u b l e   i _ f a r , r e f   M a t r i x 4 x 4   o _ m a t ) 
 	 	 { 
 	 	 	 t o C a m e r a F r u s t u m R H ( i _ a r p a r a m . g e t P e r s p e c t i v e P r o j e c t i o n M a t r i x ( ) , i _ a r p a r a m . g e t S c r e e n S i z e ( ) , i _ s c a l e , i _ n e a r , i _ f a r , r e f   o _ m a t ) ; 
 	 	 	 r e t u r n ; 
 	 	 } 
 	 	 / * * 
 	 	   *   S0n0peo00A R T o o l K i t 0000n0P r o j e c t i o n M a t r i x K000  C a m e r a F r u s t a m 0{W0~0Y00
 	 	   *   @ p a r a m   i _ p r o m a t 
 	 	   *   @ p a r a m   i _ s i z e 
 	 	   *   000000000c[W0~0Y00
 	 	   *   @ p a r a m   i _ s c a l e 
 	 	   *   { @ l i n k   # t o C a m e r a F r u s t u m R H ( N y A R P a r a m   i _ a r p a r a m , d o u b l e   i _ s c a l e , d o u b l e   i _ n e a r , d o u b l e   i _ f a r , d o u b l e [ ]   o _ g l _ p r o j e c t i o n ) } 0Sgq0
 	 	   *   @ p a r a m   i _ n e a r 
 	 	   *   { @ l i n k   # t o C a m e r a F r u s t u m R H ( N y A R P a r a m   i _ a r p a r a m , d o u b l e   i _ s c a l e , d o u b l e   i _ n e a r , d o u b l e   i _ f a r , d o u b l e [ ]   o _ g l _ p r o j e c t i o n ) } 0Sgq0
 	 	   *   @ p a r a m   i _ f a r 
 	 	   *   { @ l i n k   # t o C a m e r a F r u s t u m R H ( N y A R P a r a m   i _ a r p a r a m , d o u b l e   i _ s c a l e , d o u b l e   i _ n e a r , d o u b l e   i _ f a r , d o u b l e [ ]   o _ g l _ p r o j e c t i o n ) } 0Sgq0
 	 	   *   @ p a r a m   o _ g l _ p r o j e c t i o n 
 	 	   *   { @ l i n k   # t o C a m e r a F r u s t u m R H ( N y A R P a r a m   i _ a r p a r a m , d o u b l e   i _ s c a l e , d o u b l e   i _ n e a r , d o u b l e   i _ f a r , d o u b l e [ ]   o _ g l _ p r o j e c t i o n ) } 0Sgq0
 	 	   * / 
 	 	 p u b l i c   s t a t i c   v o i d   t o C a m e r a F r u s t u m R H ( N y A R P e r s p e c t i v e P r o j e c t i o n M a t r i x   i _ p r o m a t , N y A R I n t S i z e   i _ s i z e , d o u b l e   i _ s c a l e , d o u b l e   i _ n e a r , d o u b l e   i _ f a r , r e f   M a t r i x 4 x 4   o _ m a t ) 
 	 	 { 
 	 	 	 N y A R D o u b l e M a t r i x 4 4   m = n e w   N y A R D o u b l e M a t r i x 4 4 ( ) ; 
 	 	 	 i _ p r o m a t . m a k e C a m e r a F r u s t u m R H ( i _ s i z e . w , i _ s i z e . h , i _ n e a r * i _ s c a l e , i _ f a r * i _ s c a l e , m ) ; 
 	 	 	 o _ m a t . m 0 0 = ( f l o a t ) m . m 0 0 ; 
 	 	 	 o _ m a t . m 0 1 = ( f l o a t ) m . m 0 1 ; 
 	 	 	 o _ m a t . m 0 2 = ( f l o a t ) m . m 0 2 ; 
 	 	 	 o _ m a t . m 0 3 = ( f l o a t ) m . m 0 3 ; 
 	 	 	 o _ m a t . m 1 0 = ( f l o a t ) m . m 1 0 ; 
 	 	 	 o _ m a t . m 1 1 = ( f l o a t ) m . m 1 1 ; 
 	 	 	 o _ m a t . m 1 2 = ( f l o a t ) m . m 1 2 ; 
 	 	 	 o _ m a t . m 1 3 = ( f l o a t ) m . m 1 3 ; 
 	 	 	 o _ m a t . m 2 0 = ( f l o a t ) m . m 2 0 ; 
 	 	 	 o _ m a t . m 2 1 = ( f l o a t ) m . m 2 1 ; 
 	 	 	 o _ m a t . m 2 2 = ( f l o a t ) m . m 2 2 ; 
 	 	 	 o _ m a t . m 2 3 = ( f l o a t ) m . m 2 3 ; 
 	 	 	 o _ m a t . m 3 0 = ( f l o a t ) m . m 3 0 ; 
 	 	 	 o _ m a t . m 3 1 = ( f l o a t ) m . m 3 1 ; 
 	 	 	 o _ m a t . m 3 2 = ( f l o a t ) m . m 3 2 ; 
 	 	 	 o _ m a t . m 3 3 = ( f l o a t ) m . m 3 3 ; 
 	 	 	 r e t u r n ; 
 	 	 } 
 	 	 p u b l i c   s t a t i c   v o i d   t o C a m e r a V i e w R H ( r e f   M a t r i x 4 x 4   m a t , d o u b l e   i _ s c a l e , r e f   M a t r i x 4 x 4   o _ m a t ) 
 	 	 { 
 	 	 	 o _ m a t . m 0 0     = ( f l o a t ) - m a t . m 0 0 ;   
 	 	 	 o _ m a t . m 0 1     = ( f l o a t ) m a t . m 0 1 ; 
 	 	 	 o _ m a t . m 0 2     = ( f l o a t ) m a t . m 0 2 ; 
 
 	 	 	 o _ m a t . m 1 0     = ( f l o a t ) m a t . m 1 0 ; 
 	 	 	 o _ m a t . m 1 1     = ( f l o a t ) - m a t . m 1 1 ; 
 	 	 	 o _ m a t . m 1 2     = ( f l o a t ) - m a t . m 1 2 ; 
 
 	 	 	 o _ m a t . m 2 0     = ( f l o a t ) - m a t . m 2 0 ; 	 	 	 
 	 	 	 o _ m a t . m 2 1     = ( f l o a t ) m a t . m 2 1 ; 	 	 	 
 	 	 	 o _ m a t . m 2 2     = ( f l o a t ) m a t . m 2 2 ; 
 	 	 	 
 	 	 	 o _ m a t . m 3 0     = ( f l o a t ) 0 . 0 ; 	 	 	 
 	 	 	 o _ m a t . m 3 1     = ( f l o a t ) 0 . 0 ; 
 	 	 	 o _ m a t . m 3 2     =   ( f l o a t ) 0 . 0 ; 	 	 
 	 	 	 d o u b l e   s c a l e = 1 / i _ s c a l e ; 
 	 	 	 o _ m a t . m 0 3   = ( f l o a t ) ( m a t . m 0 3 * s c a l e ) ; 
 	 	 	 o _ m a t . m 1 3   = - ( f l o a t ) ( m a t . m 1 3 * s c a l e ) ; 
 	 	 	 o _ m a t . m 2 3   = ( f l o a t ) ( m a t . m 2 3 * s c a l e ) ; 
 	 	 	 o _ m a t . m 3 3   =   ( f l o a t ) 1 . 0 ; 
 	 	 	 r e t u r n ; 
 	 	 } 	 	 
 	 	 / * * 
 	 	   *   S0n0peo00N y A R T r a n s M a t R e s u l t 0O p e n G L n0M o d e l V i e w LRx0	YcW0~0Y00
 	 	   *   @ p a r a m   m a t 
 	 	   *   	YcCQn0LR
 	 	   *   @ p a r a m   i _ s c a l e 
 	 	   *   ^j|n00000$P0c[W0~0Y001 = 1 m m g0Y001 0 j00p01 = 1 c m , 1 0 0 0 j00p01 = 1 m g0Y00
 	 	   *   2 . 5 3 NMRn0N y A R T o o l k i t h0Nc'`0c_0[00h0M0o00{ @ l i n k   # S C A L E _ F A C T O R _ t o C a m e r a V i e w R H _ N Y A R 2 } 0c[W0f0O0`0U0D00
 	 	   *   @ p a r a m   o _ g l _ r e s u l t 
 	 	   *   O p e n G L 0000n0P r o j e c t i o n M a t r i x g0Y00d o u b l e [ 1 6 ] 0c[W0~0Y00
 	 	   * / 
 
 	 	 p u b l i c   s t a t i c   v o i d   t o C a m e r a V i e w R H ( N y A R D o u b l e M a t r i x 4 4   m a t , d o u b l e   i _ s c a l e , r e f   M a t r i x 4 x 4   o _ m a t ) 
 	 	 { 
 	 	 	 o _ m a t . m 0 0     = ( f l o a t ) - m a t . m 0 0 ;   
 	 	 	 o _ m a t . m 0 1     = ( f l o a t ) m a t . m 0 1 ; 
 	 	 	 o _ m a t . m 0 2     = ( f l o a t ) m a t . m 0 2 ; 
 
 	 	 	 o _ m a t . m 1 0     = ( f l o a t ) m a t . m 1 0 ; 
 	 	 	 o _ m a t . m 1 1     = ( f l o a t ) - m a t . m 1 1 ; 
 	 	 	 o _ m a t . m 1 2     = ( f l o a t ) - m a t . m 1 2 ; 
 
 	 	 	 o _ m a t . m 2 0     = ( f l o a t ) - m a t . m 2 0 ; 	 	 	 
 	 	 	 o _ m a t . m 2 1     = ( f l o a t ) m a t . m 2 1 ; 	 	 	 
 	 	 	 o _ m a t . m 2 2     = ( f l o a t ) m a t . m 2 2 ; 
 	 	 	 
 	 	 	 o _ m a t . m 3 0     = ( f l o a t ) 0 . 0 ; 	 	 	 
 	 	 	 o _ m a t . m 3 1     = ( f l o a t ) 0 . 0 ; 
 	 	 	 o _ m a t . m 3 2     =   ( f l o a t ) 0 . 0 ; 	 	 
 	 	 	 d o u b l e   s c a l e = 1 / i _ s c a l e ; 
 	 	 	 o _ m a t . m 0 3   = ( f l o a t ) ( m a t . m 0 3 * s c a l e ) ; 
 	 	 	 o _ m a t . m 1 3   = - ( f l o a t ) ( m a t . m 1 3 * s c a l e ) ; 
 	 	 	 o _ m a t . m 2 3   = ( f l o a t ) ( m a t . m 2 3 * s c a l e ) ; 
 	 	 	 o _ m a t . m 3 3   =   ( f l o a t ) 1 . 0 ; 
 	 	 	 r e t u r n ; 
 	 	 } 
 	 	 p u b l i c   s t a t i c   v o i d   t o C a m e r a V i e w R H ( N y A R D o u b l e M a t r i x 4 4   m a t , d o u b l e   i _ s c a l e , r e f   N y A R D o u b l e M a t r i x 4 4   o _ m a t ) 
 	 	 { 
 	 	 	 o _ m a t . m 0 0     = ( f l o a t ) - m a t . m 0 0 ;   
 	 	 	 o _ m a t . m 0 1     = ( f l o a t ) m a t . m 0 1 ; 
 	 	 	 o _ m a t . m 0 2     = ( f l o a t ) m a t . m 0 2 ; 
 
 	 	 	 o _ m a t . m 1 0     = ( f l o a t ) m a t . m 1 0 ; 
 	 	 	 o _ m a t . m 1 1     = ( f l o a t ) - m a t . m 1 1 ; 
 	 	 	 o _ m a t . m 1 2     = ( f l o a t ) - m a t . m 1 2 ; 
 
 	 	 	 o _ m a t . m 2 0     = ( f l o a t ) - m a t . m 2 0 ; 	 	 	 
 	 	 	 o _ m a t . m 2 1     = ( f l o a t ) m a t . m 2 1 ; 	 	 	 
 	 	 	 o _ m a t . m 2 2     = ( f l o a t ) m a t . m 2 2 ; 
 	 	 	 
 	 	 	 o _ m a t . m 3 0     = ( f l o a t ) 0 . 0 ; 	 	 	 
 	 	 	 o _ m a t . m 3 1     = ( f l o a t ) 0 . 0 ; 
 	 	 	 o _ m a t . m 3 2     =   ( f l o a t ) 0 . 0 ; 	 	 
 	 	 	 d o u b l e   s c a l e = 1 / i _ s c a l e ; 
 	 	 	 o _ m a t . m 0 3   = ( f l o a t ) ( m a t . m 0 3 * s c a l e ) ; 
 	 	 	 o _ m a t . m 1 3   = - ( f l o a t ) ( m a t . m 1 3 * s c a l e ) ; 
 	 	 	 o _ m a t . m 2 3   = ( f l o a t ) ( m a t . m 2 3 * s c a l e ) ; 
 	 	 	 o _ m a t . m 3 3   =   ( f l o a t ) 1 . 0 ; 
 	 	 	 r e t u r n ; 
 	 	 } 	 	 
 	 	 p u b l i c   s t a t i c   v o i d   t o C a m e r a V i e w R H ( N y A R D o u b l e M a t r i x 4 4   m a t , d o u b l e   i _ s c a l e , r e f   V e c t o r 3   o _ p o s , r e f   Q u a t e r n i o n   o _ r o t ) 
 	 	 { 
 	 	 	 m a t 2 R o t ( 
 	 	 	 	 - m a t . m 0 0 , m a t . m 0 1 , m a t . m 0 2 , 
 	 	 	 	 m a t . m 1 0 , - m a t . m 1 1 , - m a t . m 1 2 , 
 	 	 	 	 - m a t . m 2 0 , m a t . m 2 1 , m a t . m 2 2 , 
 	 	 	 	 r e f   o _ r o t ) ; 	 	 	 
 	 	 	 d o u b l e   s c a l e = 1 / i _ s c a l e ; 
 	 	 	 o _ p o s . x   = ( f l o a t ) ( m a t . m 0 3 * s c a l e ) ; 
 	 	 	 o _ p o s . y   = - ( f l o a t ) ( m a t . m 1 3 * s c a l e ) ; 
 	 	 	 o _ p o s . z   = ( f l o a t ) ( m a t . m 2 3 * s c a l e ) ; 
 	 	 	 r e t u r n ; 
 	 	 } 
 	 	 p u b l i c   s t a t i c   v o i d   t o C a m e r a V i e w R H ( r e f   M a t r i x 4 x 4   m a t , d o u b l e   i _ s c a l e , r e f   V e c t o r 3   o _ p o s , r e f   Q u a t e r n i o n   o _ r o t ) 
 	 	 { 
 	 	 	 m a t 2 R o t ( 
 	 	 	 	 - m a t . m 0 0 , m a t . m 0 1 , m a t . m 0 2 , 
 	 	 	 	 m a t . m 1 0 , - m a t . m 1 1 , - m a t . m 1 2 , 
 	 	 	 	 - m a t . m 2 0 , m a t . m 2 1 , m a t . m 2 2 , 
 	 	 	 	 r e f   o _ r o t ) ; 	 	 	 
 	 	 	 d o u b l e   s c a l e = 1 / i _ s c a l e ; 
 	 	 	 o _ p o s . x   = ( f l o a t ) ( m a t . m 0 3 * s c a l e ) ; 
 	 	 	 o _ p o s . y   = - ( f l o a t ) ( m a t . m 1 3 * s c a l e ) ; 
 	 	 	 o _ p o s . z   = ( f l o a t ) ( m a t . m 2 3 * s c a l e ) ; 
 	 	 	 r e t u r n ; 
 	 	 } 	 	 
 	 	 / / /   < s u m m a r y > 
 	 	 / / /   LR0R o t a t i o n h0V e c t o r x0RW0~0Y00
 	 	 / / /   < / s u m m a r y > 
 	 	 / / /   < p a r a m   n a m e = ' m a t ' > 
 	 	 / / /   M a t . 
 	 	 / / /   < / p a r a m > 
 	 	 / / /   < p a r a m   n a m e = ' i _ s c a l e ' > 
 	 	 / / /   I _ s c a l e . 
 	 	 / / /   < / p a r a m > 
 	 	 / / /   < p a r a m   n a m e = ' o _ p o s ' > 
 	 	 / / /   O _ p o s . 
 	 	 / / /   < / p a r a m > 
 	 	 / / /   < p a r a m   n a m e = ' o _ r o t ' > 
 	 	 / / /   O _ r o t . 
 	 	 / / /   < / p a r a m > 
 	 	 p u b l i c   s t a t i c   v o i d   m a t 2 U n i t y V e c R o t ( N y A R D o u b l e M a t r i x 4 4   m a t , d o u b l e   i _ s c a l e , r e f   V e c t o r 3   o _ p o s , r e f   Q u a t e r n i o n   o _ r o t ) 
 	 	 { 
 	 	 	 m a t 2 R o t ( 
 	 	 	 	 m a t . m 0 0 , m a t . m 0 1 , m a t . m 0 2 , 
 	 	 	 	 m a t . m 1 0 , m a t . m 1 1 , m a t . m 1 2 , 
 	 	 	 	 m a t . m 2 0 , m a t . m 2 1 , m a t . m 2 2 , r e f   o _ r o t ) ; 
 	 	 	 d o u b l e   s c a l e = 1 / i _ s c a l e ; 
 	 	 	 o _ p o s . x   = ( f l o a t ) ( m a t . m 0 3 * s c a l e ) ; 
 	 	 	 o _ p o s . y   = ( f l o a t ) ( m a t . m 1 3 * s c a l e ) ; 
 	 	 	 o _ p o s . z   = ( f l o a t ) ( m a t . m 2 3 * s c a l e ) ; 
 	 	 	 r e t u r n ; 
 	 	 } 
 	 	 p u b l i c   s t a t i c   v o i d   m a t 2 U n i t y V e c R o t ( r e f   M a t r i x 4 x 4   m a t , d o u b l e   i _ s c a l e , r e f   V e c t o r 3   o _ p o s , r e f   Q u a t e r n i o n   o _ r o t ) 
 	 	 { 
 	 	 	 m a t 2 R o t ( 
 	 	 	 	 m a t . m 0 0 , m a t . m 0 1 , m a t . m 0 2 , 
 	 	 	 	 m a t . m 1 0 , m a t . m 1 1 , m a t . m 1 2 , 
 	 	 	 	 m a t . m 2 0 , m a t . m 2 1 , m a t . m 2 2 , r e f   o _ r o t ) ; 
 	 	 	 d o u b l e   s c a l e = 1 / i _ s c a l e ; 
 	 	 	 o _ p o s . x   = ( f l o a t ) ( m a t . m 0 3 * s c a l e ) ; 
 	 	 	 o _ p o s . y   = ( f l o a t ) ( m a t . m 1 3 * s c a l e ) ; 
 	 	 	 o _ p o s . z   = ( f l o a t ) ( m a t . m 2 3 * s c a l e ) ; 
 	 	 	 r e t u r n ; 	 	 	 
 	 	 } 
 	 	 p r i v a t e   s t a t i c   v o i d   m a t 2 R o t ( 
 	 	 	 d o u b l e   m 0 0 , d o u b l e   m 0 1 , d o u b l e   m 0 2 , 
 	 	 	 d o u b l e   m 1 0 , d o u b l e   m 1 1 , d o u b l e   m 1 2 , 
 	 	 	 d o u b l e   m 2 0 , d o u b l e   m 2 1 , d o u b l e   m 2 2 , 
 	 	 	 r e f   Q u a t e r n i o n   o _ r o t ) 
 	 	 { 
 	 	 	 / /    g'YbR0i"}
 	 	         d o u b l e   e l e m 0   =   m 0 0   -   m 1 1   -   m 2 2   +   1 . 0 f ; 
 	 	         d o u b l e   e l e m 1   =   - m 0 0   +   m 1 1   -   m 2 2   +   1 . 0 f ; 
 	 	         d o u b l e   e l e m 2   =   - m 0 0   -   m 1 1   +   m 2 2   +   1 . 0 f ; 
 	 	         d o u b l e   e l e m 3   =   m 0 0   +   m 1 1   +   m 2 2   +   1 . 0 f ; 
 	 	 	 i f ( e l e m 0 > e l e m 1   & &   e l e m 0 > e l e m 2   & &   e l e m 0 > e l e m 3 ) { 
 	 	 	         d o u b l e   v   =   M a t h . S q r t ( e l e m 0 )   *   0 . 5 f ; 
 	 	 	         d o u b l e   m u l t   =   0 . 2 5 f   /   v ; 
 	 	 	 	 o _ r o t . x   =   ( f l o a t ) v ; 
 	 	                 o _ r o t . y   =   ( f l o a t ) ( ( m 1 0   +   m 0 1 )   *   m u l t ) ; 
 	 	                 o _ r o t . z   =   ( f l o a t ) ( ( m 0 2   +   m 2 0 )   *   m u l t ) ; 
 	 	                 o _ r o t . w   =   ( f l o a t ) ( ( m 2 1   -   m 1 2 )   *   m u l t ) ; 
 	 	 	 } e l s e   i f ( e l e m 1 > e l e m 2   & &   e l e m 1 > e l e m 3 ) { 
 	 	 	         d o u b l e   v   =   M a t h . S q r t ( e l e m 1 )   *   0 . 5 f ; 
 	 	 	         d o u b l e   m u l t   =   0 . 2 5 f   /   v ; 
 	 	                 o _ r o t . x   =   ( f l o a t ) ( ( m 1 0   +   m 0 1 )   *   m u l t ) ; 
 	 	 	 	 o _ r o t . y   =   ( f l o a t ) ( v ) ; 
 	 	                 o _ r o t . z   =   ( f l o a t ) ( ( m 2 1   +   m 1 2 )   *   m u l t ) ; 
 	 	                 o _ r o t . w   =   ( f l o a t ) ( ( m 0 2   -   m 2 0 )   *   m u l t ) ; 
 	 	 	 } e l s e   i f ( e l e m 2 > e l e m 3 ) { 
 	 	 	         d o u b l e   v   =   M a t h . S q r t ( e l e m 2 )   *   0 . 5 f ; 
 	 	 	         d o u b l e   m u l t   =   0 . 2 5 f   /   v ; 
 	 	                 o _ r o t . x   = ( f l o a t ) ( ( m 0 2   +   m 2 0 )   *   m u l t ) ; 
 	 	                 o _ r o t . y   = ( f l o a t ) ( ( m 2 1   +   m 1 2 )   *   m u l t ) ; 
 	 	 	 	 o _ r o t . z   = ( f l o a t ) ( v ) ; 
 	 	                 o _ r o t . w   = ( f l o a t ) ( ( m 1 0   -   m 0 1 )   *   m u l t ) ; 
 	 	 	 } e l s e { 
 	 	 	         d o u b l e   v   =   M a t h . S q r t ( e l e m 3 )   *   0 . 5 f ; 
 	 	 	         d o u b l e   m u l t   =   0 . 2 5 f   /   v ; 
 	 	                 o _ r o t . x   = ( f l o a t ) ( ( m 2 1   -   m 1 2 )   *   m u l t ) ; 
 	 	                 o _ r o t . y   = ( f l o a t ) ( ( m 0 2   -   m 2 0 )   *   m u l t ) ; 
 	 	                 o _ r o t . z   = ( f l o a t ) ( ( m 1 0   -   m 0 1 )   *   m u l t ) ; 
 	 	 	 	 o _ r o t . w   = ( f l o a t ) v ; 
 	 	 	 } 	 	 	 
 	 	 } 
 	 	 	 
 	 } 
 } 
 
 