[Opal-commits] opal/samples/src BoxObject.cpp,1.8,1.9 BoxObject.h,1.4,1.5 CapsuleObject.cpp,1.1,1.2
Status: Inactive
Brought to you by:
tylerstreeter
|
From: tylerstreeter <tyl...@us...> - 2005-03-04 05:10:04
|
Update of /cvsroot/opal/opal/samples/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10750/samples/src Modified Files: BoxObject.cpp BoxObject.h CapsuleObject.cpp CapsuleObject.h SphereObject.cpp SphereObject.h Log Message: changed how friction is used (now sqrt(f1*f2) instead of just f1*f2); minor changes to sample apps Index: CapsuleObject.h =================================================================== RCS file: /cvsroot/opal/opal/samples/src/CapsuleObject.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CapsuleObject.h 1 Mar 2005 05:04:21 -0000 1.1 --- CapsuleObject.h 4 Mar 2005 05:09:23 -0000 1.2 *************** *** 8,12 **** public: CapsuleObject(opal::Simulator* sim, opal::Solid* s, opal::real radius, ! opal::real length); ~CapsuleObject(); --- 8,12 ---- public: CapsuleObject(opal::Simulator* sim, opal::Solid* s, opal::real radius, ! opal::real length, const opal::Matrix44r& offset); ~CapsuleObject(); *************** *** 21,24 **** --- 21,27 ---- opal::Solid* mSolid; opal::Simulator* mSim; + + // The offset from the Solid's base transform. + opal::Matrix44r mOffset; }; Index: SphereObject.cpp =================================================================== RCS file: /cvsroot/opal/opal/samples/src/SphereObject.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SphereObject.cpp 1 Mar 2005 05:04:21 -0000 1.7 --- SphereObject.cpp 4 Mar 2005 05:09:23 -0000 1.8 *************** *** 2,6 **** SphereObject::SphereObject(opal::Simulator* sim, opal::Solid* s, ! opal::real radius) : Base3DObject() { --- 2,6 ---- SphereObject::SphereObject(opal::Simulator* sim, opal::Solid* s, ! opal::real radius, const opal::Matrix44r& offset) : Base3DObject() { *************** *** 8,22 **** mRadius = radius; mSim = sim; ! ! //// Create and setup the Solid. ! //mSolid = sim->createSolid(); ! //mSolid->setStatic(isStatic); ! //mSolid->setTransform(transform); ! ! //// Add a Sphere Shape to the Solid. ! //opal::SphereShapeData sphereData; ! //sphereData.material = material; ! //sphereData.radius = radius; ! //mSolid->addShape(sphereData); } --- 8,12 ---- mRadius = radius; mSim = sim; ! mOffset = offset; } *************** *** 43,46 **** --- 33,37 ---- glPushMatrix(); glMultMatrixf(mSolid->getTransform().getData()); + glMultMatrixf(mOffset.getData()); DrawSphere(mRadius); glPopMatrix(); Index: SphereObject.h =================================================================== RCS file: /cvsroot/opal/opal/samples/src/SphereObject.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SphereObject.h 1 Mar 2005 05:04:21 -0000 1.4 --- SphereObject.h 4 Mar 2005 05:09:23 -0000 1.5 *************** *** 7,11 **** { public: ! SphereObject(opal::Simulator* sim, opal::Solid* s, opal::real radius); ~SphereObject(); --- 7,12 ---- { public: ! SphereObject(opal::Simulator* sim, opal::Solid* s, opal::real radius, ! const opal::Matrix44r& offset); ~SphereObject(); *************** *** 19,22 **** --- 20,26 ---- opal::Solid* mSolid; opal::Simulator* mSim; + + // The offset from the Solid's base transform. + opal::Matrix44r mOffset; }; Index: BoxObject.h =================================================================== RCS file: /cvsroot/opal/opal/samples/src/BoxObject.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** BoxObject.h 1 Mar 2005 05:04:20 -0000 1.4 --- BoxObject.h 4 Mar 2005 05:09:23 -0000 1.5 *************** *** 7,11 **** { public: ! BoxObject(opal::Simulator* sim, opal::Solid* s, opal::Vec3r size); ~BoxObject(); --- 7,12 ---- { public: ! BoxObject(opal::Simulator* sim, opal::Solid* s, opal::Vec3r size, ! const opal::Matrix44r& offset); ~BoxObject(); *************** *** 19,22 **** --- 20,26 ---- opal::Solid* mSolid; opal::Simulator* mSim; + + // The offset from the Solid's base transform. + opal::Matrix44r mOffset; }; Index: CapsuleObject.cpp =================================================================== RCS file: /cvsroot/opal/opal/samples/src/CapsuleObject.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CapsuleObject.cpp 1 Mar 2005 05:04:21 -0000 1.1 --- CapsuleObject.cpp 4 Mar 2005 05:09:23 -0000 1.2 *************** *** 2,6 **** CapsuleObject::CapsuleObject(opal::Simulator* sim, opal::Solid* s, ! opal::real radius, opal::real length) : Base3DObject() { --- 2,6 ---- CapsuleObject::CapsuleObject(opal::Simulator* sim, opal::Solid* s, ! opal::real radius, opal::real length, const opal::Matrix44r& offset) : Base3DObject() { *************** *** 9,12 **** --- 9,13 ---- mLength = length; mSim = sim; + mOffset = offset; } *************** *** 33,36 **** --- 34,38 ---- glPushMatrix(); glMultMatrixf(mSolid->getTransform().getData()); + glMultMatrixf(mOffset.getData()); glPushMatrix(); glTranslatef(0.0, 0.0, -mLength * (opal::real)0.5); Index: BoxObject.cpp =================================================================== RCS file: /cvsroot/opal/opal/samples/src/BoxObject.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** BoxObject.cpp 1 Mar 2005 05:04:20 -0000 1.8 --- BoxObject.cpp 4 Mar 2005 05:09:23 -0000 1.9 *************** *** 2,6 **** BoxObject::BoxObject(opal::Simulator* sim, opal::Solid* s, ! opal::Vec3r dimensions) : Base3DObject() { --- 2,6 ---- BoxObject::BoxObject(opal::Simulator* sim, opal::Solid* s, ! opal::Vec3r dimensions, const opal::Matrix44r& offset) : Base3DObject() { *************** *** 8,11 **** --- 8,12 ---- mDimensions = dimensions; mSim = sim; + mOffset = offset; } *************** *** 31,34 **** --- 32,36 ---- glPushMatrix(); glMultMatrixf(mSolid->getTransform().getData()); + glMultMatrixf(mOffset.getData()); DrawBox(mDimensions); glPopMatrix(); |