From: Markus R. <rol...@us...> - 2006-02-18 19:50:10
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15196 Modified Files: property.h property.cpp Log Message: - added properties for ContactJointHandler Index: property.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/property.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** property.cpp 12 Feb 2006 11:39:09 -0000 1.6 --- property.cpp 18 Feb 2006 19:50:03 -0000 1.7 *************** *** 39,43 **** #include <oxygen/physicsserver/contactjointhandler.h> #include <oxygen/physicsserver/dragcontroller.h> ! using namespace std; --- 39,43 ---- #include <oxygen/physicsserver/contactjointhandler.h> #include <oxygen/physicsserver/dragcontroller.h> ! #include <kerosin/materialserver/materialsolid.h> using namespace std; *************** *** 46,49 **** --- 46,50 ---- using namespace zeitgeist; using namespace oxygen; + using namespace kerosin; inline wxString FormatVector3(const Vector3f& vec) *************** *** 83,86 **** --- 84,92 ---- } + inline wxString FormatRGBA(const RGBA& col) + { + return wxString::Format(_T("(%.2f, %.2f, %.2f, %.2f)"),col.r(),col.g(),col.b(),col.a()); + } + #define FORMAT_FLAG(_i, _flag)\ wxString((_i & _flag) ? #_flag" " : "") *************** *** 105,108 **** --- 111,115 ---- mClassMap[_T("/classes/oxygen/ContactJointHandler")] = CL_CONTACTJOINTHANDLER; mClassMap[_T("/classes/oxygen/DragController")] = CL_DRAGCONTROLLER; + mClassMap[_T("/classes/kerosin/MaterialSolid")] = CL_MATERIALSOLID; } *************** *** 173,176 **** --- 180,191 ---- } + void Property::GenSolidMaterialProperty(shared_ptr<Leaf> leaf, TEntryList& entries) const + { + const MaterialSolid& mat = *shared_static_cast<MaterialSolid>(leaf); + entries.push_back(Entry(_T("GetAmbient"),FormatRGBA(mat.GetAmbient()))); + entries.push_back(Entry(_T("GetDiffuse"),FormatRGBA(mat.GetDiffuse()))); + entries.push_back(Entry(_T("GetSpecular"),FormatRGBA(mat.GetSpecular()))); + } + void Property::GenJointEntries(shared_ptr<Leaf> leaf, TEntryList& entries) const { *************** *** 374,377 **** --- 389,396 ---- GenDragControllerEntries(leaf, entries); break; + + case CL_MATERIALSOLID: + GenSolidMaterialProperty(leaf, entries); + break; } } Index: property.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/property.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** property.h 12 Feb 2006 11:19:25 -0000 1.4 --- property.h 18 Feb 2006 19:50:03 -0000 1.5 *************** *** 46,50 **** CL_COLLISIONHANDLER, CL_CONTACTJOINTHANDLER, ! CL_DRAGCONTROLLER }; --- 46,51 ---- CL_COLLISIONHANDLER, CL_CONTACTJOINTHANDLER, ! CL_DRAGCONTROLLER, ! CL_MATERIALSOLID }; *************** *** 86,90 **** 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; --- 87,91 ---- void GenContactJointEntries(boost::shared_ptr<zeitgeist::Leaf> leaf, TEntryList& entries) const; void GenDragControllerEntries(boost::shared_ptr<zeitgeist::Leaf> leaf, TEntryList& entries) const; ! void GenSolidMaterialProperty(boost::shared_ptr<zeitgeist::Leaf> leaf, TEntryList& entries) const; void GetClassList(boost::shared_ptr<zeitgeist::Class> cl, TClassList& clList) const; |