diff --git a/include/ComplexShape.h b/include/ComplexShape.h index abdaed0c81a0c5af74d50266c49a8f972eba5522..3dfaeb4d56776961011a9a6e97c526e8e333b5ee 100644 --- a/include/ComplexShape.h +++ b/include/ComplexShape.h @@ -177,7 +177,8 @@ public: Matrix44 & transform, int max_bones_per_partition = 4, bool stripify = false, - bool tangent_space = false + bool tangent_space = false, + float min_vertex_weight = 0.001f ) const; /* diff --git a/src/ComplexShape.cpp b/src/ComplexShape.cpp index 9dee5fa8c1240775c67e1051bfeef3fcd8cafa50..d9fefd3d584c5da79e79a565a6a729b69b26d653 100644 --- a/src/ComplexShape.cpp +++ b/src/ComplexShape.cpp @@ -526,7 +526,7 @@ void ComplexShape::Merge( NiAVObject * root ) { //Done Merging } -Ref<NiAVObject> ComplexShape::Split( NiNode * parent, Matrix44 & transform, int max_bones_per_partition, bool stripify, bool tangent_space ) const { +Ref<NiAVObject> ComplexShape::Split( NiNode * parent, Matrix44 & transform, int max_bones_per_partition, bool stripify, bool tangent_space, float min_vertex_weight ) const { //Make sure parent is not NULL if ( parent == NULL ) { @@ -744,7 +744,7 @@ Ref<NiAVObject> ComplexShape::Split( NiNode * parent, Matrix44 & transform, int SkinWeight sk; for ( map<NiNodeRef, float>::iterator wt = cv->weights.begin(); wt != cv->weights.end(); ++wt ) { //Only record influences that make a noticable contribution - if ( wt->second > 0.1f ) { + if ( wt->second > min_vertex_weight ) { sk.index = vert_index; sk.weight = wt->second; if ( shapeWeights.find( wt->first ) == shapeWeights.end() ) {