#include <NVector3.h>
Public Member Functions | |
double | norm () const |
NVector3 () | |
Default constructor (the default normalized vector is (1,0,0)) | |
NVector3 (const NVector3 &u) | |
Copy constructor. | |
NVector3 (double x, double y, double z, bool normalization=true) | |
NVector3 (const Vector3 &u, bool normalization=true) | |
NVector3 & | operator= (const NVector3 &u) |
Assignment. | |
double | operator[] (int i) const |
void | setXYZ (double x, double y, double z, bool normalization=true) |
Writing X,Y and Z coordinates. | |
double | squareNorm () const |
double | x () const |
double | y () const |
double | z () const |
Private Member Functions | |
void | normalize () |
Private Attributes | |
double | _n [3] |
normalized vector | |
Friends | |
double | operator* (const NVector3 &u, const Vector3 &v) |
double | operator* (const Vector3 &u, const NVector3 &v) |
NVector3 | operator- (const NVector3 &u) |
std::ostream & | operator<< (std::ostream &out, const NVector3 &u) |
Out stream override: prints the 3 normalized vector components. |
Definition at line 55 of file NVector3.h.
Default constructor (the default normalized vector is (1,0,0))
Definition at line 134 of file NVector3.cpp.
NVector3::NVector3 | ( | const NVector3 & | u | ) |
Copy constructor.
Definition at line 143 of file NVector3.cpp.
vrender::NVector3::NVector3 | ( | double | x, |
double | y, | ||
double | z, | ||
bool | normalization = true |
||
) | [inline] |
Definition at line 60 of file NVector3.h.
NVector3::NVector3 | ( | const Vector3 & | u, |
bool | normalization = true |
||
) |
Definition at line 50 of file NVector3.cpp.
double vrender::NVector3::norm | ( | ) | const [inline] |
Definition at line 99 of file NVector3.h.
void NVector3::normalize | ( | ) | [private] |
Normalization Private method to do normalization (using Norm() method of the Vector class) when it is necessary (construction of a normalized vector for exemple).
Definition at line 183 of file NVector3.cpp.
Assignment.
Definition at line 161 of file NVector3.cpp.
double vrender::NVector3::operator[] | ( | int | i | ) | const [inline] |
Definition at line 103 of file NVector3.h.
void NVector3::setXYZ | ( | double | x, |
double | y, | ||
double | z, | ||
bool | normalization = true |
||
) |
Writing X,Y and Z coordinates.
Definition at line 151 of file NVector3.cpp.
double vrender::NVector3::squareNorm | ( | ) | const [inline] |
Definition at line 100 of file NVector3.h.
double vrender::NVector3::x | ( | ) | const [inline] |
Definition at line 67 of file NVector3.h.
double vrender::NVector3::y | ( | ) | const [inline] |
Definition at line 68 of file NVector3.h.
double vrender::NVector3::z | ( | ) | const [inline] |
Definition at line 69 of file NVector3.h.
Definition at line 82 of file NVector3.h.
std::ostream& operator<< | ( | std::ostream & | out, |
const NVector3 & | u | ||
) | [friend] |
Out stream override: prints the 3 normalized vector components.
Definition at line 173 of file NVector3.cpp.
double vrender::NVector3::_n[3] [private] |
normalized vector
Definition at line 114 of file NVector3.h.