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

SCM Repository

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

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

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

revision 2417, Mon Aug 19 14:15:03 2013 UTC revision 2418, Tue Sep 3 15:10:19 2013 UTC
# Line 72  Line 72 
72      return vec3(FLOOR(u.r[0]), FLOOR(u.r[1]), FLOOR(u.r[2]));      return vec3(FLOOR(u.r[0]), FLOOR(u.r[1]), FLOOR(u.r[2]));
73  }  }
74    
 STATIC_INLINE Diderot_real_t dist3 (Diderot_vec3_t u, Diderot_vec3_t v)  
 {  
     Diderot_union3_t uv = __extension__ (Diderot_union3_t)((v-u) * (v-u));  
     return SQRT(uv.r[0] + uv.r[1] + uv.r[2]);  
 }  
   
75  STATIC_INLINE Diderot_ivec3_t truncToInt3 (Diderot_vec3_t v)  STATIC_INLINE Diderot_ivec3_t truncToInt3 (Diderot_vec3_t v)
76  {  {
77      Diderot_union3_t t;      Diderot_union3_t t;
# Line 95  Line 89 
89      return uv.r[0] + uv.r[1] + uv.r[2];      return uv.r[0] + uv.r[1] + uv.r[2];
90  }  }
91    
92    STATIC_INLINE Diderot_real_t lengthSq3 (Diderot_vec3_t v)
93    {
94        return dot3(v, v);
95    }
96    
97  STATIC_INLINE Diderot_real_t length3 (Diderot_vec3_t v)  STATIC_INLINE Diderot_real_t length3 (Diderot_vec3_t v)
98  {  {
99      return SQRT(dot3(v, v));      return SQRT(lengthSq3(v));
100    }
101    
102    STATIC_INLINE Diderot_real_t dist3 (Diderot_vec3_t u, Diderot_vec3_t v)
103    {
104        return length3(v-u);
105  }  }
106    
107  STATIC_INLINE Diderot_vec3_t normalize3 (Diderot_vec3_t v)  STATIC_INLINE Diderot_vec3_t normalize3 (Diderot_vec3_t v)

Legend:
Removed from v.2417  
changed lines
  Added in v.2418

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