|
Grid3
|
Class representing 3D vectors, with elements of type T. More...
#include <Vector3.h>
Public Member Functions | |
| Vec3 (T _x=0, T _y=0, T _z=0) | |
| Standard constructor. | |
| template<class T2 > | |
| Vec3 (Vec3< T2 > v) | |
| Copy constructor. | |
| Vec3< T > | operator+ (const Vec3< T > &v) const |
| Vector addition. | |
| Vec3< T > & | operator+= (const Vec3< T > &v) |
| In-place vector addition. | |
| Vec3< T > | operator- (const Vec3< T > &v) const |
| Vector subtraction. | |
| Vec3< T > & | operator-= (const Vec3< T > &v) |
| In-place vector subtraction. | |
| Vec3< T > | operator* (const double &d) const |
| Multiplication with double. | |
| Vec3< T > & | operator*= (const double &d) |
| In-place multiplication with double. | |
| Vec3< T > | operator/ (const double &d) const |
| Division with double. | |
| Vec3< T > & | operator/= (const double &d) |
| In-place division with double. | |
| double | operator* (const Vec3< T > &v) const |
| Scalar product. | |
| Vec3< T > | cross (const Vec3< T > &v) const |
| Cross product. | |
| Vec3< T > | operator% (const Vec3< T > &v) const |
| Element-wise multiplication (hadamard product) | |
| Vec3< T > & | normalize () |
| Normalize. | |
| double | norm () const |
| Vector norm. | |
| double | norm2 () const |
| Vector norm squared. | |
| bool | operator== (const Vec3< T > &v) const |
| Equal (used for integer position vectors) | |
| bool | operator!= (const Vec3< T > &v) const |
| Not equal (used for integer position vectors) | |
Public Attributes | |
| T | x |
| T | y |
| T | z |
Friends | |
| Vec3< T > | operator* (const double &d, const Vec3< T > &v) |
| Multiplication with double. | |
| std::ostream & | operator<< (std::ostream &os, const Vec3< T > &v) |
| Write to ostream. | |
Class representing 3D vectors, with elements of type T.
1.8.9.1