wVector class More...
Public Member Functions | |
wVectorT () | |
Constructor. | |
template<bool OtherShared> | |
wVectorT (const wVectorT< OtherShared > &) | |
The function to copy from another kind of wVectorT. | |
wVectorT (const wVectorT &) | |
Copy-Constructor. | |
wVectorT (const real *ptr) | |
Constructor. | |
wVectorT (real *ptr) | |
Constructor. | |
wVectorT (real x, real y, real z, real w=1.0) | |
Constructor. | |
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 | |
real | norm () const |
return the norm of this vector | |
wVectorT & | normalize () |
Normalize the vector. | |
operator qglviewer::Vec () const | |
Convert to qglviewer::Vec. | |
template<bool OtherShared> | |
real | operator% (const wVectorT< OtherShared > &A) const |
return dot product | |
template<bool OtherShared> | |
wVectorT< false > | operator* (const wVectorT< OtherShared > &B) const |
return cross product | |
const wVectorT & | operator+ () const |
Operator + (unary) | |
template<bool OtherShared> | |
wVectorT< false > | operator+ (const wVectorT< OtherShared > &A) const |
Operator +. | |
template<bool OtherShared> | |
wVectorT & | operator+= (const wVectorT< OtherShared > &A) |
Operator +=. | |
wVectorT< false > | operator- () const |
Operator - (unary) | |
template<bool OtherShared> | |
wVectorT< false > | operator- (const wVectorT< OtherShared > &A) const |
Operator -. | |
template<bool OtherShared> | |
wVectorT & | operator-= (const wVectorT< OtherShared > &A) |
Operator -=. | |
wVectorT & | operator= (const wVectorT &A) |
Assignment. | |
template<bool OtherShared> | |
wVectorT & | operator= (const wVectorT< OtherShared > &A) |
Assignment. | |
template<bool OtherShared> | |
bool | operator== (const wVectorT< OtherShared > &A) const |
Compare only the first three elements and return true if their are equals. | |
real & | operator[] (int i) |
indexing operator | |
const real & | operator[] (int i) const |
indexing operator (const version) | |
wVectorT & | rotateAround (wVectorT< false > axis, real theta) |
rotate the position indicated by this wVectorT around the axis by the angle theta | |
wVectorT< false > | scale (real s) const |
return a new wVectorT with element scaled by s | |
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 | |
static wVectorT< false > | X () |
X axis vector. | |
static wVectorT< false > | Y () |
Y axis vector. | |
static wVectorT< false > | Z () |
Z axis vector. | |
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.
wVectorT | ( | const real * | ptr | ) |
Constructor.
wVectorT | ( | real | x, |
real | y, | ||
real | z, | ||
real | w = 1.0 |
||
) |
Constructor.
Member Function Documentation
|
inline |
return the norm of this vector
Definition at line 396 of file wvector.h.
Referenced by RenderWorld::drawArrow(), and PhyiCub::PhyiCub().
|
inline |
Normalize the vector.
- Returns
- itself normalized
Definition at line 295 of file wvector.h.
Referenced by RenderWObjectContainer::drawCylinder(), wMatrix::grammSchmidt(), and wVectorT< Shared >::rotateAround().
|
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 408 of file wvector.h.
References wVectorT< Shared >::normalize().
Referenced by wMatrix::rotateAround().
|
inline |
return a new wVectorT with element scaled by s
Definition at line 290 of file wvector.h.
Referenced by RenderWObjectContainer::drawCylinder(), RenderWObjectContainer::drawSphere(), RenderCamera::moveRotatePointOfView(), and SingleIRGraphic::render().
The documentation for this class was generated from the following file:
- worldsim/include/wvector.h