GA::kit v0.3
G&A's in-house C++ application framework
Loading...
Searching...
No Matches
math.h File Reference
#include "ga/defines.h"
#include "glm/glm.hpp"
#include "glm/gtx/matrix_decompose.hpp"
#include "glm/gtx/quaternion.hpp"
#include <algorithm>
#include <limits>

Go to the source code of this file.

Classes

struct  ga::Rect
 A 2D axis-aligned rectangle, with x,y (float) position and w,h (float) size components.
More...
 
struct  ga::Bounds3D
 A 3D axis-aligned bounding box. More...
 

Namespaces

namespace  ga
 
namespace  ga::math
 

Functions

template<typename T >
ga::toDegrees (const T &radians)
 
double ga::toDegrees (const double &radians)
 
template<typename T >
ga::toRadians (const T &degrees)
 
double ga::toRadians (const double &degrees)
 
template<typename T >
const T & ga::clamp (const T &val, const T &min, const T &max)
 Clamp a value between a minimum and a maximum.
 
template<typename T >
ga::map (const T &val, const T &inMin, const T &inMax, const T &outMin, const T &outMax, bool bClamp=false)
 Map a value from one range to another.
 
float ga::map (const float &val, const float &inMin, const float &inMax, const float &outMin, const float &outMax, bool bClamp=false)
 
template<typename T >
ga::lerp (const T &a, const T &b, const T &pct)
 
template<typename T >
ga::lerp (const T &a, const T &b, float pct)
 
float ga::lerp (float a, float b, float pct)
 
quat ga::lerp (const quat &a, const quat &b, float pct)
 
quat ga::slerp (const quat &a, const quat &b, float pct)
 
float ga::cubicBezier (float x, float x1, float y1, float x2, float y2)
 
template<typename T >
ga::interpolate (const T &a, const T &b, float pct, std::function< float(float)> easeFn, bool bClamp=false)
 

Variables

const double ga::math::pi = 4. * std::atan( 1. )
 
const double ga::math::halfPi = pi * .5
 
const double ga::math::radToDegFactor = 180. / math::pi
 
const double ga::math::degToRadFactor = math::pi / 180.