16#pragma warning(disable : 4456)
17#pragma warning(disable : 4702)
20#include <Eigen/Geometry>
21#include <Eigen/Sparse>
37inline constexpr int Dynamic = Eigen::Dynamic;
40using Map = Eigen::Map<T>;
43using Ref = Eigen::Ref<T>;
45template <
typename Scalar,
int Dim>
46using Line = Eigen::ParametrizedLine<Scalar, Dim>;
48template <
typename Scalar,
int Dim>
49using Plane = Eigen::Hyperplane<Scalar, Dim>;
51template <
typename Scalar,
int Dim>
52using Box = Eigen::AlignedBox<Scalar, Dim>;
55using Boxf = Eigen::AlignedBox<float, Dim>;
58using Boxd = Eigen::AlignedBox<double, Dim>;
61using Boxi = Eigen::AlignedBox<std::int32_t, Dim>;
64using Box2 = Eigen::AlignedBox<T, 2>;
66using Box3 = Eigen::AlignedBox<T, 3>;
80using MatrixX = Eigen::Matrix<T, Dynamic, Dynamic>;
175template <
typename T,
int N,
int M = N>
176using RowMatrix = Eigen::Matrix<T, N, M, Eigen::RowMajor>;
202template <
typename T,
int Dim,
int Options = 0>
203using Vector = Eigen::Matrix<T, Dim, 1, Options>;
298template <
typename T,
int Dim>
397using Isometry3 = Eigen::Transform<T, 3, Eigen::Isometry>;
404using Affine3 = Eigen::Transform<T, 3, Eigen::Affine>;
465template <
typename OtherScalar,
template <
typename...>
class ContainerType,
typename ObjectType>
466[[nodiscard]]
decltype(
auto)
cast(
const ContainerType<ObjectType>& originalContainer) {
467 using Scalar =
typename ObjectType::Scalar;
469 if constexpr (std::is_same_v<OtherScalar, Scalar>) {
470 return originalContainer;
472 using CastedType = std::remove_const_t<
473 std::remove_reference_t<decltype(std::declval<ObjectType>().template
cast<OtherScalar>())>>;
475 ContainerType<CastedType> castedContainer;
476 castedContainer.reserve(originalContainer.size());
479 originalContainer.begin(),
480 originalContainer.end(),
481 std::back_inserter(castedContainer),
482 [](
const ObjectType& item) { return item.template cast<OtherScalar>(); });
484 return castedContainer;
Vector3< uint8_t > Vector3b
3D vector of unsigned bytes; commonly used for RGB color storage in momentum (see ColorArray).
Vector2< float > Vector2f
Vector1< std::int32_t > Vector1i
Vector6< std::uint8_t > Vector6b
Vector6< std::uint32_t > Vector6u
Matrix6< double > Matrix6d
Eigen::AlignedBox< T, 3 > Box3
RowVector5< std::uint8_t > RowVector5b
Eigen::AlignedBox< std::int32_t, Dim > Boxi
Matrix3X< std::uint8_t > Matrix3Xb
Vector3< double > Vector3d
Matrix3< float > Matrix3f
Matrix6< std::uint16_t > Matrix6s
Quaternion< double > Quaterniond
Vector2< std::uint16_t > Vector2s
Matrix6< std::uint8_t > Matrix6b
VectorX< std::uint32_t > VectorXu
Affine3< float > Affine3f
Vector4< std::uint8_t > Vector4b
RowVector1< double > RowVector1d
RowVector4< std::uint32_t > RowVector4u
RowVector4< float > RowVector4f
Quaternion< float > Quaternionf
Vector2< std::uint8_t > Vector2b
Matrix2< float > Matrix2f
Vector8< float > Vector8f
Matrix0< float > Matrix0f
SparseRowMatrix< std::uint32_t > SparseRowMatrixu
Vector4< double > Vector4d
MatrixX< std::uint16_t > MatrixXs
RowVector6< std::uint16_t > RowVector6s
SparseMatrix< std::int32_t > SparseMatrixi
Vector6< std::int32_t > Vector6i
SparseRowMatrix< std::uint16_t > SparseRowMatrixs
Translation3< float > Translation3f
RowVector6< float > RowVector6f
RowVector6< std::uint32_t > RowVector6u
RowVector2< double > RowVector2d
RowVector3< std::uint8_t > RowVector3b
Matrix3X< std::int32_t > Matrix3Xi
Eigen::AlignedBox< T, 2 > Box2
SparseRowMatrix< double > SparseRowMatrixd
constexpr size_t kMaxModelParams
Maximum number of model parameters supported per frame across any character.
Vector0< float > Vector0f
SparseMatrix< std::uint8_t > SparseMatrixb
Matrix0< std::uint8_t > Matrix0b
RowVectorX< std::int32_t > RowVectorXi
RowVector3< double > RowVector3d
RowVector2< std::uint32_t > RowVector2u
Vector< float, Dim > Vectorf
Vector1< std::uint8_t > Vector1b
RowVector2< std::int32_t > RowVector2i
Matrix6< std::int32_t > Matrix6i
Vector5< float > Vector5f
Vector2< std::uint32_t > Vector2u
RowVector0< std::uint32_t > RowVector0u
Eigen::Matrix< T, 3, Dynamic > Matrix3X
3-row, dynamic-column matrix.
Eigen::Matrix< T, 3, 3 > Matrix3
Matrix4< double > Matrix4d
Vector6< double > Vector6d
Vector4< std::uint16_t > Vector4s
RowVector1< std::int32_t > RowVector1i
Vector2< double > Vector2d
Vector0< std::uint16_t > Vector0s
RowVector1< float > RowVector1f
RowVector3< std::uint32_t > RowVector3u
Eigen::Matrix< T, 1, Dim > RowVector
Matrix6< std::uint32_t > Matrix6u
Matrix1< std::uint8_t > Matrix1b
std::vector< Affine3f > TransformationList
One affine transform per joint, indexed by joint id.
Eigen::Matrix< T, 0, 0 > Matrix0
Eigen::ParametrizedLine< Scalar, Dim > Line
Eigen::SparseMatrix< T, Eigen::RowMajor > SparseRowMatrix
Vector3< std::uint8_t > Vector3b
Eigen::AngleAxis< T > AngleAxis
RowVector< T, 6 > RowVector6
VectorX< std::int32_t > VectorXi
Eigen::Matrix< T, 4, 4 > Matrix4
Matrix2< double > Matrix2d
Vector3< std::uint32_t > Vector3u
Matrix3Xb ColorArray
Per-vertex RGB color in [0, 255] bytes (size: 3 x numVertices).
MatrixX3< std::uint8_t > MatrixX3b
Vector0< double > Vector0d
RowVectorX< std::uint8_t > RowVectorXb
RowVectorX< float > RowVectorXf
Vector2< std::int32_t > Vector2i
Box3< std::int32_t > Box3i
Vector4< std::int32_t > Vector4i
Matrix3Xi TriangleArray
Triangle index buffer; column i holds the three vertex indices of triangle i (size: 3 x numTriangles)...
AngleAxis< double > AngleAxisd
Matrix0< std::int32_t > Matrix0i
Eigen::Matrix< T, Dynamic, 3 > MatrixX3
Matrix2< std::uint8_t > Matrix2b
MatrixX3< double > MatrixX3d
Vector5< double > Vector5d
Matrix3X< float > Matrix3Xf
Vector< double, Dim > Vectord
MatrixX< double > MatrixXd
Matrix4< std::int32_t > Matrix4i
RowVector4< std::uint8_t > RowVector4b
MatrixX< std::uint8_t > MatrixXb
Eigen::AlignedBox< Scalar, Dim > Box
Eigen::Hyperplane< Scalar, Dim > Plane
RowVector5< std::uint16_t > RowVector5s
RowVector0< std::uint16_t > RowVector0s
RowVector< T, Dynamic > RowVectorX
Vector< std::uint16_t, Dim > Vectors
RowVector< T, 1 > RowVector1
VectorX< std::uint16_t > VectorXs
Vector< std::int32_t, Dim > Vectori
Eigen::AlignedBox< float, Dim > Boxf
Vector7< float > Vector7f
constexpr int Dynamic
Re-export of Eigen::Dynamic for use as a compile-time dimension token in momentum's type aliases (e....
RowVector5< std::uint32_t > RowVector5u
RowVectorX< double > RowVectorXd
Matrix0< std::uint16_t > Matrix0s
Vector5< std::uint32_t > Vector5u
Eigen::Quaternion< T > Quaternion
Unit quaternion representing a 3D rotation.
Matrix3Xf NormalArray
Per-vertex normals matching the layout of VertexArray (size: 3 x numVertices).
Matrix3< std::uint32_t > Matrix3u
SparseRowMatrix< std::int32_t > SparseRowMatrixi
RowVector4< double > RowVector4d
Vector4< std::uint32_t > Vector4u
Vector4< float > Vector4f
Matrix3< std::int32_t > Matrix3i
Eigen::Matrix< T, 6, 6 > Matrix6
Eigen::Matrix< T, Dynamic, Dynamic > MatrixX
Dynamic-size, column-major dense matrix.
RowVector< T, 3 > RowVector3
RowVector< T, 0 > RowVector0
MatrixX3< std::uint16_t > MatrixX3s
Vector1< std::uint16_t > Vector1s
Vector< T, Dynamic > VectorX
Dynamic-size column vector. Common return type for solver residuals and parameter vectors.
RowVector5< double > RowVector5d
Matrix5< std::uint32_t > Matrix5u
Eigen::SparseMatrix< T > SparseMatrix
Column-major sparse matrix.
RowVector5< float > RowVector5f
RowVector2< std::uint8_t > RowVector2b
Matrix4< float > Matrix4f
Eigen::Transform< T, 3, Eigen::Isometry > Isometry3
3D rigid transform (rotation + translation, no scale or shear).
RowVector0< std::uint8_t > RowVector0b
Isometry3< float > Isometry3f
Matrix6< float > Matrix6f
Vector0< std::uint8_t > Vector0b
Eigen::Matrix< T, 1, 1 > Matrix1
Vector6< float > Vector6f
Eigen::Matrix< T, Dim, 1, Options > Vector
Column vector alias (an Nx1 Eigen matrix).
Matrix5< std::uint8_t > Matrix5b
Matrix5< std::uint16_t > Matrix5s
RowVector1< std::uint32_t > RowVector1u
Vector3< std::uint16_t > Vector3s
Matrix1< std::uint32_t > Matrix1u
Matrix0< double > Matrix0d
Matrix1< double > Matrix1d
RowVector1< std::uint8_t > RowVector1b
RowVector0< std::int32_t > RowVector0i
Matrix3< double > Matrix3d
Matrix2< std::int32_t > Matrix2i
Matrix1< std::uint16_t > Matrix1s
RowVector0< double > RowVector0d
RowVectorX< std::uint32_t > RowVectorXu
MatrixX< std::int32_t > MatrixXi
RowVector1< std::uint16_t > RowVector1s
Vector1< std::uint32_t > Vector1u
MatrixX3< std::uint32_t > MatrixX3u
Box2< std::int32_t > Box2i
Matrix1< float > Matrix1f
RowVector2< std::uint16_t > RowVector2s
SparseMatrix< std::uint32_t > SparseMatrixu
Matrix3X< std::uint32_t > Matrix3Xu
Isometry3< double > Isometry3d
Eigen::Matrix< T, 5, 5 > Matrix5
SparseMatrix< double > SparseMatrixd
Affine3< double > Affine3d
RowMatrix< T, Dynamic > RowMatrixX
Matrix1< std::int32_t > Matrix1i
RowVector3< float > RowVector3f
RowVector3< std::uint16_t > RowVector3s
Matrix5< double > Matrix5d
gsl::span< T > span
Span type alias using gsl::span (C++17 fallback).
Eigen::Translation< T, 3 > Translation3
Vector< std::uint32_t, Dim > Vectoru
Matrix5< float > Matrix5f
RowVector< T, 2 > RowVector2
Vector3< std::int32_t > Vector3i
Vector1< float > Vector1f
Vector5< std::int32_t > Vector5i
Matrix3X< std::uint16_t > Matrix3Xs
SparseMatrix< std::uint16_t > SparseMatrixs
RowVector0< float > RowVector0f
Matrix3< std::uint8_t > Matrix3b
RowVector6< std::int32_t > RowVector6i
MatrixX3< float > MatrixX3f
Vector3< float > Vector3f
Matrix4< std::uint32_t > Matrix4u
Matrix3< std::uint16_t > Matrix3s
VectorX< double > VectorXd
Matrix3Xf VertexArray
Mesh vertex positions; column i is the position of vertex i (size: 3 x numVertices).
VectorX< float > VectorXf
RowVector6< double > RowVector6d
Matrix5< std::int32_t > Matrix5i
VectorX< std::uint8_t > VectorXb
Matrix0< std::uint32_t > Matrix0u
Vector1< double > Vector1d
std::vector< Affine3< T > > TransformationListT
Scalar-templated counterpart of TransformationList.
Matrix4< std::uint16_t > Matrix4s
Vector6< std::uint16_t > Vector6s
Eigen::Matrix< T, N, M, Eigen::RowMajor > RowMatrix
Row-major dense matrix alias.
SparseRowMatrix< std::uint8_t > SparseRowMatrixb
RowVector2< float > RowVector2f
Eigen::AlignedBox< double, Dim > Boxd
RowVectorX< std::uint16_t > RowVectorXs
std::bitset< kMaxModelParams > ParameterSet
Bitset for model parameter enablement.
Matrix2< std::uint16_t > Matrix2s
Vector5< std::uint16_t > Vector5s
SparseMatrix< float > SparseMatrixf
Vector0< std::uint32_t > Vector0u
RowVector< T, 5 > RowVector5
SparseRowMatrix< float > SparseRowMatrixf
MatrixX< float > MatrixXf
Matrix2< std::uint32_t > Matrix2u
RowVector4< std::uint16_t > RowVector4s
decltype(auto) cast(const ContainerType< ObjectType > &originalContainer)
Casts the scalar type of objects in a container that support the cast<>() method.
Eigen::Transform< T, 3, Eigen::Affine > Affine3
3D affine transform (linear part + translation).
Vector< std::uint8_t, Dim > Vectorb
Matrix3X< double > Matrix3Xd
Vector0< std::int32_t > Vector0i
RowVector3< std::int32_t > RowVector3i
Vector5< std::uint8_t > Vector5b
Translation3< double > Translation3d
MatrixX3< std::int32_t > MatrixX3i
AngleAxis< float > AngleAxisf
Eigen::Matrix< T, 2, 2 > Matrix2
MatrixX< std::uint32_t > MatrixXu
RowVector4< std::int32_t > RowVector4i
RowVector< T, 4 > RowVector4
RowVector5< std::int32_t > RowVector5i
RowVector6< std::uint8_t > RowVector6b
Matrix4< std::uint8_t > Matrix4b
Provides a C++17-compatible span type alias.
A utility struct that facilitates the deduction of a momentum::span type from a given type.