| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
- //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
- #include "Math/BsRadian.h"
- #include "Math/BsMath.h"
- namespace bs
- {
- inline Radian::Radian (const Degree& d) : mRad(d.valueRadians())
- { }
- inline Radian Radian::wrap()
- {
- mRad = fmod(mRad, Math::TWO_PI);
- if (mRad < 0)
- mRad += Math::TWO_PI;
- return *this;
- }
- inline Radian& Radian::operator= (const Degree& d)
- {
- mRad = d.valueRadians();
- return *this;
- }
- inline Radian Radian::operator+ (const Degree& d) const
- {
- return Radian (mRad + d.valueRadians());
- }
- inline Radian& Radian::operator+= (const Degree& d)
- {
- mRad += d.valueRadians();
- return *this;
- }
- inline Radian Radian::operator- (const Degree& d) const
- {
- return Radian (mRad - d.valueRadians());
- }
- inline Radian& Radian::operator-= (const Degree& d)
- {
- mRad -= d.valueRadians();
- return *this;
- }
- float Radian::valueDegrees() const
- {
- return mRad * Math::RAD2DEG;
- }
- }
|