Changeset 10624 for code/trunk/src/orxonox/Scene.cc
- Timestamp:
- Oct 4, 2015, 9:12:21 PM (9 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
-
code/trunk/src/orxonox/Scene.cc
r10316 r10624 44 44 #include "core/GUIManager.h" 45 45 #include "core/XMLPort.h" 46 #include "core/command/ConsoleCommand .h"46 #include "core/command/ConsoleCommandIncludes.h" 47 47 #include "tools/BulletConversions.h" 48 48 #include "tools/BulletDebugDrawer.h" … … 62 62 RegisterObject(Scene); 63 63 64 this->setScene(SmartPtr<Scene>(this, false), OBJECTID_UNKNOWN); 64 this->setScene(WeakPtr<Scene>(this), this->getObjectID()); // store a weak-pointer to itself (a strong-pointer would create a recursive dependency) 65 65 66 this->bShadows_ = true; 66 67 this->bDebugDrawPhysics_ = false; 67 68 this->debugDrawer_ = NULL; 68 69 this->soundReferenceDistance_ = 20.0; 70 this->bIsUpdatingPhysics_ = false; 69 71 70 72 if (GameMode::showsGraphics()) … … 141 143 registerVariable(this->bHasPhysics_, VariableDirection::ToClient, new NetworkCallback<Scene>(this, &Scene::networkcallback_hasPhysics)); 142 144 registerVariable(this->bShadows_, VariableDirection::ToClient, new NetworkCallback<Scene>(this, &Scene::networkcallback_applyShadows)); 143 registerVariable(this->getLevel(), VariableDirection::ToClient, new NetworkCallback<Scene>(this, &Scene::changedLevel));144 145 } 145 146 … … 266 267 // Note: 60 means that Bullet will do physics correctly down to 1 frames per seconds. 267 268 // Under that mark, the simulation will "loose time" and get unusable. 268 physicalWorld_->stepSimulation(dt, 60); 269 this->bIsUpdatingPhysics_ = true; 270 this->physicalWorld_->stepSimulation(dt, 60); 271 this->bIsUpdatingPhysics_ = false; 269 272 270 273 if (this->bDebugDrawPhysics_) 271 physicalWorld_->debugDrawWorld();274 this->physicalWorld_->debugDrawWorld(); 272 275 } 273 276 } … … 313 316 { 314 317 this->objects_.push_back(object); 315 object->setScene(this, this->getObjectID());316 318 } 317 319 … … 363 365 { 364 366 // get the WorldEntity pointers 365 S martPtr<WorldEntity> object0 = static_cast<WorldEntity*>(colObj0->getUserPointer());366 S martPtr<WorldEntity> object1 = static_cast<WorldEntity*>(colObj1->getUserPointer());367 StrongPtr<WorldEntity> object0 = static_cast<WorldEntity*>(colObj0->getUserPointer()); 368 StrongPtr<WorldEntity> object1 = static_cast<WorldEntity*>(colObj1->getUserPointer()); 367 369 368 370 // get the CollisionShape pointers
Note: See TracChangeset
for help on using the changeset viewer.