[Opal-commits] opal/samples/src BaseOpalApp.h,1.8,1.9 PhysicalEntity.h,1.2,1.3
Status: Inactive
Brought to you by:
tylerstreeter
|
From: tylerstreeter <tyl...@us...> - 2005-04-25 19:47:50
|
Update of /cvsroot/opal/opal/samples/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4730/samples/src Modified Files: BaseOpalApp.h PhysicalEntity.h Log Message: minor changes Index: BaseOpalApp.h =================================================================== RCS file: /cvsroot/opal/opal/samples/src/BaseOpalApp.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** BaseOpalApp.h 20 Apr 2005 03:59:35 -0000 1.8 --- BaseOpalApp.h 25 Apr 2005 19:47:38 -0000 1.9 *************** *** 109,119 **** // Simulate physics. mSimulator->simulate(dt); - } ! // Update the PhysicalEntities. ! size_t size = mPhysicalEntityList.size(); ! for(size_t i = 0; i<size; ++i) ! { ! mPhysicalEntityList.at(i)->update(dt); } --- 109,119 ---- // Simulate physics. mSimulator->simulate(dt); ! // Update the PhysicalEntities. ! size_t size = mPhysicalEntityList.size(); ! for(size_t i = 0; i<size; ++i) ! { ! mPhysicalEntityList.at(i)->update(dt); ! } } Index: PhysicalEntity.h =================================================================== RCS file: /cvsroot/opal/opal/samples/src/PhysicalEntity.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PhysicalEntity.h 20 Apr 2005 03:59:35 -0000 1.2 --- PhysicalEntity.h 25 Apr 2005 19:47:40 -0000 1.3 *************** *** 44,47 **** --- 44,52 ---- mSceneNode = node; mSolid = s; + + if (mSolid && mSceneNode) + { + updateOgreSceneNode(); + } } *************** *** 52,64 **** } ! /// Updates the Ogre SceneNode transform from the OPAL ! /// Solid's transform. virtual void update(opal::real dt) { ! if (NULL == mSolid || NULL == mSceneNode) { return; } opal::Point3r pos = mSolid->getPosition(); opal::Quaternion quat = mSolid->getQuaternion(); --- 57,75 ---- } ! /// Updates the PhysicalEntity. virtual void update(opal::real dt) { ! if (NULL == mSolid || NULL == mSceneNode || mSolid->isSleeping()) { return; } + updateOgreSceneNode(); + } + + /// Updates the Ogre SceneNode transform from the OPAL + /// Solid's transform. + virtual void updateOgreSceneNode() + { opal::Point3r pos = mSolid->getPosition(); opal::Quaternion quat = mSolid->getQuaternion(); |