DDraceNetwork Documentation
Loading...
Searching...
No Matches
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< floatvec2
 
typedef vector2_base< boolbvec2
 
typedef vector2_base< intivec2
 
typedef vector3_base< floatvec3
 
typedef vector3_base< boolbvec3
 
typedef vector3_base< intivec3
 
typedef vector4_base< floatvec4
 
typedef vector4_base< boolbvec4
 
typedef vector4_base< intivec4
 
typedef vector4_base< uint8_tubvec4
 

Functions

template<Numeric T>
constexpr vector2_base< T > rotate (const vector2_base< T > &a, float angle)
 
template<Numeric T>
distance (const vector2_base< T > a, const vector2_base< T > &b)
 
template<Numeric T>
constexprdot (const vector2_base< T > a, const vector2_base< T > &b)
 
template<std::floating_point T>
float length (const vector2_base< T > &a)
 
constexpr float length_squared (const vector2_base< float > &a)
 
constexpr float angle (const vector2_base< float > &a)
 
template<Numeric T>
constexpr vector2_base< T > normalize_pre_length (const vector2_base< T > &v, T len)
 
vector2_base< floatnormalize (const vector2_base< float > &v)
 
vector2_base< floatdirection (float angle)
 
vector2_base< floatrandom_direction ()
 
template<Numeric 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<Numeric T>
distance (const vector3_base< T > &a, const vector3_base< T > &b)
 
template<Numeric T>
constexprdot (const vector3_base< T > &a, const vector3_base< T > &b)
 
template<Numeric 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< floatnormalize (const vector3_base< float > &v)
 

Typedef Documentation

◆ bvec2

◆ bvec3

◆ bvec4

◆ ivec2

◆ ivec3

◆ ivec4

◆ ubvec4

◆ vec2

◆ vec3

◆ vec4

Function Documentation

◆ angle()

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

◆ closest_point_on_line()

template<Numeric 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<Numeric 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<Numeric T>
T distance ( const vector2_base< T >  a,
const vector2_base< T > &  b 
)
inline

◆ distance() [2/2]

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

◆ dot() [1/2]

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

◆ dot() [2/2]

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

◆ length() [1/2]

template<std::floating_point T>
float length ( const vector2_base< T > &  a)
inline

◆ length() [2/2]

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

◆ length_squared()

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

◆ 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<Numeric 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<Numeric T>
constexpr vector2_base< T > rotate ( const vector2_base< T > &  a,
float  angle 
)
inlineconstexpr