1#ifndef RAYLIB_CPP_INCLUDE_RADIANS_DEGREES_HPP_
2#define RAYLIB_CPP_INCLUDE_RADIANS_DEGREES_HPP_
5#include "./raylib-cpp-utils.hpp"
6#include "./raymath.hpp"
8#ifndef RAYLIB_CPP_NO_MATH
21 Radian(
const float radian) : value(radian) {}
28 operator float()
const {
return value; }
30 Radian operator+(
const Radian other)
const {
return value + other.value; }
31 Radian operator-(
const Radian other)
const {
return value - other.value; }
32 Radian operator*(
const Radian other)
const {
return value * other.value; }
33 Radian operator/(
const Radian other)
const {
return value / other.value; }
35 Radian& operator+=(
const Radian other) { *
this = *
this + other;
return *
this; }
36 Radian& operator-=(
const Radian other) { *
this = *
this - other;
return *
this; }
37 Radian& operator*=(
const Radian other) { *
this = *
this * other;
return *
this; }
38 Radian& operator/=(
const Radian other) { *
this = *
this / other;
return *
this; }
40 float DegreeValue()
const;
49 Degree(
float degree) : value(degree) {}
56 operator float()
const {
return value; }
58 Degree operator+(
const Degree other)
const {
return value + other.value; }
59 Degree operator-(
const Degree other)
const {
return value - other.value; }
60 Degree operator*(
const Degree other)
const {
return value * other.value; }
61 Degree operator/(
const Degree other)
const {
return value / other.value; }
63 Degree& operator+=(
const Degree other) { *
this = *
this + other;
return *
this; }
64 Degree& operator-=(
const Degree other) { *
this = *
this - other;
return *
this; }
65 Degree& operator*=(
const Degree other) { *
this = *
this * other;
return *
this; }
66 Degree& operator/=(
const Degree other) { *
this = *
this / other;
return *
this; }
68 float RadianValue()
const {
return Radian(*
this); }
71 inline Radian::Radian(
const Degree d) :
Radian(float(d) * DEG2RAD) {}
72 inline float Radian::DegreeValue()
const {
return Degree(*
this); }
Degree type (allows automatic worry free conversion between radians and degrees)
Radian type (allows automatic worry free conversion between radians and degrees)