31 template <
class OtherVector>
52 inline bool operator == (
const Vector &inV2)
const
55 if (mF32[r] != inV2.
mF32[r])
60 inline bool operator != (
const Vector &inV2)
const
63 if (mF32[r] != inV2.
mF32[r])
87 mF32[r] = inV2.
mF32[r];
96 v.
mF32[r] = mF32[r] * inV2;
100 inline Vector & operator *= (
const float inV2)
114 inline Vector operator / (
float inV2)
const
118 v.
mF32[r] = mF32[r] / inV2;
141 mF32[r] += inV2.
mF32[r];
150 v.
mF32[r] = -mF32[r];
166 mF32[r] -= inV2.
mF32[r];
188 return sqrt(LengthSq());
200 return *
this / Length();
unsigned int uint
Definition Core.h:439
#define JPH_NAMESPACE_END
Definition Core.h:367
#define JPH_NAMESPACE_BEGIN
Definition Core.h:361
DVec3 operator*(double inV1, DVec3Arg inV2)
Definition DVec3.inl:447
#define JPH_ASSERT(...)
Definition IssueReporting.h:33
AllocateFunction Allocate
Definition Memory.cpp:59
Templatized vector class.
Definition Vector.h:12
void SetZero()
Vector with all zeros.
Definition Vector.h:22
Vector Normalized() const
Normalize vector.
Definition Vector.h:198
bool IsNormalized(float inToleranceSq=1.0e-6f)
Check if vector is normalized.
Definition Vector.h:192
float Length() const
Length of vector.
Definition Vector.h:186
uint GetRows() const
Dimensions.
Definition Vector.h:19
float mF32[Rows]
Definition Vector.h:213
bool IsZero() const
Test if vector consists of all zeros.
Definition Vector.h:69
void CopyPart(const OtherVector &inV, uint inSourceRow, uint inNumRows, uint inDestRow)
Copy a (part) of another vector into this vector.
Definition Vector.h:32
Vector()=default
Constructor.
float Dot(const Vector &inV2) const
Dot product.
Definition Vector.h:171
static Vector sZero()
Definition Vector.h:28
Vector(const Vector &inRHS)
Definition Vector.h:16
bool IsClose(const Vector &inV2, float inMaxDistSq=1.0e-12f)
Test if two vectors are close to each other.
Definition Vector.h:78
float LengthSq() const
Squared length of vector.
Definition Vector.h:180