|
Momentum
A library for solving nonlinear optimization problems related to human body kinematics
|
Computes shape deformations based on joint rotations. More...
#include <pose_shape.h>
Public Member Functions | |
| std::vector< Vector3f > | compute (const SkeletonState &state) const |
| Computes the deformed shape vertices for the given skeleton pose. | |
| bool | isApprox (const PoseShape &poseShape) const |
| Returns true if all members are approximately equal (uses Eigen::isApprox for floating-point members and exact equality for baseJoint/jointMap). | |
Public Attributes | |
| size_t | baseJoint |
| Index of the joint used as reference for computing relative rotations. | |
| Quaternionf | baseRot |
| Base rotation used as reference for computing rotation differences. | |
| std::vector< size_t > | jointMap |
| Indices of joints whose rotations drive the shape deformation. | |
| VectorXf | baseShape |
| Base shape vertices stored as a flat vector [x1,y1,z1,x2,y2,z2,...]. | |
| MatrixXf | shapeVectors |
| Shape deformation vectors for each quaternion component of each joint. | |
Computes shape deformations based on joint rotations.
PoseShape implements a linear blend shape system where shape deformations are driven by joint rotations. This is useful for modeling effects like muscle bulging or skin sliding that occur during animation.
Definition at line 20 of file pose_shape.h.
|
nodiscard |
Computes the deformed shape vertices for the given skeleton pose.
| If | baseShape.size() != shapeVectors.rows(). |
Definition at line 15 of file pose_shape.cpp.
References baseJoint, baseRot, baseShape, jointMap, momentum::SkeletonStateT< T >::jointState, MT_CHECK, and shapeVectors.
|
inlinenodiscard |
Returns true if all members are approximately equal (uses Eigen::isApprox for floating-point members and exact equality for baseJoint/jointMap).
Definition at line 51 of file pose_shape.h.
References baseJoint, baseRot, baseShape, jointMap, and shapeVectors.
| size_t momentum::PoseShape::baseJoint |
Index of the joint used as reference for computing relative rotations.
Definition at line 22 of file pose_shape.h.
Referenced by compute(), isApprox(), and momentum::loadPoseShape().
| Quaternionf momentum::PoseShape::baseRot |
Base rotation used as reference for computing rotation differences.
The effective rotation used for deformation is baseRot * joint.rotation().inverse()
Definition at line 27 of file pose_shape.h.
Referenced by compute(), isApprox(), and momentum::loadPoseShape().
| VectorXf momentum::PoseShape::baseShape |
Base shape vertices stored as a flat vector [x1,y1,z1,x2,y2,z2,...].
The size must be a multiple of 3 (3 coordinates per vertex).
Definition at line 35 of file pose_shape.h.
Referenced by compute(), isApprox(), and momentum::loadPoseShape().
| std::vector<size_t> momentum::PoseShape::jointMap |
Indices of joints whose rotations drive the shape deformation.
Definition at line 30 of file pose_shape.h.
Referenced by compute(), isApprox(), and momentum::loadPoseShape().
| MatrixXf momentum::PoseShape::shapeVectors |
Shape deformation vectors for each quaternion component of each joint.
Matrix dimensions are [baseShape.size() × (jointMap.size() * 4)]. Each column corresponds to a quaternion component (x,y,z,w) of a joint.
Definition at line 41 of file pose_shape.h.
Referenced by compute(), isApprox(), and momentum::loadPoseShape().