Leviathan  0.8.0.0
Leviathan game engine
Leviathan::Degree Class Reference

Represents an angle in degrees. More...

#include <Types.h>

Public Member Functions

constexpr Degree ()
 
constexpr Degree (float rawvalue)
 
constexpr Degree (const Degree &other)
 
DLLEXPORT Degree (const Radian &radians)
 
DLLEXPORT operator Radian () const
 
DLLEXPORT Degreeoperator= (const Radian &radians)
 
Degreeoperator= (const Degree &other)
 
constexpr float ValueInRadians () const noexcept
 
constexpr float ValueInDegrees () const noexcept
 

Protected Attributes

float Value
 

Detailed Description

Represents an angle in degrees.

Definition at line 174 of file Types.h.

Constructor & Destructor Documentation

◆ Degree() [1/4]

constexpr Leviathan::Degree::Degree ( )
inline

Definition at line 176 of file Types.h.

176 : Value(0) {}

◆ Degree() [2/4]

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

Definition at line 177 of file Types.h.

177 : Value(rawvalue) {}

◆ Degree() [3/4]

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

Definition at line 178 of file Types.h.

178 : Value(other.Value) {}

◆ Degree() [4/4]

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

Definition at line 182 of file Types.cpp.

182 : Value(radians.ValueInDegrees()) {}

Member Function Documentation

◆ operator Radian()

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

Definition at line 184 of file Types.cpp.

185 {
186  return Radian(*this);
187 }

◆ operator=() [1/2]

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

Definition at line 189 of file Types.cpp.

190 {
191  Value = radians.ValueInDegrees();
192  return *this;
193 }

◆ operator=() [2/2]

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

Definition at line 183 of file Types.h.

184  {
185  Value = other.Value;
186  return *this;
187  }

◆ ValueInDegrees()

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

Definition at line 194 of file Types.h.

195  {
196  return Value;
197  }

◆ ValueInRadians()

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

Definition at line 189 of file Types.h.

190  {
191  return DEGREES_TO_RADIANS * Value;
192  }
constexpr float DEGREES_TO_RADIANS
Definition: Define.h:68

Member Data Documentation

◆ Value

float Leviathan::Degree::Value
protected

Definition at line 200 of file Types.h.


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