|
From: Markus R. <rol...@us...> - 2006-02-12 11:19:38
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24038 Modified Files: property.h property.cpp Log Message: - added properties for collisionhandler, contactjointhandler and - dragcontroller Index: property.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/property.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** property.cpp 24 Jan 2006 18:08:46 -0000 1.4 --- property.cpp 12 Feb 2006 11:19:25 -0000 1.5 *************** *** 36,39 **** --- 36,42 ---- #include <oxygen/physicsserver/joint.h> #include <oxygen/physicsserver/world.h> + #include <oxygen/physicsserver/collisionhandler.h> + #include <oxygen/physicsserver/contactjointhandler.h> + #include <oxygen/physicsserver/dragcontroller.h> *************** *** 80,83 **** --- 83,89 ---- } + #define FORMAT_FLAG(_i, _flag)\ + wxString((_i & _flag) ? #_flag" " : "") + Property::Property() { *************** *** 96,99 **** --- 102,108 ---- mClassMap[_T("/classes/oxygen/Joint")] = CL_JOINT; mClassMap[_T("/classes/oxygen/World")] = CL_WORLD; + mClassMap[_T("/classes/oxygen/CollisionHandler")] = CL_COLLISIONHANDLER; + mClassMap[_T("/classes/oxygen/ContactJointHandler")] = CL_CONTACTJOINTHANDLER; + mClassMap[_T("/classes/oxygen/DragController")] = CL_DRAGCONTROLLER; } *************** *** 207,210 **** --- 216,263 ---- } + void Property::GenCollisionHandlerEntries(shared_ptr<Leaf> leaf, TEntryList& entries) const + { + shared_ptr<CollisionHandler> ch = shared_static_cast<CollisionHandler>(leaf); + entries.push_back(Entry(_T("IsSymmetricHandler"),FormatBool(ch->IsSymmetricHandler()))); + } + + void Property::GenContactJointEntries(shared_ptr<Leaf> leaf, TEntryList& entries) const + { + shared_ptr<ContactJointHandler> cjh = shared_static_cast<ContactJointHandler>(leaf); + + int mode = cjh->GetContactMode(); + wxString strMode = + FORMAT_FLAG(mode, dContactMu2) + + FORMAT_FLAG(mode, dContactFDir1) + + FORMAT_FLAG(mode, dContactBounce) + + FORMAT_FLAG(mode, dContactSoftERP) + + FORMAT_FLAG(mode, dContactSoftCFM) + + FORMAT_FLAG(mode, dContactMotion1) + + FORMAT_FLAG(mode, dContactMotion2) + + FORMAT_FLAG(mode, dContactSlip1) + + FORMAT_FLAG(mode, dContactSlip2) + + FORMAT_FLAG(mode, dContactApprox0) + + FORMAT_FLAG(mode, dContactApprox1_1) + + FORMAT_FLAG(mode, dContactApprox1_2) + + FORMAT_FLAG(mode, dContactApprox1); + + entries.push_back(Entry(_T("GetContactMode"),strMode)); + entries.push_back(Entry(_T("GetBounceValue"),FormatFloat(cjh->GetBounceValue()))); + entries.push_back(Entry(_T("GetMinBounceVel"),FormatFloat(cjh->GetMinBounceVel()))); + entries.push_back(Entry(_T("GetContactSoftERP"),FormatFloat(cjh->GetContactSoftERP()))); + entries.push_back(Entry(_T("GetContactSoftCFM"),FormatFloat(cjh->GetContactSoftCFM()))); + entries.push_back(Entry(_T("GetContactSlip1"),FormatFloat(cjh->GetContactSlip1()))); + entries.push_back(Entry(_T("GetContactSlip2"),FormatFloat(cjh->GetContactSlip2()))); + entries.push_back(Entry(_T("GetContactMu"),FormatFloat(cjh->GetContactMu()))); + } + + void Property::GenDragControllerEntries(shared_ptr<Leaf> leaf, TEntryList& entries) const + { + shared_ptr<DragController> dc = shared_static_cast<DragController>(leaf); + + entries.push_back(Entry(_T("GetLinearDrag"),FormatFloat(dc->GetLinearDrag()))); + entries.push_back(Entry(_T("GetAngularDrag"),FormatFloat(dc->GetAngularDrag()))); + } + void Property::GetClassList(boost::shared_ptr<Class> cl, TClassList& clList) const *************** *** 309,312 **** --- 362,378 ---- case CL_WORLD: GenWorldEntries(leaf, entries); + break; + + case CL_COLLISIONHANDLER: + GenCollisionHandlerEntries(leaf, entries); + break; + + case CL_CONTACTJOINTHANDLER: + GenContactJointEntries(leaf, entries); + break; + + case CL_DRAGCONTROLLER: + GenDragControllerEntries(leaf, entries); + break; } } Index: property.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/property.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** property.h 22 Jan 2006 18:57:46 -0000 1.3 --- property.h 12 Feb 2006 11:19:25 -0000 1.4 *************** *** 43,47 **** CL_BODY, CL_JOINT, ! CL_WORLD }; --- 43,50 ---- CL_BODY, CL_JOINT, ! CL_WORLD, ! CL_COLLISIONHANDLER, ! CL_CONTACTJOINTHANDLER, ! CL_DRAGCONTROLLER }; *************** *** 80,83 **** --- 83,90 ---- void GenJointEntries(boost::shared_ptr<zeitgeist::Leaf> leaf, TEntryList& entries) const; void GenWorldEntries(boost::shared_ptr<zeitgeist::Leaf> leaf, TEntryList& entries) const; + void GenCollisionHandlerEntries(boost::shared_ptr<zeitgeist::Leaf> leaf, TEntryList& entries) const; + void GenContactJointEntries(boost::shared_ptr<zeitgeist::Leaf> leaf, TEntryList& entries) const; + void GenDragControllerEntries(boost::shared_ptr<zeitgeist::Leaf> leaf, TEntryList& entries) const; + void GetClassList(boost::shared_ptr<zeitgeist::Class> cl, TClassList& clList) const; |