SourcePP
Several modern C++20 libraries for sanely parsing Valve's formats.
Loading...
Searching...
No Matches
sourcepp::math Namespace Reference

Namespaces

namespace  detail

Classes

struct  Mat
struct  QuatCompressed48
 Lower precision Quat compressed to 6 bytes. More...
struct  QuatCompressed64
 Lower precision Quat compressed to 8 bytes. More...
struct  Vec

Concepts

concept  Arithmetic

Typedefs

using EulerAngles = Vec3f
using Quat = Vec4f

Functions

template<Arithmetic T>
constexpr T remap (T value, T l1, T h1, T l2, T h2)
template<Arithmetic T>
constexpr T remap (T value, T h1, T h2)
constexpr bool isPowerOf2 (std::unsigned_integral auto n)
template<std::unsigned_integral T>
constexpr T nearestPowerOf2 (T n)
constexpr uint32_t log2ceil (uint32_t value)
constexpr uint16_t paddingForAlignment (uint16_t alignment, uint64_t n)
 SOURCEPP_VEC_DEFINE (2)
 SOURCEPP_VEC_DEFINE (3)
 SOURCEPP_VEC_DEFINE (4)
 SOURCEPP_MAT_DEFINE (2, 2)
 SOURCEPP_MAT_DEFINE (3, 3)
 SOURCEPP_MAT_DEFINE (4, 4)
 SOURCEPP_MAT_DEFINE (2, 3)
 SOURCEPP_MAT_DEFINE (3, 2)
 SOURCEPP_MAT_DEFINE (2, 4)
 SOURCEPP_MAT_DEFINE (4, 2)
 SOURCEPP_MAT_DEFINE (3, 4)
 SOURCEPP_MAT_DEFINE (4, 3)
template<std::size_t L>
constexpr double chebyshev (double x, const std::array< double, L > &array)
constexpr double besselI0 (double x)
constexpr double kaiserWindow (double x, double b)

Variables

template<std::floating_point F>
constexpr F pi = std::numbers::pi_v<F>
constexpr auto pi_f32 = pi<float>
constexpr auto pi_f64 = pi<double>

Typedef Documentation

◆ EulerAngles

Definition at line 331 of file Math.h.

◆ Quat

using sourcepp::math::Quat = Vec4f

Definition at line 333 of file Math.h.

Function Documentation

◆ besselI0()

double sourcepp::math::besselI0 ( double x)
nodiscardconstexpr

Definition at line 70 of file MathExtended.h.

◆ chebyshev()

template<std::size_t L>
double sourcepp::math::chebyshev ( double x,
const std::array< double, L > & array )
nodiscardconstexpr

Definition at line 17 of file MathExtended.h.

◆ isPowerOf2()

bool sourcepp::math::isPowerOf2 ( std::unsigned_integral auto n)
nodiscardconstexpr

Definition at line 43 of file Math.h.

◆ kaiserWindow()

double sourcepp::math::kaiserWindow ( double x,
double b )
nodiscardconstexpr

Definition at line 81 of file MathExtended.h.

◆ log2ceil()

uint32_t sourcepp::math::log2ceil ( uint32_t value)
nodiscardconstexpr

Definition at line 57 of file Math.h.

◆ nearestPowerOf2()

template<std::unsigned_integral T>
T sourcepp::math::nearestPowerOf2 ( T n)
nodiscardconstexpr

Definition at line 48 of file Math.h.

◆ paddingForAlignment()

uint16_t sourcepp::math::paddingForAlignment ( uint16_t alignment,
uint64_t n )
nodiscardconstexpr

Definition at line 61 of file Math.h.

◆ remap() [1/2]

template<Arithmetic T>
T sourcepp::math::remap ( T value,
T h1,
T h2 )
nodiscardconstexpr

Definition at line 39 of file Math.h.

◆ remap() [2/2]

template<Arithmetic T>
T sourcepp::math::remap ( T value,
T l1,
T h1,
T l2,
T h2 )
nodiscardconstexpr

Definition at line 34 of file Math.h.

◆ SOURCEPP_MAT_DEFINE() [1/9]

sourcepp::math::SOURCEPP_MAT_DEFINE ( 2 ,
2  )

◆ SOURCEPP_MAT_DEFINE() [2/9]

sourcepp::math::SOURCEPP_MAT_DEFINE ( 2 ,
3  )

◆ SOURCEPP_MAT_DEFINE() [3/9]

sourcepp::math::SOURCEPP_MAT_DEFINE ( 2 ,
4  )

◆ SOURCEPP_MAT_DEFINE() [4/9]

sourcepp::math::SOURCEPP_MAT_DEFINE ( 3 ,
2  )

◆ SOURCEPP_MAT_DEFINE() [5/9]

sourcepp::math::SOURCEPP_MAT_DEFINE ( 3 ,
3  )

◆ SOURCEPP_MAT_DEFINE() [6/9]

sourcepp::math::SOURCEPP_MAT_DEFINE ( 3 ,
4  )

◆ SOURCEPP_MAT_DEFINE() [7/9]

sourcepp::math::SOURCEPP_MAT_DEFINE ( 4 ,
2  )

◆ SOURCEPP_MAT_DEFINE() [8/9]

sourcepp::math::SOURCEPP_MAT_DEFINE ( 4 ,
3  )

◆ SOURCEPP_MAT_DEFINE() [9/9]

sourcepp::math::SOURCEPP_MAT_DEFINE ( 4 ,
4  )

◆ SOURCEPP_VEC_DEFINE() [1/3]

sourcepp::math::SOURCEPP_VEC_DEFINE ( 2 )

◆ SOURCEPP_VEC_DEFINE() [2/3]

sourcepp::math::SOURCEPP_VEC_DEFINE ( 3 )

◆ SOURCEPP_VEC_DEFINE() [3/3]

sourcepp::math::SOURCEPP_VEC_DEFINE ( 4 )

Variable Documentation

◆ pi

template<std::floating_point F>
F sourcepp::math::pi = std::numbers::pi_v<F>
constexpr

Definition at line 26 of file Math.h.

◆ pi_f32

auto sourcepp::math::pi_f32 = pi<float>
constexpr

Definition at line 27 of file Math.h.

◆ pi_f64

auto sourcepp::math::pi_f64 = pi<double>
constexpr

Definition at line 28 of file Math.h.