Copperfield Engine 0.1
C++ Game Engine
Loading...
Searching...
No Matches
coma::Vec3 Class Reference

represents mathematical vector with 3 components More...

#include <vector_3.h>

Public Member Functions

float Magnitude () const
 
Vec3 Normalized () const
 
float SqrMagnitude () const
 
void Scale (const Vec3 &other)
 

Static Public Member Functions

static Vec3 Lerp (const Vec3 &a, const Vec3 &b, float t)
 
static Vec3 LerpUnclamped (const Vec3 &a, const Vec3 &b, float t)
 
static float DotProduct (const Vec3 &a, const Vec3 &b)
 
static float Angle (const Vec3 &a, const Vec3 &b)
 
static Vec3 CrossProduct (const Vec3 &a, const Vec3 &b)
 
static float Distance (const Vec3 &a, const Vec3 &b)
 
static Vec3 Reflect (const Vec3 &direction, const Vec3 &normal)
 
static Vec3 eulerToForward (const Vec3 &a)
 
static Vec3 forwardToEuler (const Vec3 &forward, const Vec3 &up)
 

Static Public Attributes

static const Vec3 up
 Vec3(0, 1, 0)
 
static const Vec3 down
 Vec3(0, -1, 0)
 
static const Vec3 right
 Vec3(1, 0, 0)
 
static const Vec3 left
 Vec3(-1, 0, 0)
 
static const Vec3 forward
 Vec3(0, 0, 1)
 
static const Vec3 back
 Vec3(0, 0, -1)
 
static const Vec3 zero
 Vec3(0, 0, 0)
 
static const Vec3 unit
 Vec3(1, 1, 1)
 

Detailed Description

represents mathematical vector with 3 components

Member Function Documentation

◆ Angle()

float coma::Vec3::Angle ( const Vec3 a,
const Vec3 b 
)
inlinestatic
Parameters
a
b
Returns

◆ CrossProduct()

Vec3 coma::Vec3::CrossProduct ( const Vec3 a,
const Vec3 b 
)
inlinestatic
Parameters
a
b
Returns

◆ Distance()

float coma::Vec3::Distance ( const Vec3 a,
const Vec3 b 
)
inlinestatic
Parameters
a
b
Returns

◆ DotProduct()

float coma::Vec3::DotProduct ( const Vec3 a,
const Vec3 b 
)
inlinestatic
Parameters
a
b
Returns

◆ eulerToForward()

Vec3 coma::Vec3::eulerToForward ( const Vec3 a)
inlinestatic
Parameters
a
Returns

◆ forwardToEuler()

Vec3 coma::Vec3::forwardToEuler ( const Vec3 forward,
const Vec3 up = Vec3::up 
)
inlinestatic
Parameters
forward
up
Returns

◆ Lerp()

Vec3 coma::Vec3::Lerp ( const Vec3 a,
const Vec3 b,
float  t 
)
inlinestatic
Parameters
a
b
t
Returns

◆ LerpUnclamped()

Vec3 coma::Vec3::LerpUnclamped ( const Vec3 a,
const Vec3 b,
float  t 
)
inlinestatic
Parameters
a
b
t
Returns

◆ Magnitude()

float coma::Vec3::Magnitude ( ) const
inline
Returns

◆ Normalized()

Vec3 coma::Vec3::Normalized ( ) const
inline
Returns

◆ Reflect()

Vec3 coma::Vec3::Reflect ( const Vec3 direction,
const Vec3 normal 
)
inlinestatic
Parameters
direction
normal
Returns

◆ Scale()

void coma::Vec3::Scale ( const Vec3 other)
inline
Parameters
other

◆ SqrMagnitude()

float coma::Vec3::SqrMagnitude ( ) const
inline
Returns