CSEngine
Loading...
Searching...
No Matches
CSE::VertexSkinData Class Reference

Public Member Functions

void addJointEffect (int jointId, float weight)
 
void limitJointNumber (int max)
 
const std::vector< int > & getJointIDs () const
 
const std::vector< float > & getWeights () const
 

Detailed Description

Definition at line 9 of file VertexSkinData.h.

Member Function Documentation

◆ addJointEffect()

void CSE::VertexSkinData::addJointEffect ( int  jointId,
float  weight 
)
inline

Definition at line 15 of file VertexSkinData.h.

15 {
16 auto jointID_it = m_jointIDs.begin();
17 auto weight_it = m_weights.begin();
18 for (const auto& weight_object : m_weights) {
19 if (weight > weight_object) {
20 m_jointIDs.insert(jointID_it++, jointId);
21 m_weights.insert(weight_it++, weight);
22 return;
23 }
24 }
25 m_jointIDs.push_back(jointId);
26 m_weights.push_back(weight);
27 }

◆ getJointIDs()

const std::vector< int > & CSE::VertexSkinData::getJointIDs ( ) const
inline

Definition at line 42 of file VertexSkinData.h.

42 {
43 return m_jointIDs;
44 }

◆ getWeights()

const std::vector< float > & CSE::VertexSkinData::getWeights ( ) const
inline

Definition at line 46 of file VertexSkinData.h.

46 {
47 return m_weights;
48 }

◆ limitJointNumber()

void CSE::VertexSkinData::limitJointNumber ( int  max)
inline

Definition at line 29 of file VertexSkinData.h.

29 {
30 if (m_jointIDs.size() > max) {
31 std::vector<float> topWeights;
32 topWeights.resize(max);
33 float total = saveTopWeights(topWeights);
34 refillWeightList(topWeights, total);
35 removeExcessJointIds(max);
36 } else if (m_jointIDs.size() < max) {
37 fillEmptyWeights(max);
38 }
39 }

The documentation for this class was generated from the following file: