49 template<CVec3 Vec3Type>
54 template<CVec3 Vec3Type>
65 template<CVec3 Vec3Type>
79 template<CVec3 Vec3Type>
138 template<
typename Arg>
requires(std::is_arithmetic_v<Arg>)
140 template<
typename Arg>
requires(std::is_arithmetic_v<Arg>)
150 template<
typename Arg>
requires(std::is_arithmetic_v<Arg>)
153 template<
typename Arg>
requires(std::is_arithmetic_v<Arg>)
164 template<
typename T>
requires(std::is_arithmetic_v<T>)
166 template<
typename T>
requires(std::is_arithmetic_v<T>)
180 [[
nodiscard]]
static JPL_INLINE simd DotProduct(
const Vec3Pack&
A,
const Vec3Pack&
B)
noexcept {
return A.X *
B.X +
A.Y *
B.Y +
A.Z *
B.Z; }
184 A.Y *
B.Z -
A.Z *
B.Y,
185 A.Z *
B.X -
A.X *
B.Z,
186 A.X *
B.Y -
A.Y *
B.X
194 os <<
"{ " <<
v.X <<
", " <<
v.Y <<
", " <<
v.Z <<
" }";
return os;
#define JPL_ASSERT(inExpression,...)
Main assert macro, usage: JPL_ASSERT(condition, message) or JPL_ASSERT(condition)
Definition ErrorReporting.h:76
JPL_INLINE constexpr T FMA(T a, T b, T c) noexcept
Inlined fuse multiply-add. Compiler in some circumstances is more eager to optimize this than std::fm...
Definition Math.h:186
JPL_INLINE constexpr T Sqrt(T x) noexcept
Definition Math.h:269
JPL_INLINE constexpr auto Abs(const T &value) noexcept
Standard abs is not constexpr in C++20.
Definition Math.h:87
JPL_INLINE simd InvSqrtFast(const simd &vec) noexcept
Definition SIMD.h:1783
Definition AcousticMaterial.h:36
JPL_INLINE void SetZ(Vec3Type &v, Vec3FloatType< Vec3Type > value) noexcept
Definition Vec3Traits.h:41
JPL_INLINE auto GetX(const Vec3Type &v) noexcept
Definition Vec3Traits.h:35
JPL_INLINE void SetY(Vec3Type &v, Vec3FloatType< Vec3Type > value) noexcept
Definition Vec3Traits.h:40
JPL_INLINE auto GetZ(const Vec3Type &v) noexcept
Definition Vec3Traits.h:37
JPL_INLINE constexpr Vec2 operator/(T Scale, const JPL::Vec2 &V) noexcept
Definition MinimalVec2.h:64
std::uint32_t uint32
Definition Core.h:311
JPL_INLINE constexpr bool operator==(const Vec2 &A, const Vec2 &B) noexcept
Definition MinimalVec2.h:59
JPL_INLINE auto GetY(const Vec3Type &v) noexcept
Definition Vec3Traits.h:36
JPL_INLINE simd fma(const simd &mul1, const simd &mul2, const simd &addV) noexcept
Element-wise fused multiply-add.
Definition SIMD.h:1843
JPL_INLINE constexpr Vec2 operator*(T Scale, const JPL::Vec2 &V) noexcept
Definition MinimalVec2.h:62
JPL_INLINE void SetX(Vec3Type &v, Vec3FloatType< Vec3Type > value) noexcept
Definition Vec3Traits.h:39
JPL_INLINE simd min(const simd &a, const simd &b) noexcept
Element-wise min.
Definition SIMD.h:1813
JPL_INLINE simd abs(const simd &vec) noexcept
Definition SIMD.h:1827
std::ostream & operator<<(std::ostream &os, const AcousticMaterial &v)
Definition AcousticMaterial.h:104
Structure to pass around per axis mask parameters.
Definition Vec3Pack.h:34
simd_mask X
Definition Vec3Pack.h:35
simd_mask Y
Definition Vec3Pack.h:35
simd_mask Z
Definition Vec3Pack.h:35
Minimal Vec3 class for SIMD operations on 4 Vec3 at a time.
Definition Vec3Pack.h:41
JPL_INLINE bool IsEqual(const Vec3Pack &other) const
Check if all components of all lanes match.
Definition Vec3Pack.h:162
JPL_INLINE void store(std::span< Vec3Type > outVecs) const
Definition Vec3Pack.h:80
JPL_INLINE Vec3Pack & operator/=(simd Scale) noexcept
Definition Vec3Pack.h:156
JPL_INLINE Vec3Pack operator*(simd Scale) const noexcept
Definition Vec3Pack.h:143
static JPL_INLINE Vec3Pack select(const Vec3MaskPack &conditionMasks, const Vec3Pack &ifTrue, const Vec3Pack &ifFalse)
Definition Vec3Pack.h:108
JPL_INLINE Vec3Pack(const Vec3Type &vec) noexcept
Definition Vec3Pack.h:50
JPL_INLINE Vec3Pack operator-(const Vec3Pack &V) const
Definition Vec3Pack.h:135
JPL_INLINE Vec3Pack & operator*=(simd Scale) noexcept
Definition Vec3Pack.h:157
JPL_INLINE Vec3Pack operator-() const
Definition Vec3Pack.h:134
static JPL_INLINE Vec3Pack select(const simd_mask &conditionMask, const Vec3Pack &ifTrue, const Vec3Pack &ifFalse)
Definition Vec3Pack.h:97
JPL_INLINE void load(std::span< const Vec3Type > inVecs)
Definition Vec3Pack.h:66
JPL_INLINE Vec3Pack(const Vec3Type &vec1, const Vec3Type &vec2, const Vec3Type &vec3, const Vec3Type &vec4)
Definition Vec3Pack.h:55
JPL_INLINE Vec3Pack(float x, float y, float z) noexcept
Definition Vec3Pack.h:45
JPL_INLINE Vec3Pack & Normalize() noexcept
Definition Vec3Pack.h:122
JPL_INLINE Vec3Pack(simd x, simd y, simd z) noexcept
Definition Vec3Pack.h:47
JPL_INLINE Vec3Pack operator+(const Vec3Pack &V) const
Definition Vec3Pack.h:136
JPL_INLINE void store(float *outX, float *outY, float *outZ) const
Pointers must point to storate allocated for at least simd::size() num of floats each.
Definition Vec3Pack.h:74
simd Z
Definition Vec3Pack.h:42
JPL_INLINE void operator+=(const Vec3Pack &V) noexcept
Definition Vec3Pack.h:147
simd X
Definition Vec3Pack.h:42
JPL_INLINE Vec3Pack(const float *x, const float *y, const float *z) noexcept
Definition Vec3Pack.h:46
JPL_INLINE Vec3Pack & operator*=(const Vec3Pack Other)
Definition Vec3Pack.h:148
static JPL_INLINE Vec3Pack Zero() noexcept
Definition Vec3Pack.h:117
JPL_INLINE simd LengthSquared() const noexcept
Definition Vec3Pack.h:119
JPL_INLINE Vec3Pack(const simd &axis) noexcept
Definition Vec3Pack.h:52
simd Y
Definition Vec3Pack.h:42
JPL_INLINE Vec3Pack operator/(simd Scale) const noexcept
Definition Vec3Pack.h:144
JPL_INLINE simd Length() const noexcept
Definition Vec3Pack.h:120
Minimal 4-wide 32-bit float vector implementation for SIMD.
Definition SIMD.h:60
static JPL_INLINE simd select(const simd_mask &mask, const simd &a, const simd &b) noexcept
Component-wise select, returns 'a' if mask is true, 'b' otherwise.
Definition SIMD.h:1034
JPL_INLINE void store(float *mem) const
Store values from simd to provided memory location.
Definition SIMD.h:573
static constexpr std::size_t size() noexcept
Get number of element of the vector.
Definition SIMD.h:97