[Opal-commits] opal/src AttractorMotor.cpp,1.17,1.18 AttractorMotor.h,1.24,1.25 Defines.h,1.62,1.63
Status: Inactive
Brought to you by:
tylerstreeter
|
From: tylerstreeter <tyl...@us...> - 2005-03-01 05:04:38
|
Update of /cvsroot/opal/opal/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21242/src Modified Files: AttractorMotor.cpp AttractorMotor.h Defines.h GearedMotor.cpp GearedMotor.h Joint.cpp Joint.h ServoMotor.cpp ServoMotor.h ShapeData.h Solid.cpp Solid.h SolidData.cpp SpringMotor.cpp SpringMotor.h ThrusterMotor.cpp ThrusterMotor.h Log Message: fixed bugs in xml blueprint loading; added ragdoll xml file to sample app Index: Joint.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/Joint.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Joint.cpp 26 Feb 2005 10:22:23 -0000 1.22 --- Joint.cpp 1 Mar 2005 05:04:22 -0000 1.23 *************** *** 52,56 **** } ! const JointData& Joint::getJointData()const { return mData; --- 52,56 ---- } ! const JointData& Joint::getData()const { return mData; Index: ShapeData.h =================================================================== RCS file: /cvsroot/opal/opal/src/ShapeData.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ShapeData.h 23 Feb 2005 03:58:23 -0000 1.3 --- ShapeData.h 1 Mar 2005 05:04:22 -0000 1.4 *************** *** 55,59 **** mType = SPHERE_SHAPE; // Leave the offset as an identity matrix. ! material = defaults::material; } --- 55,59 ---- mType = SPHERE_SHAPE; // Leave the offset as an identity matrix. ! material = defaults::shape::material; } Index: GearedMotor.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/GearedMotor.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** GearedMotor.cpp 26 Feb 2005 10:22:23 -0000 1.8 --- GearedMotor.cpp 1 Mar 2005 05:04:22 -0000 1.9 *************** *** 57,61 **** } ! const GearedMotorData& GearedMotor::getMotorData()const { return mData; --- 57,61 ---- } ! const GearedMotorData& GearedMotor::getData()const { return mData; Index: ServoMotor.h =================================================================== RCS file: /cvsroot/opal/opal/src/ServoMotor.h,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** ServoMotor.h 26 Feb 2005 10:22:23 -0000 1.22 --- ServoMotor.h 1 Mar 2005 05:04:22 -0000 1.23 *************** *** 59,63 **** /// Returns all data describing the Motor. ! virtual const ServoMotorData& OPAL_CALL getMotorData()const; virtual void OPAL_CALL setName(const std::string& name); --- 59,63 ---- /// Returns all data describing the Motor. ! virtual const ServoMotorData& OPAL_CALL getData()const; virtual void OPAL_CALL setName(const std::string& name); Index: AttractorMotor.h =================================================================== RCS file: /cvsroot/opal/opal/src/AttractorMotor.h,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** AttractorMotor.h 26 Feb 2005 10:22:23 -0000 1.24 --- AttractorMotor.h 1 Mar 2005 05:04:22 -0000 1.25 *************** *** 58,62 **** /// Returns all data describing the Motor. ! virtual const AttractorMotorData& OPAL_CALL getMotorData()const; virtual void OPAL_CALL setName(const std::string& name); --- 58,62 ---- /// Returns all data describing the Motor. ! virtual const AttractorMotorData& OPAL_CALL getData()const; virtual void OPAL_CALL setName(const std::string& name); Index: ThrusterMotor.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/ThrusterMotor.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ThrusterMotor.cpp 26 Feb 2005 10:22:23 -0000 1.7 --- ThrusterMotor.cpp 1 Mar 2005 05:04:23 -0000 1.8 *************** *** 55,59 **** } ! const ThrusterMotorData& ThrusterMotor::getMotorData()const { return mData; --- 55,59 ---- } ! const ThrusterMotorData& ThrusterMotor::getData()const { return mData; Index: GearedMotor.h =================================================================== RCS file: /cvsroot/opal/opal/src/GearedMotor.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** GearedMotor.h 26 Feb 2005 10:22:23 -0000 1.8 --- GearedMotor.h 1 Mar 2005 05:04:22 -0000 1.9 *************** *** 63,67 **** /// Returns all data describing the Motor. ! virtual const GearedMotorData& OPAL_CALL getMotorData()const; virtual void OPAL_CALL setName(const std::string& name); --- 63,67 ---- /// Returns all data describing the Motor. ! virtual const GearedMotorData& OPAL_CALL getData()const; virtual void OPAL_CALL setName(const std::string& name); Index: SolidData.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/SolidData.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SolidData.cpp 25 Feb 2005 06:40:26 -0000 1.1 --- SolidData.cpp 1 Mar 2005 05:04:22 -0000 1.2 *************** *** 46,51 **** // "globalLinearVel" is already initialized in its constructor. // "globalAngularVel" is already initialized in its constructor. ! linearDamping = defaults::linearDamping; ! angularDamping = defaults::angularDamping; // The Shape list doesn't need to be initialized. } --- 46,51 ---- // "globalLinearVel" is already initialized in its constructor. // "globalAngularVel" is already initialized in its constructor. ! linearDamping = defaults::solid::linearDamping; ! angularDamping = defaults::solid::angularDamping; // The Shape list doesn't need to be initialized. } Index: Solid.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/Solid.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** Solid.cpp 26 Feb 2005 10:22:23 -0000 1.24 --- Solid.cpp 1 Mar 2005 05:04:22 -0000 1.25 *************** *** 42,46 **** } ! const SolidData& Solid::getSolidData()const { return mData; --- 42,46 ---- } ! const SolidData& Solid::getData()const { return mData; Index: Defines.h =================================================================== RCS file: /cvsroot/opal/opal/src/Defines.h,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** Defines.h 28 Feb 2005 03:27:56 -0000 1.62 --- Defines.h 1 Mar 2005 05:04:22 -0000 1.63 *************** *** 109,113 **** ForceType type; ! /// Specifies how long to apply to force. This will be ignored /// if "singleStep" is true. real duration; --- 109,114 ---- ForceType type; ! /// Specifies how long to apply to force. This makes it easy to ! /// apply forces independent of the step size. This will be ignored /// if "singleStep" is true. real duration; *************** *** 275,287 **** namespace defaults { ! const real stepSize = (real)0.0167; // ~60 Hz physics rate const Vec3r gravity(0, 0, 0); const real bounceThreshold = (real)1.0; - const Material material(opal::globals::woodMaterial); const SolverAccuracyLevel solverAccuracy = SOLVER_ACCURACY_MEDIUM; //const bool allowPartialFrames=true; //const int maxStepsPerFrame=10; - const real linearDamping = (real)0.15; - const real angularDamping = (real)0.15; const real maxLinearVel = (real)10000.0; const real maxAngularVel = (real)1000.0; --- 276,285 ---- namespace defaults { ! const real stepSize = (real)0.0167; // ~60 Hz physics update rate. const Vec3r gravity(0, 0, 0); const real bounceThreshold = (real)1.0; const SolverAccuracyLevel solverAccuracy = SOLVER_ACCURACY_MEDIUM; //const bool allowPartialFrames=true; //const int maxStepsPerFrame=10; const real maxLinearVel = (real)10000.0; const real maxAngularVel = (real)1000.0; *************** *** 294,297 **** --- 292,302 ---- const real sleepiness = (real)0.5; const bool isStatic = false; + const real linearDamping = (real)0.15; + const real angularDamping = (real)0.15; + } + + namespace shape + { + const Material material(opal::globals::woodMaterial); } *************** *** 373,377 **** const real autoDisableTimeMin=0; const real autoDisableTimeMax=(real)0.4; ! const int maxContactPoints=(int)32; const real minMassRatio=(real)0.001; --- 378,382 ---- const real autoDisableTimeMin=0; const real autoDisableTimeMax=(real)0.4; ! const int maxContactPoints=(int)24; const real minMassRatio=(real)0.001; *************** *** 380,384 **** const real minERP=(real)0.1; const real maxERP=(real)0.9; ! const real globalCFM=(real)1e-6; const real jointFudgeFactor=(real)0.001; const real maxFriction=(real)1000.0; --- 385,389 ---- const real minERP=(real)0.1; const real maxERP=(real)0.9; ! const real globalCFM=(real)1e-3; const real jointFudgeFactor=(real)0.001; const real maxFriction=(real)1000.0; Index: Solid.h =================================================================== RCS file: /cvsroot/opal/opal/src/Solid.h,v retrieving revision 1.78 retrieving revision 1.79 diff -C2 -d -r1.78 -r1.79 *** Solid.h 26 Feb 2005 10:22:23 -0000 1.78 --- Solid.h 1 Mar 2005 05:04:22 -0000 1.79 *************** *** 39,219 **** class ShapeData; - /// TODO: replace with SolidData struct - //struct BodyState - //{ - // Matrix44r transform; - // Vec3r globalLinearVel; - // Vec3r globalAngularVel; - //}; - - ///// TODO: replace with SolidData - //struct SolidDescription - //{ - // ~SolidDescription() - // { - // shapeList.clear(); - // userProperties.clear(); - // } - - // std::string name; - // Matrix44r transform; - // bool isStatic; - // real linearDamping; - // real angularDamping; - // std::vector<ShapeDescription> shapeList; - // std::vector<UserProperty> userProperties; - //}; - - // Old data structure... - //struct SolidData - //{ - // ~SolidData() - // { - // userProperties.clear(); - // } - - // std::string getUserProperty(std::string name) - // { - // std::map<std::string, std::string>::iterator iter = - // userProperties.find(name); - // if (userProperties.end() != iter) - // { - // return (*iter).second; - // } - // else - // { - // return ""; - // } - // } - - // Solid* solidPtr; - // std::map<std::string, std::string> userProperties; - //} - - //namespace globals - //{ - // /// The number of floats needed to describe the dimensions of - // /// any Shape. - // const int numShapeDimensions=7; - //} - - ///// A data structure containing all essential parameters that describe - ///// a Shape. Note that there is no class associated with Shapes, just - ///// this data structure. - //struct ShapeData - //{ - // ShapeData() - // { - // type = SPHERE_SHAPE; - // // Leave the offset as an identity matrix. - // material = defaults::material; - - // for (int i=0; i<globals::numShapeDimensions; ++i) - // { - // dimensions[i] = 0; - // } - // } - - // /// Copy constructor. - // ShapeData(const ShapeData& data) - // { - // (*this) = sd; - // } - - // /// Makes a deep copy. - // void operator=(const ShapeData& data) - // { - // type = data.type; - // offset = data.offset; - // material = data.material; - - // for (int i=0; i<globals::numShapeDimensions; ++i) - // { - // dimensions[i] = data.dimensions[i]; - // } - // } - - // /// The Shape type. - // ShapeType type; - - // /// The offset transform from a Solid's transform. - // Matrix44r offset; - - // /// The Shape's material. - // Material material; - - // /// Dimensions for all Shape types are stored in the "dimensions" - // /// array. - // /// Boxes: elements 0, 1, 2 are the box dimensions. - // /// Spheres: element 0 is radius. - // /// Planes: elements 0, 1, 2, 3 are the plane normal and - // /// distance from the origin (i.e. they define the plane equation - // /// ax + by + cz = d). - // /// Capped cylinders: elements 0 and 1 are radius and length. - // /// Rays: elements 0, 1, 2 are the origin, 3, 4, 5 are direction, - // /// and 6 is length. - // real dimensions[globals::numShapeDimensions]; - //}; - - ///// A data structure containing all essential parameters that describe - ///// a Solid. - //struct SolidData - //{ - // SolidData() - // { - // enabled = defaults::solid::enabled; - // sleeping = defaults::solid::sleeping; - // isStatic = defaults::solid::isStatic; - // // Leave the transform as an identity matrix. - // globalLinearVel = 0; - // globalAngularVel = 0; - // linearDamping = defaults::linearDamping; - // angularDamping = defaults::angularDamping; - // // The Shape list doesn't need to be initialized. - // } - - // /// Copy constructor. - // SolidData(const SolidData& data) - // { - // (*this) = data; - // } - - // /// This is necessary because SolidData uses a dynamically-allocated - // /// list of Shapes. - // ~SolidData() - // { - // shapes.clear(); - // } - - // /// Makes a deep copy. - // void operator=(const SolidData& data) - // { - // enabled = sd.enabled; - // sleeping = sd.sleeping; - // isStatic = sd.isStatic; - // transform = sd.transform; - // globalLinearVel = sd.globalLinearVel; - // globalAngularVel = sd.globalAngularVel; - // linearDamping = sd.linearDamping; - // angularDamping = sd.angularDamping; - - // shapes.clear(); - // for (unsigned int i=0; i<sd.shapes.size(); ++i) - // { - // shapes.push_back(sd.shapes[i]); - // } - // } - - // bool enabled; - // bool sleeping; - // bool isStatic; - // Matrix44r transform; - // Vec3r globalLinearVel; - // Vec3r globalAngularVel; - // real linearDamping; - // real angularDamping; - // std::vector<ShapeData> shapes; - //}; - /// Solids are the physical objects in the simulation. Solids can be /// static or dynamic. Static Solids are simple collision shapes; --- 39,42 ---- *************** *** 235,239 **** /// Returns all data describing the Solid. ! virtual const SolidData& OPAL_CALL getSolidData()const; /// Sets the Solid's name. --- 58,62 ---- /// Returns all data describing the Solid. ! virtual const SolidData& OPAL_CALL getData()const; /// Sets the Solid's name. Index: ServoMotor.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/ServoMotor.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ServoMotor.cpp 26 Feb 2005 10:22:23 -0000 1.12 --- ServoMotor.cpp 1 Mar 2005 05:04:22 -0000 1.13 *************** *** 38,44 **** ServoMotor::~ServoMotor() { ! // This will automatically set the Joint's desired vel and max ! // force to 0. ! setEnabled(false); } --- 38,49 ---- ServoMotor::~ServoMotor() { ! // We must set the Joint's desired vel and max force to 0 since ! // this Motor won't apply to it anymore. This is only necessary ! // if this Motor is enabled. ! if (mData.enabled && mData.joint) ! { ! mData.joint->internal_setDesiredVel(mData.jointAxisNum, 0); ! mData.joint->internal_setMaxTorque(mData.jointAxisNum, 0); ! } } *************** *** 80,84 **** } ! const ServoMotorData& ServoMotor::getMotorData()const { return mData; --- 85,89 ---- } ! const ServoMotorData& ServoMotor::getData()const { return mData; Index: SpringMotor.h =================================================================== RCS file: /cvsroot/opal/opal/src/SpringMotor.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** SpringMotor.h 26 Feb 2005 10:22:23 -0000 1.8 --- SpringMotor.h 1 Mar 2005 05:04:22 -0000 1.9 *************** *** 57,61 **** /// Returns all data describing the Motor. ! virtual const SpringMotorData& OPAL_CALL getMotorData()const; virtual void OPAL_CALL setName(const std::string& name); --- 57,61 ---- /// Returns all data describing the Motor. ! virtual const SpringMotorData& OPAL_CALL getData()const; virtual void OPAL_CALL setName(const std::string& name); Index: SpringMotor.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/SpringMotor.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SpringMotor.cpp 26 Feb 2005 10:22:23 -0000 1.7 --- SpringMotor.cpp 1 Mar 2005 05:04:22 -0000 1.8 *************** *** 55,59 **** } ! const SpringMotorData& SpringMotor::getMotorData()const { return mData; --- 55,59 ---- } ! const SpringMotorData& SpringMotor::getData()const { return mData; Index: Joint.h =================================================================== RCS file: /cvsroot/opal/opal/src/Joint.h,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** Joint.h 26 Feb 2005 10:22:23 -0000 1.57 --- Joint.h 1 Mar 2005 05:04:22 -0000 1.58 *************** *** 76,80 **** /// Returns all data describing the Joint. ! virtual const JointData& OPAL_CALL getJointData()const; /// Sets the Joint's name. --- 76,80 ---- /// Returns all data describing the Joint. ! virtual const JointData& OPAL_CALL getData()const; /// Sets the Joint's name. Index: ThrusterMotor.h =================================================================== RCS file: /cvsroot/opal/opal/src/ThrusterMotor.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ThrusterMotor.h 26 Feb 2005 10:22:23 -0000 1.8 --- ThrusterMotor.h 1 Mar 2005 05:04:23 -0000 1.9 *************** *** 56,60 **** /// Returns all data describing the Motor. ! virtual const ThrusterMotorData& OPAL_CALL getMotorData()const; virtual void OPAL_CALL setName(const std::string& name); --- 56,60 ---- /// Returns all data describing the Motor. ! virtual const ThrusterMotorData& OPAL_CALL getData()const; virtual void OPAL_CALL setName(const std::string& name); Index: AttractorMotor.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/AttractorMotor.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** AttractorMotor.cpp 26 Feb 2005 10:22:23 -0000 1.17 --- AttractorMotor.cpp 1 Mar 2005 05:04:22 -0000 1.18 *************** *** 68,72 **** } ! const AttractorMotorData& AttractorMotor::getMotorData()const { return mData; --- 68,72 ---- } ! const AttractorMotorData& AttractorMotor::getData()const { return mData; |