[Opal-commits] opal/src Joint.cpp,1.31,1.32 Joint.h,1.69,1.70 Simulator.cpp,1.63,1.64 Solid.cpp,1.35
Status: Inactive
Brought to you by:
tylerstreeter
|
From: tylerstreeter <tyl...@us...> - 2005-05-04 21:04:39
|
Update of /cvsroot/opal/opal/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17961/src Modified Files: Joint.cpp Joint.h Simulator.cpp Solid.cpp Solid.h Log Message: Fixed bugs in Joint::getAnchor and Joint::getAxis. Previously they returned the initial anchor and axis. Now they return the current anchor and axis. Index: Joint.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/Joint.cpp,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** Joint.cpp 2 May 2005 16:40:59 -0000 1.31 --- Joint.cpp 4 May 2005 21:04:00 -0000 1.32 *************** *** 57,62 **** } ! const JointData& Joint::getData()const { return mData; } --- 57,70 ---- } ! const JointData& Joint::getData() { + // Update parameters that don't get updated automatically. + for (int i=0; i<mNumAxes; ++i) + { + mData.axis[i] = getAxis(i); + } + + mData.anchor = getAnchor(); + return mData; } *************** *** 287,296 **** } - const JointAxis& Joint::getAxis(int axisNum)const - { - assert(axisNum >= 0 && axisNum < mNumAxes); - return mData.axis[axisNum]; - } - int Joint::getNumAxes()const { --- 295,298 ---- *************** *** 303,311 **** } - const Point3r& Joint::getAnchor()const - { - return mData.anchor; - } - bool Joint::isEnabled()const { --- 305,308 ---- Index: Solid.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/Solid.cpp,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** Solid.cpp 27 Apr 2005 02:28:18 -0000 1.35 --- Solid.cpp 4 May 2005 21:04:01 -0000 1.36 *************** *** 47,52 **** } ! const SolidData& Solid::getData()const { return mData; } --- 47,55 ---- } ! const SolidData& Solid::getData() { + // Update parameters that don't get updated automatically. + mData.sleeping = isSleeping(); + return mData; } *************** *** 242,249 **** } ! void Solid::internal_updateSleeping() ! { ! mData.sleeping = isSleeping(); ! } //// TODO: Quickly spinning solids should be set as fast rotating solids to --- 245,252 ---- } ! //void Solid::internal_updateSleeping() ! //{ ! // mData.sleeping = isSleeping(); ! //} //// TODO: Quickly spinning solids should be set as fast rotating solids to Index: Simulator.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/Simulator.cpp,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** Simulator.cpp 18 Apr 2005 22:21:03 -0000 1.63 --- Simulator.cpp 4 May 2005 21:04:00 -0000 1.64 *************** *** 155,159 **** // Update the sleeping value from the physics engine. This // needs to be updated to keep the Solid's SolidData valid. ! solid->internal_updateSleeping(); // Update the Solid's CollisionEventHandler if applicable. --- 155,161 ---- // Update the sleeping value from the physics engine. This // needs to be updated to keep the Solid's SolidData valid. ! //solid->internal_updateSleeping(); ! // Update... Now this gets updated in the Solid::getData ! // function. // Update the Solid's CollisionEventHandler if applicable. Index: Solid.h =================================================================== RCS file: /cvsroot/opal/opal/src/Solid.h,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -d -r1.89 -r1.90 *** Solid.h 18 Apr 2005 22:21:04 -0000 1.89 --- Solid.h 4 May 2005 21:04:01 -0000 1.90 *************** *** 56,60 **** /// Returns all data describing the Solid. ! virtual const SolidData& OPAL_CALL getData()const; /// Sets the Solid's name. --- 56,60 ---- /// Returns all data describing the Solid. ! virtual const SolidData& OPAL_CALL getData(); /// Sets the Solid's name. Index: Joint.h =================================================================== RCS file: /cvsroot/opal/opal/src/Joint.h,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** Joint.h 2 May 2005 16:40:59 -0000 1.69 --- Joint.h 4 May 2005 21:04:00 -0000 1.70 *************** *** 63,67 **** /// Returns all data describing the Joint. ! virtual const JointData& OPAL_CALL getData()const; /// Sets the Joint's name. --- 63,67 ---- /// Returns all data describing the Joint. ! virtual const JointData& OPAL_CALL getData(); /// Sets the Joint's name. *************** *** 173,181 **** virtual Solid* OPAL_CALL getSolid1()const; ! /// Returns the specified axis. ! virtual const JointAxis& OPAL_CALL getAxis(int axisNum)const; ! /// Returns the anchor point. ! virtual const Point3r& OPAL_CALL getAnchor()const; /// Returns the number of axes used by this Joint. --- 173,183 ---- virtual Solid* OPAL_CALL getSolid1()const; ! /// Returns the current specified axis in global coordinates. ! /// Passing in an invalid axis number will return invalid data. ! virtual JointAxis OPAL_CALL getAxis(int axisNum)const = 0; ! /// Returns the current anchor point in global coordinates. ! /// Passing in an invalid axis number will return invalid data. ! virtual Point3r OPAL_CALL getAnchor()const = 0; /// Returns the number of axes used by this Joint. *************** *** 259,262 **** --- 261,266 ---- /// This is set to true when the Joint is initialized. bool mInitCalled; + + /// The number of axes used by the Joint. int mNumAxes; |