3template <
typename Type>
4constexpr PL_ALWAYS_INLINE Type plAngle::Pi()
6 return static_cast<Type
>(3.1415926535897932384626433832795);
9template <
typename Type>
12 return Pi<Type>() / (Type)180;
15template <
typename Type>
18 return ((Type)180) / Pi<Type>();
21template <
typename Type>
27template <
typename Type>
64 return ((diff.m_fRadian >= -epsilon.m_fRadian) && (diff.m_fRadian <= epsilon.m_fRadian));
76constexpr PL_ALWAYS_INLINE
plAngle plAngle::operator-()
const
81PL_ALWAYS_INLINE
void plAngle::operator+=(
plAngle r)
83 m_fRadian += r.m_fRadian;
86PL_ALWAYS_INLINE
void plAngle::operator-=(
plAngle r)
88 m_fRadian -= r.m_fRadian;
93 return plAngle(m_fRadian + r.m_fRadian);
98 return plAngle(m_fRadian - r.m_fRadian);
101constexpr PL_ALWAYS_INLINE
bool plAngle::operator==(
const plAngle& r)
const
103 return m_fRadian == r.m_fRadian;
106constexpr PL_ALWAYS_INLINE
bool plAngle::operator!=(
const plAngle& r)
const
108 return m_fRadian != r.m_fRadian;
111constexpr PL_ALWAYS_INLINE
bool plAngle::operator<(
const plAngle& r)
const
113 return m_fRadian < r.m_fRadian;
116constexpr PL_ALWAYS_INLINE
bool plAngle::operator>(
const plAngle& r)
const
118 return m_fRadian > r.m_fRadian;
121constexpr PL_ALWAYS_INLINE
bool plAngle::operator<=(
const plAngle& r)
const
123 return m_fRadian <= r.m_fRadian;
126constexpr PL_ALWAYS_INLINE
bool plAngle::operator>=(
const plAngle& r)
const
128 return m_fRadian >= r.m_fRadian;
Float wrapper struct for a safe usage and conversions of angles.
Definition Angle.h:10
constexpr float GetDegree() const
Returns the degree value. (Performs a conversion)
Definition Angle_inl.h:43
constexpr plAngle()
Standard constructor, initializing with 0.
Definition Angle.h:40
plAngle GetNormalizedRange() const
Returns an equivalent angle with range between 0 degree - 360 degree.
Definition Angle_inl.h:53
bool IsEqualSimple(plAngle rhs, plAngle epsilon) const
Equality check with epsilon. Simple check without normalization. 360 degree will equal 0 degree,...
Definition Angle_inl.h:60
bool IsEqualNormalized(plAngle rhs, plAngle epsilon) const
Equality check with epsilon that uses normalized angles. Will recognize 720 degree == 0 degree.
Definition Angle_inl.h:67
static constexpr Type RadToDeg(Type f)
Converts an angle in radians to degree.
Definition Angle_inl.h:28
static constexpr plAngle MakeFromDegree(float fDegree)
Creates an instance of plAngle that was initialized from degree. (Performs a conversion)
Definition Angle_inl.h:33
void NormalizeRange()
Brings the angle into the range of 0 degree - 360 degree.
Definition Math.cpp:226
static constexpr plAngle MakeFromRadian(float fRadian)
Creates an instance of plAngle that was initialized from radian. (No need for any conversion)
Definition Angle_inl.h:38
static constexpr Type DegToRad(Type f)
Converts an angle in degree to radians.
Definition Angle_inl.h:22
static constexpr PL_ALWAYS_INLINE Type DegToRadMultiplier()
Returns the constant to multiply with an angle in degree to convert it to radians.
Definition Angle_inl.h:10
constexpr float GetRadian() const
Returns the radian value. (No need for any conversion)
Definition Angle_inl.h:48
static constexpr PL_ALWAYS_INLINE Type RadToDegMultiplier()
Returns the constant to multiply with an angle in degree to convert it to radians.
Definition Angle_inl.h:16
static constexpr plAngle AngleBetween(plAngle a, plAngle b)
Computes the smallest angle between the two given angles. The angle will always be a positive value.
Definition Math_inl.h:456