Advertisement
mrpowhs

Untitled

Feb 9th, 2014
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. /// OSZTÁLYON BELÜLI IMPLEMENTÁCIÓ (jobb oldalról történő szorzás)
  2.  
  3. // Szorzás skalárral
  4.     inline void operator*= (const T& a)
  5.     {v[0]*=a; v[1]*=a; v[2]*=a;}
  6.     inline Vec3 operator* (const T& a) const
  7.     {return Vec3(v[0]*a, v[1]*a, v[2]*a);}
  8.  
  9.     // Osztás skalárral (a teljesség igényével)
  10.     inline void operator/= (const T& a)
  11.     {v[0]/=a; v[1]/=a; v[2]/=a;}
  12.     inline Vec3 operator/ (const T& a) const
  13.     {return Vec3(v[0]/a, v[1]/a, v[2]/a);}
  14.  
  15. /// OSZTÁLYON KÍVÜLI IMPLEMENTÁCIÓ (bal oldalról történő szorzás)
  16.  
  17. // Szorzás skalárral bal oldalról
  18. template <class T>
  19. inline Vec3<T> operator* (const T& a, const Vec3<T>& v)
  20. {return Vec3<T>(v[0]*a, v[1]*a, v[2]*a);}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement