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

Namespaces

namespace  detail
 

Classes

class  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 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

using sourcepp::math::EulerAngles = typedef Vec3f

Definition at line 328 of file Math.h.

◆ Quat

using sourcepp::math::Quat = typedef Vec4f

Definition at line 330 of file Math.h.

Function Documentation

◆ besselI0()

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

Definition at line 70 of file MathExtended.h.

◆ chebyshev()

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

Definition at line 17 of file MathExtended.h.

◆ isPowerOf2()

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

Definition at line 43 of file Math.h.

◆ kaiserWindow()

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

Definition at line 81 of file MathExtended.h.

◆ nearestPowerOf2()

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

Definition at line 48 of file Math.h.

◆ paddingForAlignment()

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

Definition at line 57 of file Math.h.

◆ remap() [1/2]

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

Definition at line 39 of file Math.h.

◆ remap() [2/2]

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

Definition at line 34 of file Math.h.

◆ SOURCEPP_MAT_DEFINE() [1/9]

sourcepp::math::SOURCEPP_MAT_DEFINE ( ,
 
)

◆ SOURCEPP_MAT_DEFINE() [2/9]

sourcepp::math::SOURCEPP_MAT_DEFINE ( ,
 
)

◆ SOURCEPP_MAT_DEFINE() [3/9]

sourcepp::math::SOURCEPP_MAT_DEFINE ( ,
 
)

◆ SOURCEPP_MAT_DEFINE() [4/9]

sourcepp::math::SOURCEPP_MAT_DEFINE ( ,
 
)

◆ SOURCEPP_MAT_DEFINE() [5/9]

sourcepp::math::SOURCEPP_MAT_DEFINE ( ,
 
)

◆ SOURCEPP_MAT_DEFINE() [6/9]

sourcepp::math::SOURCEPP_MAT_DEFINE ( ,
 
)

◆ SOURCEPP_MAT_DEFINE() [7/9]

sourcepp::math::SOURCEPP_MAT_DEFINE ( ,
 
)

◆ SOURCEPP_MAT_DEFINE() [8/9]

sourcepp::math::SOURCEPP_MAT_DEFINE ( ,
 
)

◆ SOURCEPP_MAT_DEFINE() [9/9]

sourcepp::math::SOURCEPP_MAT_DEFINE ( ,
 
)

◆ SOURCEPP_VEC_DEFINE() [1/3]

sourcepp::math::SOURCEPP_VEC_DEFINE ( )

◆ SOURCEPP_VEC_DEFINE() [2/3]

sourcepp::math::SOURCEPP_VEC_DEFINE ( )

◆ SOURCEPP_VEC_DEFINE() [3/3]

sourcepp::math::SOURCEPP_VEC_DEFINE ( )

Variable Documentation

◆ pi

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

Definition at line 26 of file Math.h.

◆ pi_f32

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

Definition at line 27 of file Math.h.

◆ pi_f64

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

Definition at line 28 of file Math.h.