[Opal-commits] opal/samples/src Base3DObject.h,1.8,1.9 CapsuleObject.cpp,1.2,1.3
Status: Inactive
Brought to you by:
tylerstreeter
|
From: tylerstreeter <tyl...@us...> - 2005-03-21 04:29:14
|
Update of /cvsroot/opal/opal/samples/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15060/samples/src Modified Files: Base3DObject.h CapsuleObject.cpp Log Message: added a PostStepEventHandler that gets notified at the end of every simulation step Index: Base3DObject.h =================================================================== RCS file: /cvsroot/opal/opal/samples/src/Base3DObject.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Base3DObject.h 1 Mar 2005 05:04:20 -0000 1.8 --- Base3DObject.h 21 Mar 2005 04:29:05 -0000 1.9 *************** *** 44,47 **** --- 44,63 ---- } + void DrawCapsule(opal::real radius, opal::real length) + { + glPushMatrix(); + glTranslatef(0.0, 0.0, -length * (opal::real)0.5); + gluCylinder(mQuadric, radius, radius, length, 20, 20); + glPopMatrix(); + glPushMatrix(); + glTranslatef(0.0, 0.0, length * (opal::real)0.5); + gluSphere(mQuadric, radius, 20, 20); + glPopMatrix(); + glPushMatrix(); + glTranslatef(0.0, 0.0, -length * (opal::real)0.5); + gluSphere(mQuadric, radius, 20, 20); + glPopMatrix(); + } + void DrawBox(const opal::Vec3r& dimensions) { Index: CapsuleObject.cpp =================================================================== RCS file: /cvsroot/opal/opal/samples/src/CapsuleObject.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CapsuleObject.cpp 4 Mar 2005 05:09:23 -0000 1.2 --- CapsuleObject.cpp 21 Mar 2005 04:29:05 -0000 1.3 *************** *** 35,50 **** glMultMatrixf(mSolid->getTransform().getData()); glMultMatrixf(mOffset.getData()); ! glPushMatrix(); ! glTranslatef(0.0, 0.0, -mLength * (opal::real)0.5); ! gluCylinder(mQuadric, mRadius, mRadius, mLength, 20, 20); ! glPopMatrix(); ! glPushMatrix(); ! glTranslatef(0.0, 0.0, mLength * (opal::real)0.5); ! gluSphere(mQuadric, mRadius, 20, 20); ! glPopMatrix(); ! glPushMatrix(); ! glTranslatef(0.0, 0.0, -mLength * (opal::real)0.5); ! gluSphere(mQuadric, mRadius, 20, 20); ! glPopMatrix(); glPopMatrix(); } --- 35,39 ---- glMultMatrixf(mSolid->getTransform().getData()); glMultMatrixf(mOffset.getData()); ! DrawCapsule(mRadius, mLength); glPopMatrix(); } |