#include <D3Vector.h>
Public Member Functions | |
D3Vector (const T &a=0, const T &b=0, const T &c=0) | |
Construct from elements. More... | |
D3Vector (const D3Vector &o) | |
D3Vector (const T d[3]) | |
D3Vector & | operator= (const D3Vector &o) |
void | set (const T &a=0, const T &b=0, const T &c=0) |
Set vector from elements;. More... | |
T | x (const T &val) |
T | y (const T &val) |
T | z (const T &val) |
template<class TT > | |
D3Vector (const D3Vector< TT > &o) | |
Convert from other typed vector. More... | |
T | x () const |
Access elements by name. More... | |
T | y () const |
T | z () const |
T | operator[] (std::size_t index) const |
Access elements by copy. More... | |
T & | operator[] (std::size_t index) |
Access elements by reference. More... | |
T | dot (const D3Vector &rhs) const |
Return the dot product of this vector and the other. More... | |
T | magnitude () const |
Return the magnitude of this vector. More... | |
D3Vector | norm () const |
Return a normalized vector in the direction of this vector. More... | |
D3Vector | cross (const D3Vector &rhs) const |
Return the cross product of this vector and the other. More... | |
D3Vector | triplevec (D3Vector &a, D3Vector &b) const |
Return the triple cross product of this vector and the other two. More... | |
T | triplescal (D3Vector &a, D3Vector &b) const |
Return the dot-cross product of this vector and the other two. More... | |
bool | operator< (const D3Vector &rhs) const |
D3Vector & | operator+= (const D3Vector &other) |
bool | operator! () const |
operator bool () const | |
void | invalidate () |
Private Types | |
typedef std::vector< T > | D3VectorStore |
Private Attributes | |
D3VectorStore | m_v |
Friends | |
template<class U > | |
std::ostream & | operator<< (std::ostream &, const D3Vector< U > &) |
Dimension-3 vector class.
Adapted in laziness from: http://rosettacode.org/wiki/Vector_products#C.2B.2B
Definition at line 23 of file D3Vector.h.
|
private |
Definition at line 28 of file D3Vector.h.
|
inline |
|
inline |
Definition at line 38 of file D3Vector.h.
|
inline |
Definition at line 40 of file D3Vector.h.
|
inline |
|
inline |
Return the cross product of this vector and the other.
Definition at line 100 of file D3Vector.h.
|
inline |
|
inline |
Definition at line 136 of file D3Vector.h.
|
inline |
|
inline |
Return a normalized vector in the direction of this vector.
Definition at line 91 of file D3Vector.h.
|
inline |
Definition at line 132 of file D3Vector.h.
|
inline |
Definition at line 129 of file D3Vector.h.
|
inline |
Definition at line 124 of file D3Vector.h.
|
inline |
Definition at line 117 of file D3Vector.h.
|
inline |
Definition at line 43 of file D3Vector.h.
|
inline |
|
inline |
|
inline |
|
inline |
Return the dot-cross product of this vector and the other two.
Definition at line 113 of file D3Vector.h.
|
inline |
Return the triple cross product of this vector and the other two.
Definition at line 109 of file D3Vector.h.
|
inline |
Definition at line 55 of file D3Vector.h.
|
inline |
|
inline |
Definition at line 56 of file D3Vector.h.
|
inline |
Definition at line 66 of file D3Vector.h.
|
inline |
Definition at line 57 of file D3Vector.h.
|
inline |
Definition at line 67 of file D3Vector.h.
|
friend |
|
private |
Definition at line 29 of file D3Vector.h.