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);
158 CheckCastOverflow(x,
i32, L
"Overflow in CFixedVector3D::Cross() part 4", L
"Underflow in CFixedVector3D::Cross() part 4")
159 CheckCastOverflow(y,
i32, L
"Overflow in CFixedVector3D::Cross() part 5", L
"Underflow in CFixedVector3D::Cross() part 5")
160 CheckCastOverflow(z,
i32, L
"Overflow in CFixedVector3D::Cross() part 6", L
"Underflow in CFixedVector3D::Cross() part 6")
182 CheckCastOverflow(sum,
i32, L
"Overflow in CFixedVector3D::Dot() part 3", L
"Underflow in CFixedVector3D::Dot() part 3")
190 #endif // INCLUDED_FIXED_VECTOR3D
A simple fixed-point number class.
CFixedVector3D operator-(const CFixedVector3D &v) const
Vector subtraction.
#define FIXED_MUL_I64_I32_I32(a, b)
fixed Length() const
Returns the length of the vector.
void Normalize()
Normalize the vector so that length is close to 1.
T GetInternalValue() const
CFixedVector3D & operator-=(const CFixedVector3D &v)
Vector subtraction.
#define CheckSignedSubtractionOverflow(type, left, right, overflowWarning, underflowWarning)
bool operator!=(const CFixedVector3D &v) const
Vector inequality.
void SetInternalValue(T n)
bool operator==(const CFixedVector3D &v) const
Vector equality.
CFixedVector3D operator+(const CFixedVector3D &v) const
Vector addition.
CFixedVector3D operator-() const
Negation.
CFixedVector3D & operator+=(const CFixedVector3D &v)
Vector addition.
CFixedVector3D Cross(const CFixedVector3D &v)
Compute the cross product of this vector with another.
CFixedVector3D(fixed X, fixed Y, fixed Z)
u32 isqrt64(u64 n)
64-bit integer square root.
#define CheckSignedAdditionOverflow(type, left, right, overflowWarning, underflowWarning)
CFixed MulDiv(CFixed m, CFixed d) const
Compute this*m/d.
#define CheckU32CastOverflow(var, targetType, overflowWarning)
bool IsZero() const
Returns true if the number is precisely 0.
#define CheckUnsignedAdditionOverflow(result, operand, overflowWarning)
void Normalize(fixed n)
Normalize the vector so that length is close to n.
fixed Dot(const CFixedVector3D &v)
Compute the dot product of this vector with another.
#define CheckCastOverflow(var, targetType, overflowWarning, underflowWarning)