|
Drag[en]gine Game Engine 1.32.3
|
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 ). | |
| decDVector (double nx, double ny, double nz) | |
| Create new vector with the given values. | |
| decDVector (const decDVector &v) | |
| Creatses a new vector with the values of another vector. | |
| decDVector (const decVector &v) | |
| Creatses a new vector with the values of another vector. | |
| decDVector (const decPoint3 &p) | |
| Creatses a new vector with the values of another vector. | |
Management | |
| double | Length () const |
| Length of the vector. | |
| double | LengthSquared () const |
| Squared length of the vector. | |
| void | Normalize () |
| Normalizes the vector. If the length of the vector is 0 an exception is thrown. | |
| const decDVector | Normalized () const |
| Retrieves normalized vector. If the length of the vector is 0 an exception is thrown. | |
| const decDVector | Absolute () const |
| Retrieves absolute vector. | |
| void | Snap (double grid) |
| Snaps the components of the vector to a grid with the given size. | |
| bool | IsEqualTo (const decDVector &v, double threshold=DVECTOR_THRESHOLD) const |
| Components of this vector are equal to another one with respect to a threshold. | |
| bool | IsZero (double threshold=DVECTOR_THRESHOLD) const |
| All components are equal to zero with respect to a threshold. | |
| void | SetZero () |
| Sets all components to 0. | |
| void | Set (double nx, double ny, double nz) |
| Set components to the given values. | |
| void | Set (const decDVector &v) |
| Set components to the given vector. | |
| void | Set (const decVector &v) |
| Set components to the given vector. | |
| void | Negate () |
| Negates the vector. | |
| void | SetSmallest (const decDVector &v) |
| Set each component to the smallest value of this vector and another vector. | |
| decDVector | Smallest (const decDVector &v) const |
| Retrieve vector with each component set to the smallest value of this vector and another vector. | |
| void | SetLargest (const decDVector &v) |
| Set each component to the largest value of this vector and another vector. | |
| decDVector | Largest (const decDVector &v) const |
| Retrieve vector with each component set to the largest value of this vector and another vector. | |
| void | SetClamped (const decDVector &minValue, const decDVector &maxValue) |
| Clamp each component to the provided range. | |
| decDVector | Clamped (const decDVector &minValue, const decDVector &maxValue) const |
| Retrieves vector with each component clamped to the provided range. | |
| decVector | ToVector () const |
| Concerts to a normal precision vector with possible precision loss. | |
| decPoint3 | Round () const |
| Convert to point rounding to the nearest integer value. | |
| decDVector | Mix (const decDVector &vector, double blendFactor) const |
| Mix vectors component wise. | |
| decDVector | Multiply (const decDVector &vector) const |
| Multiply component wise. | |
Operators | |
| decDVector | operator- () const |
| Negation of this vector. | |
| decDVector & | operator= (const decDVector &v) |
| Set components of this vector to the values of another one. | |
| bool | operator== (const decDVector &v) const |
| Vectors are equal. | |
| bool | operator!= (const decDVector &v) const |
| Vectors are not equal. | |
| decDVector & | operator+= (const decDVector &v) |
| Adds the components of another vector to this one. | |
| decDVector & | operator-= (const decDVector &v) |
| Subtracts the components of another vector from this vector. | |
| decDVector & | operator*= (double k) |
| Multiplies the components of this vector with a value k. | |
| decDVector & | operator/= (double k) |
| Divide components of this vector by a value k. | |
| decDVector | operator+ (const decDVector &v) const |
| Vector with the sum of this vector with another one. | |
| decDVector | operator- (const decDVector &v) const |
| Vector with the difference of this vector to another one. | |
| decDVector | operator* (double k) const |
| Vector with this vector scaled by k. | |
| double | operator* (const decDVector &v) const |
| Calculates the dor product of this vector with another one. | |
| decDVector | operator/ (double k) const |
| Vector with this vector divided by k. | |
| decDVector | operator% (const decDVector &v) const |
| Vector with the cross producr of this vector with another one. | |
| bool | operator< (const decDVector &v) const |
| All components of this vector are less then the components of another one. | |
| bool | operator> (const decDVector &v) const |
| All components of this vector are greater then the components of another one. | |
| bool | operator<= (const decDVector &v) const |
| All components of this vector are less then or equal to the components of another one. | |
| bool | operator>= (const decDVector &v) const |
| All components of this vector are greater then or equal to the components of another one. | |
Public Attributes | |
| double | x |
| X Component of vector. | |
| double | y |
| Y Component of vector. | |
| double | z |
| Z Component of vector. | |
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.
| bool decDVector::operator!= | ( | const decDVector & | v | ) | const |
Vectors are not equal.
| 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 |
Vectors are equal.
| 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.