mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2024-12-27 07:05:38 +03:00
Update vector.h
This commit is contained in:
parent
7420ba158a
commit
f96ca908db
@ -64,12 +64,14 @@ public:
|
|||||||
decltype(auto) operator/(float fl) const { return Vector2D(x / fl, y / fl); }
|
decltype(auto) operator/(float fl) const { return Vector2D(x / fl, y / fl); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
decltype(auto) operator=(std::nullptr_t) { return Vector2D(0, 0); }
|
||||||
decltype(auto) operator+=(float fl) { return (*this = *this + fl); }
|
decltype(auto) operator+=(float fl) { return (*this = *this + fl); }
|
||||||
decltype(auto) operator-=(float fl) { return (*this = *this - fl); }
|
decltype(auto) operator-=(float fl) { return (*this = *this - fl); }
|
||||||
decltype(auto) operator*=(float fl) { return (*this = *this * fl); }
|
decltype(auto) operator*=(float fl) { return (*this = *this * fl); }
|
||||||
decltype(auto) operator/=(float fl) { return (*this = *this / fl); }
|
decltype(auto) operator/=(float fl) { return (*this = *this / fl); }
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
|
inline void Clear() { x = 0; y = 0; }
|
||||||
inline void CopyToArray(float *rgfl) const { *(int *)&rgfl[0] = *(int *)&x; *(int *)&rgfl[1] = *(int *)&y; }
|
inline void CopyToArray(float *rgfl) const { *(int *)&rgfl[0] = *(int *)&x; *(int *)&rgfl[1] = *(int *)&y; }
|
||||||
inline real_t Length() const { return Q_sqrt(real_t(x * x + y * y)); } // Get the vector's magnitude
|
inline real_t Length() const { return Q_sqrt(real_t(x * x + y * y)); } // Get the vector's magnitude
|
||||||
inline float LengthSquared() const { return (x * x + y * y); } // Get the vector's magnitude squared
|
inline float LengthSquared() const { return (x * x + y * y); } // Get the vector's magnitude squared
|
||||||
@ -166,11 +168,20 @@ public:
|
|||||||
decltype(auto) operator/(float fl) const { return Vector(x / fl, y / fl, z / fl); }
|
decltype(auto) operator/(float fl) const { return Vector(x / fl, y / fl, z / fl); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
decltype(auto) operator=(std::nullptr_t) { return Vector(0, 0, 0); }
|
||||||
decltype(auto) operator+=(float fl) { return (*this = *this + fl); }
|
decltype(auto) operator+=(float fl) { return (*this = *this + fl); }
|
||||||
decltype(auto) operator-=(float fl) { return (*this = *this - fl); }
|
decltype(auto) operator-=(float fl) { return (*this = *this - fl); }
|
||||||
decltype(auto) operator*=(float fl) { return (*this = *this * fl); }
|
decltype(auto) operator*=(float fl) { return (*this = *this * fl); }
|
||||||
decltype(auto) operator/=(float fl) { return (*this = *this / fl); }
|
decltype(auto) operator/=(float fl) { return (*this = *this / fl); }
|
||||||
|
|
||||||
|
// Methods
|
||||||
|
void Clear()
|
||||||
|
{
|
||||||
|
x = 0;
|
||||||
|
y = 0;
|
||||||
|
z = 0;
|
||||||
|
}
|
||||||
|
|
||||||
void CopyToArray(float *rgfl) const
|
void CopyToArray(float *rgfl) const
|
||||||
{
|
{
|
||||||
*(int *)&rgfl[0] = *(int *)&x;
|
*(int *)&rgfl[0] = *(int *)&x;
|
||||||
|
Loading…
Reference in New Issue
Block a user