![]() |
VR-Link API Documentation for HLA 1.3
|
DtVectors represent vectors in 3-d space, X, Y, Z. More...
Inheritance diagram for DtVectorT< T >:
Collaboration diagram for DtVectorT< T >:Public Member Functions | |
| DtVectorT () | |
| DtVectorT (const T &x, const T &y, const T &z) | |
| Construct from three doubles. More... | |
| ~DtVectorT () | |
| destructor More... | |
| DtVectorT (const DtVectorT< T > &vec) | |
| copy constructor More... | |
| DtVectorT< T > & | operator= (const DtVectorT< T > &vec) |
| assignment operator More... | |
| void | setToZero () |
| set Vector to all zeros More... | |
| T & | operator[] (int ind) |
| Get the value for the specified subscript. (int version) More... | |
| T | operator[] (int ind) const |
| A const version to get the value for the specified subscript. More... | |
| T & | operator[] (DtVectorOffset ind) |
| Get the value for the specified subscript. (enum version) More... | |
| T | operator[] (DtVectorOffset ind) const |
| a const version to get the value for the specified subscript. (enum version) More... | |
| int | operator== (const DtVectorT< T > &vec) const |
| Get whether another vector equals this vector. More... | |
| int | operator!= (const DtVectorT< T > &vec) const |
| Get whether another vector does not equal this vector. More... | |
| DtString | string () const |
| Get a string representation of the vector. More... | |
| double | magnitudeSquared () const |
| Get the magnitude of the vector squared, i.e. More... | |
| void | normalize () |
| Normalize the vector; i.e., magnitude = 1. More... | |
| bool | isNormalized () const |
| Returns true of the vector is Normalized. More... | |
| bool | magnitudeIsZero () const |
| check if the magnitude of this vector is zero More... | |
| bool | magnitudeIsZero (double tolerance) const |
| check if the magnitude of this vector is zero, within the tolerance passed. More... | |
| std::ostream & | printDataToStream (std::ostream &str) const |
| prints out a formated string to the stream More... | |
| void | get (T &x, T &y, T &z) const |
| get the x,y,z component of a Vector (faster than x(), y(), z() calls made separately) More... | |
| void | setAll (const T &x, const T &y, const T &z) |
| set x, y, and z components More... | |
| const T & | x () const |
| gets/sets the x component of a Vector More... | |
| void | setX (const T &x) |
| gets/sets the x component of a Vector More... | |
| const T & | y () const |
| gets/sets the y component of a Vector More... | |
| void | setY (const T &y) |
| gets/sets the y component of a Vector More... | |
| const T & | z () const |
| gets/sets the z component of a Vector More... | |
| void | setZ (const T &z) |
| gets/sets the z component of a Vector More... | |
These functions reveal the internal representation of DtVector | |
and should not be used. They are provided for backwards compatibility | |
| operator T * () | |
| operator const T * () const | |
Protected Attributes | |
| T | myRep [3] |
DtVectors represent vectors in 3-d space, X, Y, Z.
A DtVector is not a point. This class has no virtual functions, because we want the size of a DtVector to 3 * 8 (or 3*4 for DtVector32) bytes - so that you can make the same assumptions about it that we used to make about its size and layout. This is especially important in DtDcm, where we use an array of 3 DtVectors as the myRep. If DtVector had any virtual functions, there would be 4 bytes between vector reps.
Construct from three doubles.
copy constructor
|
inline |
Returns true of the vector is Normalized.
check if the magnitude of this vector is zero
check if the magnitude of this vector is zero, within the tolerance passed.
This tolerance is compared against each component of the vector, not the magnitude.
Get the magnitude of the vector squared, i.e.
x^2 + y^2 + z^2
|
inline |
Normalize the vector; i.e., magnitude = 1.
|
inline |
|
inline |
Get whether another vector does not equal this vector.
Warning: this operation calls operator== which tests floats for exact equality
assignment operator
Get whether another vector equals this vector.
Warning: This operation compares floats of exact equality.
Get the value for the specified subscript. (int version)
A const version to get the value for the specified subscript.
|
inline |
Get the value for the specified subscript. (enum version)
|
inline |
a const version to get the value for the specified subscript. (enum version)
|
inline |
prints out a formated string to the stream
|
inline |
set x, y, and z components
|
inline |
set Vector to all zeros
|
inline |
gets/sets the x component of a Vector
Referenced by DtGeocentricToMgFlatEarth().
|
inline |
gets/sets the y component of a Vector
Referenced by DtGeocentricToMgFlatEarth().
|
inline |
gets/sets the z component of a Vector
Referenced by DtGeocentricToMgFlatEarth().
Get a string representation of the vector.
|
inline |
gets/sets the x component of a Vector
|
inline |
gets/sets the y component of a Vector
|
inline |
gets/sets the z component of a Vector
|
protected |