Momentum
A library for solving nonlinear optimization problems related to human body kinematics
Loading...
Searching...
No Matches
momentum::MeshStateT< T > Struct Template Reference

Represents the complete state of a model's mesh. More...

#include <mesh_state.h>

Public Member Functions

 MeshStateT () noexcept=default
 Creates an empty mesh state.
 MeshStateT (const ModelParametersT< T > &parameters, const SkeletonStateT< T > &state, const Character &character) noexcept
 ~MeshStateT () noexcept
 MeshStateT (const MeshStateT &other)
MeshStateT & operator= (const MeshStateT &other)
 MeshStateT (MeshStateT &&other) noexcept=default
MeshStateT & operator= (MeshStateT &&other) noexcept=default
void update (const ModelParametersT< T > &parameters, const SkeletonStateT< T > &state, const Character &character)
 Updates the mesh state based on model parameters and skeleton state.

Public Attributes

std::unique_ptr< MeshT< T > > neutralMesh_
 Rest mesh without the facial expression basis, used to restore the neutral shape after facial expressions are applied.
std::unique_ptr< MeshT< T > > restMesh_
 Rest positions of the mesh after the shape basis (and potentially facial expression basis) has been applied.
std::unique_ptr< MeshT< T > > posedMesh_
 Posed mesh after the skeleton transforms have been applied.

Detailed Description

template<typename T>
struct momentum::MeshStateT< T >

Represents the complete state of a model's mesh.

Stores the mesh in its various states throughout the deformation pipeline:

  • neutralMesh: Base mesh before any deformations
  • restMesh: Mesh after blend shapes/expressions are applied
  • posedMesh: Final mesh after skinning is applied

Definition at line 24 of file mesh_state.h.

Constructor & Destructor Documentation

◆ MeshStateT() [1/4]

template<typename T>
momentum::MeshStateT< T >::MeshStateT ( )
defaultnoexcept

Creates an empty mesh state.

Referenced by MeshStateT(), and operator=().

◆ MeshStateT() [2/4]

template<typename T>
momentum::MeshStateT< T >::MeshStateT ( const ModelParametersT< T > & parameters,
const SkeletonStateT< T > & state,
const Character & character )
noexcept

Definition at line 21 of file mesh_state.cpp.

References update().

◆ ~MeshStateT()

template<typename T>
momentum::MeshStateT< T >::~MeshStateT ( )
defaultnoexcept

◆ MeshStateT() [3/4]

template<typename T>
momentum::MeshStateT< T >::MeshStateT ( const MeshStateT< T > & other)

Definition at line 32 of file mesh_state.cpp.

References MeshStateT().

◆ MeshStateT() [4/4]

template<typename T>
momentum::MeshStateT< T >::MeshStateT ( MeshStateT< T > && other)
defaultnoexcept

Member Function Documentation

◆ operator=() [1/2]

template<typename T>
MeshStateT< T > & momentum::MeshStateT< T >::operator= ( const MeshStateT< T > & other)

Definition at line 45 of file mesh_state.cpp.

References MeshStateT().

◆ operator=() [2/2]

template<typename T>
MeshStateT & momentum::MeshStateT< T >::operator= ( MeshStateT< T > && other)
defaultnoexcept

◆ update()

template<typename T>
void momentum::MeshStateT< T >::update ( const ModelParametersT< T > & parameters,
const SkeletonStateT< T > & state,
const Character & character )

Updates the mesh state based on model parameters and skeleton state.

This applies the full deformation pipeline:

  1. Apply blend shapes to create rest mesh
  2. Apply face expression blend shapes
  3. Update normals
  4. Apply skinning to create posed mesh
Parameters
parametersModel parameters containing blend weights
stateCurrent skeleton state for skinning
characterCharacter containing mesh, blend shapes, and skinning data

Definition at line 53 of file mesh_state.cpp.

References momentum::applySSD(), momentum::Character::blendShape, momentum::cast(), momentum::extractBlendWeights(), momentum::extractFaceExpressionBlendWeights(), momentum::Character::faceExpressionBlendShape, momentum::Character::inverseBindPose, momentum::Character::mesh, MT_PROFILE_FUNCTION, neutralMesh_, momentum::Character::parameterTransform, posedMesh_, restMesh_, and momentum::Character::skinWeights.

Referenced by momentum::SequenceSolverFunctionT< T >::computeJacobianBlock(), momentum::d_modelParams_d_inputs(), momentum::SequenceSolverFunctionT< T >::getGradient(), and MeshStateT().

Member Data Documentation

◆ neutralMesh_

template<typename T>
std::unique_ptr<MeshT<T> > momentum::MeshStateT< T >::neutralMesh_

Rest mesh without the facial expression basis, used to restore the neutral shape after facial expressions are applied.

Not used when there is a shape basis.

Definition at line 27 of file mesh_state.h.

Referenced by update().

◆ posedMesh_

template<typename T>
std::unique_ptr<MeshT<T> > momentum::MeshStateT< T >::posedMesh_

Posed mesh after the skeleton transforms have been applied.

Definition at line 32 of file mesh_state.h.

Referenced by momentum::SkeletonDerivativeT< T >::accumulateVertexNormalBlendShapeGradient(), momentum::SkeletonDerivativeT< T >::accumulateVertexNormalBlendShapeGradient(), momentum::SkeletonDerivativeT< T >::accumulateVertexNormalBlendShapeJacobian(), momentum::SkeletonDerivativeT< T >::accumulateVertexNormalBlendShapeJacobian(), momentum::VertexNormalErrorFunctionT< T >::evalFunction(), momentum::VertexPlaneErrorFunctionT< T >::evalFunction(), momentum::CameraVertexProjectionErrorFunctionT< T >::getError(), momentum::PointTriangleVertexErrorFunctionT< T >::getError(), momentum::SDFCollisionErrorFunctionT< T, SdfColliderType >::getError(), momentum::VertexErrorFunctionT< T, Data, FuncDim >::getError(), momentum::VertexSDFErrorFunctionT< T >::getError(), momentum::VertexVertexDistanceErrorFunctionT< T >::getError(), momentum::CameraVertexProjectionErrorFunctionT< T >::getGradient(), momentum::PointTriangleVertexErrorFunctionT< T >::getGradient(), momentum::SDFCollisionErrorFunctionT< T, SdfColliderType >::getGradient(), momentum::VertexErrorFunctionT< T, Data, FuncDim >::getGradient(), momentum::VertexNormalErrorFunctionT< T >::getGradient(), momentum::VertexPositionErrorFunctionT< T >::getGradient(), momentum::VertexSDFErrorFunctionT< T >::getGradient(), momentum::VertexVertexDistanceErrorFunctionT< T >::getGradient(), momentum::CameraVertexProjectionErrorFunctionT< T >::getJacobian(), momentum::PointTriangleVertexErrorFunctionT< T >::getJacobian(), momentum::SDFCollisionErrorFunctionT< T, SdfColliderType >::getJacobian(), momentum::VertexErrorFunctionT< T, Data, FuncDim >::getJacobian(), momentum::VertexNormalErrorFunctionT< T >::getJacobian(), momentum::VertexPositionErrorFunctionT< T >::getJacobian(), momentum::VertexSDFErrorFunctionT< T >::getJacobian(), momentum::VertexVertexDistanceErrorFunctionT< T >::getJacobian(), and update().

◆ restMesh_

template<typename T>
std::unique_ptr<MeshT<T> > momentum::MeshStateT< T >::restMesh_

Rest positions of the mesh after the shape basis (and potentially facial expression basis) has been applied.

Definition at line 30 of file mesh_state.h.

Referenced by momentum::SkeletonDerivativeT< T >::accumulateVertexGradient(), momentum::SkeletonDerivativeT< T >::accumulateVertexGradientIdentityDfdv(), momentum::SkeletonDerivativeT< T >::accumulateVertexGradientWithNormalCorrection(), momentum::SkeletonDerivativeT< T >::accumulateVertexGradientWithNormalCorrectionDirect(), momentum::SkeletonDerivativeT< T >::accumulateVertexJacobian(), momentum::SkeletonDerivativeT< T >::accumulateVertexJacobianIdentityDfdv(), momentum::SkeletonDerivativeT< T >::accumulateVertexJacobianWithNormalCorrection(), momentum::SkeletonDerivativeT< T >::accumulateVertexJacobianWithNormalCorrectionDirect(), momentum::SkeletonDerivativeT< T >::accumulateVertexNormalBlendShapeGradient(), momentum::SkeletonDerivativeT< T >::accumulateVertexNormalBlendShapeJacobian(), momentum::SkeletonDerivativeT< T >::accumulateVertexNormalCorrectionGradient(), momentum::SkeletonDerivativeT< T >::accumulateVertexNormalCorrectionJacobian(), momentum::SkinnedLocatorTriangleErrorFunctionT< T >::getError(), momentum::SDFCollisionErrorFunctionT< T, SdfColliderType >::getGradient(), momentum::SkinnedLocatorTriangleErrorFunctionT< T >::getGradient(), momentum::VertexSDFErrorFunctionT< T >::getGradient(), momentum::SDFCollisionErrorFunctionT< T, SdfColliderType >::getJacobian(), momentum::SkinnedLocatorTriangleErrorFunctionT< T >::getJacobian(), momentum::VertexSDFErrorFunctionT< T >::getJacobian(), and update().


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