Drag[en]gine Game Engine
1.21
|
3 Component Double precision Vector. The difference to the other vector class is just that this class uses double instead of float. More...
#include <decDVector.h>
Public Member Functions | |
Constructors and Destructors | |
decDVector () | |
Create new vector initialized to ( 0,0,0 ). More... | |
decDVector (double nx, double ny, double nz) | |
Create new vector with the given values. More... | |
decDVector (const decDVector &v) | |
Creatses a new vector with the values of another vector. More... | |
decDVector (const decVector &v) | |
Creatses a new vector with the values of another vector. More... | |
decDVector (const decPoint3 &p) | |
Creatses a new vector with the values of another vector. More... | |
Management | |
double | Length () const |
Length of the vector. More... | |
double | LengthSquared () const |
Squared length of the vector. More... | |
void | Normalize () |
Normalizes the vector. If the length of the vector is 0 an exception is thrown. More... | |
const decDVector | Normalized () const |
Retrieves normalized vector. If the length of the vector is 0 an exception is thrown. More... | |
const decDVector | Absolute () const |
Retrieves absolute vector. More... | |
void | Snap (double grid) |
Snaps the components of the vector to a grid with the given size. More... | |
bool | IsEqualTo (const decDVector &v, double threshold=DVECTOR_THRESHOLD) const |
Components of this vector are equal to another one with respect to a threshold. More... | |
bool | IsZero (double threshold=DVECTOR_THRESHOLD) const |
All components are equal to zero with respect to a threshold. More... | |
void | SetZero () |
Sets all components to 0. More... | |
void | Set (double nx, double ny, double nz) |
Set components to the given values. More... | |
void | Set (const decDVector &v) |
Set components to the given vector. More... | |
void | Set (const decVector &v) |
Set components to the given vector. More... | |
void | Negate () |
Negates the vector. More... | |
void | SetSmallest (const decDVector &v) |
Set each component to the smallest value of this vector and another vector. More... | |
decDVector | Smallest (const decDVector &v) const |
Retrieve vector with each component set to the smallest value of this vector and another vector. More... | |
void | SetLargest (const decDVector &v) |
Set each component to the largest value of this vector and another vector. More... | |
decDVector | Largest (const decDVector &v) const |
Retrieve vector with each component set to the largest value of this vector and another vector. More... | |
void | SetClamped (const decDVector &minValue, const decDVector &maxValue) |
Clamp each component to the provided range. More... | |
decDVector | Clamped (const decDVector &minValue, const decDVector &maxValue) const |
Retrieves vector with each component clamped to the provided range. More... | |
decVector | ToVector () const |
Concerts to a normal precision vector with possible precision loss. More... | |
decPoint3 | Round () const |
Convert to point rounding to the nearest integer value. More... | |
decDVector | Mix (const decDVector &vector, double blendFactor) const |
Mix vectors component wise. More... | |
decDVector | Multiply (const decDVector &vector) const |
Multiply component wise. More... | |
Operators | |
decDVector | operator- () const |
Negation of this vector. More... | |
decDVector & | operator= (const decDVector &v) |
Set components of this vector to the values of another one. More... | |
decDVector & | operator+= (const decDVector &v) |
Adds the components of another vector to this one. More... | |
decDVector & | operator-= (const decDVector &v) |
Subtracts the components of another vector from this vector. More... | |
decDVector & | operator*= (double k) |
Multiplies the components of this vector with a value k. More... | |
decDVector & | operator/= (double k) |
Divide components of this vector by a value k. More... | |
decDVector | operator+ (const decDVector &v) const |
Vector with the sum of this vector with another one. More... | |
decDVector | operator- (const decDVector &v) const |
Vector with the difference of this vector to another one. More... | |
decDVector | operator* (double k) const |
Vector with this vector scaled by k. More... | |
double | operator* (const decDVector &v) const |
Calculates the dor product of this vector with another one. More... | |
decDVector | operator/ (double k) const |
Vector with this vector divided by k. More... | |
decDVector | operator% (const decDVector &v) const |
Vector with the cross producr of this vector with another one. More... | |
bool | operator< (const decDVector &v) const |
All components of this vector are less then the components of another one. More... | |
bool | operator> (const decDVector &v) const |
All components of this vector are greater then the components of another one. More... | |
bool | operator<= (const decDVector &v) const |
All components of this vector are less then or equal to the components of another one. More... | |
bool | operator>= (const decDVector &v) const |
All components of this vector are greater then or equal to the components of another one. More... | |
Public Attributes | |
double | x |
X Component of vector. More... | |
double | y |
Y Component of vector. More... | |
double | z |
Z Component of vector. More... | |
3 Component Double precision Vector. The difference to the other vector class is just that this class uses double instead of float.
decDVector::decDVector | ( | ) |
Create new vector initialized to ( 0,0,0 ).
decDVector::decDVector | ( | double | nx, |
double | ny, | ||
double | nz | ||
) |
Create new vector with the given values.
decDVector::decDVector | ( | const decDVector & | v | ) |
Creatses a new vector with the values of another vector.
decDVector::decDVector | ( | const decVector & | v | ) |
Creatses a new vector with the values of another vector.
decDVector::decDVector | ( | const decPoint3 & | p | ) |
Creatses a new vector with the values of another vector.
const decDVector decDVector::Absolute | ( | ) | const |
Retrieves absolute vector.
decDVector decDVector::Clamped | ( | const decDVector & | minValue, |
const decDVector & | maxValue | ||
) | const |
Retrieves vector with each component clamped to the provided range.
bool decDVector::IsEqualTo | ( | const decDVector & | v, |
double | threshold = DVECTOR_THRESHOLD |
||
) | const |
Components of this vector are equal to another one with respect to a threshold.
bool decDVector::IsZero | ( | double | threshold = DVECTOR_THRESHOLD | ) | const |
All components are equal to zero with respect to a threshold.
decDVector decDVector::Largest | ( | const decDVector & | v | ) | const |
Retrieve vector with each component set to the largest value of this vector and another vector.
double decDVector::Length | ( | ) | const |
Length of the vector.
double decDVector::LengthSquared | ( | ) | const |
Squared length of the vector.
decDVector decDVector::Mix | ( | const decDVector & | vector, |
double | blendFactor | ||
) | const |
Mix vectors component wise.
decDVector decDVector::Multiply | ( | const decDVector & | vector | ) | const |
Multiply component wise.
void decDVector::Negate | ( | ) |
Negates the vector.
void decDVector::Normalize | ( | ) |
Normalizes the vector. If the length of the vector is 0 an exception is thrown.
const decDVector decDVector::Normalized | ( | ) | const |
Retrieves normalized vector. If the length of the vector is 0 an exception is thrown.
decDVector decDVector::operator% | ( | const decDVector & | v | ) | const |
Vector with the cross producr of this vector with another one.
The length of the result vector is len(a)*len(b)*cos(alpha). Hence the length of the result vector is only 1 if both vertices are of length 1 and orthogonal to each other.
double decDVector::operator* | ( | const decDVector & | v | ) | const |
Calculates the dor product of this vector with another one.
decDVector decDVector::operator* | ( | double | k | ) | const |
Vector with this vector scaled by k.
decDVector& decDVector::operator*= | ( | double | k | ) |
Multiplies the components of this vector with a value k.
decDVector decDVector::operator+ | ( | const decDVector & | v | ) | const |
Vector with the sum of this vector with another one.
decDVector& decDVector::operator+= | ( | const decDVector & | v | ) |
Adds the components of another vector to this one.
decDVector decDVector::operator- | ( | ) | const |
Negation of this vector.
decDVector decDVector::operator- | ( | const decDVector & | v | ) | const |
Vector with the difference of this vector to another one.
decDVector& decDVector::operator-= | ( | const decDVector & | v | ) |
Subtracts the components of another vector from this vector.
decDVector decDVector::operator/ | ( | double | k | ) | const |
Vector with this vector divided by k.
If k is 0 an exception is thrown.
decDVector& decDVector::operator/= | ( | double | k | ) |
Divide components of this vector by a value k.
If the value k is 0 an exception is thrown.
bool decDVector::operator< | ( | const decDVector & | v | ) | const |
All components of this vector are less then the components of another one.
bool decDVector::operator<= | ( | const decDVector & | v | ) | const |
All components of this vector are less then or equal to the components of another one.
decDVector& decDVector::operator= | ( | const decDVector & | v | ) |
Set components of this vector to the values of another one.
bool decDVector::operator> | ( | const decDVector & | v | ) | const |
All components of this vector are greater then the components of another one.
bool decDVector::operator>= | ( | const decDVector & | v | ) | const |
All components of this vector are greater then or equal to the components of another one.
decPoint3 decDVector::Round | ( | ) | const |
Convert to point rounding to the nearest integer value.
void decDVector::Set | ( | const decDVector & | v | ) |
Set components to the given vector.
void decDVector::Set | ( | const decVector & | v | ) |
Set components to the given vector.
void decDVector::Set | ( | double | nx, |
double | ny, | ||
double | nz | ||
) |
Set components to the given values.
void decDVector::SetClamped | ( | const decDVector & | minValue, |
const decDVector & | maxValue | ||
) |
Clamp each component to the provided range.
void decDVector::SetLargest | ( | const decDVector & | v | ) |
Set each component to the largest value of this vector and another vector.
void decDVector::SetSmallest | ( | const decDVector & | v | ) |
Set each component to the smallest value of this vector and another vector.
void decDVector::SetZero | ( | ) |
Sets all components to 0.
decDVector decDVector::Smallest | ( | const decDVector & | v | ) | const |
Retrieve vector with each component set to the smallest value of this vector and another vector.
void decDVector::Snap | ( | double | grid | ) |
Snaps the components of the vector to a grid with the given size.
decVector decDVector::ToVector | ( | ) | const |
Concerts to a normal precision vector with possible precision loss.
double decDVector::x |
X Component of vector.
double decDVector::y |
Y Component of vector.
double decDVector::z |
Z Component of vector.