/[libvob]/libvob/include/vob/Vec23.hxx
ViewVC logotype

Diff of /libvob/include/vob/Vec23.hxx

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

revision 1.9 by tjl, Mon Jun 2 18:18:41 2003 UTC revision 1.10 by tjl, Fri Jun 6 08:30:59 2003 UTC
# Line 64  namespace Vec23 { Line 64  namespace Vec23 {
64           */           */
65          Vector(T *v) : x(v[0]), y(v[1]) { }          Vector(T *v) : x(v[0]), y(v[1]) { }
66    
67            template<class F>
68                Vector &operator=(const Vector<F> &v) { x = v.x; y = v.y; return *this; }
69    
70            template<class F>
71                operator Vector<F>() const { return Vector<F>(x, y); }
72    
73          /** Making all components finite.          /** Making all components finite.
74           */           */
75          Vector finitized() const {          Vector finitized() const {
# Line 83  namespace Vec23 { Line 89  namespace Vec23 {
89    
90          /** Vector negation.          /** Vector negation.
91           */           */
92          Vector<T> operator-() { return Vector<T>(-x, -y); }          Vector<T> operator-() const { return Vector<T>(-x, -y); }
93          /** Vector addition.          /** Vector addition.
94           */           */
95          Vector operator+(const Vector<T>&v) const { return Vector(x+v.x, y+v.y); }          Vector operator+(const Vector<T>&v) const { return Vector(x+v.x, y+v.y); }
# Line 287  namespace Vec23 { Line 293  namespace Vec23 {
293       */       */
294      typedef Vector3<float> ZVec;      typedef Vector3<float> ZVec;
295    
296        /** Shorthand.
297         */
298        typedef Vector<double> PtD;
299        /** Shorthand.
300         */
301        typedef Vector3<double> ZPtD;
302        /** Shorthand.
303         */
304        typedef Vector<double> VecD;
305        /** Shorthand.
306         */
307        typedef Vector3<double> ZVecD;
308    
309    
310    
311      /** Linear interpolation.      /** Linear interpolation.
312       * Returns a + fract*(b-a)       * Returns a + fract*(b-a)
313       */       */
314      template<class X, class Y> inline X lerp(X a, Y b, double fract) {      template<class X> inline X lerp(X a, X b, double fract) {
315            return a + fract * (b-a);
316        }
317        inline float lerp(double a, double b, double fract) {
318          return a + fract * (b-a);          return a + fract * (b-a);
319      }      }
320    
# Line 383  using Vec23::ZPt; Line 407  using Vec23::ZPt;
407  using Vec23::ZVec;  using Vec23::ZVec;
408  using Vec23::Pt;  using Vec23::Pt;
409  using Vec23::Vec;  using Vec23::Vec;
410    using Vec23::ZPtD;
411    using Vec23::ZVecD;
412    using Vec23::PtD;
413    using Vec23::VecD;
414  using Vec23::lerp;  using Vec23::lerp;
415  using Vec23::dirVec;  using Vec23::dirVec;
416  }  }

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26