Leviathan  0.8.0.0
Leviathan game engine
Leviathan::Radian Class Reference

Represents an angle in radians. More...

#include <Types.h>

Public Member Functions

constexpr Radian ()
 
constexpr Radian (float rawvalue)
 
constexpr Radian (const Radian &other)
 
DLLEXPORT Radian (const Degree &degree)
 
DLLEXPORT operator Degree () const
 
DLLEXPORT Radianoperator= (const Degree &degrees)
 
Radianoperator= (const Radian &other)
 
bool operator> (const Radian &other)
 
bool operator< (const Radian &other)
 
bool operator== (const Radian &other)
 
constexpr float ValueInRadians () const noexcept
 
constexpr float ValueInDegrees () const noexcept
 

Protected Attributes

float Value
 

Detailed Description

Represents an angle in radians.

Definition at line 129 of file Types.h.

Constructor & Destructor Documentation

◆ Radian() [1/4]

constexpr Leviathan::Radian::Radian ( )
inline

Definition at line 131 of file Types.h.

131 : Value(0) {}

◆ Radian() [2/4]

constexpr Leviathan::Radian::Radian ( float  rawvalue)
inline

Definition at line 132 of file Types.h.

132 : Value(rawvalue) {}

◆ Radian() [3/4]

constexpr Leviathan::Radian::Radian ( const Radian other)
inline

Definition at line 133 of file Types.h.

133 : Value(other.Value) {}

◆ Radian() [4/4]

DLLEXPORT Leviathan::Radian::Radian ( const Degree degree)
explicit

Definition at line 168 of file Types.cpp.

168 : Value(degree.ValueInRadians()) {}

Member Function Documentation

◆ operator Degree()

DLLEXPORT Leviathan::Radian::operator Degree ( ) const

Definition at line 170 of file Types.cpp.

171 {
172  return Degree(*this);
173 }

◆ operator<()

bool Leviathan::Radian::operator< ( const Radian other)
inline

Definition at line 149 of file Types.h.

150  {
151  return Value < other.Value;
152  }

◆ operator=() [1/2]

DLLEXPORT Radian & Leviathan::Radian::operator= ( const Degree degrees)

Definition at line 175 of file Types.cpp.

176 {
177  Value = degrees.ValueInRadians();
178  return *this;
179 }

◆ operator=() [2/2]

Radian& Leviathan::Radian::operator= ( const Radian other)
inline

Definition at line 138 of file Types.h.

139  {
140  Value = other.Value;
141  return *this;
142  }

◆ operator==()

bool Leviathan::Radian::operator== ( const Radian other)
inline

Definition at line 154 of file Types.h.

155  {
156  return Value == other.Value;
157  }

◆ operator>()

bool Leviathan::Radian::operator> ( const Radian other)
inline

Definition at line 144 of file Types.h.

145  {
146  return Value > other.Value;
147  }

◆ ValueInDegrees()

constexpr float Leviathan::Radian::ValueInDegrees ( ) const
inlinenoexcept

Definition at line 164 of file Types.h.

165  {
166  return RADIANS_TO_DEGREES * Value;
167  }
constexpr float RADIANS_TO_DEGREES
Definition: Define.h:69

◆ ValueInRadians()

constexpr float Leviathan::Radian::ValueInRadians ( ) const
inlinenoexcept

Definition at line 159 of file Types.h.

160  {
161  return Value;
162  }

Member Data Documentation

◆ Value

float Leviathan::Radian::Value
protected

Definition at line 170 of file Types.h.


The documentation for this class was generated from the following files: