16#if defined(JPH_USE_AVX)
18#elif defined(JPH_USE_SSE)
21#elif defined(JPH_USE_NEON)
28 #ifdef JPH_FLOATING_POINT_EXCEPTIONS_ENABLED
41#if defined(JPH_USE_AVX)
43#elif defined(JPH_USE_SSE)
46#elif defined(JPH_USE_NEON)
53 #ifdef JPH_FLOATING_POINT_EXCEPTIONS_ENABLED
61#if defined(JPH_USE_AVX)
67#elif defined(JPH_USE_SSE)
70#elif defined(JPH_USE_NEON)
77 #ifdef JPH_FLOATING_POINT_EXCEPTIONS_ENABLED
85#ifdef JPH_FLOATING_POINT_EXCEPTIONS_ENABLED
94#ifdef JPH_FLOATING_POINT_EXCEPTIONS_ENABLED
95 #if defined(JPH_USE_AVX)
97 #elif defined(JPH_USE_SSE)
102 #elif defined(JPH_USE_NEON)
122#if defined(JPH_USE_AVX)
124#elif defined(JPH_USE_SSE)
127#elif defined(JPH_USE_NEON)
131 return DVec3(0, 0, 0);
137#if defined(JPH_USE_AVX)
139#elif defined(JPH_USE_SSE)
142#elif defined(JPH_USE_NEON)
152 return sReplicate(numeric_limits<double>::quiet_NaN());
157#if defined(JPH_USE_AVX)
159#elif defined(JPH_USE_SSE)
163#elif defined(JPH_USE_NEON)
180#if defined(JPH_USE_AVX)
182#elif defined(JPH_USE_SSE)
186#elif defined(JPH_USE_NEON)
189 return Vec3((
float)GetX(), (
float)GetY(), (
float)GetZ());
195#if defined(JPH_USE_AVX)
197#elif defined(JPH_USE_SSE)
199#elif defined(JPH_USE_NEON)
210#if defined(JPH_USE_AVX)
212#elif defined(JPH_USE_SSE)
214#elif defined(JPH_USE_NEON)
230#if defined(JPH_USE_AVX)
232#elif defined(JPH_USE_SSE)
234#elif defined(JPH_USE_NEON)
245#if defined(JPH_USE_AVX)
247#elif defined(JPH_USE_SSE)
249#elif defined(JPH_USE_NEON)
260#if defined(JPH_USE_AVX)
262#elif defined(JPH_USE_SSE)
264#elif defined(JPH_USE_NEON)
275#if defined(JPH_USE_AVX)
277#elif defined(JPH_USE_SSE)
279#elif defined(JPH_USE_NEON)
290#if defined(JPH_USE_AVX)
292#elif defined(JPH_USE_SSE)
294#elif defined(JPH_USE_NEON)
305#if defined(JPH_USE_AVX)
311#elif defined(JPH_USE_NEON)
320#if defined(JPH_USE_AVX)
322#elif defined(JPH_USE_SSE4_1)
325#elif defined(JPH_USE_NEON)
330 for (
int i = 0;
i < 3;
i++)
332#ifdef JPH_FLOATING_POINT_EXCEPTIONS_ENABLED
341#if defined(JPH_USE_AVX)
343#elif defined(JPH_USE_SSE)
345#elif defined(JPH_USE_NEON)
356#if defined(JPH_USE_AVX)
358#elif defined(JPH_USE_SSE)
360#elif defined(JPH_USE_NEON)
371#if defined(JPH_USE_AVX)
373#elif defined(JPH_USE_SSE)
375#elif defined(JPH_USE_NEON)
386#if defined(JPH_USE_AVX)
388#elif defined(JPH_USE_SSE)
422#if defined(JPH_USE_AVX)
424#elif defined(JPH_USE_SSE)
426#elif defined(JPH_USE_NEON)
435#if defined(JPH_USE_AVX)
437#elif defined(JPH_USE_SSE)
440#elif defined(JPH_USE_NEON)
449#if defined(JPH_USE_AVX)
451#elif defined(JPH_USE_SSE)
454#elif defined(JPH_USE_NEON)
463#if defined(JPH_USE_AVX)
465#elif defined(JPH_USE_SSE)
468#elif defined(JPH_USE_NEON)
478#if defined(JPH_USE_AVX)
480#elif defined(JPH_USE_SSE)
484#elif defined(JPH_USE_NEON)
488 for (
int i = 0;
i < 3; ++
i)
490 #ifdef JPH_FLOATING_POINT_EXCEPTIONS_ENABLED
499#if defined(JPH_USE_AVX)
501#elif defined(JPH_USE_SSE)
504#elif defined(JPH_USE_NEON)
508 for (
int i = 0;
i < 3; ++
i)
510 #ifdef JPH_FLOATING_POINT_EXCEPTIONS_ENABLED
519#if defined(JPH_USE_AVX)
521#elif defined(JPH_USE_SSE)
525#elif defined(JPH_USE_NEON)
530 for (
int i = 0;
i < 3; ++
i)
532 #ifdef JPH_FLOATING_POINT_EXCEPTIONS_ENABLED
541#if defined(JPH_USE_AVX)
543#elif defined(JPH_USE_SSE)
545#elif defined(JPH_USE_NEON)
554#if defined(JPH_USE_AVX)
556#elif defined(JPH_USE_SSE)
558#elif defined(JPH_USE_NEON)
567#if defined(JPH_USE_AVX)
569#elif defined(JPH_USE_SSE)
572#elif defined(JPH_USE_NEON)
576 for (
int i = 0;
i < 3; ++
i)
578 #ifdef JPH_FLOATING_POINT_EXCEPTIONS_ENABLED
587#if defined(JPH_USE_AVX)
589#elif defined(JPH_USE_SSE)
592#elif defined(JPH_USE_NEON)
596 for (
int i = 0;
i < 3; ++
i)
598 #ifdef JPH_FLOATING_POINT_EXCEPTIONS_ENABLED
607#if defined(JPH_USE_AVX)
609#elif defined(JPH_USE_SSE)
612#elif defined(JPH_USE_NEON)
621#if defined(JPH_USE_AVX)
623#elif defined(JPH_USE_SSE)
625#elif defined(JPH_USE_NEON)
634#if defined(JPH_USE_AVX)
636#elif defined(JPH_USE_SSE)
638#elif defined(JPH_USE_NEON)
647#if defined(JPH_USE_AVX)
649#elif defined(JPH_USE_SSE)
652#elif defined(JPH_USE_NEON)
656 for (
int i = 0;
i < 3; ++
i)
658 #ifdef JPH_FLOATING_POINT_EXCEPTIONS_ENABLED
667#if defined(JPH_USE_AVX)
669#elif defined(JPH_USE_SSE)
672#elif defined(JPH_USE_NEON)
676 for (
int i = 0;
i < 3; ++
i)
678 #ifdef JPH_FLOATING_POINT_EXCEPTIONS_ENABLED
688#if defined(JPH_USE_AVX)
690#elif defined(JPH_USE_SSE)
692#elif defined(JPH_USE_NEON)
701#if defined(JPH_USE_AVX512)
703#elif defined(JPH_USE_AVX)
705#elif defined(JPH_USE_SSE)
708#elif defined(JPH_USE_NEON)
722#if defined(JPH_USE_AVX2)
738#if defined(JPH_USE_AVX)
746#elif defined(JPH_USE_SSE)
753#elif defined(JPH_USE_NEON)
759 for (
int i = 0;
i < 3;
i++)
772#if defined(JPH_USE_AVX)
774#elif defined(JPH_USE_SSE)
776#elif defined(JPH_USE_NEON)
785 return sqrt(
Dot(*
this));
800#if defined(JPH_USE_AVX512)
802#elif defined(JPH_USE_AVX)
804#elif defined(JPH_USE_SSE)
807 return isnan(
mF64[0]) || isnan(
mF64[1]) || isnan(
mF64[2]);
813#if defined(JPH_USE_AVX512)
815#elif defined(JPH_USE_AVX)
819#elif defined(JPH_USE_SSE)
823#elif defined(JPH_USE_NEON)
828 return DVec3(std::signbit(
mF64[0])? -1.0 : 1.0,
829 std::signbit(
mF64[1])? -1.0 : 1.0,
830 std::signbit(
mF64[2])? -1.0 : 1.0);
839#if defined(JPH_USE_AVX)
841#elif defined(JPH_USE_SSE)
844#elif defined(JPH_USE_NEON)
852 return DVec3(x, y, z);
861#if defined(JPH_USE_AVX512)
866#elif defined(JPH_USE_AVX)
872#elif defined(JPH_USE_SSE4_1)
882#elif defined(JPH_USE_NEON)
903 return DVec3(x, y, z);
std::uint64_t uint64
Definition Core.h:443
#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_MAKE_HASHABLE(type,...)
Definition HashCombine.h:87
#define JPH_ASSERT(...)
Definition IssueReporting.h:33
AllocateFunction Allocate
Definition Memory.cpp:59
static JPH_INLINE DVec3 sLess(DVec3Arg inV1, DVec3Arg inV2)
Less than (component wise)
Definition DVec3.inl:243
double mF64[4]
Definition DVec3.h:280
static JPH_INLINE DVec3 sMax(DVec3Arg inV1, DVec3Arg inV2)
Return the maximum of each of the components.
Definition DVec3.inl:208
JPH_INLINE bool TestAnyTrue() const
Test if any of the components are true (true is when highest bit of component is set)
Definition DVec3.inl:395
JPH_INLINE Vec3 ToVec3RoundDown() const
Convert to float vector 3 rounding down.
Definition DVec3.inl:907
static JPH_INLINE DVec3 sClamp(DVec3Arg inV, DVec3Arg inMin, DVec3Arg inMax)
Clamp a vector between min and max (component wise)
Definition DVec3.inl:223
static JPH_INLINE DVec3 sMin(DVec3Arg inV1, DVec3Arg inV2)
Return the minimum value of each of the components.
Definition DVec3.inl:193
JPH_INLINE int GetTrues() const
Store if X is true in bit 0, Y in bit 1, Z in bit 2 and W in bit 3 (true is when highest bit of compo...
Definition DVec3.inl:384
static JPH_INLINE DVec3 sAnd(DVec3Arg inV1, DVec3Arg inV2)
Logical and (component wise)
Definition DVec3.inl:369
JPH_INLINE DVec3 & operator*=(double inV2)
Multiply vector with double.
Definition DVec3.inl:476
JPH_INLINE DVec3 Abs() const
Return the absolute value of each of the components.
Definition DVec3.inl:699
static JPH_INLINE DVec3 sFusedMultiplyAdd(DVec3Arg inMul1, DVec3Arg inMul2, DVec3Arg inAdd)
Calculates inMul1 * inMul2 + inAdd.
Definition DVec3.inl:303
static JPH_INLINE Type sFixW(TypeArg inValue)
Internal helper function that ensures that the Z component is replicated to the W component to preven...
Definition DVec3.inl:92
JPH_INLINE DVec3 Sqrt() const
Component wise square root.
Definition DVec3.inl:770
JPH_INLINE DVec3 GetSign() const
Get vector that contains the sign of each element (returns 1 if positive, -1 if negative)
Definition DVec3.inl:811
Type mValue
Definition DVec3.h:279
static JPH_INLINE DVec3 sXor(DVec3Arg inV1, DVec3Arg inV2)
Logical xor (component wise)
Definition DVec3.inl:354
static JPH_INLINE DVec3 sGreaterOrEqual(DVec3Arg inV1, DVec3Arg inV2)
Greater than or equal (component wise)
Definition DVec3.inl:288
JPH_INLINE DVec3 operator+(Vec3Arg inV2) const
Add two vectors (component wise)
Definition DVec3.inl:539
JPH_INLINE bool IsClose(DVec3Arg inV2, double inMaxDistSq=1.0e-24) const
Test if two vectors are close.
Definition DVec3.inl:410
JPH_INLINE bool IsNormalized(double inTolerance=1.0e-12) const
Test if vector is normalized.
Definition DVec3.inl:793
const Type & TypeArg
Definition DVec3.h:30
static JPH_INLINE DVec3 sNaN()
Vector with all NaN's.
Definition DVec3.inl:150
friend JPH_INLINE DVec3 operator*(double inV1, DVec3Arg inV2)
Multiply vector with double.
Definition DVec3.inl:447
static JPH_INLINE DVec3 sGreater(DVec3Arg inV1, DVec3Arg inV2)
Greater than (component wise)
Definition DVec3.inl:273
JPH_INLINE void StoreDouble3(Double3 *outV) const
Store 3 doubles to memory.
Definition DVec3.inl:171
static JPH_INLINE DVec3 sOr(DVec3Arg inV1, DVec3Arg inV2)
Logical or (component wise)
Definition DVec3.inl:339
static JPH_INLINE DVec3 sSelect(DVec3Arg inV1, DVec3Arg inV2, DVec3Arg inControl)
Component wise select, returns inV1 when highest bit of inControl = 0 and inV2 when highest bit of in...
Definition DVec3.inl:318
static JPH_INLINE DVec3 sZero()
Vector with all zeros.
Definition DVec3.inl:120
JPH_INLINE bool TestAllTrue() const
Test if all components are true (true is when highest bit of component is set)
Definition DVec3.inl:400
JPH_INLINE double Length() const
Length of vector.
Definition DVec3.inl:783
JPH_INLINE DVec3 operator-() const
Negate.
Definition DVec3.inl:605
JPH_INLINE bool IsNaN() const
Test if vector contains NaN elements.
Definition DVec3.inl:798
JPH_INLINE Vec3 ToVec3RoundUp() const
Convert to float vector 3 rounding up.
Definition DVec3.inl:914
static const double cTrue
Representations of true and false for boolean operations.
Definition DVec3.h:274
DVec3()=default
Constructor.
JPH_INLINE void CheckW() const
Internal helper function that checks that W is equal to Z, so e.g. dividing by it should not generate...
Definition DVec3.inl:83
JPH_INLINE double LengthSq() const
Squared length of vector.
Definition DVec3.inl:765
JPH_INLINE DVec3 Normalized() const
Normalize vector.
Definition DVec3.inl:788
JPH_INLINE DVec3 operator/(double inV2) const
Divide vector by double.
Definition DVec3.inl:461
JPH_INLINE double Dot(DVec3Arg inV2) const
Dot product.
Definition DVec3.inl:736
static JPH_INLINE DVec3 sReplicate(double inV)
Replicate inV across all components.
Definition DVec3.inl:135
static JPH_INLINE DVec3 sLessOrEqual(DVec3Arg inV1, DVec3Arg inV2)
Less than or equal (component wise)
Definition DVec3.inl:258
JPH_INLINE DVec3 PrepareRoundToInf() const
Prepare to convert to float vector 3 rounding towards positive/negative inf (returns DVec3 that can b...
Definition DVec3.inl:856
JPH_INLINE DVec3 & operator+=(Vec3Arg inV2)
Add two vectors (component wise)
Definition DVec3.inl:565
static JPH_INLINE DVec3 sLoadDouble3Unsafe(const Double3 &inV)
Load 3 doubles from memory (reads 64 bits extra which it doesn't use)
Definition DVec3.inl:155
JPH_INLINE DVec3 & operator/=(double inV2)
Divide vector by double.
Definition DVec3.inl:517
JPH_INLINE DVec3 Cross(DVec3Arg inV2) const
Cross product.
Definition DVec3.inl:720
JPH_INLINE DVec3 & operator-=(Vec3Arg inV2)
Add two vectors (component wise)
Definition DVec3.inl:645
JPH_INLINE DVec3 PrepareRoundToZero() const
Prepare to convert to float vector 3 rounding towards zero (returns DVec3 that can be converted to a ...
Definition DVec3.inl:834
JPH_INLINE DVec3 Reciprocal() const
Reciprocal vector (1 / value) for each of the components.
Definition DVec3.inl:715
static JPH_INLINE DVec3 sEquals(DVec3Arg inV1, DVec3Arg inV2)
Equals (component wise)
Definition DVec3.inl:228
struct { double mData[4];} Type
Definition DVec3.h:29
JPH_INLINE bool IsNearZero(double inMaxDistSq=1.0e-24) const
Test if vector is near zero.
Definition DVec3.inl:415
JPH_INLINE bool operator==(DVec3Arg inV2) const
Comparison.
Definition DVec3.inl:405
static const double cFalse
Definition DVec3.h:275
Class that holds 3 doubles. Used as a storage class. Convert to DVec3 for calculations.
Definition Double3.h:13
Type mValue
Definition Vec3.h:285
float mF32[4]
Definition Vec3.h:286