63NamedPivotMapClass::WeightInfoStruct & NamedPivotMapClass::WeightInfoStruct::operator = (WeightInfoStruct
const &that)
65 if(Name)
delete [] Name;
66 assert(that.Name != 0);
75 WeightInfoStruct info;
76 info.Name = (
char *) Name;
93 (*this)[numPivots] = 1.0f;
98 int count = WeightInfo.Count();
101 if(actualPivot != -1) {
102 (*this)[actualPivot] = WeightInfo[count].Weight;
113: Shared(shared), HAnim(0), PivotMap(0), Frame(0), PrevFrame(0), Weight(1)
147 HAnim->Release_Ref();
149 PivotMap->Release_Ref();
154 if ( HAnim !=
NULL ) {
155 HAnim->Release_Ref();
162 PivotMap->Release_Ref();
174 if ( motion !=
NULL ) {
177 if ( HAnim !=
NULL ) {
178 HAnim->Release_Ref();
189 if ( PivotMap !=
NULL ) {
190 PivotMap->Release_Ref();
201 if ( PivotMap !=
NULL ) {
202 PivotMap->Release_Ref();
209 int numpivots = HAnim->Get_Num_Pivots();
211 PivotMap->Resize(numpivots);
214 while(count < numpivots) {
215 if(HAnim->Is_Node_Motion_Present(count)) {
238 while(num_animations--) {
253 while ( numAnimations-- ) {
263 while ( numAnimations-- ) {
278 if (!anim_count)
return true;
283 bool all_pivot_maps =
true;
284 bool none_pivot_maps =
true;
285 int num_anim_pivots = 100000;
286 for (anim_idx = 0; anim_idx < anim_count; anim_idx++ ) {
287 num_anim_pivots =
MIN(num_anim_pivots,
Peek_Motion(anim_idx)->Get_Num_Pivots());
289 all_pivot_maps &= has_pivot_map;
290 none_pivot_maps &= !has_pivot_map;
292 if ( num_anim_pivots == 100000 ) {
296 if (none_pivot_maps) {
299 float weight_total = 0.0f;
300 for (anim_idx = 0; anim_idx < anim_count; anim_idx++ ) {
303 weight_total += weight;
309 float oo_total = 1.0f / weight_total;
310 for (anim_idx = 0; anim_idx < anim_count; anim_idx++ ) {
319 if (all_pivot_maps) {
322 for (
int piv_idx = 1; piv_idx < num_anim_pivots; piv_idx++) {
324 float weight_total = 0.0f;
325 for (anim_idx = 0; anim_idx < anim_count; anim_idx++ ) {
328 weight_total += weight;
334 float oo_total = 1.0f / weight_total;
335 for (anim_idx = 0; anim_idx < anim_count; anim_idx++ ) {
338 float new_weight = (*pivot_map)[piv_idx] * oo_total;
339 (*pivot_map)[piv_idx] = new_weight;
371 if ( anim !=
NULL ) {
virtual bool Resize(int newsize, float const *array=0)
void Append_Anim_Combo_Data(HAnimComboDataClass *AnimComboData)
DynamicVectorClass< HAnimComboDataClass * > HAnimComboData
float Get_Prev_Frame(int indx)
float Get_Frame(int indx)
void Set_Weight(int indx, float weight)
float Get_Weight(int indx)
void Set_Pivot_Weight_Map(int indx, PivotMapClass *map)
HAnimClass * Get_Motion(int indx)
HAnimClass * Peek_Motion(int indx)
void Remove_Anim_Combo_Data(HAnimComboDataClass *AnimComboData)
PivotMapClass * Peek_Pivot_Weight_Map(int indx)
void Set_Frame(int indx, float frame)
void Set_Prev_Frame(int indx, float frame)
PivotMapClass * Get_Pivot_Weight_Map(int indx)
bool Normalize_Weights(void)
void Set_Motion(int indx, HAnimClass *motion)
float Get_Prev_Frame(void) const
void Set_Weight(float weight)
void Copy(const HAnimComboDataClass *)
void Set_Frame(float frame)
PivotMapClass * Peek_Pivot_Map(void) const
HAnimClass * Peek_HAnim(void) const
~HAnimComboDataClass(void)
void Set_HAnim(HAnimClass *motion)
void Build_Active_Pivot_Map(void)
HAnimClass * Get_HAnim(void) const
PivotMapClass * Get_Pivot_Map(void) const
bool Is_Shared(void) const
void Set_Pivot_Map(PivotMapClass *map)
void Set_Prev_Frame(float frame)
float Get_Frame(void) const
HAnimComboDataClass(bool shared=false)
float Get_Weight(void) const
WWINLINE int Num_Pivots(void) const
int Get_Bone_Index(const char *name) const
void Add(const char *Name, float Weight)
void Update_Pivot_Map(const HTreeClass *Tree)
~NamedPivotMapClass(void)
WWINLINE void Release_Ref(void) const
static WWINLINE float Fabs(float val)
#define DEFINE_AUTO_POOL(T, BLOCKSIZE)
char * nstrdup(const char *str)