Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/pure-cfg/src/include/Diderot/inline-vec3.h
ViewVC logotype

Diff of /branches/pure-cfg/src/include/Diderot/inline-vec3.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 748, Wed Apr 6 21:43:07 2011 UTC revision 749, Wed Apr 6 21:43:31 2011 UTC
# Line 59  Line 59 
59          0 };          0 };
60  }  }
61    
 STATIC_INLINE vec3f_t cross3f (vec3f_t u, vec3f_t v)  
 {  
     union3f_t uu = (union3f_t)u;  
     union3f_t uv = (union3f_t)v;  
     return __extension__ (vec3f_t){  
         uu.r[1]*uv.r[2] - uu.r[2]*uv.r[1],  
         uu.r[2]*uv.r[0] - uu.r[0]*uv.r[2],  
         uu.r[0]*uv.r[1] - uu.r[1]*uv.r[0],  
         0 };  
 }  
   
62  STATIC_INLINE float dot3f (vec3f_t u, vec3f_t v)  STATIC_INLINE float dot3f (vec3f_t u, vec3f_t v)
63  {  {
64      union3f_t uv = __extension__ (union3f_t)(u*v);      union3f_t uv = __extension__ (union3f_t)(u*v);
# Line 81  Line 70 
70      return sqrtf(dot3f(v, v));      return sqrtf(dot3f(v, v));
71  }  }
72    
73    STATIC_INLINE vec3f_t normalize3f (vec3f_t v)
74    {
75        return scale3f(1.0 / length3f(v), v);
76    }
77    
78    STATIC_INLINE vec3f_t cross3f (vec3f_t u, vec3f_t v)
79    {
80        union3f_t uu = (union3f_t)u;
81        union3f_t uv = (union3f_t)v;
82        return __extension__ (vec3f_t){
83            uu.r[1]*uv.r[2] - uu.r[2]*uv.r[1],
84            uu.r[2]*uv.r[0] - uu.r[0]*uv.r[2],
85            uu.r[0]*uv.r[1] - uu.r[1]*uv.r[0],
86            0 };
87    }
88    
89  #endif /* !_DIDEROT_INLINE_VEC3_H_ */  #endif /* !_DIDEROT_INLINE_VEC3_H_ */

Legend:
Removed from v.748  
changed lines
  Added in v.749

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0