mirror of https://github.com/AxioDL/zeus.git
CRelAngle division ops
This commit is contained in:
parent
1bba8594d5
commit
8ccc52d3b1
|
@ -165,7 +165,7 @@ public:
|
||||||
*/
|
*/
|
||||||
static inline CQuaternion fromAxisAngle(const CUnitVector3f& axis, const CRelAngle& angle)
|
static inline CQuaternion fromAxisAngle(const CUnitVector3f& axis, const CRelAngle& angle)
|
||||||
{
|
{
|
||||||
return CQuaternion(std::cos(angle.asRadians() / 2.f), axis * std::sin(angle.asRadians() / 2.f));
|
return CQuaternion(std::cos(angle / 2.f), axis * std::sin(angle / 2.f));
|
||||||
}
|
}
|
||||||
|
|
||||||
void rotateX(const CRelAngle& angle) { *this *= fromAxisAngle({1.0f, 0.0f, 0.0f}, angle); }
|
void rotateX(const CRelAngle& angle) { *this *= fromAxisAngle({1.0f, 0.0f, 0.0f}, angle); }
|
||||||
|
|
|
@ -26,7 +26,7 @@ struct CRelAngle
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
operator float() { return angle; }
|
operator float() const { return angle; }
|
||||||
static CRelAngle FromRadians(float angle) { return CRelAngle(angle); }
|
static CRelAngle FromRadians(float angle) { return CRelAngle(angle); }
|
||||||
|
|
||||||
bool operator <(const CRelAngle& other) const { return angle < other.angle; }
|
bool operator <(const CRelAngle& other) const { return angle < other.angle; }
|
||||||
|
@ -34,6 +34,8 @@ struct CRelAngle
|
||||||
CRelAngle& operator +=(float r) { angle += r; return *this; }
|
CRelAngle& operator +=(float r) { angle += r; return *this; }
|
||||||
CRelAngle& operator *=(const CRelAngle& other) { angle *= other.angle; return *this; }
|
CRelAngle& operator *=(const CRelAngle& other) { angle *= other.angle; return *this; }
|
||||||
CRelAngle& operator *=(float r) { angle *= r; return *this;}
|
CRelAngle& operator *=(float r) { angle *= r; return *this;}
|
||||||
|
CRelAngle& operator /=(const CRelAngle& other) { angle /= other.angle; return *this;}
|
||||||
|
CRelAngle& operator /=(float r) { angle /= r; return *this;}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue