41 template <
typename T2>
48 static_cast<T2
>(this->targetDistance),
49 static_cast<T2
>(this->weight)};
90 int& usedRows)
override;
113 return constraints_.size();
120 std::vector<JointToJointDistanceConstraintT<T>> constraints_;
const std::vector< JointToJointDistanceConstraintT< float > > & getConstraints() const
double getError(const ModelParametersT< T > ¶ms, const SkeletonStateT< T > &state, const MeshStateT< T > &meshState) final
double getJacobian(const ModelParametersT< T > ¶ms, const SkeletonStateT< T > &state, const MeshStateT< T > &meshState, Ref< MatrixX< T > > jacobian, Ref< VectorX< T > > residual, int &usedRows) override
void addConstraint(size_t joint1, const Vector3< float > &offset1, size_t joint2, const Vector3< float > &offset2, float targetDistance, float weight=float(1))
size_t getJacobianSize() const final
size_t getNumConstraints() const
Returns the number of constraints.
double getGradient(const ModelParametersT< T > ¶ms, const SkeletonStateT< T > &state, const MeshStateT< T > &meshState, Ref< VectorX< T > > gradient) override
static constexpr float kDistanceWeight
JointToJointDistanceErrorFunctionT(const Character &character)
JointToJointDistanceErrorFunctionT(const Skeleton &skel, const ParameterTransform &pt)
SkeletonErrorFunctionT(const Skeleton &skel, const ParameterTransform &pt)
SkeletonT< float > Skeleton
ParameterTransformT< float > ParameterTransform
Eigen::Matrix< T, Dynamic, Dynamic > MatrixX
Dynamic-size, column-major dense matrix.
Vector< T, Dynamic > VectorX
Dynamic-size column vector. Common return type for solver residuals and parameter vectors.
constexpr size_t kInvalidIndex
Sentinel value indicating an invalid or unset size_t index.
A character model with skeletal structure, mesh, and optional components.
Constraint that enforces a distance relationship between two points attached to different joints.
Vector3< T > offset2
Offset from joint2 in the local coordinate system of joint2.
Vector3< T > offset1
Offset from joint1 in the local coordinate system of joint1.
size_t joint2
Index of the second joint.
T targetDistance
Target distance between the two points (in world space).
JointToJointDistanceConstraintT< T2 > cast() const
size_t joint1
Index of the first joint.
T weight
Weight for this constraint.
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.