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

SCM Repository

[diderot] Diff of /trunk/src/include/Diderot/inline-vec2.h
ViewVC logotype

Diff of /trunk/src/include/Diderot/inline-vec2.h

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

revision 1294, Wed Jun 8 20:01:46 2011 UTC revision 1295, Thu Jun 9 06:42:54 2011 UTC
# Line 53  Line 53 
53      return vec2f(s, s) * v;      return vec2f(s, s) * v;
54  }  }
55    
56    STATIC_INLINE vec2f_t clamp2f (vec2f_t lo, vec2f_t hi, vec2f_t v)
57    {
58      // FIXME: there is probably a vectorized way to compute this
59        union2f_t a, b, c;
60        a.v = lo; b.v = hi; c.v = v;
61        return vec2f(
62            clampf(a.r[0], b.r[0], c.r[0]),
63            clampf(a.r[1], b.r[1], c.r[1]));
64    }
65    
66  STATIC_INLINE vec2f_t lerp2f (vec2f_t a, vec2f_t b, float t)  STATIC_INLINE vec2f_t lerp2f (vec2f_t a, vec2f_t b, float t)
67  {  {
68      return a + scale2f(t, b - a);      return a + scale2f(t, b - a);

Legend:
Removed from v.1294  
changed lines
  Added in v.1295

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