11class [[nodiscard]] alignas(JPH_VECTOR_ALIGNMENT)
UVec4
17#if defined(JPH_USE_SSE)
19#elif defined(JPH_USE_NEON)
20 using Type = uint32x4_t;
35 JPH_INLINE
bool operator == (
UVec4Arg inV2)
const;
36 JPH_INLINE
bool operator != (
UVec4Arg inV2)
const {
return !(*
this == inV2); }
39 template<u
int32 SwizzleX, u
int32 SwizzleY, u
int32 SwizzleZ, u
int32 SwizzleW>
58 template <const
int Scale>
91#if defined(JPH_USE_SSE)
93 JPH_INLINE
uint32 GetY()
const {
return mU32[1]; }
94 JPH_INLINE
uint32 GetZ()
const {
return mU32[2]; }
95 JPH_INLINE
uint32 GetW()
const {
return mU32[3]; }
96#elif defined(JPH_USE_NEON)
97 JPH_INLINE
uint32 GetX()
const {
return vgetq_lane_u32(mValue, 0); }
98 JPH_INLINE
uint32 GetY()
const {
return vgetq_lane_u32(mValue, 1); }
99 JPH_INLINE
uint32 GetZ()
const {
return vgetq_lane_u32(mValue, 2); }
100 JPH_INLINE
uint32 GetW()
const {
return vgetq_lane_u32(mValue, 3); }
134 JPH_INLINE
UVec4 SplatX()
const;
137 JPH_INLINE
UVec4 SplatY()
const;
140 JPH_INLINE
UVec4 SplatZ()
const;
143 JPH_INLINE
UVec4 SplatW()
const;
146 JPH_INLINE
Vec4 ToFloat()
const;
149 JPH_INLINE
Vec4 ReinterpretAsFloat()
const;
158 JPH_INLINE
void StoreInt4(
uint32 *outV)
const;
161 JPH_INLINE
void StoreInt4Aligned(
uint32 *outV)
const;
164 JPH_INLINE
bool TestAnyTrue()
const;
167 JPH_INLINE
bool TestAnyXYZTrue()
const;
170 JPH_INLINE
bool TestAllTrue()
const;
173 JPH_INLINE
bool TestAllXYZTrue()
const;
176 JPH_INLINE
int CountTrues()
const;
179 JPH_INLINE
int GetTrues()
const;
182 template <const u
int Count>
186 template <const u
int Count>
190 template <const u
int Count>
215 friend ostream & operator << (ostream &inStream,
UVec4Arg inV)
217 inStream << inV.
mU32[0] <<
", " << inV.
mU32[1] <<
", " << inV.
mU32[2] <<
", " << inV.
mU32[3];
228static_assert(std::is_trivial<UVec4>(),
"Is supposed to be a trivial type!");
unsigned int uint
Definition Core.h:500
#define JPH_NAMESPACE_END
Definition Core.h:425
std::uint32_t uint32
Definition Core.h:503
#define JPH_NAMESPACE_BEGIN
Definition Core.h:419
DVec3 operator*(double inV1, DVec3Arg inV2)
Definition DVec3.inl:456
#define JPH_ASSERT(...)
Definition IssueReporting.h:33
const UVec4 UVec4Arg
Definition MathTypes.h:26
#define JPH_OVERRIDE_NEW_DELETE
Macro to override the new and delete functions.
Definition Memory.h:50
JPH_INLINE UVec4 Swizzle() const
Swizzle the elements in inV.
static JPH_INLINE UVec4 sNot(UVec4Arg inV1)
Logical not (component wise).
Definition UVec4.inl:217
JPH_INLINE uint32 GetZ() const
Definition UVec4.h:104
static JPH_INLINE UVec4 sMin(UVec4Arg inV1, UVec4Arg inV2)
Return the minimum value of each of the components.
Definition UVec4.inl:115
JPH_INLINE UVec4 LogicalShiftLeft() const
Shift all components by Count bits to the left (filling with zeros from the left).
static JPH_INLINE UVec4 sSelect(UVec4Arg inNotSet, UVec4Arg inSet, UVec4Arg inControl)
Component wise select, returns inNotSet when highest bit of inControl = 0 and inSet when highest bit ...
Definition UVec4.inl:157
static JPH_INLINE UVec4 sLoadInt(const uint32 *inV)
Load 1 int from memory and place it in the X component, zeros Y, Z and W.
Definition UVec4.inl:67
JPH_INLINE UVec4 Expand4Uint16Lo() const
Takes the lower 4 16 bits and expands them to X, Y, Z and W.
Definition UVec4.inl:518
JPH_INLINE void SetW(uint32 inW)
Definition UVec4.h:112
static JPH_INLINE UVec4 sSort4True(UVec4Arg inValue, UVec4Arg inIndex)
Definition UVec4.inl:230
JPH_INLINE uint32 GetY() const
Definition UVec4.h:103
JPH_INLINE void SetY(uint32 inY)
Definition UVec4.h:110
JPH_INLINE UVec4 LogicalShiftRight() const
Shift all components by Count bits to the right (filling with zeros from the right).
static JPH_INLINE UVec4 sReplicate(uint32 inV)
Replicate int inV across all components.
Definition UVec4.inl:56
JPH_INLINE UVec4 Expand4Byte4() const
Takes byte 4 .. 7 and expands them to X, Y, Z and W.
Definition UVec4.inl:565
JPH_INLINE UVec4 Expand4Byte0() const
Takes byte 0 .. 3 and expands them to X, Y, Z and W.
Definition UVec4.inl:550
static JPH_INLINE UVec4 sGatherInt4(const uint32 *inBase, UVec4Arg inOffsets)
Gather 4 ints from memory at inBase + inOffsets[i] * Scale.
static JPH_INLINE UVec4 sAnd(UVec4Arg inV1, UVec4Arg inV2)
Logical and (component wise).
Definition UVec4.inl:202
static JPH_INLINE UVec4 sEquals(UVec4Arg inV1, UVec4Arg inV2)
Equals (component wise).
Definition UVec4.inl:143
static JPH_INLINE UVec4 sOr(UVec4Arg inV1, UVec4Arg inV2)
Logical or (component wise).
Definition UVec4.inl:174
struct { uint32 mData[4];} Type
Definition UVec4.h:22
JPH_INLINE void SetZ(uint32 inZ)
Definition UVec4.h:111
JPH_INLINE uint32 GetW() const
Definition UVec4.h:105
JPH_INLINE UVec4 ShiftComponents4Minus(int inCount) const
Shift vector components by 4 - Count floats to the left, so if Count = 1 the resulting vector is (W,...
Definition UVec4.inl:610
static JPH_INLINE UVec4 sMax(UVec4Arg inV1, UVec4Arg inV2)
Return the maximum of each of the components.
Definition UVec4.inl:129
Type mValue
Definition UVec4.h:223
UVec4(const UVec4 &inRHS)=default
JPH_INLINE uint32 GetX() const
Get individual components.
Definition UVec4.h:102
JPH_INLINE UVec4 Expand4Byte8() const
Takes byte 8 .. 11 and expands them to X, Y, Z and W.
Definition UVec4.inl:580
static JPH_INLINE UVec4 sLoadInt4Aligned(const uint32 *inV)
Load 4 ints from memory, aligned to 16 bytes.
Definition UVec4.inl:89
static JPH_INLINE UVec4 sLoadInt4(const uint32 *inV)
Load 4 ints from memory.
Definition UVec4.inl:78
JPH_INLINE UVec4 Expand4Byte12() const
Takes byte 12 .. 15 and expands them to X, Y, Z and W.
Definition UVec4.inl:595
static JPH_INLINE UVec4 sXor(UVec4Arg inV1, UVec4Arg inV2)
Logical xor (component wise).
Definition UVec4.inl:188
JPH_INLINE void SetX(uint32 inX)
Set individual components.
Definition UVec4.h:109
JPH_INLINE UVec4 Expand4Uint16Hi() const
Takes the upper 4 16 bits and expands them to X, Y, Z and W.
Definition UVec4.inl:534
static JPH_INLINE UVec4 sZero()
Vector with all zeros.
Definition UVec4.inl:45
JPH_INLINE UVec4 ArithmeticShiftRight() const
Shift all components by Count bits to the right (shifting in the value of the highest bit).
JPH_INLINE UVec4(Type inRHS)
Definition UVec4.h:29
UVec4()=default
Constructor.
uint32 mU32[4]
Definition UVec4.h:224