Grid3
|
Class representing 3D vectors, with elements of type T. More...
#include <Vector3.h>
Public Member Functions | |
Vec3 (T value=0) | |
Constructor accepting a single value, which defaults to 0. All three components are set to the same value. More... | |
Vec3 (T _x, T _y, T _z) | |
Constructor accepting three values, one for each vector component. More... | |
template<class T2 > | |
Vec3 (Vec3< T2 > v) | |
Copy constructor. More... | |
Vec3< T > | operator+ (const Vec3< T > &v) const |
Vector addition. More... | |
Vec3< T > & | operator+= (const Vec3< T > &v) |
In-place vector addition. More... | |
Vec3< T > | operator- (const Vec3< T > &v) const |
Vector subtraction. More... | |
Vec3< T > & | operator-= (const Vec3< T > &v) |
In-place vector subtraction. More... | |
Vec3< T > | operator* (const double &d) const |
Multiplication with double. More... | |
Vec3< T > & | operator*= (const double &d) |
In-place multiplication with double. More... | |
Vec3< T > | operator/ (const double &d) const |
Division with double. More... | |
Vec3< T > & | operator/= (const double &d) |
In-place division with double. More... | |
double | operator* (const Vec3< T > &v) const |
Scalar product. More... | |
Vec3< T > | cross (const Vec3< T > &v) const |
Cross product. More... | |
Vec3< T > | operator% (const Vec3< T > &v) const |
Element-wise multiplication (hadamard product) More... | |
Vec3< T > & | normalize () |
Normalize. More... | |
double | norm () const |
Vector norm. More... | |
double | norm2 () const |
Vector norm squared. More... | |
bool | operator== (const Vec3< T > &v) const |
Equal (used for integer position vectors) More... | |
bool | operator!= (const Vec3< T > &v) const |
Not equal (used for integer position vectors) More... | |
operator T () | |
Cast to scalar, simply returns the x component. More... | |
Public Attributes | |
T | x |
T | y |
T | z |
Friends | |
Vec3< T > | operator* (const double &d, const Vec3< T > &v) |
Multiplication with double. More... | |
std::ostream & | operator<< (std::ostream &os, const Vec3< T > &v) |
Write to ostream. More... | |
Class representing 3D vectors, with elements of type T.
Constructor accepting a single value, which defaults to 0. All three components are set to the same value.
Constructor accepting three values, one for each vector component.
|
inline |
Vector norm.
|
inline |
Vector norm squared.
|
inline |
Cast to scalar, simply returns the x component.
Not equal (used for integer position vectors)
Element-wise multiplication (hadamard product)
Multiplication with double.
In-place multiplication with double.
In-place vector addition.
Vector subtraction.
In-place vector subtraction.
Division with double.
In-place division with double.
Equal (used for integer position vectors)
Multiplication with double.
|
friend |
Write to ostream.
T Vec3< T >::x |
T Vec3< T >::y |
T Vec3< T >::z |