|
Momentum
A library for solving nonlinear optimization problems related to human body kinematics
|
Represents the complete state of a skeleton. More...
#include <skeleton_state.h>
Public Member Functions | |
| SkeletonStateT () noexcept=default | |
| Creates an empty skeleton state. | |
| SkeletonStateT (const JointParametersT< T > ¶meters, const Skeleton &referenceSkeleton, bool computeDeriv=true) | |
| Creates a skeleton state from joint parameters and a reference skeleton. | |
| SkeletonStateT (JointParametersT< T > &¶meters, const Skeleton &referenceSkeleton, bool computeDeriv=true) | |
| Creates a skeleton state from rvalue joint parameters and a reference skeleton. | |
| template<typename T2> | |
| SkeletonStateT (const SkeletonStateT< T2 > &rhs) | |
| Creates a skeleton state from another skeleton state with a different scalar type. | |
| void | set (const JointParametersT< T > &jointParameters, const Skeleton &referenceSkeleton, bool computeDeriv=true) |
| Updates the skeleton state with new joint parameters. | |
| void | set (JointParametersT< T > &&jointParameters, const Skeleton &referenceSkeleton, bool computeDeriv=true) |
| Updates the skeleton state with new rvalue joint parameters. | |
| template<typename T2> | |
| void | set (const SkeletonStateT< T2 > &rhs) |
| Updates the skeleton state from another skeleton state with a different scalar type. | |
| TransformListT< T > | toTransforms () const |
| Extracts global transforms for all joints in the skeleton. | |
| template<typename T2> | |
| SkeletonStateT< T2 > | cast () const |
| Converts the skeleton state to a different scalar type. | |
Static Public Member Functions | |
| static StateSimilarity | compare (const SkeletonStateT< T > &state1, const SkeletonStateT< T > &state2) |
| Compares two skeleton states and returns similarity metrics. | |
Public Attributes | |
| JointParametersT< T > | jointParameters |
| Joint parameters for all joints in the skeleton. | |
| JointStateListT< T > | jointState |
| Computed joint states for all joints in the skeleton. | |
Represents the complete state of a skeleton.
Stores joint parameters and computed joint states for an entire skeleton. Provides methods for updating the state based on new parameters and comparing different skeleton states.
Definition at line 45 of file skeleton_state.h.
|
defaultnoexcept |
Creates an empty skeleton state.
Referenced by compare(), set(), and SkeletonStateT().
| momentum::SkeletonStateT< T >::SkeletonStateT | ( | const JointParametersT< T > & | parameters, |
| const Skeleton & | referenceSkeleton, | ||
| bool | computeDeriv = true ) |
Creates a skeleton state from joint parameters and a reference skeleton.
| parameters | Joint parameters for all joints in the skeleton |
| referenceSkeleton | The skeleton structure defining joint hierarchy |
| computeDeriv | If true, computes translationAxis and rotationAxis matrices needed for Jacobian computation in error functions. Set to false ONLY when the state is used for visualization, FK output inspection, or IO — never when the state will be passed to a solver or error function. Skipping derivatives saves ~30% of per-joint FK cost. When false, derivDirty is set to true and derivative accessors (getRotationDerivative, getTranslationDerivative, getScaleDerivative) return invalid results. |
Definition at line 22 of file skeleton_state.cpp.
References jointParameters, jointState, and set().
| momentum::SkeletonStateT< T >::SkeletonStateT | ( | JointParametersT< T > && | parameters, |
| const Skeleton & | referenceSkeleton, | ||
| bool | computeDeriv = true ) |
Creates a skeleton state from rvalue joint parameters and a reference skeleton.
| parameters | Joint parameters for all joints in the skeleton (moved from) |
| referenceSkeleton | The skeleton structure defining joint hierarchy |
| computeDeriv | If true, computes translationAxis and rotationAxis matrices needed for Jacobian computation in error functions. Set to false ONLY when the state is used for visualization, FK output inspection, or IO — never when the state will be passed to a solver or error function. Skipping derivatives saves ~30% of per-joint FK cost. When false, derivDirty is set to true and derivative accessors (getRotationDerivative, getTranslationDerivative, getScaleDerivative) return invalid results. |
Definition at line 31 of file skeleton_state.cpp.
References jointParameters, jointState, and set().
|
explicit |
Creates a skeleton state from another skeleton state with a different scalar type.
| T2 | Source scalar type |
| rhs | Source skeleton state to copy from |
Definition at line 41 of file skeleton_state.cpp.
References cast(), jointParameters, jointState, and SkeletonStateT().
|
inlinenodiscard |
Converts the skeleton state to a different scalar type.
| T2 | Target scalar type |
Definition at line 156 of file skeleton_state.h.
Referenced by SkeletonStateT().
|
staticnodiscard |
Compares two skeleton states and returns similarity metrics.
| state1 | First skeleton state to compare |
| state2 | Second skeleton state to compare |
Definition at line 134 of file skeleton_state.cpp.
References momentum::dot(), jointParameters, jointState, MT_CHECK, momentum::StateSimilarity::orientationError, momentum::StateSimilarity::orientationMax, momentum::StateSimilarity::orientationRMSE, momentum::StateSimilarity::positionError, momentum::StateSimilarity::positionMax, momentum::StateSimilarity::positionRMSE, and SkeletonStateT().
| void momentum::SkeletonStateT< T >::set | ( | const JointParametersT< T > & | jointParameters, |
| const Skeleton & | referenceSkeleton, | ||
| bool | computeDeriv = true ) |
Updates the skeleton state with new joint parameters.
| jointParameters | New joint parameters for all joints |
| referenceSkeleton | The skeleton structure defining joint hierarchy |
| computeDeriv | If true, computes translationAxis and rotationAxis matrices needed for Jacobian computation in error functions. Set to false ONLY when the state is used for visualization, FK output inspection, or IO — never when the state will be passed to a solver or error function. Skipping derivatives saves ~30% of per-joint FK cost. When false, derivDirty is set to true and derivative accessors (getRotationDerivative, getTranslationDerivative, getScaleDerivative) return invalid results. |
Definition at line 65 of file skeleton_state.cpp.
References jointParameters, momentum::SkeletonT< T >::joints, jointState, MT_PROFILE_FUNCTION, and set().
Referenced by momentum::SkeletonStateT< float >::cast(), momentum::computeFloorContactConstraints(), momentum::SequenceSolverFunctionT< T >::getGradient(), momentum::getLocatorError(), momentum::sampleFrames(), set(), set(), SkeletonStateT(), and SkeletonStateT().
| void momentum::SkeletonStateT< T >::set | ( | const SkeletonStateT< T2 > & | rhs | ) |
Updates the skeleton state from another skeleton state with a different scalar type.
| T2 | Source scalar type |
| rhs | Source skeleton state to copy from |
Definition at line 48 of file skeleton_state.cpp.
References momentum::cast(), jointParameters, jointState, MT_PROFILE_FUNCTION, and SkeletonStateT().
| void momentum::SkeletonStateT< T >::set | ( | JointParametersT< T > && | jointParameters, |
| const Skeleton & | referenceSkeleton, | ||
| bool | computeDeriv = true ) |
Updates the skeleton state with new rvalue joint parameters.
| jointParameters | New joint parameters for all joints (moved from) |
| referenceSkeleton | The skeleton structure defining joint hierarchy |
| computeDeriv | If true, computes translationAxis and rotationAxis matrices needed for Jacobian computation in error functions. Set to false ONLY when the state is used for visualization, FK output inspection, or IO — never when the state will be passed to a solver or error function. Skipping derivatives saves ~30% of per-joint FK cost. When false, derivDirty is set to true and derivative accessors (getRotationDerivative, getTranslationDerivative, getScaleDerivative) return invalid results. |
Definition at line 76 of file skeleton_state.cpp.
References jointParameters, momentum::SkeletonT< T >::joints, jointState, MT_PROFILE_FUNCTION, and set().
|
nodiscard |
Extracts global transforms for all joints in the skeleton.
Definition at line 124 of file skeleton_state.cpp.
References jointState.
Referenced by momentum::StateErrorFunctionT< T >::setTargetState().
| JointParametersT<T> momentum::SkeletonStateT< T >::jointParameters |
Joint parameters for all joints in the skeleton.
Definition at line 47 of file skeleton_state.h.
Referenced by compare(), momentum::CollisionErrorFunctionStatelessT< T >::getError(), momentum::CollisionErrorFunctionT< T >::getError(), momentum::LimitErrorFunctionT< T >::getError(), momentum::PlaneCollisionErrorFunctionT< T >::getError(), momentum::StateErrorFunctionT< T >::getError(), momentum::CollisionErrorFunctionStatelessT< T >::getGradient(), momentum::CollisionErrorFunctionT< T >::getGradient(), momentum::PlaneCollisionErrorFunctionT< T >::getGradient(), momentum::StateErrorFunctionT< T >::getGradient(), momentum::CollisionErrorFunctionStatelessT< T >::getJacobian(), momentum::CollisionErrorFunctionT< T >::getJacobian(), momentum::PlaneCollisionErrorFunctionT< T >::getJacobian(), set(), set(), set(), SkeletonStateT(), SkeletonStateT(), and SkeletonStateT().
| JointStateListT<T> momentum::SkeletonStateT< T >::jointState |
Computed joint states for all joints in the skeleton.
Definition at line 50 of file skeleton_state.h.
Referenced by momentum::accumulateChainDerivatives(), momentum::detail_sdf_collision::accumulateColliderHierarchyGradient(), momentum::detail_sdf_collision::accumulateColliderHierarchyJacobian(), 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::applyInverseSSD(), momentum::applySSD(), momentum::applySSD(), momentum::calculateDWorldPos(), compare(), momentum::PoseShape::compute(), momentum::detail_sdf_collision::computeColliderWorldBoundingBox(), momentum::computeFloorContactConstraints(), momentum::detail_sdf_collision::computeWorldToColliderTransform(), momentum::FullyDifferentiableProjectionErrorFunctionT< T >::constraintGradient_dot(), momentum::extractLocatorsFromCharacter(), momentum::extractMarkersFromMotion(), momentum::CameraProjectionErrorFunctionT< T >::getError(), momentum::CameraVertexProjectionErrorFunctionT< T >::getError(), momentum::CenterOfMassErrorFunctionT< T >::getError(), momentum::CollisionErrorFunctionStatelessT< T >::getError(), momentum::CollisionErrorFunctionT< T >::getError(), momentum::DistanceErrorFunctionT< T >::getError(), momentum::FullyDifferentiableOrientationErrorFunctionT< T >::getError(), momentum::JointErrorFunctionT< T, Data, FuncDim, NumVec, NumPos >::getError(), momentum::JointErrorFunctionT< T, AimDataT< T >, 3, 2, 1 >::getError(), momentum::JointToJointDistanceErrorFunctionT< T >::getError(), momentum::JointToJointOrientationErrorFunctionT< T >::getError(), momentum::JointToJointPositionErrorFunctionT< T >::getError(), momentum::PlaneCollisionErrorFunctionT< T >::getError(), momentum::ProjectionErrorFunctionT< T >::getError(), momentum::StateErrorFunctionT< T >::getError(), momentum::CameraProjectionErrorFunctionT< T >::getGradient(), momentum::CameraVertexProjectionErrorFunctionT< T >::getGradient(), momentum::CenterOfMassErrorFunctionT< T >::getGradient(), momentum::CollisionErrorFunctionStatelessT< T >::getGradient(), momentum::CollisionErrorFunctionT< T >::getGradient(), momentum::DistanceErrorFunctionT< T >::getGradient(), momentum::JointToJointDistanceErrorFunctionT< T >::getGradient(), momentum::JointToJointOrientationErrorFunctionT< T >::getGradient(), momentum::JointToJointPositionErrorFunctionT< T >::getGradient(), momentum::PlaneCollisionErrorFunctionT< T >::getGradient(), momentum::ProjectionErrorFunctionT< T >::getGradient(), momentum::SDFCollisionErrorFunctionT< T, SdfColliderType >::getGradient(), momentum::StateErrorFunctionT< T >::getGradient(), momentum::VertexSDFErrorFunctionT< T >::getGradient(), momentum::getInverseSSDTransformation(), momentum::CameraProjectionErrorFunctionT< T >::getJacobian(), momentum::CameraVertexProjectionErrorFunctionT< T >::getJacobian(), momentum::CenterOfMassErrorFunctionT< T >::getJacobian(), momentum::CollisionErrorFunctionStatelessT< T >::getJacobian(), momentum::CollisionErrorFunctionT< T >::getJacobian(), momentum::DistanceErrorFunctionT< T >::getJacobian(), momentum::JointErrorFunctionT< T, Data, FuncDim, NumVec, NumPos >::getJacobian(), momentum::JointToJointDistanceErrorFunctionT< T >::getJacobian(), momentum::JointToJointOrientationErrorFunctionT< T >::getJacobian(), momentum::JointToJointPositionErrorFunctionT< T >::getJacobian(), momentum::PlaneCollisionErrorFunctionT< T >::getJacobian(), momentum::ProjectionErrorFunctionT< T >::getJacobian(), momentum::SDFCollisionErrorFunctionT< T, SdfColliderType >::getJacobian(), momentum::StateErrorFunctionT< T >::getJacobian(), momentum::VelocityMagnitudeSequenceErrorFunctionT< T >::getJacobian(), momentum::VertexSDFErrorFunctionT< T >::getJacobian(), momentum::getLocatorError(), momentum::getSkinnedLocatorPosition(), momentum::Character::initInverseBindPose(), momentum::JointErrorFunctionT< T, AimDataT< T >, 3, 2, 1 >::JointErrorFunctionT(), momentum::loadLocatorsFromBuffer(), momentum::locatorsToSkinnedLocators(), momentum::logCharacter(), momentum::logCollisionGeometry(), momentum::detail::makeCollisionBoxLogData(), momentum::detail::makeCollisionEllipsoidLogData(), momentum::Character::remapLocators(), momentum::Character::remapParameterLimits(), momentum::sampleFrames(), set(), set(), set(), momentum::StateErrorFunctionT< T >::setTargetState(), SkeletonStateT(), SkeletonStateT(), SkeletonStateT(), momentum::skeletonStateToJointParameters(), momentum::skeletonStateToJointParametersRespectingActiveParameters(), momentum::skinnedLocatorsToLocators(), momentum::SkinningWeightIteratorT< T >::SkinningWeightIteratorT(), momentum::SkinningWeightIteratorT< T >::SkinningWeightIteratorT(), momentum::skinWithBlendShapes(), toTransforms(), momentum::transformAtoB(), momentum::PlaneCollisionQueryT< T >::update(), momentum::PositionConstraintStateT< T >::update(), and momentum::CollisionGeometryStateT< T >::updatePrimitive().