56 int& usedRows)
override;
130 T scaleCorrection = T(0))
const;
143 T scaleCorrection = T(0))
const;
PlaneCollisionQueryT< float > collisionQuery_
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
PlaneCollisionErrorFunctionT(const Skeleton &skel, const ParameterTransform &pt, const CollisionGeometry &cg, const Vector3< T > &planeNormal, T planeOffset)
PlaneCollisionQueryT< T > & getCollisionQuery()
Return the reusable query helper used by this error function.
size_t getJacobianSize() const final
void setPlane(const Vector3< float > &planeNormal, float planeOffset)
void accumulateJacobianAlongChain(const SkeletonStateT< T > &state, const Vector3< T > &position, const Vector3< T > &direction, T factor, size_t startJoint, Ref< MatrixX< T > > jacobian, int row, T scaleCorrection=T(0)) const
Accumulate Jacobian contributions along a joint chain up to the root.
std::vector< PlaneCollisionDebugEntryT< T > > getCollisionDebugInfo() const
Query detailed collision state for all currently-colliding primitives.
std::vector< PlaneCollisionContactPointT< T > > getContactPointsByParentWithDetails(std::span< const JointStateT< T > > states, T contactMargin)
Return one detailed world-space primitive surface point per parent joint at or near the plane.
static constexpr float kCollisionWeight
T getPlaneOffset() const
Return the plane offset after normalization by setPlane().
void accumulateGradientAlongChain(const SkeletonStateT< T > &state, const Vector3< T > &position, const Vector3< T > &direction, T weight, size_t startJoint, Ref< VectorX< T > > gradient, T scaleCorrection=T(0)) const
Accumulate gradient contributions along a joint chain up to the root.
std::vector< Vector3< T > > getContactPointsByParent(std::span< const JointStateT< T > > states, T contactMargin)
Return one world-space primitive surface point per parent joint at or near the plane.
double getGradient(const ModelParametersT< T > ¶ms, const SkeletonStateT< T > &state, const MeshStateT< T > &meshState, Ref< VectorX< T > > gradient) override
const PlaneCollisionQueryT< T > & getCollisionQuery() const
Return the reusable query helper used by this error function.
double getError(const ModelParametersT< T > ¶ms, const SkeletonStateT< T > &state, const MeshStateT< T > &meshState) final
const Vector3< T > & getPlaneNormal() const
Return the normalized plane normal used by collision and contact queries.
PlaneCollisionErrorFunctionT(const Character &character, const Vector3< T > &planeNormal, T planeOffset)
std::vector< Vector3< T > > getContactPoints(std::span< const JointStateT< T > > states, T contactMargin)
Return world-space primitive surface points at or near the plane for an explicit state.
std::vector< size_t > getCollidingPrimitives() const
Stateful query helper for collision primitives against a fixed world plane.
SkeletonErrorFunctionT(const Skeleton &skel, const ParameterTransform &pt)
CollisionGeometryT< float > CollisionGeometry
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.
A character model with skeletal structure, mesh, and optional components.
Represents the state of a joint with local and global transformations.
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.