DDraceNetwork Docs
vmath.h File Reference
#include <cmath>
#include <cstdint>
#include "math.h"
Include dependency graph for vmath.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  vector2_base< T >
 
class  vector3_base< T >
 
class  vector4_base< T >
 

Typedefs

typedef vector2_base< float > vec2
 
typedef vector2_base< bool > bvec2
 
typedef vector2_base< int > ivec2
 
typedef vector3_base< float > vec3
 
typedef vector3_base< bool > bvec3
 
typedef vector3_base< int > ivec3
 
typedef vector4_base< float > vec4
 
typedef vector4_base< bool > bvec4
 
typedef vector4_base< int > ivec4
 
typedef vector4_base< uint8_t > ubvec4
 

Functions

template<typename T >
constexpr vector2_base< T > rotate (const vector2_base< T > &a, float angle)
 
template<typename T >
distance (const vector2_base< T > a, const vector2_base< T > &b)
 
template<typename T >
constexpr T dot (const vector2_base< T > a, const vector2_base< T > &b)
 
float length (const vector2_base< float > &a)
 
float length (const vector2_base< int > &a)
 
float length_squared (const vector2_base< float > &a)
 
constexpr float angle (const vector2_base< float > &a)
 
template<typename T >
constexpr vector2_base< T > normalize_pre_length (const vector2_base< T > &v, T len)
 
vector2_base< float > normalize (const vector2_base< float > &v)
 
vector2_base< float > direction (float angle)
 
vector2_base< float > random_direction ()
 
template<typename T >
constexpr bool closest_point_on_line (vector2_base< T > line_pointA, vector2_base< T > line_pointB, vector2_base< T > target_point, vector2_base< T > &out_pos)
 
template<typename T >
distance (const vector3_base< T > &a, const vector3_base< T > &b)
 
template<typename T >
constexpr T dot (const vector3_base< T > &a, const vector3_base< T > &b)
 
template<typename T >
constexpr vector3_base< T > cross (const vector3_base< T > &a, const vector3_base< T > &b)
 
float length (const vector3_base< float > &a)
 
vector3_base< float > normalize (const vector3_base< float > &v)
 

Typedef Documentation

◆ bvec2

typedef vector2_base<bool> bvec2

◆ bvec3

typedef vector3_base<bool> bvec3

◆ bvec4

typedef vector4_base<bool> bvec4

◆ ivec2

typedef vector2_base<int> ivec2

◆ ivec3

typedef vector3_base<int> ivec3

◆ ivec4

typedef vector4_base<int> ivec4

◆ ubvec4

typedef vector4_base<uint8_t> ubvec4

◆ vec2

typedef vector2_base<float> vec2

◆ vec3

typedef vector3_base<float> vec3

◆ vec4

typedef vector4_base<float> vec4

Function Documentation

◆ angle()

constexpr float angle ( const vector2_base< float > &  a)
inlineconstexpr

◆ closest_point_on_line()

template<typename T >
constexpr bool closest_point_on_line ( vector2_base< T >  line_pointA,
vector2_base< T >  line_pointB,
vector2_base< T >  target_point,
vector2_base< T > &  out_pos 
)
inlineconstexpr

◆ cross()

template<typename T >
constexpr vector3_base< T > cross ( const vector3_base< T > &  a,
const vector3_base< T > &  b 
)
inlineconstexpr

◆ direction()

vector2_base< float > direction ( float  angle)
inline

◆ distance() [1/2]

template<typename T >
T distance ( const vector2_base< T >  a,
const vector2_base< T > &  b 
)
inline

◆ distance() [2/2]

template<typename T >
T distance ( const vector3_base< T > &  a,
const vector3_base< T > &  b 
)
inline

◆ dot() [1/2]

template<typename T >
constexpr T dot ( const vector2_base< T >  a,
const vector2_base< T > &  b 
)
inlineconstexpr

◆ dot() [2/2]

template<typename T >
constexpr T dot ( const vector3_base< T > &  a,
const vector3_base< T > &  b 
)
inlineconstexpr

◆ length() [1/3]

float length ( const vector2_base< float > &  a)
inline

◆ length() [2/3]

float length ( const vector2_base< int > &  a)
inline

◆ length() [3/3]

float length ( const vector3_base< float > &  a)
inline

◆ length_squared()

float length_squared ( const vector2_base< float > &  a)
inline

◆ normalize() [1/2]

vector2_base< float > normalize ( const vector2_base< float > &  v)
inline

◆ normalize() [2/2]

vector3_base< float > normalize ( const vector3_base< float > &  v)
inline

◆ normalize_pre_length()

template<typename T >
constexpr vector2_base< T > normalize_pre_length ( const vector2_base< T > &  v,
len 
)
inlineconstexpr

◆ random_direction()

vector2_base< float > random_direction ( )
inline

◆ rotate()

template<typename T >
constexpr vector2_base< T > rotate ( const vector2_base< T > &  a,
float  angle 
)
inlineconstexpr