// Copyright (C) 2017 Jérôme Leclercq // This file is part of the "Nazara Engine - Mathematics module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once #ifndef NAZARA_ANGLE_HPP #define NAZARA_ANGLE_HPP #include #include #include #include namespace Nz { struct SerializationContext; template class Angle { public: Angle() = default; Angle(T Angle); template> explicit Angle(const Angle& Angle) { Set(Angle); } template> explicit Angle(const Angle& Angle) { Set(Angle); } template explicit Angle(const Angle& Angle); Angle(const Angle&) = default; ~Angle() = default; Angle& MakeZero(); void Normalize(); template> Angle& Set(const Angle& Angle); template> Angle& Set(const Angle& Angle); Angle& Set(const Angle& Angle); template Angle& Set(const Angle& Angle); Angle ToDegrees() const; Angle ToRadians() const; String ToString() const; Angle& operator=(const Angle&) = default; Angle operator+(const Angle& Angle) const; Angle operator-(const Angle& Angle) const; Angle& operator+=(const Angle& Angle); Angle& operator-=(const Angle& Angle); Angle& operator*=(T scalar); Angle& operator/=(T divider); bool operator==(const Angle& Angle) const; bool operator!=(const Angle& Angle) const; static Angle Zero(); T angle; }; template using DegreeAngle = Angle; using DegreeAngled = DegreeAngle; using DegreeAnglef = DegreeAngle; template using RadianAngle = Angle; using RadianAngled = RadianAngle; using RadianAnglef = RadianAngle; template bool Serialize(SerializationContext& context, const Angle& angle, TypeTag>); template bool Unserialize(SerializationContext& context, Angle* angle, TypeTag>); } template Nz::Angle operator*(T scale, const Nz::Angle& angle); template Nz::Angle operator/(T divider, const Nz::Angle& angle); template std::ostream& operator<<(std::ostream& out, const Nz::Angle& angle); #include #endif // NAZARA_ANGLE_HPP