![]() |
Public API Reference |
#include <vector2.h>
Public Methods | |
| csVector2 () | |
| Make a new vector. No initialization is done. More... | |
| csVector2 (float x, float y) | |
| Make a new vector and initialize with the given values. More... | |
| void | Set (float ix, float iy) |
| Set vector to given values. More... | |
| void | Set (const csVector2 &v) |
| Set vector to given values. More... | |
| float | Norm () const |
| Return the norm (magnitude) of this vector. More... | |
| float | SquaredNorm () const |
| Return the squared norm (magnitude) of this vector. More... | |
| void | Rotate (float angle) |
| Rotate vector around the origin by a given angle in radians. More... | |
| csVector2 & | operator+= (const csVector2 &v) |
| Add another vector to this vector. More... | |
| csVector2 & | operator-= (const csVector2 &v) |
| Subtract another vector from this vector. More... | |
| csVector2 & | operator *= (float f) |
| Multiply this vector by a scalar. More... | |
| csVector2 & | operator/= (float f) |
| Divide this vector by a scalar. More... | |
| csVector2 | operator+ () const |
| Unary + operator. More... | |
| csVector2 | operator- () const |
| Unary - operator. More... | |
Static Public Methods | |
| float | Norm (const csVector2 &v) |
| Return the norm (magnitude) of a 2D vector. More... | |
Friends | |
| csVector2 | operator+ (const csVector2 &v1, const csVector2 &v2) |
| Add two vectors. More... | |
| csVector2 | operator- (const csVector2 &v1, const csVector2 &v2) |
| Subtract two vectors. More... | |
| float | operator * (const csVector2 &v1, const csVector2 &v2) |
| Take the dot product of two vectors. More... | |
| csVector2 | operator * (const csVector2 &v, float f) |
| Multiply a vector and a scalar. More... | |
| csVector2 | operator * (float f, const csVector2 &v) |
| Multiply a vector and a scalar. More... | |
| csVector2 | operator/ (const csVector2 &v, float f) |
| Divide a vector by a scalar. More... | |
| bool | operator== (const csVector2 &v1, const csVector2 &v2) |
| Check if two vectors are equal. More... | |
| bool | operator!= (const csVector2 &v1, const csVector2 &v2) |
| Check if two vectors are not equal. More... | |
| bool | operator< (const csVector2 &v, float f) |
| Test if each component of a vector is less than a small epsilon value. More... | |
| bool | operator> (float f, const csVector2 &v) |
| Test if each component of a vector is greater than a small epsilon value. More... | |
Definition at line 32 of file vector2.h.
|
|
Make a new vector. No initialization is done.
Definition at line 41 of file vector2.h. Referenced by operator-. |
|
||||||||||||
|
Make a new vector and initialize with the given values.
|
|
|
Return the norm (magnitude) of this vector.
|
|
|
Return the norm (magnitude) of a 2D vector.
Referenced by csPlane2::Normalize. |
|
|
Multiply this vector by a scalar.
|
|
|
Unary + operator.
|
|
|
Add another vector to this vector.
|
|
|
Unary - operator.
Definition at line 85 of file vector2.h. References csVector2. |
|
|
Subtract another vector from this vector.
|
|
|
Divide this vector by a scalar.
|
|
|
Rotate vector around the origin by a given angle in radians.
|
|
|
Set vector to given values.
|
|
||||||||||||
|
Set vector to given values.
|
|
|
Return the squared norm (magnitude) of this vector.
Definition at line 61 of file vector2.h. Referenced by csPlane2::SquaredDistance. |
|
||||||||||||
|
Multiply a vector and a scalar.
|
|
||||||||||||
|
Multiply a vector and a scalar.
|
|
||||||||||||
|
Take the dot product of two vectors.
|
|
||||||||||||
|
Check if two vectors are not equal.
|
|
||||||||||||
|
Add two vectors.
|
|
||||||||||||
|
Subtract two vectors.
|
|
||||||||||||
|
Divide a vector by a scalar.
|
|
||||||||||||
|
Test if each component of a vector is less than a small epsilon value.
|
|
||||||||||||
|
Check if two vectors are equal.
|
|
||||||||||||
|
Test if each component of a vector is greater than a small epsilon value.
|