fix the whitespaces
parent
798f6cf083
commit
f8024188f0
|
@ -104,9 +104,11 @@ void LimitBoneWeightsProcess::ProcessMesh(aiMesh *pMesh)
|
|||
WeightsPerVertex vertexWeights(pMesh->mNumVertices);
|
||||
size_t maxVertexWeights = 0;
|
||||
|
||||
for (unsigned int b = 0; b < pMesh->mNumBones; ++b) {
|
||||
for (unsigned int b = 0; b < pMesh->mNumBones; ++b)
|
||||
{
|
||||
const aiBone *bone = pMesh->mBones[b];
|
||||
for (unsigned int w = 0; w < bone->mNumWeights; ++w) {
|
||||
for (unsigned int w = 0; w < bone->mNumWeights; ++w)
|
||||
{
|
||||
const aiVertexWeight &vw = bone->mWeights[w];
|
||||
vertexWeights[vw.mVertexId].push_back(Weight(b, vw.mWeight));
|
||||
maxVertexWeights = std::max(maxVertexWeights, vertexWeights[vw.mVertexId].size());
|
||||
|
@ -134,12 +136,14 @@ void LimitBoneWeightsProcess::ProcessMesh(aiMesh *pMesh)
|
|||
|
||||
// and renormalize the weights
|
||||
float sum = 0.0f;
|
||||
for (const Weight *it = vit->begin(); it != vit->end(); ++it) {
|
||||
for (const Weight *it = vit->begin(); it != vit->end(); ++it)
|
||||
{
|
||||
sum += it->mWeight;
|
||||
}
|
||||
if (0.0f != sum) {
|
||||
const float invSum = 1.0f / sum;
|
||||
for (Weight *it = vit->begin(); it != vit->end(); ++it) {
|
||||
for (Weight *it = vit->begin(); it != vit->end(); ++it)
|
||||
{
|
||||
it->mWeight *= invSum;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue