DubiousEngine
0.2.0
Simple Game Engine
|
A 3D Unit Vector. More...
#include <Unit_quaternion.h>
Public Member Functions | |
Unit_vectorT ()=default | |
Constructor. More... | |
Unit_vectorT (float x, float y, float z) | |
Constructor. More... | |
Unit_vectorT (const VectorT< T > &v) | |
Constructor. More... | |
float | x () const |
X accessor. More... | |
float | y () const |
Y accessor. More... | |
float | z () const |
Z accessor. More... | |
Unit_vectorT< T > | operator- () const |
Friends | |
bool | operator== (const Unit_vectorT< T > &a, const Unit_vectorT< T > &b) |
bool | operator!= (const Unit_vectorT< T > &a, const Unit_vectorT< T > &b) |
VectorT< T > | operator* (const Unit_vectorT< T > &a, float b) |
VectorT< T > | operator* (float a, const Unit_vectorT< T > &b) |
VectorT< T > | operator+ (const Unit_vectorT< T > &a, const Unit_vectorT< T > &b) |
VectorT< T > | operator- (const Unit_vectorT< T > &a, const Unit_vectorT< T > &b) |
A 3D Unit Vector.
This class represents a 3D Unit Vector. The template parameter is only so the compiler can enforce different meanings for Unit Vectors (ie local versus global)
|
default |
Constructor.
This is primarily an optimization. In some cases you need to create an empty UnitVector so that you can assign it or pass it as an out parameter to something. In this case you don't really care what value it holds. Creating one with dummy args causes a painful normalization. So this function will create one as 1,0,0 and not call normalization
Dubious::Math::Unit_vectorT< T >::Unit_vectorT | ( | float | x, |
float | y, | ||
float | z | ||
) |
Constructor.
Creates the unit vector with the given X, Y, and Z converted to a length of 1
x | - [in] X component |
y | - [in] Y component |
z | - [in] Z component |
Dubious::Math::Unit_vectorT< T >::Unit_vectorT | ( | const VectorT< T > & | v | ) |
Constructor.
Creates a Unit Vector from the passed in Vector. This serves as a Normalize function
v | - [in] Vector to copy |
|
inline |
|
inline |
X accessor.
|
inline |
Y accessor.
|
inline |
Z accessor.
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |