]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - libs/splines/math_vector.h
Merge commit 'c5a6237a2b002c9811719172931b0c9cc5a725f4' into master-merge
[xonotic/netradiant.git] / libs / splines / math_vector.h
index 4fbe8d9dc5820f8071af22b13308e98aaad0288b..328ca3fea610835d3f37eeca58c27658ef0cf098 100644 (file)
@@ -124,59 +124,60 @@ static inline double idSqrt( double x ) {
 class idVec3 {
 public:
 #ifndef FAT_VEC3
-float x,y,z;
+       float x,y,z;
 #else
-float x,y,z,dist;
+       float x,y,z,dist;
 #endif
 
 #ifndef FAT_VEC3
-idVec3() {};
+       idVec3() {};
 #else
-idVec3() {dist = 0.0f; };
+       idVec3() {dist = 0.0f; };
 #endif
-idVec3( const float x, const float y, const float z );
+       idVec3( const float x, const float y, const float z );
+       idVec3( const idVec3& ) = default;
 
-operator float *();
+       operator float *();
 
-float operator[]( const int index ) const;
-float           &operator[]( const int index );
+       float operator[]( const int index ) const;
+       float &operator[]( const int index );
 
-void            set( const float x, const float y, const float z );
+       void set( const float x, const float y, const float z );
 
-idVec3 operator-() const;
+       idVec3 operator-() const;
 
-idVec3          &operator=( const idVec3 &a );
+       idVec3 &operator=( const idVec3 &a ) = default;
 
-float operator*( const idVec3 &a ) const;
-idVec3 operator*( const float a ) const;
-friend idVec3 operator*( float a, idVec3 b );
+       float operator*( const idVec3 &a ) const;
+       idVec3 operator*( const float a ) const;
+       friend idVec3 operator*( float a, idVec3 b );
 
-idVec3 operator+( const idVec3 &a ) const;
-idVec3 operator-( const idVec3 &a ) const;
+       idVec3 operator+( const idVec3 &a ) const;
+       idVec3 operator-( const idVec3 &a ) const;
 
-idVec3          &operator+=( const idVec3 &a );
-idVec3          &operator-=( const idVec3 &a );
-idVec3          &operator*=( const float a );
+       idVec3 &operator+=( const idVec3 &a );
+       idVec3 &operator-=( const idVec3 &a );
+       idVec3 &operator*=( const float a );
 
-int operator==( const idVec3 &a ) const;
-int operator!=( const idVec3 &a ) const;
+       int operator==( const idVec3 &a ) const;
+       int operator!=( const idVec3 &a ) const;
 
-idVec3          Cross( const idVec3 &a ) const;
-idVec3          &Cross( const idVec3 &a, const idVec3 &b );
+       idVec3          Cross( const idVec3 &a ) const;
+       idVec3          &Cross( const idVec3 &a, const idVec3 &b );
 
-float           Length( void ) const;
-float           Normalize( void );
+       float           Length( void ) const;
+       float           Normalize( void );
 
-void            Zero( void );
-void            Snap( void );
-void            SnapTowards( const idVec3 &to );
+       void            Zero( void );
+       void            Snap( void );
+       void            SnapTowards( const idVec3 &to );
 
-float           toYaw( void );
-float           toPitch( void );
-angles_t        toAngles( void );
-friend idVec3   LerpVector( const idVec3 &w1, const idVec3 &w2, const float t );
+       float           toYaw( void );
+       float           toPitch( void );
+       angles_t        toAngles( void );
+       friend idVec3   LerpVector( const idVec3 &w1, const idVec3 &w2, const float t );
 
-char            *string( void );
+       char            *string( void );
 };
 
 extern idVec3 vec_zero;
@@ -206,14 +207,6 @@ ID_INLINE idVec3 idVec3::operator-() const {
        return idVec3( -x, -y, -z );
 }
 
-ID_INLINE idVec3 &idVec3::operator=( const idVec3 &a ) {
-       x = a.x;
-       y = a.y;
-       z = a.z;
-
-       return *this;
-}
-
 ID_INLINE void idVec3::set( const float x, const float y, const float z ) {
        this->x = x;
        this->y = y;