|
Drag[en]gine Game Engine 1.32.3
|
2 component vector. More...
#include <decVector2.h>
Public Member Functions | |
Constructors and Destructors | |
| decVector2 () | |
| Create zero vector. | |
| decVector2 (float nx, float ny) | |
| Create vector with initial values. | |
| decVector2 (const decVector2 &v) | |
| Create copy of vector. | |
| decVector2 (const decPoint &p) | |
| Create vector from point. | |
Management | |
| float | Length () const |
| Length. | |
| void | Normalize () |
| Normalize vector. | |
| decVector2 | Normalized () const |
| Normalized vector. | |
| const decVector2 | Absolute () const |
| Absolute vector. | |
| void | Snap (float grid) |
| Snaps the components of the vector to a grid with the given size. | |
| bool | IsEqualTo (const decVector2 &v, float threshold=VECTOR_THRESHOLD) const |
| Component of vector are equal to another one with respect to a threshold. | |
| void | SetZero () |
| Set all components to 0. | |
| void | Set (float nx, float ny) |
| Set components to the given values. | |
| void | Set (const decVector2 &v) |
| Set components to the given vector. | |
| void | Negate () |
| Negate vector. | |
| void | SetSmallest (const decVector2 &v) |
| Set each component to the smallest value of this vector and another vector. | |
| decVector2 | Smallest (const decVector2 &v) const |
| Vector with each component set to the smallest value of this vector and another vector. | |
| void | SetLargest (const decVector2 &v) |
| Set each component to the largest value of this vector and another vector. | |
| decVector2 | Largest (const decVector2 &v) const |
| Vector with each component set to the largest value of this vector and another vector. | |
| void | SetClamped (const decVector2 &minValue, const decVector2 &maxValue) |
| Clamp each component to the provided range. | |
| decVector2 | Clamped (const decVector2 &minValue, const decVector2 &maxValue) const |
| Vector with each component clamped to the provided range. | |
| decVector2 | RotateLeft () const |
| Rotate vector counter-clock-wise by 90 degrees. | |
| decVector2 | RotateRight () const |
| Rotate vector clock-wise by 90 degrees. | |
| decPoint | Round () const |
| Convert to point rounding to the nearest integer value. | |
| decVector2 | Mix (const decVector2 &vector, float blendFactor) const |
| Mix vectors component wise. | |
| decVector2 | Multiply (const decVector2 &vector) const |
| Multiply component wise. | |
Operators | |
| decVector2 | operator- () const |
| Negation of this vector. | |
| decVector2 & | operator= (const decVector2 &v) |
| Set components of this vector to the values of another one. | |
| bool | operator== (const decVector2 &v) const |
| Vectors are equal. | |
| bool | operator!= (const decVector2 &v) const |
| Vectors are not equal. | |
| decVector2 & | operator+= (const decVector2 &v) |
| Add components of another vector to this one. | |
| decVector2 & | operator-= (const decVector2 &v) |
| Subtract components of another vector from this vector. | |
| decVector2 & | operator*= (float k) |
| Multiply components of this vector with a value k. | |
| decVector2 & | operator/= (float k) |
| Divide components of this vector by a value k. | |
| decVector2 | operator+ (const decVector2 &v) const |
| Vector with the sum of this vector with another one. | |
| decVector2 | operator- (const decVector2 &v) const |
| Vector with the difference of this vector to another one. | |
| decVector2 | operator* (float k) const |
| Vector with this vector scaled by k. | |
| float | operator* (const decVector2 &v) const |
| Calculate dot product of this vector with another one. | |
| decVector2 | operator/ (float k) const |
| Vector with this vector divided by k. | |
| bool | operator< (const decVector2 &v) const |
| All the components of this vector are less then the components of another one. | |
| bool | operator> (const decVector2 &v) const |
| All the components of this vector are greater then the components of another one. | |
| bool | operator<= (const decVector2 &v) const |
| All the components of this vector are less then or equal to the components of another one. | |
| bool | operator>= (const decVector2 &v) const |
| All the components of this vector are greater then or equal to the components of another one. | |
Public Attributes | |
| float | x |
| float | y |
2 component vector.
| decVector2::decVector2 | ( | ) |
Create zero vector.
| decVector2::decVector2 | ( | float | nx, |
| float | ny | ||
| ) |
Create vector with initial values.
| decVector2::decVector2 | ( | const decVector2 & | v | ) |
Create copy of vector.
| decVector2::decVector2 | ( | const decPoint & | p | ) |
Create vector from point.
| const decVector2 decVector2::Absolute | ( | ) | const |
Absolute vector.
| decVector2 decVector2::Clamped | ( | const decVector2 & | minValue, |
| const decVector2 & | maxValue | ||
| ) | const |
Vector with each component clamped to the provided range.
| bool decVector2::IsEqualTo | ( | const decVector2 & | v, |
| float | threshold = VECTOR_THRESHOLD |
||
| ) | const |
Component of vector are equal to another one with respect to a threshold.
| decVector2 decVector2::Largest | ( | const decVector2 & | v | ) | const |
Vector with each component set to the largest value of this vector and another vector.
| float decVector2::Length | ( | ) | const |
Length.
| decVector2 decVector2::Mix | ( | const decVector2 & | vector, |
| float | blendFactor | ||
| ) | const |
Mix vectors component wise.
| decVector2 decVector2::Multiply | ( | const decVector2 & | vector | ) | const |
Multiply component wise.
| void decVector2::Negate | ( | ) |
Negate vector.
| void decVector2::Normalize | ( | ) |
Normalize vector.
| deeDivisionByZero | Length of vector is 0. |
| decVector2 decVector2::Normalized | ( | ) | const |
Normalized vector.
| deeDivisionByZero | Length of vector is 0. |
| bool decVector2::operator!= | ( | const decVector2 & | v | ) | const |
Vectors are not equal.
| float decVector2::operator* | ( | const decVector2 & | v | ) | const |
Calculate dot product of this vector with another one.
| decVector2 decVector2::operator* | ( | float | k | ) | const |
Vector with this vector scaled by k.
| decVector2 & decVector2::operator*= | ( | float | k | ) |
Multiply components of this vector with a value k.
| decVector2 decVector2::operator+ | ( | const decVector2 & | v | ) | const |
Vector with the sum of this vector with another one.
| decVector2 & decVector2::operator+= | ( | const decVector2 & | v | ) |
Add components of another vector to this one.
| decVector2 decVector2::operator- | ( | ) | const |
Negation of this vector.
| decVector2 decVector2::operator- | ( | const decVector2 & | v | ) | const |
Vector with the difference of this vector to another one.
| decVector2 & decVector2::operator-= | ( | const decVector2 & | v | ) |
Subtract components of another vector from this vector.
| decVector2 decVector2::operator/ | ( | float | k | ) | const |
Vector with this vector divided by k.
| deeDivisionByZero | Length of vector is 0. |
| decVector2 & decVector2::operator/= | ( | float | k | ) |
Divide components of this vector by a value k.
| deeDivisionByZero | Length of vector is 0. |
| bool decVector2::operator< | ( | const decVector2 & | v | ) | const |
All the components of this vector are less then the components of another one.
| bool decVector2::operator<= | ( | const decVector2 & | v | ) | const |
All the components of this vector are less then or equal to the components of another one.
| decVector2 & decVector2::operator= | ( | const decVector2 & | v | ) |
Set components of this vector to the values of another one.
| bool decVector2::operator== | ( | const decVector2 & | v | ) | const |
Vectors are equal.
| bool decVector2::operator> | ( | const decVector2 & | v | ) | const |
All the components of this vector are greater then the components of another one.
| bool decVector2::operator>= | ( | const decVector2 & | v | ) | const |
All the components of this vector are greater then or equal to the components of another one.
| decVector2 decVector2::RotateLeft | ( | ) | const |
Rotate vector counter-clock-wise by 90 degrees.
| decVector2 decVector2::RotateRight | ( | ) | const |
Rotate vector clock-wise by 90 degrees.
| decPoint decVector2::Round | ( | ) | const |
Convert to point rounding to the nearest integer value.
| void decVector2::Set | ( | const decVector2 & | v | ) |
Set components to the given vector.
| void decVector2::Set | ( | float | nx, |
| float | ny | ||
| ) |
Set components to the given values.
| void decVector2::SetClamped | ( | const decVector2 & | minValue, |
| const decVector2 & | maxValue | ||
| ) |
Clamp each component to the provided range.
| void decVector2::SetLargest | ( | const decVector2 & | v | ) |
Set each component to the largest value of this vector and another vector.
| void decVector2::SetSmallest | ( | const decVector2 & | v | ) |
Set each component to the smallest value of this vector and another vector.
| void decVector2::SetZero | ( | ) |
Set all components to 0.
| decVector2 decVector2::Smallest | ( | const decVector2 & | v | ) | const |
Vector with each component set to the smallest value of this vector and another vector.
| void decVector2::Snap | ( | float | grid | ) |
Snaps the components of the vector to a grid with the given size.
| float decVector2::x |
| float decVector2::y |