wVector class More...
Public Member Functions | |
wVectorT () | |
Constructor. More... | |
template<bool OtherShared> | |
wVectorT (const wVectorT< OtherShared > &) | |
The function to copy from another kind of wVectorT. More... | |
wVectorT (const wVectorT &) | |
Copy-Constructor. More... | |
wVectorT (const real *ptr) | |
Constructor. More... | |
wVectorT (real *ptr) | |
Constructor. More... | |
wVectorT (real x, real y, real z, real w=1.0) | |
Constructor. More... | |
template<> | |
wVectorT (const wVectorT< OtherShared > &src) | |
template<> | |
wVectorT (const wVectorT< false > &src) | |
template<> | |
wVectorT (const real *ptr) | |
template<> | |
wVectorT (real *ptr) | |
template<> | |
wVectorT (real _x, real _y, real _z, real _w) | |
template<bool OtherShared> | |
wVectorT< false > | compProduct (const wVectorT< OtherShared > &A) const |
component wise multiplication More... | |
real | norm () const |
return the norm of this vector More... | |
wVectorT & | normalize () |
Normalize the vector. More... | |
wVectorT< false > | normalized () const |
Returns a normalized vector with the same direction of the current vector. More... | |
operator qglviewer::Vec () const | |
Convert to qglviewer::Vec. More... | |
operator QString () const | |
Returns a string representation of the vector. More... | |
template<bool OtherShared> | |
real | operator% (const wVectorT< OtherShared > &A) const |
return dot product More... | |
template<bool OtherShared> | |
wVectorT< false > | operator* (const wVectorT< OtherShared > &B) const |
return cross product More... | |
const wVectorT & | operator+ () const |
Operator + (unary) More... | |
template<bool OtherShared> | |
wVectorT< false > | operator+ (const wVectorT< OtherShared > &A) const |
Operator +. More... | |
template<bool OtherShared> | |
wVectorT & | operator+= (const wVectorT< OtherShared > &A) |
Operator +=. More... | |
template<bool OtherShared> | |
wVectorT< Shared > & | operator+= (const wVectorT< OtherShared > &A) |
wVectorT< false > | operator- () const |
Operator - (unary) More... | |
template<bool OtherShared> | |
wVectorT< false > | operator- (const wVectorT< OtherShared > &A) const |
Operator -. More... | |
template<bool OtherShared> | |
wVectorT & | operator-= (const wVectorT< OtherShared > &A) |
Operator -=. More... | |
template<bool OtherShared> | |
wVectorT< Shared > & | operator-= (const wVectorT< OtherShared > &A) |
wVectorT & | operator= (const wVectorT &A) |
Assignment. More... | |
template<bool OtherShared> | |
wVectorT & | operator= (const wVectorT< OtherShared > &A) |
Assignment. More... | |
template<bool OtherShared> | |
wVectorT< Shared > & | operator= (const wVectorT< OtherShared > &A) |
template<bool OtherShared> | |
bool | operator== (const wVectorT< OtherShared > &A) const |
Compare only the first three elements and return true if their are equals. More... | |
real & | operator[] (int i) |
indexing operator More... | |
const real & | operator[] (int i) const |
indexing operator (const version) More... | |
wVectorT & | rotateAround (wVectorT< false > axis, real theta) |
rotate the position indicated by this wVectorT around the axis by the angle theta More... | |
wVectorT< false > | scale (real s) const |
return a new wVectorT with element scaled by s More... | |
Static Public Member Functions | |
template<bool SharedA, bool SharedB> | |
static real | distance (const wVectorT< SharedA > &A, const wVectorT< SharedB > &B) |
return the distance from A to B More... | |
static wVectorT< false > | X () |
X axis vector. More... | |
static wVectorT< false > | Y () |
Y axis vector. More... | |
static wVectorT< false > | Z () |
Z axis vector. More... | |
Public Attributes | |
real & | w |
real & | x |
real & | y |
real & | z |
Additional Inherited Members | |
Protected Attributes inherited from InternalData< Shared > | |
real | data [4] |
Detailed Description
template<bool Shared = false>
class farsa::wVectorT< Shared >
wVector class
\
- Motivation
- 4 dimensional Vector of real numbers; useful for transformation matrix, quaternion and 3d points and vectors.
- Description
- This class has a template parameter which allows to choose whether to have inner data or shared data. In case of shared data this can only be constructed using the constructor having a pointer to a vector of real as a parameter.
- Warnings
- When it is used as 3-dimensional vector the fourth value is set to 1.0
Constructor & Destructor Documentation
wVectorT | ( | ) |
Constructor.
Member Function Documentation
|
inline |
return the norm of this vector
Definition at line 422 of file wvector.h.
Referenced by RenderWObjectContainer::drawArrow(), and RenderWorld::drawArrow().
|
inline |
Normalize the vector.
- Returns
- itself normalized
Definition at line 310 of file wvector.h.
Referenced by wMatrix::grammSchmidt(), and wVectorT< Shared >::rotateAround().
|
inline |
|
inline |
Convert to qglviewer::Vec.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
rotate the position indicated by this wVectorT around the axis by the angle theta
- Parameters
-
axis specify the axis of rotation theta specify the angle of rotation (right-hand system)
- Returns
- itself rotated
Definition at line 434 of file wvector.h.
References wVectorT< Shared >::normalize().
Referenced by wMatrix::rotateAround().
return a new wVectorT with element scaled by s
Definition at line 305 of file wvector.h.
Referenced by RenderWObjectContainer::drawArrow(), RenderWObjectContainer::drawCylinder(), RenderWObjectContainer::drawSphere(), and SingleIRGraphic::render().
The documentation for this class was generated from the following file:
- worldsim/include/wvector.h