18 #ifndef INCLUDED_FIXED_VECTOR2D 19 #define INCLUDED_FIXED_VECTOR2D 35 return (X == v.
X && Y == v.
Y);
41 return (X != v.
X || Y != v.
Y);
209 CheckCastOverflow(sum,
i32, L
"Overflow in CFixedVector2D::Dot() part 2", L
"Underflow in CFixedVector2D::Dot() part 2")
231 #endif // INCLUDED_FIXED_VECTOR2D int CompareLength(fixed cmp) const
Returns -1, 0, +1 depending on whether length is less/equal/greater than the argument.
Definition: FixedVector2D.h:124
A simple fixed-point number class.
Definition: Fixed.h:115
fixed Dot(const CFixedVector2D &v) const
Compute the dot product of this vector with another.
Definition: FixedVector2D.h:201
int64_t i64
Definition: types.h:35
Definition: FixedVector2D.h:24
CFixedVector2D operator/(int n) const
Scalar division by an integer. Must not have n == 0.
Definition: FixedVector2D.h:83
#define FIXED_MUL_I64_I32_I32(a, b)
Definition: Fixed.h:36
CFixedVector2D operator*(int n) const
Scalar multiplication by an integer.
Definition: FixedVector2D.h:77
CFixedVector2D & operator+=(const CFixedVector2D &v)
Vector addition.
Definition: FixedVector2D.h:63
void Normalize()
Normalize the vector so that length is close to 1.
Definition: FixedVector2D.h:174
bool IsZero() const
Definition: FixedVector2D.h:165
void Normalize(fixed n)
Normalize the vector so that length is close to n.
Definition: FixedVector2D.h:188
CFixedVector2D operator-() const
Negation.
Definition: FixedVector2D.h:57
T GetInternalValue() const
Definition: Fixed.h:131
CFixedVector2D(fixed X, fixed Y)
Definition: FixedVector2D.h:30
CFixedVector2D operator-(const CFixedVector2D &v) const
Vector subtraction.
Definition: FixedVector2D.h:51
uint64_t u64
Definition: types.h:40
void SetInternalValue(T n)
Definition: Fixed.h:132
bool operator!=(const CFixedVector2D &v) const
Vector inequality.
Definition: FixedVector2D.h:39
fixed Y
Definition: FixedVector2D.h:27
uint32_t u32
Definition: types.h:39
CFixedVector2D operator+(const CFixedVector2D &v) const
Vector addition.
Definition: FixedVector2D.h:45
CFixed Multiply(CFixed n) const
Multiply by a CFixed.
Definition: Fixed.h:311
CFixedVector2D Perpendicular() const
Definition: FixedVector2D.h:215
u32 isqrt64(u64 n)
64-bit integer square root.
Definition: Sqrt.cpp:23
#define CheckSignedAdditionOverflow(type, left, right, overflowWarning, underflowWarning)
Definition: Fixed.h:60
CFixed MulDiv(CFixed m, CFixed d) const
Compute this*m/d.
Definition: Fixed.h:331
#define CheckU32CastOverflow(var, targetType, overflowWarning)
Definition: Fixed.h:72
int32_t i32
Definition: types.h:34
CFixedVector2D()
Definition: FixedVector2D.h:29
CFixedVector2D Multiply(fixed n) const
Multiply by a CFixed.
Definition: FixedVector2D.h:92
fixed Length() const
Returns the length of the vector.
Definition: FixedVector2D.h:101
bool operator==(const CFixedVector2D &v) const
Vector equality.
Definition: FixedVector2D.h:33
bool IsZero() const
Returns true if the number is precisely 0.
Definition: Fixed.h:199
CFixedVector2D & operator-=(const CFixedVector2D &v)
Vector subtraction.
Definition: FixedVector2D.h:70
#define CheckUnsignedAdditionOverflow(result, operand, overflowWarning)
Definition: Fixed.h:76
fixed X
Definition: FixedVector2D.h:27
void sincos_approx(CFixed_15_16 a, CFixed_15_16 &sin_out, CFixed_15_16 &cos_out)
Compute sin(a) and cos(a).
Definition: Fixed.cpp:187
int CompareLength(const CFixedVector2D &other) const
Returns -1, 0, +1 depending on whether length is less/equal/greater than the argument's length...
Definition: FixedVector2D.h:147
CFixedVector2D Rotate(fixed angle) const
Rotate the vector by the given angle (anticlockwise).
Definition: FixedVector2D.h:223
#define CheckCastOverflow(var, targetType, overflowWarning, underflowWarning)
Definition: Fixed.h:66