vector3d(T nx, T ny, T nz) : X(nx), Y(ny), Z(nz) {}\r
//! Constructor with the same value for all elements\r
explicit vector3d(T n) : X(n), Y(n), Z(n) {}\r
- //! Copy constructor\r
- vector3d(const vector3d<T>& other) : X(other.X), Y(other.Y), Z(other.Z) {}\r
\r
// operators\r
\r
vector3d<T> operator-() const { return vector3d<T>(-X, -Y, -Z); }\r
\r
- vector3d<T>& operator=(const vector3d<T>& other) { X = other.X; Y = other.Y; Z = other.Z; return *this; }\r
-\r
vector3d<T> operator+(const vector3d<T>& other) const { return vector3d<T>(X + other.X, Y + other.Y, Z + other.Z); }\r
vector3d<T>& operator+=(const vector3d<T>& other) { X+=other.X; Y+=other.Y; Z+=other.Z; return *this; }\r
vector3d<T> operator+(const T val) const { return vector3d<T>(X + val, Y + val, Z + val); }\r
\r
vector3d<T> operator/(const vector3d<T>& other) const { return vector3d<T>(X / other.X, Y / other.Y, Z / other.Z); }\r
vector3d<T>& operator/=(const vector3d<T>& other) { X/=other.X; Y/=other.Y; Z/=other.Z; return *this; }\r
- vector3d<T> operator/(const T v) const { T i=(T)1.0/v; return vector3d<T>(X * i, Y * i, Z * i); }\r
- vector3d<T>& operator/=(const T v) { T i=(T)1.0/v; X*=i; Y*=i; Z*=i; return *this; }\r
+ vector3d<T> operator/(const T v) const { return vector3d<T>(X/v, Y/v, Z/v); }\r
+ vector3d<T>& operator/=(const T v) { X/=v; Y/=v; Z/=v; return *this; }\r
\r
T& operator [](u32 index)\r
{\r