|
Momentum
A library for solving nonlinear optimization problems related to human body kinematics
|
Support constraining a skinned locator to a location on the mesh defined by a target triangle and its normal. More...
#include <skinned_locator_triangle_error_function.h>
Public Member Functions | |
| SkinnedLocatorTriangleErrorFunctionT (const Character &character, VertexConstraintType type=VertexConstraintType::Position) | |
| ~SkinnedLocatorTriangleErrorFunctionT () override | |
| SkinnedLocatorTriangleErrorFunctionT (const SkinnedLocatorTriangleErrorFunctionT &other)=delete | |
| SkinnedLocatorTriangleErrorFunctionT & | operator= (const SkinnedLocatorTriangleErrorFunctionT &)=delete |
| SkinnedLocatorTriangleErrorFunctionT (SkinnedLocatorTriangleErrorFunctionT &&)=delete | |
| SkinnedLocatorTriangleErrorFunctionT & | operator= (SkinnedLocatorTriangleErrorFunctionT &&)=delete |
| double | getError (const ModelParametersT< T > &modelParameters, const SkeletonStateT< T > &state, const MeshStateT< T > &meshState) final |
| double | getGradient (const ModelParametersT< T > &modelParameters, const SkeletonStateT< T > &state, const MeshStateT< T > &meshState, Eigen::Ref< Eigen::VectorX< T > > gradient) final |
| double | getJacobian (const ModelParametersT< T > &modelParameters, const SkeletonStateT< T > &state, const MeshStateT< T > &meshState, Eigen::Ref< Eigen::MatrixX< T > > jacobian, Eigen::Ref< Eigen::VectorX< T > > residual, int &usedRows) final |
| size_t | getJacobianSize () const final |
| void | addConstraint (int locatorIndex, const Eigen::Vector3i &triangleIndices, const Eigen::Vector3< T > &triangleBaryCoords, float depth=0, T weight=1) |
| void | clearConstraints () |
| void | setConstraints (const std::vector< SkinnedLocatorTriangleConstraintT< T > > &constraints) |
| const std::vector< SkinnedLocatorTriangleConstraintT< T > > & | getConstraints () const |
| const Character * | getCharacter () const override |
| For mesh-based error functions, get access to the underlying character. | |
| bool | needsMesh () const override |
| Override to indicate this function requires mesh state. | |
| Public Member Functions inherited from momentum::SkeletonErrorFunctionT< T > | |
| SkeletonErrorFunctionT (const Skeleton &skel, const ParameterTransform &pt) | |
| virtual | ~SkeletonErrorFunctionT ()=default |
| const Skeleton & | getSkeleton () const |
| const ParameterTransform & | getParameterTransform () const |
| void | setWeight (T w) |
| T | getWeight () const |
| void | setActiveJoints (const VectorX< bool > &aj) |
| void | setEnabledParameters (const ParameterSet &ps) |
| virtual void | getHessian (const ModelParametersT< T > &, const SkeletonStateT< T > &, const MeshStateT< T > &, Eigen::Ref< Eigen::MatrixX< T > >) |
| virtual double | getSolverDerivatives (const ModelParametersT< T > ¶meters, const SkeletonStateT< T > &state, const MeshStateT< T > &meshState, const size_t actualParameters, Eigen::MatrixX< T > &hess, Eigen::VectorX< T > &grad) |
Additional Inherited Members | |
| Protected Attributes inherited from momentum::SkeletonErrorFunctionT< T > | |
| const Skeleton & | skeleton_ |
| const ParameterTransform & | parameterTransform_ |
| T | weight_ |
| VectorX< bool > | activeJointParams_ |
| ParameterSet | enabledParameters_ |
| bool | useHessian_ {false} |
Support constraining a skinned locator to a location on the mesh defined by a target triangle and its normal.
The target point is specified as sum_i (bary_i * target_triangle_vertex_i) + depth * target_triangle_normal. This constraint applies "forces" both to the skinned locator and every vertex in the mesh target triangle, so it will actually try to pull both toward each other.
Definition at line 64 of file skinned_locator_triangle_error_function.h.
|
explicit |
Definition at line 30 of file skinned_locator_triangle_error_function.cpp.
References momentum::Character::mesh, MT_CHECK, MT_THROW_IF, momentum::Plane, momentum::Position, and momentum::SkeletonErrorFunctionT< T >::SkeletonErrorFunctionT().
|
overridedefault |
|
delete |
|
delete |
| void momentum::SkinnedLocatorTriangleErrorFunctionT< T >::addConstraint | ( | int | locatorIndex, |
| const Eigen::Vector3i & | triangleIndices, | ||
| const Eigen::Vector3< T > & | triangleBaryCoords, | ||
| float | depth = 0, | ||
| T | weight = 1 ) |
Definition at line 57 of file skinned_locator_triangle_error_function.cpp.
References MT_CHECK.
| void momentum::SkinnedLocatorTriangleErrorFunctionT< T >::clearConstraints | ( | ) |
Definition at line 46 of file skinned_locator_triangle_error_function.cpp.
|
inlinenodiscardoverridevirtual |
For mesh-based error functions, get access to the underlying character.
Error functions that depend only on the skeleton can return nullptr.
Reimplemented from momentum::SkeletonErrorFunctionT< T >.
Definition at line 111 of file skinned_locator_triangle_error_function.h.
|
inlinenodiscard |
Definition at line 107 of file skinned_locator_triangle_error_function.h.
|
nodiscardfinalvirtual |
Reimplemented from momentum::SkeletonErrorFunctionT< T >.
Definition at line 253 of file skinned_locator_triangle_error_function.cpp.
References momentum::computeTargetBaryPosition(), momentum::computeTargetPosition(), momentum::computeTargetTriangleNormal(), momentum::SkinnedLocatorTriangleConstraintT< T >::depth, MT_CHECK, MT_CHECK_NOTNULL, MT_PROFILE_FUNCTION, momentum::Plane, momentum::Position, momentum::MeshStateT< T >::restMesh_, and momentum::SkeletonErrorFunctionT< T >::weight_.
|
finalvirtual |
Reimplemented from momentum::SkeletonErrorFunctionT< T >.
Definition at line 566 of file skinned_locator_triangle_error_function.cpp.
References momentum::SkinnedLocatorTriangleConstraintT< T >::locatorIndex, MT_CHECK, MT_CHECK_NOTNULL, momentum::Plane, momentum::Position, momentum::MeshStateT< T >::restMesh_, and momentum::SkeletonErrorFunctionT< T >::weight_.
|
finalvirtual |
Reimplemented from momentum::SkeletonErrorFunctionT< T >.
Definition at line 604 of file skinned_locator_triangle_error_function.cpp.
References momentum::SkinnedLocatorTriangleConstraintT< T >::locatorIndex, MT_CHECK, momentum::Plane, momentum::Position, momentum::MeshStateT< T >::restMesh_, and momentum::EigenStrongType< Derived, EigenType >::size().
|
nodiscardfinalvirtual |
Reimplemented from momentum::SkeletonErrorFunctionT< T >.
Definition at line 664 of file skinned_locator_triangle_error_function.cpp.
References momentum::Plane, and momentum::Position.
|
inlinenodiscardoverridevirtual |
Override to indicate this function requires mesh state.
Reimplemented from momentum::SkeletonErrorFunctionT< T >.
Definition at line 116 of file skinned_locator_triangle_error_function.h.
|
delete |
|
delete |
| void momentum::SkinnedLocatorTriangleErrorFunctionT< T >::setConstraints | ( | const std::vector< SkinnedLocatorTriangleConstraintT< T > > & | constraints | ) |
Definition at line 51 of file skinned_locator_triangle_error_function.cpp.