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 1296, Thu Jun 9 12:42:09 2011 UTC revision 1297, Thu Jun 9 12:44:43 2011 UTC
# Line 41  Line 41 
41      return vec3f(s, s, s) * v;      return vec3f(s, s, s) * v;
42  }  }
43    
44    STATIC_INLINE vec3f_t clamp3f (vec3f_t lo, vec3f_t hi, vec3f_t v)
45    {
46      // FIXME: there is probably a vectorized way to compute this
47        union3f_t a, b, c;
48        a.v = lo; b.v = hi; c.v = v;
49        return vec3f(
50            clampf(a.r[0], b.r[0], c.r[0]),
51            clampf(a.r[1], b.r[1], c.r[1]),
52            clampf(a.r[2], b.r[2], c.r[2]));
53    }
54    
55  STATIC_INLINE vec3f_t lerp3f (vec3f_t a, vec3f_t b, float t)  STATIC_INLINE vec3f_t lerp3f (vec3f_t a, vec3f_t b, float t)
56  {  {
57      return a + scale3f(t, b - a);      return a + scale3f(t, b - a);

Legend:
Removed from v.1296  
changed lines
  Added in v.1297

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