Momentum
A library for solving nonlinear optimization problems related to human body kinematics
Loading...
Searching...
No Matches
momentum::SkinWeights Struct Reference

Linear blend skinning weights for a character mesh: per-vertex joint indices and influence weights. More...

#include <skin_weights.h>

Public Member Functions

void set (const std::vector< std::vector< size_t > > &ind, const std::vector< std::vector< float > > &wgt)
 Populates index and weight from ragged per-vertex influence lists.
bool operator== (const SkinWeights &skinWeights) const
 Approximate equality on index and weight using Eigen's isApprox.

Public Attributes

IndexMatrix index
 Joint indices influencing each vertex.
WeightMatrix weight
 Joint influence weights per vertex.

Detailed Description

Linear blend skinning weights for a character mesh: per-vertex joint indices and influence weights.

index and weight always have the same row count (one row per vertex) and matching unused-slot conventions.

Definition at line 34 of file skin_weights.h.

Member Function Documentation

◆ operator==()

bool momentum::SkinWeights::operator== ( const SkinWeights & skinWeights) const

Approximate equality on index and weight using Eigen's isApprox.

Definition at line 33 of file skin_weights.cpp.

References index, and weight.

◆ set()

void momentum::SkinWeights::set ( const std::vector< std::vector< size_t > > & ind,
const std::vector< std::vector< float > > & wgt )

Populates index and weight from ragged per-vertex influence lists.

Each entry of ind/wgt is one vertex's joints/weights; influences beyond kMaxSkinJoints are silently dropped, and unused slots are zero-filled.

Precondition
ind.size() == wgt.size() (checked via MT_CHECK).
For each vertex i, wgt[i].size() >= min(ind[i].size(), kMaxSkinJoints); shorter weight rows produce out-of-bounds reads.

Definition at line 16 of file skin_weights.cpp.

References index, momentum::kMaxSkinJoints, MT_CHECK, and weight.

Member Data Documentation

◆ index

◆ weight

WeightMatrix momentum::SkinWeights::weight

Joint influence weights per vertex.

Weights for a vertex are expected to sum to 1.0; unused slots are set to 0.0. Loaders/setters do not enforce normalization — callers are responsible for normalized input.

Definition at line 43 of file skin_weights.h.

Referenced by momentum::applyInverseSSD(), momentum::applySSD(), momentum::applySSD(), momentum::closestPointOnMeshMatchingParent(), momentum::findCandidateTrianglesDfs(), momentum::detail_sdf_collision::findCommonAncestorForVertex(), momentum::getInverseSSDTransformation(), momentum::loadSkinWeightsFromUsd(), operator==(), momentum::Character::remapSkinWeights(), momentum::saveSkinWeightsToUsd(), and set().


The documentation for this struct was generated from the following files: