Advertisement
mrpowhs

Untitled

Feb 9th, 2014
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1. /// KONSTRUKTOROK
  2. Vec3() {v[0]=0; v[1]=0; v[2]=0;}                                                // Default konstruktor
  3. Vec3(T x, T y=0, T z=0) {v[0]=x; v[1]=y; v[2]=z;}                               // Init konstruktor
  4. Vec3(const Vec3& other) {v[0]=other.v[0]; v[1]=other.v[1]; v[2]=other.v[2];}    // Copy konstruktor
  5.  
  6. // Inicializálás tömbbel (vagy init list C++11 esetében)
  7. Vec3(const T arr[]) {v[0]=arr[0]; v[1]=arr[1]; v[2]=arr[2];}
  8.  
  9. // Megjegyzés: memcpy(), memset() használata véleményem szerint itt annyira nem indokolt.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement