25 update(parameters, state, character);
33 if (other.neutralMesh_) {
34 neutralMesh_ = std::make_unique<MeshT<T>>(*other.neutralMesh_);
36 if (other.restMesh_) {
37 restMesh_ = std::make_unique<MeshT<T>>(*other.restMesh_);
39 if (other.posedMesh_) {
40 posedMesh_ = std::make_unique<MeshT<T>>(*other.posedMesh_);
71 bool doUpdateNormals =
false;
77 doUpdateNormals =
true;
85 Eigen::Map<Eigen::VectorX<T>> outputVec(
87 const Eigen::Map<Eigen::VectorX<T>> baseVec(
89 outputVec = baseVec.template
cast<T>();
94 faceExpressionBlendWeights,
restMesh_->vertices);
95 doUpdateNormals =
true;
98 if (doUpdateNormals) {
This file provides functions for applying blend shape deformations and skeletal transformations to ch...
Functions for linear blend skinning (Skeletal Subspace Deformation).
BlendWeightsT< T > extractFaceExpressionBlendWeights(const ParameterTransform ¶mTransform, const ModelParametersT< T > &modelParams)
Extracts facial expression blend shape weights from model parameters.
std::vector< Vector3< T > > applySSD(const SkinWeights &skin, typename DeduceSpanType< const Vector3< T > >::type points, typename DeduceSpanType< const Eigen::Matrix4< T > >::type skinningTransforms)
Applies forward SSD (linear blend skinning) to points using precomputed skinning transforms.
BlendWeightsT< T > extractBlendWeights(const ParameterTransform ¶mTransform, const ModelParametersT< T > &modelParams)
Extracts blend shape weights from model parameters.
decltype(auto) cast(const ContainerType< ObjectType > &originalContainer)
Casts the scalar type of objects in a container that support the cast<>() method.
Profiling macros that dispatch to one of three backends, selected at compile time:
#define MT_PROFILE_FUNCTION()
A character model with skeletal structure, mesh, and optional components.
TransformationList inverseBindPose
Inverse of the bind pose transformations for each joint.
SkinWeights_u skinWeights
Defines how mesh vertices are influenced by joints.
BlendShapeBase_const_p faceExpressionBlendShape
Facial expression blend shapes.
Mesh_u mesh
3D mesh representing the character's surface
ParameterTransform parameterTransform
Maps model parameters to joint parameters.
BlendShape_const_p blendShape
Shape variations that can be blended.
Represents the complete state of a model's mesh.
std::unique_ptr< MeshT< T > > neutralMesh_
Rest mesh without the facial expression basis, used to restore the neutral shape after facial express...
void update(const ModelParametersT< T > ¶meters, const SkeletonStateT< T > &state, const Character &character)
Updates the mesh state based on model parameters and skeleton state.
MeshStateT & operator=(const MeshStateT &other)
std::unique_ptr< MeshT< T > > posedMesh_
Posed mesh after the skeleton transforms have been applied.
std::unique_ptr< MeshT< T > > restMesh_
Rest positions of the mesh after the shape basis (and potentially facial expression basis) has been a...
MeshStateT() noexcept=default
Creates an empty mesh state.
A vector of size numModelParams holding the values of all model parameters for a character.
Represents the complete state of a skeleton.