OpenEnroth 73e68f7
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
Vec3< T > Struct Template Reference

#include <Vec.h>

Public Member Functions

constexpr Vec3 ()=default
 
constexpr Vec3 (const Vec3 &other)=default
 
constexpr Vec3 (T a, T b, T c)
 
Vec2< T > xy ()
 
void normalize ()
 
Vec3< int > toInt () const
 
Vec3< int > toIntTrunc () const
 
Vec3< int > toFixpoint () const
 
Vec3< float > toFloat () const
 
Vec3< float > toFloatFromFixpoint () const
 
auto lengthSqr () const
 
length () const
 
chebyshevLength () const
 
Vec3operator+= (const Vec3 &v)
 
Vec3operator-= (const Vec3 &v)
 
Vec3operator*= (T v)
 
Vec3operator/= (T v)
 

Static Public Member Functions

static Vec3 fromPolar (T length, int yaw, int pitch)
 

Public Attributes

x = 0
 
y = 0
 
z = 0
 

Friends

bool operator== (const Vec3 &l, const Vec3 &r)=default
 
Vec3 operator+ (const Vec3 &l, const Vec3 &r)
 
Vec3 operator- (const Vec3 &l, const Vec3 &r)
 
Vec3 operator/ (const Vec3 &l, T r)
 
Vec3 operator* (const Vec3 &l, T r)
 
Vec3 operator* (T l, const Vec3 &r)
 
Vec3 operator- (const Vec3 &v)
 
Vec3 cross (const Vec3 &l, const Vec3 &r)
 
dot (const Vec3 &l, const Vec3 &r)
 

Constructor & Destructor Documentation

◆ Vec3() [1/3]

template<class T >
constexpr Vec3< T >::Vec3 ( )
constexprdefault

◆ Vec3() [2/3]

template<class T >
constexpr Vec3< T >::Vec3 ( const Vec3< T > &  other)
constexprdefault

◆ Vec3() [3/3]

template<class T >
constexpr Vec3< T >::Vec3 ( a,
b,
c 
)
inlineconstexpr

Member Function Documentation

◆ chebyshevLength()

template<class T >
T Vec3< T >::chebyshevLength ( ) const
inline

◆ fromPolar()

template<class T >
static Vec3 Vec3< T >::fromPolar ( length,
int  yaw,
int  pitch 
)
inlinestatic

◆ length()

template<class T >
T Vec3< T >::length ( ) const
inline

◆ lengthSqr()

template<class T >
auto Vec3< T >::lengthSqr ( ) const
inline

◆ normalize()

template<class T >
void Vec3< T >::normalize ( )
inline

◆ operator*=()

template<class T >
Vec3 & Vec3< T >::operator*= ( v)
inline

◆ operator+=()

template<class T >
Vec3 & Vec3< T >::operator+= ( const Vec3< T > &  v)
inline

◆ operator-=()

template<class T >
Vec3 & Vec3< T >::operator-= ( const Vec3< T > &  v)
inline

◆ operator/=()

template<class T >
Vec3 & Vec3< T >::operator/= ( v)
inline

◆ toFixpoint()

template<class T >
Vec3< int > Vec3< T >::toFixpoint ( ) const
inline

◆ toFloat()

template<class T >
Vec3< float > Vec3< T >::toFloat ( ) const
inline

◆ toFloatFromFixpoint()

template<class T >
Vec3< float > Vec3< T >::toFloatFromFixpoint ( ) const
inline

◆ toInt()

template<class T >
Vec3< int > Vec3< T >::toInt ( ) const
inline

◆ toIntTrunc()

template<class T >
Vec3< int > Vec3< T >::toIntTrunc ( ) const
inline

◆ xy()

template<class T >
Vec2< T > Vec3< T >::xy ( )
inline

Friends And Related Function Documentation

◆ cross

template<class T >
Vec3 cross ( const Vec3< T > &  l,
const Vec3< T > &  r 
)
friend

◆ dot

template<class T >
T dot ( const Vec3< T > &  l,
const Vec3< T > &  r 
)
friend

◆ operator* [1/2]

template<class T >
Vec3 operator* ( const Vec3< T > &  l,
r 
)
friend

◆ operator* [2/2]

template<class T >
Vec3 operator* ( l,
const Vec3< T > &  r 
)
friend

◆ operator+

template<class T >
Vec3 operator+ ( const Vec3< T > &  l,
const Vec3< T > &  r 
)
friend

◆ operator- [1/2]

template<class T >
Vec3 operator- ( const Vec3< T > &  l,
const Vec3< T > &  r 
)
friend

◆ operator- [2/2]

template<class T >
Vec3 operator- ( const Vec3< T > &  v)
friend

◆ operator/

template<class T >
Vec3 operator/ ( const Vec3< T > &  l,
r 
)
friend

◆ operator==

template<class T >
bool operator== ( const Vec3< T > &  l,
const Vec3< T > &  r 
)
friend

Member Data Documentation

◆ x

template<class T >
T Vec3< T >::x = 0

◆ y

template<class T >
T Vec3< T >::y = 0

◆ z

template<class T >
T Vec3< T >::z = 0

The documentation for this struct was generated from the following file: