From: <a-...@us...> - 2010-02-28 21:10:11
|
Revision: 185 http://simspark.svn.sourceforge.net/simspark/?rev=185&view=rev Author: a-held Date: 2010-02-28 21:10:01 +0000 (Sun, 28 Feb 2010) Log Message: ----------- Replace some ODE constants with their actual values in rsgedit files Declare SetParameter in joint.h because rsgedit calls it (even though it's not implemented and not meant to be implemented there) Modified Paths: -------------- trunk/rsgedit/src/kinematicframe.cpp trunk/rsgedit/src/property.cpp trunk/spark/lib/oxygen/physicsserver/joint.h Modified: trunk/rsgedit/src/kinematicframe.cpp =================================================================== --- trunk/rsgedit/src/kinematicframe.cpp 2010-02-28 12:56:26 UTC (rev 184) +++ trunk/rsgedit/src/kinematicframe.cpp 2010-02-28 21:10:01 UTC (rev 185) @@ -101,17 +101,17 @@ strType = wxT("?"); break; - case dJointTypeUniversal: + case /*dJointTypeUniversal*/ 5: bmp = new wxStaticBitmap(mCtrScrollWnd, wxID_ANY, mBmpUniversal); strType = wxT("Universal"); break; - case dJointTypeHinge: + case /*dJointTypeHinge*/ 2: bmp = new wxStaticBitmap(mCtrScrollWnd, wxID_ANY, mBmpHinge); strType = wxT("Hinge"); break; - case dJointTypeSlider: + case /*dJointTypeSlider*/ 3: bmp = new wxStaticBitmap(mCtrScrollWnd, wxID_ANY, mBmpSlider); strType = wxT("Slider"); break; @@ -209,10 +209,10 @@ switch (jt) { - case dJointTypeFixed: + case 7 /*dJointTypeFixed*/: break; - case dJointTypeUniversal: + case 5 /*dJointTypeUniversal*/: AddJointDescription(joint); AddJointControl(joint, 0); AddJointControl(joint, 1); @@ -280,7 +280,7 @@ default: break; - case dJointTypeSlider: + case 3: //dJointTypeSlider: { shared_ptr<SliderJoint> sliderJoint = shared_static_cast<SliderJoint>(entry.joint.lock()); @@ -288,7 +288,7 @@ break; } - case dJointTypeUniversal: + case 5: //dJointTypeUniversal: { shared_ptr<UniversalJoint> universal = shared_static_cast<UniversalJoint>(entry.joint.lock()); @@ -296,7 +296,7 @@ break; } - case dJointTypeHinge: + case 2: //dJointTypeHinge: { shared_ptr<HingeJoint> hinge = shared_static_cast<HingeJoint>(entry.joint.lock()); @@ -323,7 +323,7 @@ JointControl& entry = (*iter).second; shared_ptr<Joint> joint(shared_static_cast<Joint>(entry.joint.lock())); - joint->SetParameter(dParamVel, 0); + joint->SetParameter(2 /*dParamVel*/, 0); } float kinematicFrame::GetJointVel(float diff) @@ -334,7 +334,7 @@ int kinematicFrame::GetParamVel(int axis) const { - return (axis == 0) ? dParamVel : dParamVel2; + return (axis == 0) ? 2 /*dParamVel*/ : 258 /*dParamVel2*/; } void kinematicFrame::MoveJoint(JointControl& entry) @@ -346,7 +346,7 @@ default: break; - case dJointTypeHinge: + case 2: //dJointTypeHinge: { shared_ptr<HingeJoint> hinge = shared_static_cast<HingeJoint>(entry.joint.lock()); @@ -363,7 +363,7 @@ break; } - case dJointTypeUniversal: + case 5: //dJointTypeUniversal: { shared_ptr<UniversalJoint> universal = shared_static_cast<UniversalJoint>(entry.joint.lock()); Modified: trunk/rsgedit/src/property.cpp =================================================================== --- trunk/rsgedit/src/property.cpp 2010-02-28 12:56:26 UTC (rev 184) +++ trunk/rsgedit/src/property.cpp 2010-02-28 21:10:01 UTC (rev 185) @@ -274,20 +274,20 @@ const 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); + wxString strMode = //replace ODE constants with their actual values + FORMAT_FLAG(mode, 1 /*dContactMu2*/) + + FORMAT_FLAG(mode, 2 /*dContactFDir1*/) + + FORMAT_FLAG(mode, 4 /*dContactBounce*/) + + FORMAT_FLAG(mode, 8 /*dContactSoftERP*/) + + FORMAT_FLAG(mode, 16 /*dContactSoftCFM*/) + + FORMAT_FLAG(mode, 32 /*dContactMotion1*/) + + FORMAT_FLAG(mode, 64 /*dContactMotion2*/) + + FORMAT_FLAG(mode, 256 /*dContactSlip1*/) + + FORMAT_FLAG(mode, 512 /*dContactSlip2*/) + + FORMAT_FLAG(mode, 0 /*dContactApprox0*/) + + FORMAT_FLAG(mode, 4096 /*dContactApprox1_1*/) + + FORMAT_FLAG(mode, 8192 /*dContactApprox1_2*/) + + FORMAT_FLAG(mode, 12288 /*dContactApprox1*/); entries.push_back(Entry(wxT("GetContactMode"),strMode)); entries.push_back(Entry(wxT("GetBounceValue"),FormatFloat(cjh.GetBounceValue()))); Modified: trunk/spark/lib/oxygen/physicsserver/joint.h =================================================================== --- trunk/spark/lib/oxygen/physicsserver/joint.h 2010-02-28 12:56:26 UTC (rev 184) +++ trunk/spark/lib/oxygen/physicsserver/joint.h 2010-02-28 21:10:01 UTC (rev 185) @@ -270,6 +270,11 @@ /** Whether limit jointMaxSpeed2 */ bool IsLimitJointMaxSpeed2() const; + + /** This has to be declared here because rsgedit upcasts to Joint + at one point and then calls this. + */ + virtual void SetParameter(int parameter, float value){}; protected: /** associates the created joint with this node */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |