19#if defined(JPH_USE_SSE4_1)
20 mValue = _mm_blend_ps(inRHS.
mValue, _mm_set1_ps(inW), 8);
21#elif defined(JPH_USE_NEON)
24 for (
int i = 0; i < 3; i++)
32#if defined(JPH_USE_SSE)
33 mValue = _mm_set_ps(inW, inZ, inY, inX);
34#elif defined(JPH_USE_NEON)
35 uint32x2_t xy = vcreate_u32(
static_cast<uint64>(BitCast<uint32>(inX)) | (
static_cast<uint64>(BitCast<uint32>(inY)) << 32));
36 uint32x2_t zw = vcreate_u32(
static_cast<uint64>(BitCast<uint32>(inZ)) | (
static_cast<uint64>(BitCast<uint32>(inW)) << 32));
37 mValue = vreinterpretq_f32_u32(vcombine_u32(xy, zw));
46template<u
int32 SwizzleX, u
int32 SwizzleY, u
int32 SwizzleZ, u
int32 SwizzleW>
49 static_assert(SwizzleX <= 3,
"SwizzleX template parameter out of range");
50 static_assert(SwizzleY <= 3,
"SwizzleY template parameter out of range");
51 static_assert(SwizzleZ <= 3,
"SwizzleZ template parameter out of range");
52 static_assert(SwizzleW <= 3,
"SwizzleW template parameter out of range");
54#if defined(JPH_USE_SSE)
55 return _mm_shuffle_ps(
mValue,
mValue, _MM_SHUFFLE(SwizzleW, SwizzleZ, SwizzleY, SwizzleX));
56#elif defined(JPH_USE_NEON)
57 return JPH_NEON_SHUFFLE_F32x4(
mValue,
mValue, SwizzleX, SwizzleY, SwizzleZ, SwizzleW);
65#if defined(JPH_USE_SSE)
66 return _mm_setzero_ps();
67#elif defined(JPH_USE_NEON)
68 return vdupq_n_f32(0);
70 return Vec4(0, 0, 0, 0);
76#if defined(JPH_USE_SSE)
77 return _mm_set1_ps(inV);
78#elif defined(JPH_USE_NEON)
79 return vdupq_n_f32(inV);
81 return Vec4(inV, inV, inV, inV);
87 return sReplicate(numeric_limits<float>::quiet_NaN());
92#if defined(JPH_USE_SSE)
93 return _mm_loadu_ps(&inV->
x);
94#elif defined(JPH_USE_NEON)
95 return vld1q_f32(&inV->
x);
97 return Vec4(inV->
x, inV->
y, inV->
z, inV->
w);
103#if defined(JPH_USE_SSE)
104 return _mm_load_ps(&inV->
x);
105#elif defined(JPH_USE_NEON)
106 return vld1q_f32(&inV->
x);
108 return Vec4(inV->
x, inV->
y, inV->
z, inV->
w);
112template <const
int Scale>
115#if defined(JPH_USE_SSE)
117 return _mm_i32gather_ps(inBase, inOffsets.
mValue, Scale);
119 const uint8 *base =
reinterpret_cast<const uint8 *
>(inBase);
120 Type x = _mm_load_ss(
reinterpret_cast<const float *
>(base + inOffsets.
GetX() * Scale));
121 Type y = _mm_load_ss(
reinterpret_cast<const float *
>(base + inOffsets.
GetY() * Scale));
122 Type xy = _mm_unpacklo_ps(x, y);
123 Type z = _mm_load_ss(
reinterpret_cast<const float *
>(base + inOffsets.
GetZ() * Scale));
124 Type w = _mm_load_ss(
reinterpret_cast<const float *
>(base + inOffsets.
GetW() * Scale));
125 Type zw = _mm_unpacklo_ps(z, w);
126 return _mm_movelh_ps(xy, zw);
129 const uint8 *base =
reinterpret_cast<const uint8 *
>(inBase);
130 float x = *
reinterpret_cast<const float *
>(base + inOffsets.
GetX() * Scale);
131 float y = *
reinterpret_cast<const float *
>(base + inOffsets.
GetY() * Scale);
132 float z = *
reinterpret_cast<const float *
>(base + inOffsets.
GetZ() * Scale);
133 float w = *
reinterpret_cast<const float *
>(base + inOffsets.
GetW() * Scale);
134 return Vec4(x, y, z, w);
140#if defined(JPH_USE_SSE)
142#elif defined(JPH_USE_NEON)
154#if defined(JPH_USE_SSE)
156#elif defined(JPH_USE_NEON)
168#if defined(JPH_USE_SSE)
169 return _mm_castps_si128(_mm_cmpeq_ps(inV1.
mValue, inV2.
mValue));
170#elif defined(JPH_USE_NEON)
174 inV1.
mF32[1] == inV2.
mF32[1]? 0xffffffffu : 0,
175 inV1.
mF32[2] == inV2.
mF32[2]? 0xffffffffu : 0,
176 inV1.
mF32[3] == inV2.
mF32[3]? 0xffffffffu : 0);
182#if defined(JPH_USE_SSE)
183 return _mm_castps_si128(_mm_cmplt_ps(inV1.
mValue, inV2.
mValue));
184#elif defined(JPH_USE_NEON)
188 inV1.
mF32[1] < inV2.
mF32[1]? 0xffffffffu : 0,
189 inV1.
mF32[2] < inV2.
mF32[2]? 0xffffffffu : 0,
190 inV1.
mF32[3] < inV2.
mF32[3]? 0xffffffffu : 0);
196#if defined(JPH_USE_SSE)
197 return _mm_castps_si128(_mm_cmple_ps(inV1.
mValue, inV2.
mValue));
198#elif defined(JPH_USE_NEON)
202 inV1.
mF32[1] <= inV2.
mF32[1]? 0xffffffffu : 0,
203 inV1.
mF32[2] <= inV2.
mF32[2]? 0xffffffffu : 0,
204 inV1.
mF32[3] <= inV2.
mF32[3]? 0xffffffffu : 0);
210#if defined(JPH_USE_SSE)
211 return _mm_castps_si128(_mm_cmpgt_ps(inV1.
mValue, inV2.
mValue));
212#elif defined(JPH_USE_NEON)
216 inV1.
mF32[1] > inV2.
mF32[1]? 0xffffffffu : 0,
217 inV1.
mF32[2] > inV2.
mF32[2]? 0xffffffffu : 0,
218 inV1.
mF32[3] > inV2.
mF32[3]? 0xffffffffu : 0);
224#if defined(JPH_USE_SSE)
225 return _mm_castps_si128(_mm_cmpge_ps(inV1.
mValue, inV2.
mValue));
226#elif defined(JPH_USE_NEON)
230 inV1.
mF32[1] >= inV2.
mF32[1]? 0xffffffffu : 0,
231 inV1.
mF32[2] >= inV2.
mF32[2]? 0xffffffffu : 0,
232 inV1.
mF32[3] >= inV2.
mF32[3]? 0xffffffffu : 0);
238#if defined(JPH_USE_SSE)
244#elif defined(JPH_USE_NEON)
256#if defined(JPH_USE_SSE4_1) && !defined(JPH_PLATFORM_WASM)
257 return _mm_blendv_ps(inNotSet.
mValue, inSet.
mValue, _mm_castsi128_ps(inControl.
mValue));
258#elif defined(JPH_USE_SSE)
259 __m128 is_set = _mm_castsi128_ps(_mm_srai_epi32(inControl.
mValue, 31));
260 return _mm_or_ps(_mm_and_ps(is_set, inSet.
mValue), _mm_andnot_ps(is_set, inNotSet.
mValue));
261#elif defined(JPH_USE_NEON)
262 return vbslq_f32(vreinterpretq_u32_s32(vshrq_n_s32(vreinterpretq_s32_u32(inControl.
mValue), 31)), inSet.
mValue, inNotSet.
mValue);
265 for (
int i = 0; i < 4; i++)
266 result.
mF32[i] = (inControl.
mU32[i] & 0x80000000u) ? inSet.
mF32[i] : inNotSet.
mF32[i];
273#if defined(JPH_USE_SSE)
275#elif defined(JPH_USE_NEON)
276 return vreinterpretq_f32_u32(vorrq_u32(vreinterpretq_u32_f32(inV1.
mValue), vreinterpretq_u32_f32(inV2.
mValue)));
284#if defined(JPH_USE_SSE)
286#elif defined(JPH_USE_NEON)
287 return vreinterpretq_f32_u32(veorq_u32(vreinterpretq_u32_f32(inV1.
mValue), vreinterpretq_u32_f32(inV2.
mValue)));
295#if defined(JPH_USE_SSE)
297#elif defined(JPH_USE_NEON)
298 return vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(inV1.
mValue), vreinterpretq_u32_f32(inV2.
mValue)));
310 ioValue =
sSelect(ioValue, v1, c1);
317 ioValue =
sSelect(ioValue, v2, c2);
324 ioValue =
sSelect(ioValue, v3, c3);
334 ioValue =
sSelect(ioValue, v1, c1);
341 ioValue =
sSelect(ioValue, v2, c2);
348 ioValue =
sSelect(ioValue, v3, c3);
359 return (inV2 - *
this).LengthSq() <= inMaxDistSq;
364 return abs(
LengthSq() - 1.0f) <= inTolerance;
369#if defined(JPH_USE_AVX512)
370 return _mm_fpclass_ps_mask(
mValue, 0b10000001) != 0;
371#elif defined(JPH_USE_SSE)
372 return _mm_movemask_ps(_mm_cmpunord_ps(
mValue,
mValue)) != 0;
373#elif defined(JPH_USE_NEON)
375 return vaddvq_u32(vshrq_n_u32(is_equal, 31)) != 4;
377 return isnan(
mF32[0]) || isnan(
mF32[1]) || isnan(
mF32[2]) || isnan(
mF32[3]);
383#if defined(JPH_USE_SSE)
385#elif defined(JPH_USE_NEON)
397#if defined(JPH_USE_SSE)
398 return _mm_mul_ps(
mValue, _mm_set1_ps(inV2));
399#elif defined(JPH_USE_NEON)
400 return vmulq_n_f32(
mValue, inV2);
409#if defined(JPH_USE_SSE)
410 return _mm_mul_ps(_mm_set1_ps(inV1), inV2.
mValue);
411#elif defined(JPH_USE_NEON)
412 return vmulq_n_f32(inV2.
mValue, inV1);
417 inV1 * inV2.
mF32[3]);
423#if defined(JPH_USE_SSE)
424 return _mm_div_ps(
mValue, _mm_set1_ps(inV2));
425#elif defined(JPH_USE_NEON)
426 return vdivq_f32(
mValue, vdupq_n_f32(inV2));
434#if defined(JPH_USE_SSE)
436#elif defined(JPH_USE_NEON)
439 for (
int i = 0; i < 4; ++i)
447#if defined(JPH_USE_SSE)
449#elif defined(JPH_USE_NEON)
452 for (
int i = 0; i < 4; ++i)
460#if defined(JPH_USE_SSE)
462#elif defined(JPH_USE_NEON)
465 for (
int i = 0; i < 4; ++i)
473#if defined(JPH_USE_SSE)
475#elif defined(JPH_USE_NEON)
487#if defined(JPH_USE_SSE)
489#elif defined(JPH_USE_NEON)
492 for (
int i = 0; i < 4; ++i)
500#if defined(JPH_USE_SSE)
501 return _mm_sub_ps(_mm_setzero_ps(),
mValue);
502#elif defined(JPH_USE_NEON)
503 #ifdef JPH_CROSS_PLATFORM_DETERMINISTIC
504 return vsubq_f32(vdupq_n_f32(0),
mValue);
509 #ifdef JPH_CROSS_PLATFORM_DETERMINISTIC
519#if defined(JPH_USE_SSE)
521#elif defined(JPH_USE_NEON)
533#if defined(JPH_USE_SSE)
535#elif defined(JPH_USE_NEON)
538 for (
int i = 0; i < 4; ++i)
546#if defined(JPH_USE_SSE)
548#elif defined(JPH_USE_NEON)
560#if defined(JPH_USE_SSE)
561 return _mm_shuffle_ps(
mValue,
mValue, _MM_SHUFFLE(0, 0, 0, 0));
562#elif defined(JPH_USE_NEON)
563 return vdupq_laneq_f32(
mValue, 0);
571#if defined(JPH_USE_SSE)
572 return _mm_shuffle_ps(
mValue,
mValue, _MM_SHUFFLE(1, 1, 1, 1));
573#elif defined(JPH_USE_NEON)
574 return vdupq_laneq_f32(
mValue, 1);
582#if defined(JPH_USE_SSE)
583 return _mm_shuffle_ps(
mValue,
mValue, _MM_SHUFFLE(2, 2, 2, 2));
584#elif defined(JPH_USE_NEON)
585 return vdupq_laneq_f32(
mValue, 2);
593#if defined(JPH_USE_SSE)
594 return _mm_shuffle_ps(
mValue,
mValue, _MM_SHUFFLE(3, 3, 3, 3));
595#elif defined(JPH_USE_NEON)
596 return vdupq_laneq_f32(
mValue, 3);
604#if defined(JPH_USE_AVX512)
606#elif defined(JPH_USE_SSE)
607 return _mm_max_ps(_mm_sub_ps(_mm_setzero_ps(),
mValue),
mValue);
608#elif defined(JPH_USE_NEON)
622#if defined(JPH_USE_SSE4_1)
624#elif defined(JPH_USE_NEON)
626 return vdupq_n_f32(vaddvq_f32(mul));
635#if defined(JPH_USE_SSE4_1)
636 return _mm_cvtss_f32(_mm_dp_ps(
mValue, inV2.
mValue, 0xff));
637#elif defined(JPH_USE_NEON)
639 return vaddvq_f32(mul);
648#if defined(JPH_USE_SSE4_1)
650#elif defined(JPH_USE_NEON)
652 return vaddvq_f32(mul);
661#if defined(JPH_USE_SSE4_1)
662 return _mm_cvtss_f32(_mm_sqrt_ss(_mm_dp_ps(
mValue,
mValue, 0xff)));
663#elif defined(JPH_USE_NEON)
665 float32x2_t sum = vdup_n_f32(vaddvq_f32(mul));
666 return vget_lane_f32(vsqrt_f32(sum), 0);
675#if defined(JPH_USE_SSE)
676 return _mm_sqrt_ps(
mValue);
677#elif defined(JPH_USE_NEON)
678 return vsqrtq_f32(
mValue);
687#if defined(JPH_USE_AVX512)
688 return _mm_fixupimm_ps(
mValue,
mValue, _mm_set1_epi32(0xA9A90A00), 0);
689#elif defined(JPH_USE_SSE)
690 Type minus_one = _mm_set1_ps(-1.0f);
691 Type one = _mm_set1_ps(1.0f);
692 return _mm_or_ps(_mm_and_ps(
mValue, minus_one), one);
693#elif defined(JPH_USE_NEON)
694 Type minus_one = vdupq_n_f32(-1.0f);
695 Type one = vdupq_n_f32(1.0f);
696 return vreinterpretq_f32_u32(vorrq_u32(vandq_u32(vreinterpretq_u32_f32(
mValue), vreinterpretq_u32_f32(minus_one)), vreinterpretq_u32_f32(one)));
698 return Vec4(std::signbit(
mF32[0])? -1.0f : 1.0f,
699 std::signbit(
mF32[1])? -1.0f : 1.0f,
700 std::signbit(
mF32[2])? -1.0f : 1.0f,
701 std::signbit(
mF32[3])? -1.0f : 1.0f);
707#if defined(JPH_USE_SSE4_1)
709#elif defined(JPH_USE_NEON)
711 float32x4_t sum = vdupq_n_f32(vaddvq_f32(mul));
712 return vdivq_f32(
mValue, vsqrtq_f32(sum));
720#if defined(JPH_USE_SSE)
721 _mm_storeu_ps(&outV->
x,
mValue);
722#elif defined(JPH_USE_NEON)
725 for (
int i = 0; i < 4; ++i)
726 (&outV->
x)[i] =
mF32[i];
732#if defined(JPH_USE_SSE)
733 return _mm_cvttps_epi32(
mValue);
734#elif defined(JPH_USE_NEON)
735 return vcvtq_u32_f32(
mValue);
743#if defined(JPH_USE_SSE)
745#elif defined(JPH_USE_NEON)
746 return vreinterpretq_u32_f32(
mValue);
748 return *
reinterpret_cast<const UVec4 *
>(
this);
754#if defined(JPH_USE_SSE)
755 return _mm_movemask_ps(
mValue);
756#elif defined(JPH_USE_NEON)
757 int32x4_t shift = JPH_NEON_INT32x4(0, 1, 2, 3);
758 return vaddvq_u32(vshlq_u32(vshrq_n_u32(vreinterpretq_u32_f32(
mValue), 31), shift));
760 return (std::signbit(
mF32[0])? 1 : 0) | (std::signbit(
mF32[1])? 2 : 0) | (std::signbit(
mF32[2])? 4 : 0) | (std::signbit(
mF32[3])? 8 : 0);
766 Vec4 v =
sMin(
mValue, Swizzle<SWIZZLE_Y, SWIZZLE_UNUSED, SWIZZLE_W, SWIZZLE_UNUSED>());
773 Vec4 v =
sMax(
mValue, Swizzle<SWIZZLE_Y, SWIZZLE_UNUSED, SWIZZLE_W, SWIZZLE_UNUSED>());
801 x = ((x - float_quadrant * 1.5703125f) - float_quadrant * 0.0004837512969970703125f) - float_quadrant * 7.549789948768648e-8f;
854 x = ((x - float_quadrant * 1.5703125f) - float_quadrant * 0.0004837512969970703125f) - float_quadrant * 7.549789948768648e-8f;
964 Vec4 atan = (numerator / denominator).
ATan();
std::uint8_t uint8
Definition Core.h:447
std::uint64_t uint64
Definition Core.h:450
#define JPH_NAMESPACE_END
Definition Core.h:379
std::uint32_t uint32
Definition Core.h:449
#define JPH_IF_FLOATING_POINT_EXCEPTIONS_ENABLED(...)
Definition Core.h:514
#define JPH_NAMESPACE_BEGIN
Definition Core.h:373
@ SWIZZLE_Z
Use the Z component.
Definition Swizzle.h:14
@ SWIZZLE_W
Use the W component.
Definition Swizzle.h:15
@ SWIZZLE_X
Use the X component.
Definition Swizzle.h:12
@ SWIZZLE_UNUSED
We always use the Z component when we don't specifically want to initialize a value,...
Definition Swizzle.h:16
@ SWIZZLE_Y
Use the Y component.
Definition Swizzle.h:13
Vec4 operator*(float inV1, Vec4Arg inV2)
Multiply vector with float.
Definition Vec4.inl:407
Class that holds 4 float values. Convert to Vec4 to perform calculations.
Definition Float4.h:11
float x
Definition Float4.h:25
float y
Definition Float4.h:26
float z
Definition Float4.h:27
float w
Definition Float4.h:28
JPH_INLINE UVec4 Swizzle() const
Swizzle the elements in inV.
JPH_INLINE uint32 GetZ() const
Definition UVec4.h:104
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
JPH_INLINE uint32 GetY() const
Definition UVec4.h:103
static JPH_INLINE UVec4 sReplicate(uint32 inV)
Replicate int inV across all components.
Definition UVec4.inl:56
JPH_INLINE bool TestAllTrue() const
Test if all components are true (true is when highest bit of component is set)
Definition UVec4.inl:408
static JPH_INLINE UVec4 sAnd(UVec4Arg inV1, UVec4Arg inV2)
Logical and (component wise)
Definition UVec4.inl:202
static JPH_INLINE UVec4 sOr(UVec4Arg inV1, UVec4Arg inV2)
Logical or (component wise)
Definition UVec4.inl:174
JPH_INLINE uint32 GetW() const
Definition UVec4.h:105
Type mValue
Definition UVec4.h:211
JPH_INLINE uint32 GetX() const
Get individual components.
Definition UVec4.h:102
static JPH_INLINE UVec4 sXor(UVec4Arg inV1, UVec4Arg inV2)
Logical xor (component wise)
Definition UVec4.inl:188
JPH_INLINE UVec4 ArithmeticShiftRight() const
Shift all components by Count bits to the right (shifting in the value of the highest bit)
JPH_INLINE Vec4 ToFloat() const
Convert each component from an int to a float.
Definition UVec4.inl:329
JPH_INLINE Vec4 ReinterpretAsFloat() const
Reinterpret UVec4 as a Vec4 (doesn't change the bits)
Definition UVec4.inl:340
uint32 mU32[4]
Definition UVec4.h:212
Type mValue
Definition Vec3.h:286
float mF32[4]
Definition Vec3.h:287
JPH_INLINE Vec4 SplatX() const
Replicate the X component to all components.
Definition Vec4.inl:558
static JPH_INLINE void sSort4(Vec4 &ioValue, UVec4 &ioIndex)
Definition Vec4.inl:304
Vec4 ATan() const
Calculate the arc tangent for each element of this vector (returns value in the range [-PI / 2,...
Definition Vec4.inl:914
static JPH_INLINE UVec4 sGreater(Vec4Arg inV1, Vec4Arg inV2)
Greater than (component wise)
Definition Vec4.inl:208
float mF32[4]
Definition Vec4.h:275
JPH_INLINE Vec4 operator-() const
Negate.
Definition Vec4.inl:498
Vec4()=default
Constructor.
static JPH_INLINE Vec4 sAnd(Vec4Arg inV1, Vec4Arg inV2)
Logical and (component wise)
Definition Vec4.inl:293
static JPH_INLINE Vec4 sLoadFloat4Aligned(const Float4 *inV)
Load 4 floats from memory, 16 bytes aligned.
Definition Vec4.inl:101
static Vec4 sATan2(Vec4Arg inY, Vec4Arg inX)
Calculate the arc tangent of y / x using the signs of the arguments to determine the correct quadrant...
Definition Vec4.inl:948
JPH_INLINE Vec4 GetSign() const
Get vector that contains the sign of each element (returns 1.0f if positive, -1.0f if negative)
Definition Vec4.inl:685
Vec4 ASin() const
Definition Vec4.inl:873
static JPH_INLINE Vec4 sXor(Vec4Arg inV1, Vec4Arg inV2)
Logical xor (component wise)
Definition Vec4.inl:282
JPH_INLINE Vec4 Abs() const
Return the absolute value of each of the components.
Definition Vec4.inl:602
JPH_INLINE Vec4 operator/(float inV2) const
Divide vector by float.
Definition Vec4.inl:421
Vec4 Tan() const
Calculate the tangent for each element of this vector (input in radians)
Definition Vec4.inl:840
JPH_INLINE UVec4 ToInt() const
Convert each component from a float to an int.
Definition Vec4.inl:730
JPH_INLINE Vec4 & operator+=(Vec4Arg inV2)
Add two float vectors (component wise)
Definition Vec4.inl:485
static JPH_INLINE UVec4 sLessOrEqual(Vec4Arg inV1, Vec4Arg inV2)
Less than or equal (component wise)
Definition Vec4.inl:194
static JPH_INLINE UVec4 sLess(Vec4Arg inV1, Vec4Arg inV2)
Less than (component wise)
Definition Vec4.inl:180
JPH_INLINE float Length() const
Length of vector.
Definition Vec4.inl:659
static JPH_INLINE void sSort4Reverse(Vec4 &ioValue, UVec4 &ioIndex)
Definition Vec4.inl:328
static JPH_INLINE Vec4 sFusedMultiplyAdd(Vec4Arg inMul1, Vec4Arg inMul2, Vec4Arg inAdd)
Calculates inMul1 * inMul2 + inAdd.
Definition Vec4.inl:236
JPH_INLINE Vec4 Normalized() const
Normalize vector.
Definition Vec4.inl:705
static JPH_INLINE UVec4 sEquals(Vec4Arg inV1, Vec4Arg inV2)
Equals (component wise)
Definition Vec4.inl:166
JPH_INLINE float ReduceMax() const
Get the maximum of X, Y, Z and W.
Definition Vec4.inl:771
JPH_INLINE Vec4 Reciprocal() const
Reciprocal vector (1 / value) for each of the components.
Definition Vec4.inl:615
JPH_INLINE Vec4 SplatY() const
Replicate the Y component to all components.
Definition Vec4.inl:569
JPH_INLINE UVec4 ReinterpretAsInt() const
Reinterpret Vec4 as a UVec4 (doesn't change the bits)
Definition Vec4.inl:741
static JPH_INLINE UVec4 sGreaterOrEqual(Vec4Arg inV1, Vec4Arg inV2)
Greater than or equal (component wise)
Definition Vec4.inl:222
static JPH_INLINE Vec4 sMin(Vec4Arg inV1, Vec4Arg inV2)
Return the minimum value of each of the components.
Definition Vec4.inl:138
JPH_INLINE Vec4 SplatZ() const
Replicate the Z component to all components.
Definition Vec4.inl:580
JPH_INLINE Vec4 Sqrt() const
Component wise square root.
Definition Vec4.inl:673
JPH_INLINE Vec4 & operator*=(float inV2)
Multiply vector with float.
Definition Vec4.inl:432
static JPH_INLINE Vec4 sGatherFloat4(const float *inBase, UVec4Arg inOffsets)
Gather 4 floats from memory at inBase + inOffsets[i] * Scale.
JPH_INLINE Vec4 operator+(Vec4Arg inV2) const
Add two float vectors (component wise)
Definition Vec4.inl:471
JPH_INLINE Vec4 & operator/=(float inV2)
Divide vector by float.
Definition Vec4.inl:458
JPH_INLINE bool IsNormalized(float inTolerance=1.0e-6f) const
Test if vector is normalized.
Definition Vec4.inl:362
JPH_INLINE bool operator==(Vec4Arg inV2) const
Comparison.
Definition Vec4.inl:352
JPH_INLINE Vec4 SplatW() const
Replicate the W component to all components.
Definition Vec4.inl:591
JPH_INLINE Vec4 DotV(Vec4Arg inV2) const
Dot product, returns the dot product in X, Y and Z components.
Definition Vec4.inl:620
JPH_INLINE bool IsClose(Vec4Arg inV2, float inMaxDistSq=1.0e-12f) const
Test if two vectors are close.
Definition Vec4.inl:357
JPH_INLINE float GetX() const
Get individual components.
Definition Vec4.h:113
static JPH_INLINE Vec4 sLoadFloat4(const Float4 *inV)
Load 4 floats from memory.
Definition Vec4.inl:90
{ float mData[4] Type
Definition Vec4.h:24
static JPH_INLINE Vec4 sZero()
Vector with all zeros.
Definition Vec4.inl:63
JPH_INLINE Vec4 Swizzle() const
Swizzle the elements in inV.
static JPH_INLINE Vec4 sOr(Vec4Arg inV1, Vec4Arg inV2)
Logical or (component wise)
Definition Vec4.inl:271
JPH_INLINE float ReduceMin() const
Get the minimum of X, Y, Z and W.
Definition Vec4.inl:764
Type mValue
Definition Vec4.h:274
JPH_INLINE Vec4 & operator-=(Vec4Arg inV2)
Subtract two float vectors (component wise)
Definition Vec4.inl:531
JPH_INLINE float LengthSq() const
Squared length of vector.
Definition Vec4.inl:646
static JPH_INLINE Vec4 sMax(Vec4Arg inV1, Vec4Arg inV2)
Return the maximum of each of the components.
Definition Vec4.inl:152
JPH_INLINE float Dot(Vec4Arg inV2) const
Dot product.
Definition Vec4.inl:633
JPH_INLINE bool IsNaN() const
Test if vector contains NaN elements.
Definition Vec4.inl:367
static JPH_INLINE Vec4 sNaN()
Vector with all NaN's.
Definition Vec4.inl:85
Vec4 ACos() const
Definition Vec4.inl:908
static JPH_INLINE Vec4 sSelect(Vec4Arg inNotSet, Vec4Arg inSet, UVec4Arg inControl)
Component wise select, returns inNotSet when highest bit of inControl = 0 and inSet when highest bit ...
Definition Vec4.inl:254
JPH_INLINE int GetSignBits() const
Store if X is negative in bit 0, Y in bit 1, Z in bit 2 and W in bit 3.
Definition Vec4.inl:752
static JPH_INLINE Vec4 sReplicate(float inV)
Replicate inV across all components.
Definition Vec4.inl:74
void SinCos(Vec4 &outSin, Vec4 &outCos) const
Calculate the sine and cosine for each element of this vector (input in radians)
Definition Vec4.inl:778
JPH_INLINE void StoreFloat4(Float4 *outV) const
Store 4 floats to memory.
Definition Vec4.inl:718
friend JPH_INLINE Vec4 operator*(float inV1, Vec4Arg inV2)
Multiply vector with float.
Definition Vec4.inl:407