|
Momentum
A library for solving nonlinear optimization problems related to human body kinematics
|
The skeletal structure of a momentum Character. More...
#include <skeleton.h>
Public Member Functions | |
| SkeletonT ()=default | |
| SkeletonT (JointList joints) | |
| SkeletonT (const SkeletonT &other)=default | |
| SkeletonT (SkeletonT &&other) noexcept=default | |
| SkeletonT & | operator= (const SkeletonT &other)=default |
| SkeletonT & | operator= (SkeletonT &&other) noexcept=default |
| ~SkeletonT ()=default | |
| size_t | getJointIdByName (std::string_view name) const |
| Returns the index of a joint with the given name, or kInvalidIndex if not found. | |
| std::vector< std::string > | getJointNames () const |
| std::vector< size_t > | getChildrenJoints (size_t jointId, bool recursive=true) const |
| Returns indices of child joints of the specified joint. | |
| bool | isAncestor (size_t jointId, size_t ancestorJointId) const |
| Returns true if ancestorJointId is an ancestor of jointId. | |
| bool | isSameOrAdjacentJoints (size_t joint1, size_t joint2) const |
| Returns true if the two joints are the same, or one is the direct parent of the other. | |
| size_t | commonAncestor (size_t joint1, size_t joint2) const |
| Returns the lowest common ancestor of two joints in the hierarchy, or kInvalidIndex if either joint is kInvalidIndex. | |
| template<typename U> | |
| SkeletonT< U > | cast () const |
| Returns a copy of this skeleton with all numeric values converted to scalar type U. | |
Public Attributes | |
| JointList | joints |
| The list of joints in this skeleton, ordered such that every joint's parent appears earlier in the list (parent index < child index, or kInvalidIndex for roots). | |
The skeletal structure of a momentum Character.
Definition at line 22 of file skeleton.h.
|
default |
|
explicit |
| if | the hierarchy invariant is violated. |
Definition at line 16 of file skeleton.cpp.
References joints, momentum::kInvalidIndex, and MT_CHECK.
|
default |
|
defaultnoexcept |
|
default |
|
inlinenodiscard |
Returns a copy of this skeleton with all numeric values converted to scalar type U.
Definition at line 68 of file skeleton.h.
|
nodiscard |
Returns the lowest common ancestor of two joints in the hierarchy, or kInvalidIndex if either joint is kInvalidIndex.
Definition at line 97 of file skeleton.cpp.
References joints, momentum::kInvalidIndex, and MT_CHECK.
Referenced by momentum::detail_sdf_collision::findCommonAncestorForVertex().
|
nodiscard |
Returns indices of child joints of the specified joint.
| jointId | Index of the joint to find children for |
| recursive | If true, returns all descendants; if false, only direct children |
| std::out_of_range | if jointId is invalid |
Definition at line 45 of file skeleton.cpp.
References joints, momentum::kInvalidIndex, and MT_THROW_IF_T.
|
nodiscard |
Returns the index of a joint with the given name, or kInvalidIndex if not found.
Definition at line 25 of file skeleton.cpp.
References joints, and momentum::kInvalidIndex.
Referenced by momentum::createGloveOrientationConstraintData(), momentum::createGlovePositionConstraintData(), momentum::extractGloveOffsetsFromCharacter(), momentum::loadCollisionGeometryFromUsd(), momentum::loadLocatorsFromUsd(), momentum::loadPoseShape(), momentum::mapIdentityToCharacter(), momentum::mapMotionToCharacter(), momentum::parameterTransformFromJson(), momentum::parseParameterTransform(), momentum::replaceSkeletonHierarchy(), momentum::resolvePhysicalPropertiesJointIndex(), and momentum::setupGloveErrorFunctions().
|
nodiscard |
Definition at line 35 of file skeleton.cpp.
References joints.
Referenced by momentum::logJoints(), momentum::parameterTransformFromJson(), and momentum::saveMotion().
|
nodiscard |
Returns true if ancestorJointId is an ancestor of jointId.
A joint is considered to be its own ancestor (isAncestor(id, id) returns true).
Definition at line 73 of file skeleton.cpp.
References joints, momentum::kInvalidIndex, and MT_CHECK.
Referenced by momentum::replaceSkeletonHierarchy().
|
nodiscard |
Returns true if the two joints are the same, or one is the direct parent of the other.
Returns false if either joint is kInvalidIndex, since world-fixed entities have no joint ancestry and are never considered adjacent to skeleton joints.
Definition at line 87 of file skeleton.cpp.
References joints, momentum::kInvalidIndex, and MT_CHECK.
Referenced by momentum::isValidCollisionPair().
|
default |
|
defaultnoexcept |
| JointList momentum::SkeletonT< T >::joints |
The list of joints in this skeleton, ordered such that every joint's parent appears earlier in the list (parent index < child index, or kInvalidIndex for roots).
Definition at line 25 of file skeleton.h.
Referenced by momentum::accumulateChainDerivatives(), momentum::detail_sdf_collision::accumulateColliderHierarchyGradient(), momentum::detail_sdf_collision::accumulateColliderHierarchyJacobian(), momentum::addKeypointProjectionConstraints(), momentum::fbx_internal::addPhysicalProperties(), momentum::addRigidTransformNode(), momentum::averageTriangleSkinWeights(), momentum::bakeGloveOffsetsFromParams(), momentum::buildHierarchicalPaths(), momentum::calibrateModel(), momentum::SkeletonT< float >::cast(), commonAncestor(), momentum::fbx_internal::createAnimationCurves(), momentum::createGloveOrientationConstraintData(), momentum::createGlovePositionConstraintData(), momentum::fbx_internal::createSkeletonNodes(), momentum::FiniteDifferenceSequenceErrorFunctionT< T >::FiniteDifferenceSequenceErrorFunctionT(), getChildrenJoints(), getJointIdByName(), getJointNames(), isAncestor(), momentum::isRelatedJoint(), isSameOrAdjacentJoints(), momentum::loadCharacterFromLegacyJsonString(), momentum::loadLocatorsFromBuffer(), momentum::loadPoseShape(), momentum::loadSkeletonFromUsd(), momentum::loadSkeletonStatesFromUsd(), momentum::locatorsToSkinnedLocators(), momentum::logJoints(), momentum::makeCharacterDocument(), momentum::mapIdentityToCharacter(), momentum::mapMotionToCharacter(), momentum::parameterTransformFromJson(), momentum::parameterTransformToJson(), momentum::parseParameterTransform(), momentum::Character::remapLocators(), momentum::Character::remapParameterLimits(), momentum::Character::remapSkinnedLocators(), momentum::Character::remapSkinWeights(), momentum::removeJoints(), momentum::replaceSkeletonHierarchy(), momentum::resolvePhysicalPropertiesJointIndex(), momentum::saveBvhCharacter(), momentum::saveCollisionGeometryToUsd(), momentum::saveLocators(), momentum::saveLocatorsToUsd(), momentum::saveMmo(), momentum::saveSkeletonStatesToUsd(), momentum::saveSkeletonToUsd(), momentum::SkeletonStateT< T >::set(), momentum::SkeletonStateT< T >::set(), momentum::fbx_internal::setupJointAnimCurves(), momentum::Character::simplifySkeleton(), momentum::skeletonStateToJointParameters(), momentum::skeletonStateToJointParameters(), momentum::skeletonStateToJointParametersRespectingActiveParameters(), momentum::skeletonStateToJointParametersRespectingActiveParameters(), SkeletonT(), momentum::skinnedLocatorsToLocators(), momentum::transformAtoB(), momentum::VelocityMagnitudeSequenceErrorFunctionT< T >::VelocityMagnitudeSequenceErrorFunctionT(), momentum::writeParameterLimits(), and momentum::writeParameterTransform().