]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - libs/splines/math_angles.h
Merge commit '70f0925f0000a132c709b935aa5cb0942b5080d9' into master-merge
[xonotic/netradiant.git] / libs / splines / math_angles.h
index f356b56943555d5586116163e983d4ad3b4cb2ff..e1916ca74d47ee0f5c1da51543e0f48a37d971d7 100644 (file)
@@ -34,50 +34,49 @@ typedef idVec3 &vec3_p;
 
 class angles_t {
 public:
-float pitch;
-float yaw;
-float roll;
+       float pitch;
+       float yaw;
+       float roll;
 
-angles_t();
-angles_t( float pitch, float yaw, float roll );
-angles_t( const idVec3 &vec );
+       angles_t();
+       angles_t( float pitch, float yaw, float roll );
+       angles_t( const idVec3 &vec );
 
-friend void     toAngles( idVec3 &src, angles_t &dst );
-friend void     toAngles( quat_t &src, angles_t &dst );
-friend void     toAngles( mat3_t &src, angles_t &dst );
+       friend void     toAngles( idVec3 &src, angles_t &dst );
+       friend void     toAngles( quat_t &src, angles_t &dst );
+       friend void     toAngles( mat3_t &src, angles_t &dst );
 
-operator vec3_p();
+       operator vec3_p();
 
-float operator[]( int index ) const;
-float&          operator[]( int index );
+       float operator[]( int index ) const;
+       float&          operator[]( int index );
 
-void            set( float pitch, float yaw, float roll );
+       void            set( float pitch, float yaw, float roll );
 
-void operator=( angles_t const &a );
-void operator=( idVec3 const &a );
+       angles_t &operator=( angles_t const &a ) = default;
+       angles_t &operator=( idVec3 const &a );
 
-friend angles_t operator+( const angles_t &a, const angles_t &b );
-angles_t        &operator+=( angles_t const &a );
-angles_t        &operator+=( idVec3 const &a );
+       friend angles_t operator+( const angles_t &a, const angles_t &b );
+       angles_t        &operator+=( angles_t const &a );
+       angles_t        &operator+=( idVec3 const &a );
 
-friend angles_t operator-( angles_t &a, angles_t &b );
-angles_t        &operator-=( angles_t &a );
+       friend angles_t operator-( angles_t &a, angles_t &b );
+       angles_t        &operator-=( angles_t &a );
 
-friend angles_t operator*( const angles_t &a, float b );
-friend angles_t operator*( float a, const angles_t &b );
-angles_t        &operator*=( float a );
+       friend angles_t operator*( const angles_t &a, float b );
+       friend angles_t operator*( float a, const angles_t &b );
+       angles_t        &operator*=( float a );
 
-friend int operator==( angles_t &a, angles_t &b );
+       friend int operator==( angles_t &a, angles_t &b );
+       friend int operator!=( angles_t &a, angles_t &b );
 
-friend int operator!=( angles_t &a, angles_t &b );
+       void            toVectors( idVec3 *forward, idVec3 *right = NULL, idVec3 *up = NULL );
+       idVec3          toForward( void );
 
-void            toVectors( idVec3 *forward, idVec3 *right = NULL, idVec3 *up = NULL );
-idVec3          toForward( void );
+       angles_t        &Zero( void );
 
-angles_t        &Zero( void );
-
-angles_t        &Normalize360( void );
-angles_t        &Normalize180( void );
+       angles_t        &Normalize360( void );
+       angles_t        &Normalize180( void );
 };
 
 extern angles_t ang_zero;
@@ -116,16 +115,11 @@ inline void angles_t::set( float pitch, float yaw, float roll ) {
        this->roll  = roll;
 }
 
-inline void angles_t::operator=( angles_t const &a ) {
-       pitch   = a.pitch;
-       yaw     = a.yaw;
-       roll    = a.roll;
-}
-
-inline void angles_t::operator=( idVec3 const &a ) {
+inline angles_t &angles_t::operator=( idVec3 const &a ) {
        pitch   = a[ 0 ];
        yaw     = a[ 1 ];
        roll    = a[ 2 ];
+       return *this;
 }
 
 inline angles_t operator+( const angles_t &a, const angles_t &b ) {