JPL Spatial
Sound spatialization and propagation library
Loading...
Searching...
No Matches
JPL::Basis< Vec3 > Struct Template Reference

Orthonormal basis (column-major) More...

#include <JPLSpatial/Math/MinimalBasis.h>

Public Types

using Float = Internal::FloatOf< Vec3 >
 

Public Member Functions

JPL_INLINE Vec3 InverseTransform (const Vec3 &pWorld) const noexcept
 Apply rotation world -> local.
 
JPL_INLINE Vec3 Transform (const Vec3 &vector) const noexcept
 Apply rotation local -> world.
 
JPL_INLINE void Transform (simd &inOutX, simd &inOutY, simd &inOutZ) const noexcept
 
JPL_INLINE Basis Transform (const Basis &otherBasis) const noexcept
 Compose orientations: apply 'this' basis mapping to the other's axes.
 
JPL_INLINE Basis InverseTransform (const Basis &otherBasis) const noexcept
 Re-express 'other' in 'this' local frame.
 

Static Public Member Functions

static const BasisIdentity () noexcept
 
static JPL_INLINE Basis FromForward (const Vec3 &forward) noexcept
 
static Basis FromUpAndForward (const Vec3 &up, const Vec3 &forward) noexcept
 Creates a basis from the given up and forward normalized unit vectors.
 
static Basis Rotation (const Vec3 &axis, Float angleRad) noexcept
 

Public Attributes

Vec3 X
 
Vec3 Y
 
Vec3 Z
 

Detailed Description

template<CVec3 Vec3>
struct JPL::Basis< Vec3 >

Orthonormal basis (column-major)

Member Typedef Documentation

◆ Float

template<CVec3 Vec3>
using JPL::Basis< Vec3 >::Float = Internal::FloatOf<Vec3>

Member Function Documentation

◆ FromForward()

template<CVec3 Vec3>
static JPL_INLINE Basis JPL::Basis< Vec3 >::FromForward ( const Vec3 &  forward)
inlinestaticnoexcept

Creates a basis from the given forward (normal vector).

Parameters
n: normal vector, must be normalized

◆ FromUpAndForward()

template<CVec3 Vec3>
static Basis JPL::Basis< Vec3 >::FromUpAndForward ( const Vec3 &  up,
const Vec3 &  forward 
)
inlinestaticnoexcept

Creates a basis from the given up and forward normalized unit vectors.

◆ Identity()

template<CVec3 Vec3>
static const Basis & JPL::Basis< Vec3 >::Identity ( )
inlinestaticnoexcept

◆ InverseTransform() [1/2]

template<CVec3 Vec3>
JPL_INLINE Basis JPL::Basis< Vec3 >::InverseTransform ( const Basis< Vec3 > &  otherBasis) const
inlinenoexcept

Re-express 'other' in 'this' local frame.

◆ InverseTransform() [2/2]

template<CVec3 Vec3>
JPL_INLINE Vec3 JPL::Basis< Vec3 >::InverseTransform ( const Vec3 &  pWorld) const
inlinenoexcept

Apply rotation world -> local.

◆ Rotation()

template<CVec3 Vec3>
static Basis JPL::Basis< Vec3 >::Rotation ( const Vec3 &  axis,
Float  angleRad 
)
inlinestaticnoexcept

Build a rotation "matrix" axis–angle. Columns are R*ex, R*ey, R*ez (column-major). (this is cheaper than Quat if > 2 vectors need the same rotation)

Parameters
axis: must be a normalized direction vector

◆ Transform() [1/3]

template<CVec3 Vec3>
JPL_INLINE Basis JPL::Basis< Vec3 >::Transform ( const Basis< Vec3 > &  otherBasis) const
inlinenoexcept

Compose orientations: apply 'this' basis mapping to the other's axes.

◆ Transform() [2/3]

template<CVec3 Vec3>
JPL_INLINE Vec3 JPL::Basis< Vec3 >::Transform ( const Vec3 &  vector) const
inlinenoexcept

Apply rotation local -> world.

◆ Transform() [3/3]

template<CVec3 Vec3>
JPL_INLINE void JPL::Basis< Vec3 >::Transform ( simd inOutX,
simd inOutY,
simd inOutZ 
) const
inlinenoexcept

Apply rotation local -> world. Performs transform on 4 directions packed into simd vectors at the same time.

Member Data Documentation

◆ X

template<CVec3 Vec3>
Vec3 JPL::Basis< Vec3 >::X

◆ Y

template<CVec3 Vec3>
Vec3 JPL::Basis< Vec3 >::Y

◆ Z

template<CVec3 Vec3>
Vec3 JPL::Basis< Vec3 >::Z

The documentation for this struct was generated from the following file: