|
From: Markus R. <rol...@us...> - 2007-06-13 13:21:45
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv25071 Modified Files: Tag: ROSIMPORTER_XLAB property.cpp property.h Log Message: - add GetAngle() and GetAngleRate() properties for Hinge- and UniversalJoint Index: property.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/property.cpp,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -C2 -d -r1.9 -r1.9.2.1 *** property.cpp 17 May 2007 17:49:23 -0000 1.9 --- property.cpp 13 Jun 2007 13:21:41 -0000 1.9.2.1 *************** *** 36,39 **** --- 36,41 ---- #include <oxygen/physicsserver/body.h> #include <oxygen/physicsserver/joint.h> + #include <oxygen/physicsserver/hingejoint.h> + #include <oxygen/physicsserver/universaljoint.h> #include <oxygen/physicsserver/world.h> #include <oxygen/physicsserver/collisionhandler.h> *************** *** 108,111 **** --- 110,115 ---- mClassMap[_T("/classes/oxygen/Body")] = CL_BODY; mClassMap[_T("/classes/oxygen/Joint")] = CL_JOINT; + mClassMap[_T("/classes/oxygen/HingeJoint")] = CL_HINGEJOINT; + mClassMap[_T("/classes/oxygen/UniversalJoint")] = CL_UNIVERSALJOINT; mClassMap[_T("/classes/oxygen/World")] = CL_WORLD; mClassMap[_T("/classes/oxygen/CollisionHandler")] = CL_COLLISIONHANDLER; *************** *** 201,204 **** --- 205,224 ---- } + void Property::GenHingeEntries(shared_ptr<Leaf> leaf, TEntryList& entries) const + { + const HingeJoint& hinge = *shared_static_cast<HingeJoint>(leaf); + entries.push_back(Entry(_T("GetAngle"),FormatFloat(hinge.GetAngle()))); + entries.push_back(Entry(_T("GetAngleRate"),FormatFloat(hinge.GetAngleRate()))); + } + + void Property::GenUniversalEntries(shared_ptr<Leaf> leaf, TEntryList& entries) const + { + const UniversalJoint& universal = *shared_static_cast<UniversalJoint>(leaf); + entries.push_back(Entry(_T("GetAngle(0)"),FormatFloat(universal.GetAngle(Joint::AI_FIRST)))); + entries.push_back(Entry(_T("GetAngle(1)"),FormatFloat(universal.GetAngle(Joint::AI_SECOND)))); + entries.push_back(Entry(_T("GetAngleRate(0)"),FormatFloat(universal.GetAngleRate(Joint::AI_FIRST)))); + entries.push_back(Entry(_T("GetAngleRate(1)"),FormatFloat(universal.GetAngleRate(Joint::AI_SECOND)))); + } + void Property::GenJointEntries(shared_ptr<Leaf> leaf, TEntryList& entries) const { *************** *** 383,386 **** --- 403,414 ---- break; + case CL_HINGEJOINT: + GenHingeEntries(leaf, entries); + break; + + case CL_UNIVERSALJOINT: + GenUniversalEntries(leaf, entries); + break; + case CL_JOINT: GenJointEntries(leaf, entries); Index: property.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/property.h,v retrieving revision 1.6 retrieving revision 1.6.4.1 diff -C2 -d -r1.6 -r1.6.4.1 *** property.h 15 Mar 2007 07:26:24 -0000 1.6 --- property.h 13 Jun 2007 13:21:41 -0000 1.6.4.1 *************** *** 47,50 **** --- 47,52 ---- CL_BODY, CL_JOINT, + CL_HINGEJOINT, + CL_UNIVERSALJOINT, CL_WORLD, CL_COLLISIONHANDLER, *************** *** 86,89 **** --- 88,93 ---- void GenTransformEntries(boost::shared_ptr<zeitgeist::Leaf> leaf, TEntryList& entries) const; void GenBodyEntries(boost::shared_ptr<zeitgeist::Leaf> leaf, TEntryList& entries) const; + void GenHingeEntries(boost::shared_ptr<zeitgeist::Leaf> leaf, TEntryList& entries) const; + void GenUniversalEntries(boost::shared_ptr<zeitgeist::Leaf> leaf, TEntryList& entries) const; void GenJointEntries(boost::shared_ptr<zeitgeist::Leaf> leaf, TEntryList& entries) const; void GenWorldEntries(boost::shared_ptr<zeitgeist::Leaf> leaf, TEntryList& entries) const; |