28 template <
typename T2>
31 this->vertexIndex,
static_cast<T2
>(this->weight), this->targetVelocity.template
cast<T2>()};
56 Eigen::Ref<Eigen::VectorX<T>> gradient)
const final;
66 Eigen::Ref<Eigen::MatrixX<T>> jacobian,
67 Eigen::Ref<Eigen::VectorX<T>> residual,
68 int& usedRows)
const final;
92 return constraints_.size();
104 double calculateVelocityGradient(
108 Eigen::Ref<Eigen::VectorX<T>> gradient)
const;
111 double calculateVelocityJacobian(
115 Eigen::Ref<Eigen::MatrixX<T>> jacobian,
116 Eigen::Ref<Eigen::VectorX<T>> residual,
117 Eigen::Index startRow)
const;
120 std::vector<VertexVelocityConstraintT<T>> constraints_;
SequenceErrorFunctionT(const Skeleton &skel, const ParameterTransform &pt)
double getError(std::span< const ModelParametersT< T > > modelParameters, std::span< const SkeletonStateT< T > > skelStates, std::span< const MeshStateT< T > > meshStates) const final
void addConstraint(int vertexIndex, float weight, const Eigen::Vector3< float > &targetVelocity)
size_t numFrames() const final
size_t getNumConstraints() const
Get the number of constraints.
const Character & getCharacter() const
Get the character reference.
double getJacobian(std::span< const ModelParametersT< T > > modelParameters, std::span< const SkeletonStateT< T > > skelStates, std::span< const MeshStateT< T > > meshStates, Eigen::Ref< Eigen::MatrixX< T > > jacobian, Eigen::Ref< Eigen::VectorX< T > > residual, int &usedRows) const final
size_t getJacobianSize() const final
VertexSequenceErrorFunctionT(const Character &character)
bool needsMesh() const final
static constexpr float kVelocityWeight
double getGradient(std::span< const ModelParametersT< T > > modelParameters, std::span< const SkeletonStateT< T > > skelStates, std::span< const MeshStateT< T > > meshStates, Eigen::Ref< Eigen::VectorX< T > > gradient) const final
const std::vector< VertexVelocityConstraintT< float > > & getConstraints() const
Shared types used across error function hierarchies.
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.
Constraint structure for vertex velocity.
Eigen::Vector3< T > targetVelocity
VertexVelocityConstraintT< T2 > cast() const