PeriDyno 1.0.0
Loading...
Searching...
No Matches
vgMath.h File Reference
#include "vgConfig.h"
#include <math.h>
#include <cmath>
#include <stdint.h>
Include dependency graph for vgMath.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  vgm::Vec2
 
class  vgm::Vec3
 
class  vgm::Vec4
 
class  vgm::Quat
 
class  vgm::Mat3
 
class  vgm::Mat4
 

Namespaces

namespace  vgm
 

Macros

#define VG_T_TYPE   float
 
#define VGM_NAMESPACE   vgm
 
#define TEMPLATE_TYPENAME_T
 
#define VEC2_T   Vec2
 
#define VEC3_T   Vec3
 
#define VEC4_T   Vec4
 
#define QUAT_T   Quat
 
#define MAT3_T   Mat3
 
#define MAT4_T   Mat4
 
#define VEC2_PRECISION   Vec2
 
#define VEC3_PRECISION   Vec3
 
#define VEC4_PRECISION   Vec4
 
#define QUAT_PRECISION   Quat
 
#define MAT3_PRECISION   Mat3
 
#define MAT4_PRECISION   Mat4
 
#define T_PI   vgm::pi()
 
#define T_INV_PI   vgm::one_over_pi()
 
#define T   VG_T_TYPE
 
#define M(X, Y)
 
#define M(X, Y)
 
#define M(X, Y)
 

Typedefs

using vec2 = vgm::Vec2
 
using vec3 = vgm::Vec3
 
using vec4 = vgm::Vec4
 
using quat = vgm::Quat
 
using mat3 = vgm::Mat3
 
using mat4 = vgm::Mat4
 
using mat3x3 = mat3
 
using mat4x4 = mat4
 
using tVec2 = vgm::VEC2_PRECISION
 
using tVec3 = vgm::VEC3_PRECISION
 
using tVec4 = vgm::VEC4_PRECISION
 
using tQuat = vgm::QUAT_PRECISION
 
using tMat3 = vgm::MAT3_PRECISION
 
using tMat4 = vgm::MAT4_PRECISION
 
using uint8 = uint8_t
 
using int8 = int8_t
 
using uint = uint32_t
 
using int32 = int32_t
 
using uint32 = uint32_t
 
using int64 = int64_t
 
using uint64 = uint64_t
 

Functions

TEMPLATE_TYPENAME_T MAT3_T vgm::mat3_cast (QUAT_T const &q)
 
TEMPLATE_TYPENAME_T MAT4_T vgm::mat4_cast (QUAT_T const &q)
 
float vgm::uintBitsToFloat (uint32_t const v)
 
uint32_t vgm::floatBitsToUint (float const v)
 
TEMPLATE_TYPENAME_T T vgm::dot (const VEC2_T &v0, const VEC2_T &v1)
 
TEMPLATE_TYPENAME_T T vgm::dot (const VEC3_T &v0, const VEC3_T &v1)
 
TEMPLATE_TYPENAME_T T vgm::dot (const VEC4_T &v0, const VEC4_T &v1)
 
TEMPLATE_TYPENAME_T T vgm::dot (const QUAT_T &q0, const QUAT_T &q1)
 
TEMPLATE_TYPENAME_T T vgm::cross (const VEC2_T &u, const VEC2_T &v)
 
TEMPLATE_TYPENAME_T VEC3_T vgm::cross (const VEC3_T &u, const VEC3_T &v)
 
TEMPLATE_TYPENAME_T T vgm::length (const VEC2_T &v)
 
TEMPLATE_TYPENAME_T T vgm::length (const VEC3_T &v)
 
TEMPLATE_TYPENAME_T T vgm::length (const VEC4_T &v)
 
TEMPLATE_TYPENAME_T T vgm::length (const QUAT_T &q)
 
TEMPLATE_TYPENAME_T T vgm::distance (const VEC2_T &v0, const VEC2_T &v1)
 
TEMPLATE_TYPENAME_T T vgm::distance (const VEC3_T &v0, const VEC3_T &v1)
 
TEMPLATE_TYPENAME_T T vgm::distance (const VEC4_T &v0, const VEC4_T &v1)
 
TEMPLATE_TYPENAME_T T vgm::tAbs (T x)
 
TEMPLATE_TYPENAME_T VEC2_T vgm::abs (const VEC2_T &v)
 
TEMPLATE_TYPENAME_T VEC3_T vgm::abs (const VEC3_T &v)
 
TEMPLATE_TYPENAME_T VEC4_T vgm::abs (const VEC4_T &v)
 
TEMPLATE_TYPENAME_T QUAT_T vgm::abs (const QUAT_T &q)
 
TEMPLATE_TYPENAME_T T vgm::sign (const T v)
 
TEMPLATE_TYPENAME_T VEC2_T vgm::normalize (const VEC2_T &v)
 
TEMPLATE_TYPENAME_T VEC3_T vgm::normalize (const VEC3_T &v)
 
TEMPLATE_TYPENAME_T VEC4_T vgm::normalize (const VEC4_T &v)
 
TEMPLATE_TYPENAME_T QUAT_T vgm::normalize (const QUAT_T &q)
 
TEMPLATE_TYPENAME_T T vgm::mix (const T x, const T y, const T a)
 
TEMPLATE_TYPENAME_T VEC2_T vgm::mix (const VEC2_T &x, const VEC2_T &y, const T a)
 
TEMPLATE_TYPENAME_T VEC3_T vgm::mix (const VEC3_T &x, const VEC3_T &y, const T a)
 
TEMPLATE_TYPENAME_T VEC4_T vgm::mix (const VEC4_T &x, const VEC4_T &y, const T a)
 
TEMPLATE_TYPENAME_T VEC2_T vgm::pow (const VEC2_T &b, const VEC2_T &e)
 
TEMPLATE_TYPENAME_T VEC3_T vgm::pow (const VEC3_T &b, const VEC3_T &e)
 
TEMPLATE_TYPENAME_T VEC4_T vgm::pow (const VEC4_T &b, const VEC4_T &e)
 
TEMPLATE_TYPENAME_T Tvgm::value_ptr (const VEC2_T &v)
 
TEMPLATE_TYPENAME_T Tvgm::value_ptr (const VEC3_T &v)
 
TEMPLATE_TYPENAME_T Tvgm::value_ptr (const VEC4_T &v)
 
TEMPLATE_TYPENAME_T Tvgm::value_ptr (const QUAT_T &q)
 
TEMPLATE_TYPENAME_T Tvgm::value_ptr (const MAT3_T &m)
 
TEMPLATE_TYPENAME_T Tvgm::value_ptr (const MAT4_T &m)
 
TEMPLATE_TYPENAME_T MAT3_T vgm::transpose (MAT3_T m)
 
TEMPLATE_TYPENAME_T MAT4_T vgm::transpose (MAT4_T m)
 
TEMPLATE_TYPENAME_T QUAT_T vgm::inverse (QUAT_T const &q)
 
TEMPLATE_TYPENAME_T MAT3_T vgm::inverse (MAT3_T const &m)
 
TEMPLATE_TYPENAME_T MAT4_T vgm::inverse (MAT4_T const &m)
 
TEMPLATE_TYPENAME_T VEC2_T vgm::operator* (const T s, const VEC2_T &v)
 
TEMPLATE_TYPENAME_T VEC3_T vgm::operator* (const T s, const VEC3_T &v)
 
TEMPLATE_TYPENAME_T VEC4_T vgm::operator* (const T s, const VEC4_T &v)
 
TEMPLATE_TYPENAME_T QUAT_T vgm::operator* (const T s, const QUAT_T &q)
 
TEMPLATE_TYPENAME_T VEC2_T vgm::operator/ (const T s, const VEC2_T &v)
 
TEMPLATE_TYPENAME_T VEC3_T vgm::operator/ (const T s, const VEC3_T &v)
 
TEMPLATE_TYPENAME_T VEC4_T vgm::operator/ (const T s, const VEC4_T &v)
 
TEMPLATE_TYPENAME_T QUAT_T vgm::operator/ (const T s, const QUAT_T &q)
 
TEMPLATE_TYPENAME_T VEC3_T vgm::operator* (const QUAT_T &q, const VEC3_T &v)
 
TEMPLATE_TYPENAME_T VEC3_T vgm::operator* (const VEC3_T &v, const QUAT_T &q)
 
TEMPLATE_TYPENAME_T MAT4_T vgm::translate (MAT4_T const &m, VEC3_T const &v)
 
TEMPLATE_TYPENAME_T MAT4_T vgm::scale (MAT4_T const &m, VEC3_T const &v)
 
TEMPLATE_TYPENAME_T QUAT_T vgm::angleAxis (T const &a, VEC3_T const &v)
 
TEMPLATE_TYPENAME_T T vgm::angle (QUAT_T const &q)
 
TEMPLATE_TYPENAME_T VEC3_T vgm::axis (QUAT_T const &q)
 
TEMPLATE_TYPENAME_T T vgm::radians (T d)
 
TEMPLATE_TYPENAME_T T vgm::degrees (T r)
 
TEMPLATE_TYPENAME_T T vgm::pi ()
 
TEMPLATE_TYPENAME_T T vgm::one_over_pi ()
 
TEMPLATE_TYPENAME_T MAT4_T vgm::lookAt (const VEC3_T &pov, const VEC3_T &tgt, const VEC3_T &up)
 
TEMPLATE_TYPENAME_T MAT4_T vgm::ortho (T l, T r, T b, T t, T n, T f)
 
TEMPLATE_TYPENAME_T MAT4_T vgm::perspective (T fovy, T a, T n, T f)
 
TEMPLATE_TYPENAME_T MAT4_T vgm::perspectiveFov (T fovy, T w, T h, T n, T f)
 
TEMPLATE_TYPENAME_T MAT4_T vgm::frustum (T l, T r, T b, T t, T n, T f)
 

Macro Definition Documentation

◆ M [1/3]

#define M ( X,
Y )
Value:
(m##X * m.m##Y)

Definition at line 291 of file vgMath.h.

◆ M [2/3]

#define M ( X,
Y )
Value:
(m##X * m.m##Y)

Definition at line 291 of file vgMath.h.

◆ M [3/3]

#define M ( X,
Y )
Value:
(m.m##X * m.m##Y)

Definition at line 291 of file vgMath.h.

◆ MAT3_PRECISION

#define MAT3_PRECISION   Mat3

Definition at line 92 of file vgMath.h.

◆ MAT3_T

#define MAT3_T   Mat3

Definition at line 85 of file vgMath.h.

◆ MAT4_PRECISION

#define MAT4_PRECISION   Mat4

Definition at line 93 of file vgMath.h.

◆ MAT4_T

#define MAT4_T   Mat4

Definition at line 86 of file vgMath.h.

◆ QUAT_PRECISION

#define QUAT_PRECISION   Quat

Definition at line 91 of file vgMath.h.

◆ QUAT_T

#define QUAT_T   Quat

Definition at line 84 of file vgMath.h.

◆ T

#define T   VG_T_TYPE

Definition at line 105 of file vgMath.h.

◆ T_INV_PI

#define T_INV_PI   vgm::one_over_pi()

Definition at line 96 of file vgMath.h.

◆ T_PI

#define T_PI   vgm::pi()

Definition at line 95 of file vgMath.h.

◆ TEMPLATE_TYPENAME_T

#define TEMPLATE_TYPENAME_T

Definition at line 79 of file vgMath.h.

◆ VEC2_PRECISION

#define VEC2_PRECISION   Vec2

Definition at line 88 of file vgMath.h.

◆ VEC2_T

#define VEC2_T   Vec2

Definition at line 81 of file vgMath.h.

◆ VEC3_PRECISION

#define VEC3_PRECISION   Vec3

Definition at line 89 of file vgMath.h.

◆ VEC3_T

#define VEC3_T   Vec3

Definition at line 82 of file vgMath.h.

◆ VEC4_PRECISION

#define VEC4_PRECISION   Vec4

Definition at line 90 of file vgMath.h.

◆ VEC4_T

#define VEC4_T   Vec4

Definition at line 83 of file vgMath.h.

◆ VG_T_TYPE

#define VG_T_TYPE   float

Definition at line 21 of file vgMath.h.

◆ VGM_NAMESPACE

#define VGM_NAMESPACE   vgm

Definition at line 56 of file vgMath.h.

Typedef Documentation

◆ int32

using int32 = int32_t

Definition at line 659 of file vgMath.h.

◆ int64

using int64 = int64_t

Definition at line 661 of file vgMath.h.

◆ int8

using int8 = int8_t

Definition at line 657 of file vgMath.h.

◆ mat3

using mat3 = vgm::Mat3

Definition at line 634 of file vgMath.h.

◆ mat3x3

using mat3x3 = mat3

Definition at line 636 of file vgMath.h.

◆ mat4

using mat4 = vgm::Mat4

Definition at line 635 of file vgMath.h.

◆ mat4x4

using mat4x4 = mat4

Definition at line 637 of file vgMath.h.

◆ quat

using quat = vgm::Quat

Definition at line 633 of file vgMath.h.

◆ tMat3

Definition at line 653 of file vgMath.h.

◆ tMat4

Definition at line 654 of file vgMath.h.

◆ tQuat

Definition at line 652 of file vgMath.h.

◆ tVec2

Definition at line 649 of file vgMath.h.

◆ tVec3

Definition at line 650 of file vgMath.h.

◆ tVec4

Definition at line 651 of file vgMath.h.

◆ uint

using uint = uint32_t

Definition at line 658 of file vgMath.h.

◆ uint32

using uint32 = uint32_t

Definition at line 660 of file vgMath.h.

◆ uint64

using uint64 = uint64_t

Definition at line 662 of file vgMath.h.

◆ uint8

using uint8 = uint8_t

Definition at line 656 of file vgMath.h.

◆ vec2

using vec2 = vgm::Vec2

Definition at line 630 of file vgMath.h.

◆ vec3

using vec3 = vgm::Vec3

Definition at line 631 of file vgMath.h.

◆ vec4

using vec4 = vgm::Vec4

Definition at line 632 of file vgMath.h.