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