Momentum
A library for solving nonlinear optimization problems related to human body kinematics
Loading...
Searching...
No Matches
skin_weights.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8#pragma once
9
11#include <momentum/math/types.h>
12
13#include <cstdint>
14#include <vector>
15
16namespace momentum {
17
19inline constexpr uint32_t kMaxSkinJoints = 8;
20
24 Eigen::Matrix<uint32_t, Eigen::Dynamic, kMaxSkinJoints, Eigen::AutoAlign | Eigen::RowMajor>;
25
29 Eigen::Matrix<float, Eigen::Dynamic, kMaxSkinJoints, Eigen::AutoAlign | Eigen::RowMajor>;
30
39
44
52 void set(const std::vector<std::vector<size_t>>& ind, const std::vector<std::vector<float>>& wgt);
53
55 bool operator==(const SkinWeights& skinWeights) const;
56};
57
58} // namespace momentum
Eigen::Matrix< float, Eigen::Dynamic, kMaxSkinJoints, Eigen::AutoAlign|Eigen::RowMajor > WeightMatrix
Skinning weights for each joint influence.
constexpr uint32_t kMaxSkinJoints
Maximum number of joints that can influence a single vertex.
Eigen::Matrix< uint32_t, Eigen::Dynamic, kMaxSkinJoints, Eigen::AutoAlign|Eigen::RowMajor > IndexMatrix
Joint indices that influence each vertex.
Linear blend skinning weights for a character mesh: per-vertex joint indices and influence weights.
WeightMatrix weight
Joint influence weights per vertex.
IndexMatrix index
Joint indices influencing each vertex.
bool operator==(const SkinWeights &skinWeights) const
Approximate equality on index and weight using Eigen's isApprox.
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.