DDraceNetwork Documentation
Loading...
Searching...
No Matches
vmath.h File Reference
#include "math.h"
#include <cmath>
#include <cstdint>
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<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>
constexpr T dot (const vector2_base< T > a, const vector2_base< T > &b)
template<std::floating_point T>
float length (const vector2_base< T > &a)
template<std::integral 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< float > normalize (const vector2_base< float > &v)
vector2_base< float > direction (float angle)
vector2_base< float > random_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)
constexpr int intersect_line_circle (const vec2 LineStart, const vec2 LineEnd, const vec2 CircleCenter, float Radius, vec2 aIntersections[2])
template<Numeric T>
distance (const vector3_base< T > &a, const vector3_base< T > &b)
template<Numeric T>
constexpr T dot (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< 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()

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

◆ closest_point_on_line()

template<Numeric T>
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 )
constexpr

◆ cross()

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

◆ 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>
T dot ( const vector2_base< T > a,
const vector2_base< T > & b )
constexpr

◆ dot() [2/2]

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

◆ intersect_line_circle()

int intersect_line_circle ( const vec2 LineStart,
const vec2 LineEnd,
const vec2 CircleCenter,
float Radius,
vec2 aIntersections[2] )
constexpr

◆ length() [1/3]

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

◆ length() [2/3]

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

◆ length() [3/3]

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

◆ length_squared()

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

◆ 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>
vector2_base< T > normalize_pre_length ( const vector2_base< T > & v,
T len )
constexpr

◆ random_direction()

vector2_base< float > random_direction ( )
inline

◆ rotate()

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