#include <FixedVector2D.h>
◆ CFixedVector2D() [1/2]
CFixedVector2D::CFixedVector2D |
( |
| ) |
|
|
inline |
◆ CFixedVector2D() [2/2]
CFixedVector2D::CFixedVector2D |
( |
fixed |
X, |
|
|
fixed |
Y |
|
) |
| |
|
inline |
◆ CompareLength() [1/2]
int CFixedVector2D::CompareLength |
( |
const CFixedVector2D & |
other | ) |
const |
|
inline |
Returns -1, 0, +1 depending on whether length is less/equal/greater than the argument's length.
Avoids sqrting and overflowing.
◆ CompareLength() [2/2]
int CFixedVector2D::CompareLength |
( |
fixed |
cmp | ) |
const |
|
inline |
Returns -1, 0, +1 depending on whether length is less/equal/greater than the argument.
Avoids sqrting and overflowing.
◆ CompareLengthSquared()
int CFixedVector2D::CompareLengthSquared |
( |
u64 |
cmpSquared | ) |
const |
|
inline |
Same as above, but avoids squaring the compared value.
The argument must be the result of an SQUARE_U64_FIXED operation.
◆ Dot()
Compute the dot product of this vector with another.
Likely to overflow if both vectors are large-ish (around the 200 range).
◆ IsZero()
bool CFixedVector2D::IsZero |
( |
| ) |
const |
|
inline |
◆ Length()
fixed CFixedVector2D::Length |
( |
| ) |
const |
|
inline |
Returns the length of the vector.
Will not overflow if the result can be represented as type 'fixed'.
◆ Multiply()
Multiply by a CFixed.
Likely to overflow if both numbers are large, so we use an ugly name instead of operator* to make it obvious.
◆ Normalize() [1/2]
void CFixedVector2D::Normalize |
( |
| ) |
|
|
inline |
Normalize the vector so that length is close to 1.
If length is 0, does nothing.
◆ Normalize() [2/2]
void CFixedVector2D::Normalize |
( |
fixed |
n | ) |
|
|
inline |
Normalize the vector so that length is close to n.
If length is 0, does nothing.
◆ operator!=()
◆ operator*()
Scalar multiplication by an integer.
◆ operator+()
◆ operator+=()
◆ operator-() [1/2]
◆ operator-() [2/2]
◆ operator-=()
◆ operator/()
Scalar division by an integer. Must not have n == 0.
◆ operator==()
◆ Perpendicular()
◆ RelativeOrientation()
int CFixedVector2D::RelativeOrientation |
( |
const CFixedVector2D & |
v | ) |
const |
|
inline |
- Returns
- -1, 0 or 1 if this and @v face respectively opposite directions, perpendicular, or same directions.
◆ Rotate()
Rotate the vector by the given angle (anticlockwise).
The documentation for this class was generated from the following file: