18 #ifndef INCLUDED_FIXED_VECTOR3D 19 #define INCLUDED_FIXED_VECTOR3D 36 return (X == v.
X && Y == v.
Y && Z == v.
Z);
42 return (X != v.
X || Y != v.
Y || Z != v.
Z);
155 CheckCastOverflow(x,
i32, L
"Overflow in CFixedVector3D::Cross() part 4", L
"Underflow in CFixedVector3D::Cross() part 4")
156 CheckCastOverflow(y,
i32, L
"Overflow in CFixedVector3D::Cross() part 5", L
"Underflow in CFixedVector3D::Cross() part 5")
157 CheckCastOverflow(z,
i32, L
"Overflow in CFixedVector3D::Cross() part 6", L
"Underflow in CFixedVector3D::Cross() part 6")
179 CheckCastOverflow(sum,
i32, L
"Overflow in CFixedVector3D::Dot() part 3", L
"Underflow in CFixedVector3D::Dot() part 3")
187 #endif // INCLUDED_FIXED_VECTOR3D A simple fixed-point number class.
Definition: Fixed.h:119
int64_t i64
Definition: types.h:35
CFixedVector3D operator-() const
Negation.
Definition: FixedVector3D.h:58
T GetInternalValue() const
Definition: Fixed.h:135
fixed Y
Definition: FixedVector3D.h:27
void Normalize()
Normalize the vector so that length is close to 1.
Definition: FixedVector3D.h:106
CFixedVector3D & operator-=(const CFixedVector3D &v)
Vector subtraction.
Definition: FixedVector3D.h:71
fixed Length() const
Returns the length of the vector.
Definition: FixedVector3D.h:82
#define CheckSignedSubtractionOverflow(type, left, right, overflowWarning, underflowWarning)
Definition: Fixed.h:58
uint64_t u64
Definition: types.h:40
void SetInternalValue(T n)
Definition: Fixed.h:136
bool operator==(const CFixedVector3D &v) const
Vector equality.
Definition: FixedVector3D.h:34
uint32_t u32
Definition: types.h:39
CFixedVector3D operator-(const CFixedVector3D &v) const
Vector subtraction.
Definition: FixedVector3D.h:52
CFixedVector3D & operator+=(const CFixedVector3D &v)
Vector addition.
Definition: FixedVector3D.h:64
CFixedVector3D Cross(const CFixedVector3D &v)
Compute the cross product of this vector with another.
Definition: FixedVector3D.h:135
CFixedVector3D(fixed X, fixed Y, fixed Z)
Definition: FixedVector3D.h:31
Definition: FixedVector3D.h:24
u32 isqrt64(u64 n)
64-bit integer square root.
Definition: Sqrt.cpp:23
bool operator!=(const CFixedVector3D &v) const
Vector inequality.
Definition: FixedVector3D.h:40
CFixedVector3D operator+(const CFixedVector3D &v) const
Vector addition.
Definition: FixedVector3D.h:46
constexpr bool IsZero() const
Returns true if the number is precisely 0.
Definition: Fixed.h:209
#define CheckSignedAdditionOverflow(type, left, right, overflowWarning, underflowWarning)
Definition: Fixed.h:64
#define CheckU32CastOverflow(var, targetType, overflowWarning)
Definition: Fixed.h:76
int32_t i32
Definition: types.h:34
fixed Z
Definition: FixedVector3D.h:27
fixed X
Definition: FixedVector3D.h:27
#define CheckUnsignedAdditionOverflow(result, operand, overflowWarning)
Definition: Fixed.h:80
CFixedVector3D()
Definition: FixedVector3D.h:29
#define SQUARE_U64_FIXED(a)
Definition: Fixed.h:39
#define MUL_I64_I32_I32(a, b)
Definition: Fixed.h:37
CFixed MulDiv(CFixed m, CFixed d) const
Compute this*m/d.
Definition: Fixed.h:341
void Normalize(fixed n)
Normalize the vector so that length is close to n.
Definition: FixedVector3D.h:121
fixed Dot(const CFixedVector3D &v)
Compute the dot product of this vector with another.
Definition: FixedVector3D.h:168
#define CheckCastOverflow(var, targetType, overflowWarning, underflowWarning)
Definition: Fixed.h:70