[nnm] No Nonsense Math 0.5.0
A No-Nonsense, C++ 17, single-header-only Math library geared towards graphics programming.
|
#include <nnm.hpp>
Public Member Functions | |
constexpr | Basis3 () |
template<typename Other> | |
constexpr | Basis3 (const Basis3< Other > &basis) |
constexpr | Basis3 (const Matrix3< Real > &matrix) |
constexpr Real | trace () const |
constexpr Real | determinant () const |
constexpr Basis3 | unchecked_inverse () const |
constexpr std::optional< Basis3 > | inverse () const |
constexpr bool | valid () const |
Basis3 | rotate_axis_angle (const Vector3< Real > &axis, const Real angle) const |
Basis3 | rotate_axis_angle_local (const Vector3< Real > &axis, const Real angle) const |
constexpr Basis3 | rotate_quaternion (const Quaternion< Real > &quaternion) const |
constexpr Basis3 | rotate_quaternion_local (const Quaternion< Real > &quaternion) const |
constexpr Basis3 | scale (const Vector3< Real > &factor) const |
constexpr Basis3 | scale_local (const Vector3< Real > &factor) const |
constexpr Basis3 | shear_x (const Real factor_y, const Real factor_z) const |
constexpr Basis3 | shear_x_local (const Real factor_y, const Real factor_z) const |
constexpr Basis3 | shear_y (const Real factor_x, const Real factor_z) const |
constexpr Basis3 | shear_y_local (const Real factor_x, const Real factor_z) const |
constexpr Basis3 | shear_z (const Real factor_x, const Real factor_y) const |
constexpr Basis3 | shear_z_local (const Real factor_x, const Real factor_y) const |
constexpr Basis3 | transform (const Basis3 &by) const |
constexpr Basis3 | transform_local (const Basis3 &by) const |
constexpr bool | approx_equal (const Basis3 &other) const |
constexpr const Vector3< Real > & | at (const uint8_t column) const |
constexpr Vector3< Real > & | at (const uint8_t column) |
constexpr const Real & | at (const uint8_t column, const uint8_t row) const |
constexpr Real & | at (const uint8_t column, const uint8_t row) |
constexpr const Vector3< Real > & | operator[] (const uint8_t index) const |
constexpr Vector3< Real > & | operator[] (const uint8_t index) |
constexpr bool | operator== (const Basis3 &other) const |
constexpr bool | operator!= (const Basis3 &other) const |
constexpr bool | operator< (const Basis3 &other) const |
Static Public Member Functions | |
static Basis3 | from_rotation_axis_angle (const Vector3< Real > &axis, const Real angle) |
static constexpr Basis3 | from_rotation_quaternion (const Quaternion< Real > &quaternion) |
static constexpr Basis3 | from_scale (const Vector3< Real > &factor) |
static constexpr Basis3 | from_shear_x (const Real factor_y, const Real factor_z) |
static constexpr Basis3 | from_shear_y (const Real factor_x, const Real factor_z) |
static constexpr Basis3 | from_shear_z (const Real factor_x, const Real factor_y) |
Public Attributes | |
Matrix3< Real > | matrix |
Three-dimensional basis matrix. Can represent three-dimensional scale, shear, and rotation.
Real |
|
inlineconstexpr |
Initializes with identity.
|
inlineexplicitconstexpr |
Casts from another basis type.
Other | Other basis type. |
basis | Basis to cast from. |
|
inlineexplicitconstexpr |
Initialize from 3x3 matrix. No validation is done.
matrix | 3x3 matrix. |
|
inlinenodiscardconstexpr |
Determines if approximately equal to another basis.
other | Other basis. |
|
inlineconstexpr |
Reference to column at index.
column | Index of column. |
|
inlinenodiscardconstexpr |
Constant reference to column at index.
column | Index of column. |
|
inlineconstexpr |
Reference of element at index of column and row.
column | Index of column. |
row | Index of row. |
|
inlinenodiscardconstexpr |
Constant reference of element at index of column and row.
column | Index of column. |
row | Index of row. |
|
inlinenodiscardconstexpr |
Determinant of the matrix.
|
inlinestatic |
Basis rotated from normalized axis and angle.
axis | Normalized axis. |
angle | Angle in radians. |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
Basis scaled by factor.
factor | Scale factor. |
|
inlinestaticconstexpr |
Basis sheared along the x-axis.
factor_y | Y-Axis factor. |
factor_z | Z-Axis factor. |
|
inlinestaticconstexpr |
Basis sheared along the y-axis.
factor_x | X-Axis factor. |
factor_z | Z-Axis factor. |
|
inlinestaticconstexpr |
Basis sheared along the z-axis.
factor_x | X-Axis factor. |
factor_y | Y-Axis factor. |
|
inlinenodiscardconstexpr |
Inverse of the basis.
|
inlinenodiscardconstexpr |
Element-wise inequality with another basis.
other | Other basis. |
|
inlinenodiscardconstexpr |
Lexicographical comparison between elements.
other | Other basis. |
|
inlinenodiscardconstexpr |
Element-wise equality with another basis.
other | Other basis. |
|
inlineconstexpr |
Reference to column at index.
index | Index of column. |
|
inlinenodiscardconstexpr |
Constant reference to column at index.
index | Index of column. |
|
inlinenodiscard |
Rotate about an axis by an angle.
axis | Normalized axis vector. |
angle | Angle in radians. |
|
inlinenodiscard |
Local rotate about an axis by an angle.
axis | Normalize axis vector. |
angle | Angle in radians. |
|
inlinenodiscardconstexpr |
|
inlinenodiscardconstexpr |
|
inlinenodiscardconstexpr |
Per-axis scale by factor.
factor | Vector scale factor. |
|
inlinenodiscardconstexpr |
Local per-axis scale by factor.
factor | Vector scale factor. |
|
inlinenodiscardconstexpr |
Shear about x-axis.
factor_y | Y-Axis factor. |
factor_z | Z-Axis factor. |
|
inlinenodiscardconstexpr |
Local shear about x-axis
factor_y | Y-Axis factor. |
factor_z | Z-Axis factor. |
|
inlinenodiscardconstexpr |
Shear about y-axis.
factor_x | X-Axis factor. |
factor_z | Z-Axis factor. |
|
inlinenodiscardconstexpr |
Local shear about y-axis.
factor_x | X-Axis factor. |
factor_z | Z-Axis factor. |
|
inlinenodiscardconstexpr |
Shear about z-axis.
factor_x | X-Axis factor. |
factor_y | Y-Axis factor. |
|
inlinenodiscardconstexpr |
Local shear about z-axis.
factor_x | X-Axis factor. |
factor_y | Y-Axis factor. |
|
inlinenodiscardconstexpr |
Trace which is the sum of the matrix diagonal.
|
inlinenodiscardconstexpr |
Transform by another basis.
by | Basis. |
|
inlinenodiscardconstexpr |
Local transform by another basis.
by | Basis. |
|
inlinenodiscardconstexpr |
Inverse without checking if the basis is valid first.
|
inlinenodiscardconstexpr |
Determines if the basis is valid.
Matrix3<Real> nnm::Basis3< Real >::matrix |