API Documentation
|
Stores an angle in an optimized format. More...
#include <Angle.h>
Public Member Functions | |
constexpr | Angle () |
constexpr | Angle (const Angle &angle) |
template<class t_other_type > | |
constexpr | Angle (const Angle< t_other_type > &angle) |
constexpr | Angle (AngleType type, fltp04 value) |
constexpr | Angle (AngleType type, fltp08 value) |
constexpr | Angle (t_type value) |
template<AngleType t_angle_type> | |
constexpr fltp08 | as () const |
constexpr fltp08 | as (AngleType type) const |
template<bool t_normalized> | |
constexpr t_type | internal () const |
template<class t_new_type > | |
constexpr Angle< t_new_type > | toTypeAngle () const |
constexpr Angle | normalized () const |
constexpr Angle | normalizedOffset () const |
constexpr Angle & | operator= (const Angle &angle) |
constexpr bool | operator== (const Angle &angle) const |
constexpr bool | operator!= (const Angle &angle) const |
Angle | operator- () const |
Static Public Member Functions | |
static Angle | acos (fltp04 value) |
static Angle | acos (fltp08 value) |
static Angle | asin (fltp04 value) |
static Angle | asin (fltp08 value) |
static Angle | atan (fltp04 value) |
static Angle | atan (fltp08 value) |
static fltp08 | atan (Angle value) |
static Angle | atan2 (fltp04 value_a, fltp04 value_b) |
static Angle | atan2 (fltp08 value_a, fltp08 value_b) |
Static Public Attributes | |
static constexpr sint04 | INDEX_PI = 32768 |
static constexpr fltp08 | INV_INDEX_PI = { 1.0 / Angle<t_type>::INDEX_PI } |
Static Protected Member Functions | |
template<class t_normal_type > | |
static constexpr std::enable_if<!ObjectInfo< t_normal_type >::Float, t_normal_type >::type | NormalizeInternal (t_normal_type value) |
template<class t_normal_type > | |
static constexpr std::enable_if< ObjectInfo< t_normal_type >::Float, t_normal_type >::type | NormalizeInternal (t_normal_type value) |
Protected Attributes | |
t_type | m_index_angle |
Stores an angle in an optimized format.
Class: Angle
Since all angles are from 0-360 degrees it is possible to make certain optimizations that make use of defined overflow that traditional floating point angles would not be able to achieve. In addition space can be saved and expensive sin, cos, tan functions can be precomputed.
Author: Tyler Parke
|
inlineconstexpr |
|
inlineexplicitconstexpr |
Fn: explicit Angle::Angle(AngleType type, fltp04 value);
Constructor.
Author: Tyler Parke
Date: 2017-11-13
Parameters: type - The type of the angle given (Example: radians, degrees, percent)
Fn: explicit Angle::Angle(AngleType type, fltp08 value);
Constructor.
Author: Tyler Parke
Date: 2017-11-13
Parameters: type - The type of the angle given (Example: radians, degrees, percent)
|
inlineexplicitconstexpr |
Fn: static Angle Angle::acos(fltp04 value);
Acos the given value.
Author: Tyler Parke
Date: 2017-11-13
Parameters: value - The value.
|
inlinenodiscardconstexpr |
Fn: template<AngleType, bool t_is_signed> fltp04 Angle::as() const;
Returns a form of this angle as a given type (Radian, Degree, Percent, etc)
Author: Tyler Parke
Date: 2017-11-13
Typeparams: t_type - The type of the angle to return (Example: radians, degrees, percent) t_is_signed - Whether the given type should be signed or not (-180 - 180 vs 0 to 360)
Fn: template<bool t_is_signed> fltp04 Angle::as(AngleType type) const;
Returns a form of this angle as a given type (Radian, Degree, Percent, etc)
Author: Tyler Parke
Date: 2017-11-13
Typeparams: t_is_signed - Whether the given type should be signed or not (-180 - 180 vs 0 to 360) Parameters: type - The type of the angle to return (Example: radians, degrees, percent).
Fn: static Angle Angle::asin(fltp04 value);
Gets the arc sin of a given value.
Author: Tyler Parke
Date: 2017-11-13
Parameters: value - The value.
|
inlinenodiscardconstexpr |
Fn: t_type Angle::internal() const
Gets the internal index angle.
Author: Tyler Parke
Date: 2017-11-13
Returns: The internal index angle, or the angle represented by 0 - Constant<t_type>::Max representing
|
inlinenodiscardconstexpr |
|
inlinenodiscardconstexpr |
|
inlinestaticconstexprprotected |
|
inlinestaticconstexprprotected |
|
inlineconstexpr |
Fn: bool Angle::operator!=(const Angle& value) const
Inequality operator.
Author: Tyler Parke
Date: 2017-11-13
Parameters: value - The value.
|
inline |
Fn: Angle Angle::operator-() const
Negation operator.
Author: Tyler Parke
Date: 2017-11-13
Fn: const Angle& Angle::operator=(const Angle& value)
Assignment operator.
Author: Tyler Parke
Date: 2017-11-13
Parameters: value - The value.
|
inlineconstexpr |
Fn: bool Angle::operator==(const Angle& value) const
Equality operator.
Author: Tyler Parke
Date: 2017-11-13
Parameters: value - The value.
|
inlineconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
protected |
The index angle.