4 Component Vector. More...
#include <decDVector4.h>
Public Member Functions | |
Constructors and Destructors | |
| decDVector4 () | |
| Creates a new vector initialized to ( 0,0,0,1 ). | |
| decDVector4 (float nx, float ny, float nz) | |
| Creates a new vector with the given values. | |
| decDVector4 (float nx, float ny, float nz, float nw) | |
| Creates a new vector with the given values. | |
| decDVector4 (const decDVector4 &v) | |
| Creates a new vector with the values of another vector. | |
| decDVector4 (const decVector4 &v) | |
| Creates a new vector with the values of another vector. | |
Management | |
| float | Length () |
| Retrieves the length of the vector. | |
| void | Normalize () |
| Normalizes the vector. | |
| void | SetZero () |
| Sets all components to 0. | |
| void | Set (float nx, float ny, float nz, float nw) |
| Sets the components to the given values. | |
| decVector4 | ToVector4 () const |
| Convert to a single precision vector with possible loss of precision. | |
Operators | |
| decDVector4 | operator- () |
| Retrieves the negation of this vector. | |
| decDVector4 & | operator= (const decDVector4 &v) |
| Sets the components of this vector to the values of another one. | |
| decDVector4 & | operator+= (const decDVector4 &v) |
| Adds the components of another vector to this one. | |
| decDVector4 & | operator-= (const decDVector4 &v) |
| Subtracts the components of another vector from this vector. | |
| decDVector4 & | operator*= (float k) |
| Multiplies the components of this vector with a value k. | |
| decDVector4 & | operator/= (float k) |
| Divides the components of this vector by a value k. | |
| decDVector4 | operator+ (const decDVector4 &v) const |
| Retrieves a new vector with the sum of this vector with another one. | |
| decDVector4 | operator- (const decDVector4 &v) const |
| Retrieves a new vector with the difference of this vector to another one. | |
| decDVector4 | operator* (float k) const |
| Retrieves a new vector with this vector scaled by k. | |
| float | operator* (const decDVector4 &v) const |
| Calculates the dor product of this vector with another one. | |
| decDVector4 | operator/ (float k) const |
| Retrieves a new vector with this vector divided by k. | |
| decDVector4 | operator% (const decDVector4 &v) const |
| Retrieves a new vector with the cross producr of this vector with another one. | |
| bool | operator< (const decDVector4 &v) const |
| Determines if all the components of this vector are less then the components of another one. | |
| bool | operator> (const decDVector4 &v) const |
| Determines if all the components of this vector are greater then the components of another one. | |
| bool | operator<= (const decDVector4 &v) const |
| Determines if all the components of this vector are less then or equal to the components of another one. | |
| bool | operator>= (const decDVector4 &v) const |
| Determines if all the components of this vector are greater then or equal to the components of another one. | |
Public Attributes | |
| float | w |
| W Component of vector. | |
| float | x |
| X Component of vector. | |
| float | y |
| Y Component of vector. | |
| float | z |
| Z Component of vector. | |
4 Component Vector.
| decDVector4::decDVector4 | ( | ) | [inline] |
Creates a new vector initialized to ( 0,0,0,1 ).
Referenced by operator%(), operator*(), operator+(), operator-(), and operator/().
| decDVector4::decDVector4 | ( | float | nx, |
| float | ny, | ||
| float | nz | ||
| ) | [inline] |
| decDVector4::decDVector4 | ( | float | nx, |
| float | ny, | ||
| float | nz, | ||
| float | nw | ||
| ) | [inline] |
| decDVector4::decDVector4 | ( | const decDVector4 & | v ) | [inline] |
| decDVector4::decDVector4 | ( | const decVector4 & | v ) | [inline] |
Creates a new vector with the values of another vector.
References decVector4::w, w, decVector4::x, x, decVector4::y, y, decVector4::z, and z.
| float decDVector4::Length | ( | ) |
Retrieves the length of the vector.
| void decDVector4::Normalize | ( | ) |
Normalizes the vector.
If the length of the vector is 0 an exception is thrown.
| decDVector4 decDVector4::operator% | ( | const decDVector4 & | v ) | const [inline] |
Retrieves a new vector with the cross producr of this vector with another one.
References decDVector4(), x, y, and z.
| decDVector4 decDVector4::operator* | ( | float | k ) | const [inline] |
Retrieves a new vector with this vector scaled by k.
References decDVector4(), x, y, and z.
| float decDVector4::operator* | ( | const decDVector4 & | v ) | const [inline] |
| decDVector4& decDVector4::operator*= | ( | float | k ) | [inline] |
| decDVector4 decDVector4::operator+ | ( | const decDVector4 & | v ) | const [inline] |
Retrieves a new vector with the sum of this vector with another one.
References decDVector4(), x, y, and z.
| decDVector4& decDVector4::operator+= | ( | const decDVector4 & | v ) | [inline] |
| decDVector4 decDVector4::operator- | ( | ) | [inline] |
Retrieves the negation of this vector.
References decDVector4(), x, y, and z.
| decDVector4 decDVector4::operator- | ( | const decDVector4 & | v ) | const [inline] |
Retrieves a new vector with the difference of this vector to another one.
References decDVector4(), x, y, and z.
| decDVector4& decDVector4::operator-= | ( | const decDVector4 & | v ) | [inline] |
| decDVector4 decDVector4::operator/ | ( | float | k ) | const [inline] |
Retrieves a new vector with this vector divided by k.
If k is 0 an exception is thrown.
References decDVector4(), THROW, x, y, and z.
| decDVector4& decDVector4::operator/= | ( | float | k ) | [inline] |
| bool decDVector4::operator< | ( | const decDVector4 & | v ) | const [inline] |
| bool decDVector4::operator<= | ( | const decDVector4 & | v ) | const [inline] |
| decDVector4& decDVector4::operator= | ( | const decDVector4 & | v ) | [inline] |
| bool decDVector4::operator> | ( | const decDVector4 & | v ) | const [inline] |
| bool decDVector4::operator>= | ( | const decDVector4 & | v ) | const [inline] |
| void decDVector4::Set | ( | float | nx, |
| float | ny, | ||
| float | nz, | ||
| float | nw | ||
| ) | [inline] |
| decVector4 decDVector4::ToVector4 | ( | ) | const [inline] |
| float decDVector4::w |
W Component of vector.
Referenced by decDVector4(), operator=(), Set(), SetZero(), and ToVector4().
| float decDVector4::x |
X Component of vector.
Referenced by decDVector4(), operator%(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator<(), operator<=(), operator=(), operator>(), operator>=(), Set(), SetZero(), and ToVector4().
| float decDVector4::y |
Y Component of vector.
Referenced by decDVector4(), operator%(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator<(), operator<=(), operator=(), operator>(), operator>=(), Set(), SetZero(), and ToVector4().
| float decDVector4::z |
Z Component of vector.
Referenced by decDVector4(), operator%(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator<(), operator<=(), operator=(), operator>(), operator>=(), Set(), SetZero(), and ToVector4().
1.7.2