Skip to content
Snippets Groups Projects
Commit 4aec784a authored by Alecu100's avatar Alecu100
Browse files

more fixes to niflib, last commit didn't submit the complexshape updates

parent 30afda29
No related branches found
No related tags found
No related merge requests found
...@@ -177,7 +177,8 @@ public: ...@@ -177,7 +177,8 @@ public:
Matrix44 & transform, Matrix44 & transform,
int max_bones_per_partition = 4, int max_bones_per_partition = 4,
bool stripify = false, bool stripify = false,
bool tangent_space = false bool tangent_space = false,
float min_vertex_weight = 0.001f
) const; ) const;
/* /*
......
...@@ -526,7 +526,7 @@ void ComplexShape::Merge( NiAVObject * root ) { ...@@ -526,7 +526,7 @@ void ComplexShape::Merge( NiAVObject * root ) {
//Done Merging //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 //Make sure parent is not NULL
if ( parent == NULL ) { if ( parent == NULL ) {
...@@ -744,7 +744,7 @@ Ref<NiAVObject> ComplexShape::Split( NiNode * parent, Matrix44 & transform, int ...@@ -744,7 +744,7 @@ Ref<NiAVObject> ComplexShape::Split( NiNode * parent, Matrix44 & transform, int
SkinWeight sk; SkinWeight sk;
for ( map<NiNodeRef, float>::iterator wt = cv->weights.begin(); wt != cv->weights.end(); ++wt ) { for ( map<NiNodeRef, float>::iterator wt = cv->weights.begin(); wt != cv->weights.end(); ++wt ) {
//Only record influences that make a noticable contribution //Only record influences that make a noticable contribution
if ( wt->second > 0.1f ) { if ( wt->second > min_vertex_weight ) {
sk.index = vert_index; sk.index = vert_index;
sk.weight = wt->second; sk.weight = wt->second;
if ( shapeWeights.find( wt->first ) == shapeWeights.end() ) { if ( shapeWeights.find( wt->first ) == shapeWeights.end() ) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment