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/diderot.h
ViewVC logotype

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

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

revision 587, Wed Mar 9 20:34:26 2011 UTC revision 588, Wed Mar 9 21:45:37 2011 UTC
# Line 162  Line 162 
162      return (a < b)? b : a;      return (a < b)? b : a;
163  }  }
164    
165    /********** 2-element vector functions **********/
166    
167    STATIC_INLINE vec2f_t vec2f (float a, float b)
168    {
169        return __extension__ (vec2f_t){ a, b };
170    }
171    
172    STATIC_INLINE float dot2f (vec2f_t u, vec2f_t v)
173    {
174        union2f_t uv = (union2f_t)(u*v);
175        return uv.r[0] + uv.r[1];
176    }
177    
178  /********** 3-element vector functions **********/  /********** 3-element vector functions **********/
179    
180    STATIC_INLINE vec3i_t vec3ftoi (vec3f_t v)
181    {
182        union4f_t u;
183        u.v = v;
184        return __extension__ (vec3i_t){ (int32_t)u.r[0], (int32_t)u.r[1], (int32_t)u.r[2], 0 };
185    }
186    
187    STATIC_INLINE vec3f_t vec3itof (vec3i_t v)
188    {
189        union4i_t u;
190        u.v = v;
191        return __extension__ (vec3f_t){ (float)u.i[0], (float)u.i[1], (float)u.i[2], 0 };
192    }
193    
194  STATIC_INLINE vec3f_t vec3f (float a, float b, float c)  STATIC_INLINE vec3f_t vec3f (float a, float b, float c)
195  {  {
196      return __extension__ (vec4f_t){ a, b, c, 0.0f };      return __extension__ (vec4f_t){ a, b, c, 0.0f };

Legend:
Removed from v.587  
changed lines
  Added in v.588

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