SDF-based collision error function that penalizes vertex penetration into SDF colliders.
More...
|
| | SDFCollisionErrorFunctionT (const Character &character, const std::vector< SdfColliderType > &sdfColliders, const std::vector< int > &participatingVertices={}, const std::vector< T > &vertexWeights={}, bool filterRestPoseIntersections=true, uint8_t maxCollisionsPerVertex=1) |
| | Constructor with vertex index list and uniform weights.
|
| | SDFCollisionErrorFunctionT (const SDFCollisionErrorFunctionT &)=default |
| SDFCollisionErrorFunctionT & | operator= (const SDFCollisionErrorFunctionT &)=delete |
| | SDFCollisionErrorFunctionT (SDFCollisionErrorFunctionT &&) noexcept=default |
| SDFCollisionErrorFunctionT & | operator= (SDFCollisionErrorFunctionT &&) noexcept=delete |
| | ~SDFCollisionErrorFunctionT () override=default |
| double | getError (const ModelParametersT< T > ¶ms, const SkeletonStateT< T > &state, const MeshStateT< T > &meshState) override |
| double | getGradient (const ModelParametersT< T > ¶ms, const SkeletonStateT< T > &state, const MeshStateT< T > &meshState, Eigen::Ref< Eigen::VectorX< T > > gradient) override |
| 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 |
| size_t | getJacobianSize () const override |
| bool | needsMesh () const override |
| const Character * | getCharacter () const override |
| | Returns the character used to update mesh state for SDF collision evaluation.
|
| size_t | getNumActiveVertices () const |
| size_t | getNumCollisionPairs () const |
| | 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) |
template<typename T, typename SdfColliderType = SDFColliderT<float>>
class momentum::SDFCollisionErrorFunctionT< T, SdfColliderType >
SDF-based collision error function that penalizes vertex penetration into SDF colliders.
This error function tests source vertices against SDF collision objects and applies penalties for interpenetration. It uses an efficient contiguous memory layout where vertices are grouped by their primary bone index to improve cache locality and reduce memory usage.
The SdfColliderType must provide the following duck-typed interface:
- T evaluate(const Vector3<T>& localPos) const — signed distance
- pair<T, Vector3<T>> evaluateWithGradient(const Vector3<T>& localPos) const
- BoundingBox<S> bounds() const — local-frame AABB
- size_t parentJoint() const — parent joint index
- TransformT<S> localToParentTransform() const — local-to-parent transform
- void update(const VectorX<T>& modelParams) — per-iteration update
- bool isValid() const — whether the collider is usable
Definition at line 76 of file sdf_collision_error_function.h.