bugfix: fix stupid test introduced by myself.
Signed-off-by: Kim Kulling <kim.kulling@googlemail.com>pull/321/head
parent
46ca36cb6f
commit
d655199043
|
@ -131,10 +131,11 @@ void LimitBoneWeightsProcess::ProcessMesh( aiMesh* pMesh)
|
||||||
|
|
||||||
// and renormalize the weights
|
// and renormalize the weights
|
||||||
float sum = 0.0f;
|
float sum = 0.0f;
|
||||||
for( std::vector<Weight>::const_iterator it = vit->begin(); it != vit->end(); ++it)
|
for( std::vector<Weight>::const_iterator it = vit->begin(); it != vit->end(); ++it ) {
|
||||||
sum += it->mWeight;
|
sum += it->mWeight;
|
||||||
const float invSum = 1.0f/sum;
|
}
|
||||||
if( 0.0f != sum ) {
|
if( 0.0f != sum ) {
|
||||||
|
const float invSum = 1.0f / sum;
|
||||||
for( std::vector<Weight>::iterator it = vit->begin(); it != vit->end(); ++it ) {
|
for( std::vector<Weight>::iterator it = vit->begin(); it != vit->end(); ++it ) {
|
||||||
it->mWeight *= invSum;
|
it->mWeight *= invSum;
|
||||||
}
|
}
|
||||||
|
@ -161,18 +162,6 @@ void LimitBoneWeightsProcess::ProcessMesh( aiMesh* pMesh)
|
||||||
const std::vector<aiVertexWeight>& bw = boneWeights[a];
|
const std::vector<aiVertexWeight>& bw = boneWeights[a];
|
||||||
aiBone* bone = pMesh->mBones[a];
|
aiBone* bone = pMesh->mBones[a];
|
||||||
|
|
||||||
// ignore the bone if no vertex weights were removed there
|
|
||||||
|
|
||||||
// FIX (Aramis, 07|22|08)
|
|
||||||
// NO! we can't ignore it in this case ... it is possible that
|
|
||||||
// the number of weights did not change, but the weight values did.
|
|
||||||
|
|
||||||
// if( bw.size() == bone->mNumWeights)
|
|
||||||
// continue;
|
|
||||||
|
|
||||||
// FIX (Aramis, 07|21|08)
|
|
||||||
// It is possible that all weights of a bone have been removed.
|
|
||||||
// This would naturally cause an exception in &bw[0].
|
|
||||||
if ( bw.empty() )
|
if ( bw.empty() )
|
||||||
{
|
{
|
||||||
abNoNeed[a] = bChanged = true;
|
abNoNeed[a] = bChanged = true;
|
||||||
|
|
Loading…
Reference in New Issue