13class [[nodiscard]] alignas(JPH_DVECTOR_ALIGNMENT) 
DVec3 
   19#if defined(JPH_USE_AVX) 
   22#elif defined(JPH_USE_SSE) 
   23    using Type = 
struct { __m128d mLow, mHigh; };
 
   25#elif defined(JPH_USE_NEON) 
   26    using Type = float64x2x2_t;
 
   29    using Type = 
struct { 
double mData[4]; };
 
   45    JPH_INLINE                  
DVec3(
double inX, 
double inY, 
double inZ);
 
   51    static JPH_INLINE 
DVec3     sZero();
 
   54    static JPH_INLINE 
DVec3     sOne();
 
   62    static JPH_INLINE 
DVec3     sReplicate(
double inV);
 
   65    static JPH_INLINE 
DVec3     sNaN();
 
   68    static JPH_INLINE 
DVec3     sLoadDouble3Unsafe(
const Double3 &inV);
 
   71    JPH_INLINE 
void             StoreDouble3(
Double3 *outV) 
const;
 
   74    JPH_INLINE 
explicit         operator Vec3() 
const;
 
   77    JPH_INLINE 
DVec3            PrepareRoundToZero() 
const;
 
   80    JPH_INLINE 
DVec3            PrepareRoundToInf() 
const;
 
   83    JPH_INLINE 
Vec3             ToVec3RoundDown() 
const;
 
   86    JPH_INLINE 
Vec3             ToVec3RoundUp() 
const;
 
  128    JPH_INLINE 
int              GetTrues() 
const;
 
  131    JPH_INLINE 
bool             TestAnyTrue() 
const;
 
  134    JPH_INLINE 
bool             TestAllTrue() 
const;
 
  137#if defined(JPH_USE_AVX) 
  138    JPH_INLINE 
double           GetX()
 const                                    { 
return _mm_cvtsd_f64(_mm256_castpd256_pd128(mValue)); }
 
  139    JPH_INLINE 
double           GetY()
 const                                    { 
return mF64[1]; }
 
  140    JPH_INLINE 
double           GetZ()
 const                                    { 
return mF64[2]; }
 
  141#elif defined(JPH_USE_SSE) 
  142    JPH_INLINE 
double           GetX()
 const                                    { 
return _mm_cvtsd_f64(mValue.mLow); }
 
  143    JPH_INLINE 
double           GetY()
 const                                    { 
return mF64[1]; }
 
  144    JPH_INLINE 
double           GetZ()
 const                                    { 
return _mm_cvtsd_f64(mValue.mHigh); }
 
  145#elif defined(JPH_USE_NEON) 
  146    JPH_INLINE 
double           GetX()
 const                                    { 
return vgetq_lane_f64(mValue.val[0], 0); }
 
  147    JPH_INLINE 
double           GetY()
 const                                    { 
return vgetq_lane_f64(mValue.val[0], 1); }
 
  148    JPH_INLINE 
double           GetZ()
 const                                    { 
return vgetq_lane_f64(mValue.val[1], 0); }
 
  150    JPH_INLINE 
double           GetX()
 const                                    { 
return mF64[0]; }
 
  151    JPH_INLINE 
double           GetY()
 const                                    { 
return mF64[1]; }
 
  152    JPH_INLINE 
double           GetZ()
 const                                    { 
return mF64[2]; }
 
  156    JPH_INLINE 
void             SetX(
double inX)                                { mF64[0] = inX; }
 
  157    JPH_INLINE 
void             SetY(
double inY)                                { mF64[1] = inY; }
 
  158    JPH_INLINE 
void             SetZ(
double inZ)                                { mF64[2] = mF64[3] = inZ; } 
 
  161    JPH_INLINE 
void             Set(
double inX, 
double inY, 
double inZ)         { *
this = 
DVec3(inX, inY, inZ); }
 
  164    JPH_INLINE 
double           operator [] (
uint inCoordinate)
 const           { 
JPH_ASSERT(inCoordinate < 3); 
return mF64[inCoordinate]; }
 
  167    JPH_INLINE 
void             SetComponent(
uint inCoordinate, 
double inValue) { 
JPH_ASSERT(inCoordinate < 3); mF64[inCoordinate] = inValue; mValue = sFixW(mValue); } 
 
  170    JPH_INLINE 
bool             operator == (
DVec3Arg inV2) 
const;
 
  171    JPH_INLINE 
bool             operator != (
DVec3Arg inV2)
 const               { 
return !(*
this == inV2); }
 
  174    JPH_INLINE 
bool             IsClose(
DVec3Arg inV2, 
double inMaxDistSq = 1.0e-24) 
const;
 
  177    JPH_INLINE 
bool             IsNearZero(
double inMaxDistSq = 1.0e-24) 
const;
 
  180    JPH_INLINE 
bool             IsNormalized(
double inTolerance = 1.0e-12) 
const;
 
  183    JPH_INLINE 
bool             IsNaN() 
const;
 
  195    JPH_INLINE 
DVec3            operator / (
double inV2) 
const;
 
  198    JPH_INLINE 
DVec3 &          operator *= (
double inV2);
 
  204    JPH_INLINE 
DVec3 &          operator /= (
double inV2);
 
  219    JPH_INLINE 
DVec3            operator - () 
const;
 
  237    JPH_INLINE 
DVec3            Abs() 
const;
 
  240    JPH_INLINE 
DVec3            Reciprocal() 
const;
 
  246    JPH_INLINE 
double           Dot(
DVec3Arg inV2) 
const;
 
  249    JPH_INLINE 
double           LengthSq() 
const;
 
  252    JPH_INLINE 
double           Length() 
const;
 
  255    JPH_INLINE 
DVec3            Normalized() 
const;
 
  258    JPH_INLINE 
DVec3            Sqrt() 
const;
 
  261    JPH_INLINE 
DVec3            GetSign() 
const;
 
  264    friend ostream &            operator << (ostream &inStream, 
DVec3Arg inV)
 
  266        inStream << inV.
mF64[0] << 
", " << inV.
mF64[1] << 
", " << inV.
mF64[2];
 
  271    JPH_INLINE 
void             CheckW() 
const;
 
  274    static JPH_INLINE Type      sFixW(TypeArg inValue);
 
  277    inline static const double  cTrue = BitCast<double>(~
uint64(0));
 
  278    inline static const double  cFalse = 0.0;
 
  287static_assert(std::is_trivial<DVec3>(), 
"Is supposed to be a trivial type!");
 
std::uint64_t uint64
Definition: Core.h:491
unsigned int uint
Definition: Core.h:487
#define JPH_NAMESPACE_END
Definition: Core.h:419
#define JPH_NAMESPACE_BEGIN
Definition: Core.h:413
DVec3 operator*(double inV1, DVec3Arg inV2)
Definition: DVec3.inl:456
#define JPH_ASSERT(...)
Definition: IssueReporting.h:33
const DVec3 & DVec3Arg
Definition: MathTypes.h:23
#define JPH_OVERRIDE_NEW_DELETE
Macro to override the new and delete functions.
Definition: Memory.h:31
double mF64[4]
Definition: DVec3.h:283
{ double mData[4] Type
Definition: DVec3.h:29
static JPH_INLINE DVec3 sAxisY()
Definition: DVec3.h:58
JPH_INLINE DVec3(TypeArg inRHS)
Definition: DVec3.h:42
Type mValue
Definition: DVec3.h:282
const Type & TypeArg
Definition: DVec3.h:30
JPH_INLINE void SetComponent(uint inCoordinate, double inValue)
Set double component by index.
Definition: DVec3.h:167
JPH_INLINE void Set(double inX, double inY, double inZ)
Set all components.
Definition: DVec3.h:161
static JPH_INLINE DVec3 sAxisX()
Vectors with the principal axis.
Definition: DVec3.h:57
JPH_INLINE void SetY(double inY)
Definition: DVec3.h:157
JPH_INLINE double GetZ() const
Definition: DVec3.h:152
DVec3()=default
Constructor.
static JPH_INLINE DVec3 sAxisZ()
Definition: DVec3.h:59
JPH_INLINE DVec3(Vec3Arg inRHS)
JPH_INLINE void SetZ(double inZ)
Definition: DVec3.h:158
JPH_INLINE double GetY() const
Definition: DVec3.h:151
DVec3(const DVec3 &inRHS)=default
JPH_INLINE void SetX(double inX)
Set individual components.
Definition: DVec3.h:156
JPH_INLINE double GetX() const
Get individual components.
Definition: DVec3.h:150
Class that holds 3 doubles. Used as a storage class. Convert to DVec3 for calculations.
Definition: Double3.h:13