150 .
V = a.W * b.V + b.W * a.V + CrossProduct(a.V, b.V),
151 .W = a.W * b.W - DotProduct(a.V, b.V)
207 return W ==
Float(0.0) ? JPL_PI :
Float(2.0) * std::atan(DotProduct(
V,
axis) /
W);
233 F dot = a.W * b.W + DotProduct(a.V, b.V);
249 .V =
wA * a.V +
wB *
b1.V,
261 return a * b.Conjugated();
std::remove_cvref_t< decltype(GetX(std::declval< Vec3 >()))> FloatOf
Definition Vec3Math.h:36
JPL_INLINE constexpr T Lerp(const T &v0, const T &v1, T t) noexcept
Linearly interpolate v0 towards v1.
Definition Math.h:172
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 std::pair< T, T > SinCos(T value) noexcept
Definition Math.h:164
Vec3 GetNormalizedPerpendicular(const Vec3 &vec) noexcept
Definition Vec3Math.h:67
Definition AcousticMaterial.h:36
JPL_INLINE auto GetX(const Vec3Type &v) noexcept
Definition Vec3Traits.h:35
JPL_INLINE auto GetZ(const Vec3Type &v) noexcept
Definition Vec3Traits.h:37
JPL_INLINE auto GetY(const Vec3Type &v) noexcept
Definition Vec3Traits.h:36
JPL_INLINE simd min(const simd &a, const simd &b) noexcept
Element-wise min.
Definition SIMD.h:1813
std::ostream & operator<<(std::ostream &os, const AcousticMaterial &v)
Definition AcousticMaterial.h:104
Orthonormal basis (column-major)
Definition MinimalBasis.h:35
Vec3 X
Definition MinimalBasis.h:38
Minimal quaternion (w + xi + yj + zk)
Definition MinimalQuat.h:38
JPL_INLINE Float Length() const noexcept
Definition MinimalQuat.h:191
Float W
Definition MinimalQuat.h:41
JPL_INLINE Float GetRotationAngle(const Vec3 &axis) const noexcept
Get rotation angle around axis.
Definition MinimalQuat.h:205
JPL_INLINE Quat Conjugated() const noexcept
Definition MinimalQuat.h:49
static JPL_INLINE Quat LookAt(const Vec3 &direction, const Vec3 &up) noexcept
Definition MinimalQuat.h:140
bool operator!=(const Quat &rhs) const noexcept
Definition MinimalQuat.h:45
JPL_INLINE Quat Inversed() const noexcept
Definition MinimalQuat.h:51
bool operator==(const Quat &rhs) const noexcept
Check if two quaternions are exactly equal.
Definition MinimalQuat.h:44
JPL_INLINE friend Quat operator*(const Quat &a, const Quat &b) noexcept
Quaternion multiplication (rotation composition)
Definition MinimalQuat.h:146
static JPL_INLINE Quat FromUpAndForward(const Vec3 &up, const Vec3 &forward) noexcept
Definition MinimalQuat.h:135
JPL_INLINE Vec3 Rotate(const Vec3 &vector) const noexcept
Rotate a vector by this quaternion.
Definition MinimalQuat.h:182
static Quat FromTo(const Vec3 &from, const Vec3 &to) noexcept
Definition MinimalQuat.h:68
static Quat FromBasis(const Basis< Vec3 > &basis) noexcept
Construct quaternian from basis columns X, Y, Z.
Definition MinimalQuat.h:83
Vec3 V
Definition MinimalQuat.h:40
Basis< Vec3 > ToBasis() const noexcept
Convert to an orthonormal Basis3 (column-major)
Definition MinimalQuat.h:211
static JPL_INLINE Quat Rotation(const Vec3 &axis, Float angleRad) noexcept
Definition MinimalQuat.h:59
JPL_INLINE Float LengthSquared() const noexcept
Definition MinimalQuat.h:189
Internal::FloatOf< Vec3 > Float
Definition MinimalQuat.h:39
JPL_INLINE bool IsNormalized(Float tolerance=Float(1.0e-5)) const noexcept
Definition MinimalQuat.h:199
static JPL_INLINE Quat MakeSlerp(const Vec3 &from, const Vec3 &to, Float t) noexcept
Create quaternian to slerp direction vector based on 'from' and 'to'.
Definition MinimalQuat.h:175
JPL_INLINE Quat Normalized() const noexcept
Definition MinimalQuat.h:193
static JPL_INLINE Quat Identity() noexcept
Definition MinimalQuat.h:47