20 Eigen::Vector3<T>
target = Eigen::Vector3<T>::Zero();
25 const Eigen::Vector3<T>& targetPos,
27 const std::string& n =
"")
48 const T& lossC = T(1));
56 std::span<
const Eigen::Vector3<T>> worldVecs,
58 std::span<DfdvType> dfdv)
const final;
69 Eigen::Ref<Eigen::VectorX<T>> gradient)
override;
76 Eigen::Ref<Eigen::MatrixX<T>> jacobian,
77 Eigen::Ref<Eigen::VectorX<T>> residual,
78 int& usedRows)
override;
static constexpr T kL2
Special-case alpha values that are either at a singularity in the general formula or simplify to a cl...
VertexErrorFunctionT(const Character &character, const ParameterTransform ¶meterTransform, const T &lossAlpha=GeneralizedLossT< T >::kL2, const T &lossC=T(1))
Eigen::Matrix< T, FuncDim, 1 > FuncType
Eigen::Matrix< T, FuncDim, 3 > DfdvType
void evalFunction(size_t constrIndex, const SkeletonStateT< T > &state, const MeshStateT< T > &meshState, std::span< const Eigen::Vector3< T > > worldVecs, FuncType &f, std::span< DfdvType > dfdv) const final
Computes the residual and derivatives.
VertexErrorFunctionT< float, VertexPositionDataT< float >, 3 > Base
double getGradient(const ModelParametersT< T > ¶ms, const SkeletonStateT< T > &state, const MeshStateT< T > &meshState, Eigen::Ref< Eigen::VectorX< T > > gradient) override
Specialized getGradient that avoids the dfdv*derivative matrix multiply.
~VertexPositionErrorFunctionT() override=default
VertexPositionErrorFunctionT(const Character &character, const ParameterTransform ¶meterTransform, const T &lossAlpha=GeneralizedLossT< T >::kL2, const T &lossC=T(1))
double getJacobian(const ModelParametersT< T > ¶ms, const SkeletonStateT< T > &state, const MeshStateT< T > &meshState, Eigen::Ref< Eigen::MatrixX< T > > jacobian, Eigen::Ref< Eigen::VectorX< T > > residual, int &usedRows) override
Specialized getJacobian with the same dfdv=Identity optimization.
ParameterTransformT< float > ParameterTransform
A character model with skeletal structure, mesh, and optional components.
Represents the complete state of a model's mesh.
A vector of size numModelParams holding the values of all model parameters for a character.
Represents the complete state of a skeleton.
VertexConstraintData()=default
Eigen::Vector3< T > target
Target position in world space.
VertexPositionDataT(size_t vIndex, const Eigen::Vector3< T > &targetPos, float w, const std::string &n="")
VertexPositionDataT()=default