Radium Engine  1.5.20
Loading...
Searching...
No Matches
HandleWeightOperation.hpp
1#pragma once
2
3#include <Core/Animation/HandleWeight.hpp>
4
5namespace Ra {
6namespace Core {
7namespace Animation {
8
9/*
10 * Return the WeightMatrix extracted from the MeshWeight vector, for a handle with handle_size
11 * transforms
12 */
13RA_CORE_API WeightMatrix extractWeightMatrix( const MeshWeight& weight, const uint handle_size );
14
15/*
16 * Return the MeshWeight from the given WeightMatrix.
17 */
18RA_CORE_API MeshWeight extractMeshWeight( Eigen::Ref<const WeightMatrix> matrix );
19
20/*
21 * Return the WeightMatrix holding the partition of unity property.
22 * This is obtained by normalizing each row by its l1-norm, assuming:
23 * weights( i, j ) >= 0
24 * lpNorm1( weights.row( i ) ) > 0
25 */
26RA_CORE_API WeightMatrix partitionOfUnity( Eigen::Ref<const WeightMatrix> weights );
27
28/*
29 * Return the index of the weight that influence the most the position of vertex at vertexId.
30 */
31RA_CORE_API uint getMaxWeightIndex( Eigen::Ref<const WeightMatrix> weights, const uint vertexID );
32
33/*
34 * Return the vector containing the index of the handle influencing the most a vertex.
35 */
36RA_CORE_API void getMaxWeightIndex( Eigen::Ref<const WeightMatrix> weights,
37 std::vector<uint>& handleID );
38
39/*
40 * Call Math::checkInvalidNumbers and checkNoWeightVertex on the input matrix
41 */
42RA_CORE_API bool checkWeightMatrix( Eigen::Ref<const WeightMatrix> matrix,
43 const bool FAIL_ON_ASSERT = false,
44 const bool MT = false );
45
46RA_CORE_API bool checkNoWeightVertex( Eigen::Ref<const WeightMatrix> matrix,
47 const bool FAIL_ON_ASSERT = false,
48 const bool MT = false );
49
54RA_CORE_API bool normalizeWeights( Eigen::Ref<WeightMatrix> matrix, const bool MT = false );
55
56} // namespace Animation
57} // Namespace Core
58} // Namespace Ra
hepler function to manage enum as underlying types in VariableSet
Definition Cage.cpp:3