OrbitEngine::Math namespace

Namespaces

namespace Color

Classes

template<typename T>
struct AABB
Axis-aligned bounding box.
template<typename T>
struct Bounds
2D AABB boundaries
struct Color3f
RGB Color (0-1)
struct Color4f
RGBA Color (0-1)
class ColorGradient
Color gradient.
template<typename T>
class Gradient
Linear gradient used for animations.
template<typename T>
class GradientStop
Value stop within a Gradient.
struct Mat4
4x4 matrix
struct Scissor
struct UV
Describes the uv coordinates of a single quad.
template<typename T>
struct Vec2
2-dimensional vector
template<typename T>
struct Vec3
3-dimensional vector
template<typename T>
struct Vec4
4-dimensional vector

Typedefs

using AABBf = AABB<float>
Float AABB.
using Vec2i = Vec2<int>
2-dimensional integer vector
using Vec2f = Vec2<float>
2-dimensional float vector
using Vec2d = Vec2<double>
2-dimensional double vector
using Vec3i = Vec3<int>
3-dimensional integer vector
using Vec3f = Vec3<float>
3-dimensional float vector
using Vec3d = Vec3<double>
3-dimensional double vector
using Vec4i = Vec4<int>
4-dimensional integer vector
using Vec4f = Vec4<float>
4-dimensional float vector
using Vec4d = Vec4<double>
4-dimensional double vector

Functions

auto deg2rad(double deg) -> double
Convert degrees to radians.
auto rad2deg(double rad) -> double
Convert radians to degrees.
auto nextPowerOfTwo(unsigned int x) -> unsigned int
Get the next power of two.
auto isPowerOfTwo(unsigned int x) -> bool
Check if a number is a power of two.
template<typename T>
auto approximatelyEqual(T a, T b, T epsilon) -> T
Check if two values are 'equal' by at most epsilon.
template<typename T>
auto lerp(T v0, T v1, float t) -> T
Linearly interpolates two elements.
template<typename T>
auto clamp(T input, T min_, T max_) -> T
Constrain a value between two others.
template<typename T>
auto minAngleDifference(T current, T target) -> T
template<typename T>
auto sign(T input) -> T
Extract the sign of the parameter.
template<typename A, typename B>
auto castMinMax(B in) -> A

Variables

const float DEFAULT_SCISSOR_EXTENT
static const UV UV_Default
Default UVs for 2D quads.

Typedef documentation

typedef AABB<float>OrbitEngine::Math::AABBf

Float AABB.

typedef Vec2<int>OrbitEngine::Math::Vec2i

2-dimensional integer vector

typedef Vec2<float>OrbitEngine::Math::Vec2f

2-dimensional float vector

typedef Vec2<double>OrbitEngine::Math::Vec2d

2-dimensional double vector

typedef Vec3<int>OrbitEngine::Math::Vec3i

3-dimensional integer vector

typedef Vec3<float>OrbitEngine::Math::Vec3f

3-dimensional float vector

typedef Vec3<double>OrbitEngine::Math::Vec3d

3-dimensional double vector

typedef Vec4<int>OrbitEngine::Math::Vec4i

4-dimensional integer vector

typedef Vec4<float>OrbitEngine::Math::Vec4f

4-dimensional float vector

typedef Vec4<double>OrbitEngine::Math::Vec4d

4-dimensional double vector

Function documentation

double OrbitEngine::Math::deg2rad(double deg)

Convert degrees to radians.

double OrbitEngine::Math::rad2deg(double rad)

Convert radians to degrees.

unsigned int OrbitEngine::Math::nextPowerOfTwo(unsigned int x)

Get the next power of two.

bool OrbitEngine::Math::isPowerOfTwo(unsigned int x)

Check if a number is a power of two.

template<typename T>
T OrbitEngine::Math::approximatelyEqual(T a, T b, T epsilon)

Check if two values are 'equal' by at most epsilon.

template<typename T>
T OrbitEngine::Math::lerp(T v0, T v1, float t)

Linearly interpolates two elements.

template<typename T>
T OrbitEngine::Math::clamp(T input, T min_, T max_)

Constrain a value between two others.

template<typename T>
T OrbitEngine::Math::minAngleDifference(T current, T target)

Returns the smallest difference between two angles

template<typename T>
T OrbitEngine::Math::sign(T input)

Extract the sign of the parameter.

template<typename A, typename B>
A OrbitEngine::Math::castMinMax(B in)

Variable documentation

const float OrbitEngine::Math::DEFAULT_SCISSOR_EXTENT

static const UV OrbitEngine::Math::UV_Default

Default UVs for 2D quads.