Changeset 3196 for code/trunk/src/orxonox/objects/Scene.cc
- Timestamp:
- Jun 20, 2009, 9:20:47 AM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/pch (added) merged: 3114-3118,3124-3125,3127-3131,3133,3138-3194
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/objects/Scene.cc
r3110 r3196 31 31 32 32 #include <OgreRoot.h> 33 #include <OgreSceneManager.h> 33 34 #include <OgreSceneManagerEnumerator.h> 34 35 #include <OgreSceneNode.h> 35 36 36 #include "BulletCollision/BroadphaseCollision/btAxisSweep3.h"37 #include "BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.h"38 #include "BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h"39 #include "BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h"37 #include <BulletCollision/BroadphaseCollision/btAxisSweep3.h> 38 #include <BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.h> 39 #include <BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h> 40 #include <BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h> 40 41 41 42 #include "core/CoreIncludes.h" … … 58 59 if (GameMode::showsGraphics()) 59 60 { 60 if (Ogre::Root::getSingletonPtr()) 61 { 62 this->sceneManager_ = Ogre::Root::getSingleton().createSceneManager(Ogre::ST_GENERIC); 63 this->rootSceneNode_ = this->sceneManager_->getRootSceneNode(); 64 } 65 else 66 { 67 this->sceneManager_ = 0; 68 this->rootSceneNode_ = 0; 69 } 61 assert(Ogre::Root::getSingletonPtr()); 62 this->sceneManager_ = Ogre::Root::getSingleton().createSceneManager(Ogre::ST_GENERIC); 63 this->rootSceneNode_ = this->sceneManager_->getRootSceneNode(); 70 64 } 71 65 else … … 94 88 if (this->isInitialized()) 95 89 { 96 if (Ogre::Root::getSingletonPtr()) 97 { 90 if (GameMode::showsGraphics()) 98 91 Ogre::Root::getSingleton().destroySceneManager(this->sceneManager_); 99 } 100 else if (!GameMode::showsGraphics()) 101 { 92 else 102 93 delete this->sceneManager_; 103 }104 94 105 95 this->setPhysicalWorld(false); … … 112 102 113 103 XMLPortParam(Scene, "skybox", setSkybox, getSkybox, xmlelement, mode); 114 XMLPortParam(Scene, "ambientlight", setAmbientLight, getAmbientLight, xmlelement, mode).defaultValues(ColourValue(0.2 , 0.2, 0.2, 1));104 XMLPortParam(Scene, "ambientlight", setAmbientLight, getAmbientLight, xmlelement, mode).defaultValues(ColourValue(0.2f, 0.2f, 0.2f, 1.0f)); 115 105 XMLPortParam(Scene, "shadow", setShadow, getShadow, xmlelement, mode).defaultValues(true); 116 106 … … 139 129 { 140 130 CCOUT(2) << "Warning: Setting the negative world range to a very small value: " 141 << omni_cast<std::string>(range) << std::endl;131 << multi_cast<std::string>(range) << std::endl; 142 132 } 143 133 if (this->hasPhysics()) … … 158 148 { 159 149 CCOUT(2) << "Warning: Setting the positive world range to a very small value: " 160 << omni_cast<std::string>(range) << std::endl;150 << multi_cast<std::string>(range) << std::endl; 161 151 } 162 152 if (this->hasPhysics()) … … 176 166 this->gravity_ = gravity; 177 167 if (this->hasPhysics()) 178 this->physicalWorld_->setGravity( omni_cast<btVector3>(this->gravity_));168 this->physicalWorld_->setGravity(multi_cast<btVector3>(this->gravity_)); 179 169 } 180 170 … … 187 177 // It would require further investigation to properly dertermine the right choices. 188 178 this->broadphase_ = new bt32BitAxisSweep3( 189 omni_cast<btVector3>(this->negativeWorldRange_), omni_cast<btVector3>(this->positiveWorldRange_));179 multi_cast<btVector3>(this->negativeWorldRange_), multi_cast<btVector3>(this->positiveWorldRange_)); 190 180 this->collisionConfig_ = new btDefaultCollisionConfiguration(); 191 181 this->dispatcher_ = new btCollisionDispatcher(this->collisionConfig_); … … 193 183 194 184 this->physicalWorld_ = new btDiscreteDynamicsWorld(this->dispatcher_, this->broadphase_, this->solver_, this->collisionConfig_); 195 this->physicalWorld_->setGravity( omni_cast<btVector3>(this->gravity_));185 this->physicalWorld_->setGravity(multi_cast<btVector3>(this->gravity_)); 196 186 197 187 // also set the collision callback variable.
Note: See TracChangeset
for help on using the changeset viewer.