[Gcblue-commits] gcb_wx/src/database tcGenericDBObject.cpp,1.4,1.5
Status: Alpha
Brought to you by:
ddcforge
From: <ddc...@us...> - 2004-01-14 01:13:25
|
Update of /cvsroot/gcblue/gcb_wx/src/database In directory sc8-pr-cvs1:/tmp/cvs-serv10758/src/database Modified Files: tcGenericDBObject.cpp Log Message: more animation work Index: tcGenericDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcGenericDBObject.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcGenericDBObject.cpp 4 Jan 2004 22:24:52 -0000 1.4 --- tcGenericDBObject.cpp 14 Jan 2004 01:13:22 -0000 1.5 *************** *** 26,30 **** #include "randfn.h" #include "CsvTranslator.h" ! using namespace std; --- 26,30 ---- #include "randfn.h" #include "CsvTranslator.h" ! #include "tc3DModel.h" using namespace std; *************** *** 33,36 **** --- 33,46 ---- { + /** + * Search 3D model for animation nodes. Configure + * animation data for matching nodes. + */ + void tcGenericDBObject::Animate3DModel() + { + //if (animationInfo.size()==0) return; // no animation in this model + model->ProcessAnimations(animationInfo); + } + void tcGenericDBObject::RandInit() { *************** *** 121,124 **** --- 131,135 ---- file.Read(&maSensorClass[i],sizeof(tcDBString)); } + Animate3DModel(); } else *************** *** 201,204 **** --- 212,228 ---- } } + for(i=0;i<MAXANIMATIONS;i++) + { + animationDBInfo ai; + *csv >> ai.objectName; + *csv >> ai.animationType; + *csv >> ai.param; + + if (ai.objectName.size() > 0) + { + animationInfo.push_back(ai); + } + } + Animate3DModel(); } else *************** *** 247,250 **** --- 271,291 ---- } } + size_t nAnimations = animationInfo.size(); + for(size_t i=0;i<MAXANIMATIONS;i++) + { + if (i < nAnimations) + { + animationDBInfo& ai = animationInfo[i]; + *csv << ai.objectName; + *csv << ai.animationType; + *csv << (long)ai.param; + } + else + { + *csv << ""; + *csv << ""; + *csv << ""; + } + } csv->WriteLine(); } *************** *** 287,290 **** --- 328,341 ---- *csv << s.GetBuffer(); } + for(i=0;i<MAXANIMATIONS;i++) + { + tcString s; + s.Format("Animation%d-obj",i+1); + *csv << s.GetBuffer(); + s.Format("Animation%d-type",i+1); + *csv << s.GetBuffer(); + s.Format("Animation%d-param",i+1); + *csv << s.GetBuffer(); + } csv->WriteLine(); return 1; *************** *** 312,315 **** --- 363,367 ---- mnNumSensors = 0; flightportClass = ""; + animationInfo.clear(); } *************** *** 347,350 **** --- 399,408 ---- } flightportClass = obj.flightportClass; + animationInfo.clear(); + size_t nAn = obj.animationInfo.size(); + for(size_t n=0;n<nAn;n++) + { + animationInfo.push_back(obj.animationInfo[n]); + } } |