From 4aec784afc66774774b8a2b6062114a735de6c2e Mon Sep 17 00:00:00 2001 From: Alecu100 <lui_alecu@yahoo.co.uk> Date: Fri, 20 Jan 2012 17:52:51 +0200 Subject: [PATCH] more fixes to niflib, last commit didn't submit the complexshape updates --- include/ComplexShape.h | 3 ++- src/ComplexShape.cpp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/ComplexShape.h b/include/ComplexShape.h index abdaed0c..3dfaeb4d 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 9dee5fa8..d9fefd3d 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() ) { -- GitLab