46 bool updateCollision) {
47 setBindPose(referenceCharacter, updateMesh, updateCollision);
57 set(
parameters, referenceCharacter, updateMesh, updateCollision, applyLimits);
64 bool updateCollision) {
65 set(referenceCharacter.
bindPose(), referenceCharacter, updateMesh, updateCollision);
100 if (updateMesh && referenceCharacter.
mesh && referenceCharacter.
skinWeights) {
104 meshState = std::make_unique<Mesh>(*referenceCharacter.
mesh);
124 *referenceCharacter.
mesh,
130 if (updateCollision && referenceCharacter.
collision) {
This file provides functions for applying blend shape deformations and skeletal transformations to ch...
#define MT_CHECK(condition,...)
Runtime check macros with two interchangeable backends:
Functions for linear blend skinning (Skeletal Subspace Deformation).
CollisionGeometryStateT< float > CollisionGeometryState
void skinWithBlendShapes(const Character &character, const SkeletonStateT< T > &state, const ModelParametersT< T > &modelParams, MeshT< T > &outputMesh)
Applies blend shape deformations and skeletal transformations to a mesh.
JointParameters applyPassiveJointParameterLimits(const ParameterLimits &limits, const JointParameters &jointParams)
Only processes MinMaxJointPassive limits, clamping parameters to their ranges.
JointParametersT< float > JointParameters
CharacterParametersT< float > CharacterParameters
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.
Represents the complete state of a character at a specific point in time.
CharacterParameters parameters
Model parameters (pose) and joint parameter offsets driving this state.
Mesh_u meshState
Skinned mesh; null when constructed/updated with updateMesh=false or when the reference character has...
void setBindPose(const Character &referenceCharacter, bool updateMesh=true, bool updateCollision=true)
Sets the character state to referenceCharacter's bind pose.
void set(const CharacterParameters ¶meters, const Character &referenceCharacter, bool updateMesh=true, bool updateCollision=true, bool applyLimits=true)
Updates the character state by applying parameters to referenceCharacter.
CharacterStateT & operator=(const CharacterStateT &rhs)=delete
Copy assignment is deleted; use the explicit copy constructor instead.
SkeletonState skeletonState
LocatorState locatorState
CollisionGeometryState_u collisionState
Collision geometry state; null when constructed/updated with updateCollision=false or when the refere...
A character model with skeletal structure, mesh, and optional components.
TransformationList inverseBindPose
Inverse of the bind pose transformations for each joint.
LocatorList locators
Points of interest attached to joints.
SkinWeights_u skinWeights
Defines how mesh vertices are influenced by joints.
CharacterParameters bindPose() const
Returns parameters representing the character's bind pose.
ParameterLimits parameterLimits
Constraints on model parameters.
Mesh_u mesh
3D mesh representing the character's surface
PoseShape_u poseShapes
Pose-dependent shape corrections.
Skeleton skeleton
Skeletal structure defining the character's joints and hierarchy.
ParameterTransform parameterTransform
Maps model parameters to joint parameters.
BlendShape_const_p blendShape
Shape variations that can be blended.
CollisionGeometry_u collision
Collision volumes for the character.