My Project
|
3-dimensional vector with double precision. More...
#include <ParaDVector3.h>
Public Member Functions | |
DVector3 (const double fX, const double fY, const double fZ) | |
DVector3 (const double afCoordinate[3]) | |
DVector3 (const int afCoordinate[3]) | |
DVector3 (double *const r) | |
DVector3 (const double scaler) | |
DVector3 (const Vector3 &vFrom) | |
double | operator[] (const size_t i) const |
double & | operator[] (const size_t i) |
double * | ptr () |
Pointer accessor for direct copying. | |
const double * | ptr () const |
Pointer accessor for direct copying. | |
operator Vector3 () const | |
convert to a vector3 | |
DVector3 & | operator= (const DVector3 &rkVector) |
Assigns the value of the other vector. More... | |
DVector3 & | operator= (const Vector3 &rkVector) |
DVector3 & | operator= (const double fScaler) |
bool | operator== (const DVector3 &rkVector) const |
bool | operator!= (const DVector3 &rkVector) const |
DVector3 | operator+ (const DVector3 &rkVector) const |
DVector3 | operator+ (const Vector3 &rkVector) const |
DVector3 | operator- (const DVector3 &rkVector) const |
DVector3 | operator- (const Vector3 &rkVector) const |
DVector3 | operator* (const double fScalar) const |
DVector3 | operator% (const DVector3 &rhs) const |
special cross product | |
DVector3 | operator* (const DVector3 &rhs) const |
DVector3 | operator/ (const double fScalar) const |
DVector3 | operator/ (const DVector3 &rhs) const |
const DVector3 & | operator+ () const |
DVector3 | operator- () const |
DVector3 & | operator+= (const DVector3 &rkVector) |
DVector3 & | operator+= (const Vector3 &rkVector) |
DVector3 & | operator+= (const double fScalar) |
DVector3 & | operator-= (const DVector3 &rkVector) |
DVector3 & | operator-= (const Vector3 &rkVector) |
DVector3 & | operator-= (const double fScalar) |
DVector3 & | operator*= (const double fScalar) |
DVector3 & | operator*= (const DVector3 &rkVector) |
DVector3 & | operator/= (const double fScalar) |
DVector3 & | operator/= (const DVector3 &rkVector) |
double | length () const |
Returns the length (magnitude) of the vector. More... | |
double | squaredLength () const |
Returns the square of the length(magnitude) of the vector. More... | |
double | distance (const DVector3 &rhs) const |
Returns the distance to another vector. More... | |
double | squaredDistance (const DVector3 &rhs) const |
Returns the square of the distance to another vector. More... | |
double | dotProduct (const DVector3 &vec) const |
Calculates the dot (scalar) product of this vector with another. More... | |
double | absDotProduct (const DVector3 &vec) const |
Calculates the absolute dot (scalar) product of this vector with another. More... | |
double | normalise () |
Normalises the vector. More... | |
DVector3 | crossProduct (const DVector3 &rkVector) const |
Calculates the cross-product of 2 vectors, i.e. More... | |
DVector3 | midPoint (const DVector3 &vec) const |
Returns a vector at a point half way between this and the passed in vector. | |
bool | operator< (const DVector3 &rhs) const |
Returns true if the vector's scalar components are all greater that the ones of the vector it is compared against. | |
bool | operator> (const DVector3 &rhs) const |
Returns true if the vector's scalar components are all smaller that the ones of the vector it is compared against. | |
void | makeFloor (const DVector3 &cmp) |
Sets this vector's components to the minimum of its own and the ones of the passed in vector. More... | |
void | makeCeil (const DVector3 &cmp) |
Sets this vector's components to the maximum of its own and the ones of the passed in vector. More... | |
bool | isZeroLength (void) const |
Returns true if this vector is zero length. More... | |
DVector3 | normalisedCopy (void) const |
As normalise, except that this vector is unaffected and the normalized vector is returned as a copy. More... | |
DVector3 | reflect (const DVector3 &normal) const |
Calculates a reflection vector to the plane with the given normal . More... | |
bool | positionEquals (const Vector3 &rhs, float tolerance=1e-03) const |
Returns whether this vector is within a positional tolerance of another floating precision vector. More... | |
bool | positionCloses (const DVector3 &rhs, float tolerance=1e-03f) const |
Returns whether this vector is within a positional tolerance of another vector, also take scale of the vectors into account. More... | |
bool | directionEquals (const DVector3 &rhs, const Radian &tolerance) const |
Returns whether this vector is within a directional tolerance of another vector. More... | |
Public Attributes | |
double | x |
double | y |
double | z |
Friends | |
DVector3 | operator* (const double fScalar, const DVector3 &rkVector) |
DVector3 | operator/ (const double fScalar, const DVector3 &rkVector) |
DVector3 | operator+ (const DVector3 &lhs, const double rhs) |
DVector3 | operator+ (const double lhs, const DVector3 &rhs) |
DVector3 | operator- (const DVector3 &lhs, const double rhs) |
DVector3 | operator- (const double lhs, const DVector3 &rhs) |
std::ostream & | operator<< (std::ostream &o, const DVector3 &v) |
Function for writing to a stream. | |
3-dimensional vector with double precision.
|
inline |
Calculates the absolute dot (scalar) product of this vector with another.
vec | Vector with which to calculate the absolute dot product (together with this one). |
Calculates the cross-product of 2 vectors, i.e.
the vector that lies perpendicular to them both.
vec | Vector which, together with this one, will be used to calculate the cross-product. |
|
inline |
Returns whether this vector is within a directional tolerance of another vector.
rhs | The vector to compare with |
tolerance | The maximum angle by which the vectors may vary and still be considered equal |
|
inline |
Returns the distance to another vector.
|
inline |
Calculates the dot (scalar) product of this vector with another.
vec | Vector with which to calculate the dot product (together with this one). |
|
inline |
Returns true if this vector is zero length.
|
inline |
Returns the length (magnitude) of the vector.
|
inline |
Sets this vector's components to the maximum of its own and the ones of the passed in vector.
|
inline |
Sets this vector's components to the minimum of its own and the ones of the passed in vector.
|
inline |
Normalises the vector.
|
inline |
As normalise, except that this vector is unaffected and the normalized vector is returned as a copy.
Assigns the value of the other vector.
rkVector | The other vector |
|
inline |
Returns whether this vector is within a positional tolerance of another vector, also take scale of the vectors into account.
rhs | The vector to compare with |
tolerance | The amount (related to the scale of vectors) that distance of the vector may vary by and still be considered close |
|
inline |
Returns whether this vector is within a positional tolerance of another floating precision vector.
rhs | The vector to compare with |
tolerance | The amount that each element of the vector may vary by and still be considered equal |
Calculates a reflection vector to the plane with the given normal .
|
inline |
Returns the square of the distance to another vector.
|
inline |
Returns the square of the length(magnitude) of the vector.