Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 4, 2015, 9:12:21 PM (9 years ago)
Author:
landauf
Message:

merged branch core7 back to trunk

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/Scene.cc

    r10316 r10624  
    4444#include "core/GUIManager.h"
    4545#include "core/XMLPort.h"
    46 #include "core/command/ConsoleCommand.h"
     46#include "core/command/ConsoleCommandIncludes.h"
    4747#include "tools/BulletConversions.h"
    4848#include "tools/BulletDebugDrawer.h"
     
    6262        RegisterObject(Scene);
    6363
    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
    6566        this->bShadows_ = true;
    6667        this->bDebugDrawPhysics_ = false;
    6768        this->debugDrawer_ = NULL;
    6869        this->soundReferenceDistance_ = 20.0;
     70        this->bIsUpdatingPhysics_ = false;
    6971
    7072        if (GameMode::showsGraphics())
     
    141143        registerVariable(this->bHasPhysics_,        VariableDirection::ToClient, new NetworkCallback<Scene>(this, &Scene::networkcallback_hasPhysics));
    142144        registerVariable(this->bShadows_,           VariableDirection::ToClient, new NetworkCallback<Scene>(this, &Scene::networkcallback_applyShadows));
    143         registerVariable(this->getLevel(),          VariableDirection::ToClient, new NetworkCallback<Scene>(this, &Scene::changedLevel));
    144145    }
    145146
     
    266267            // Note: 60 means that Bullet will do physics correctly down to 1 frames per seconds.
    267268            //       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;
    269272
    270273            if (this->bDebugDrawPhysics_)
    271                 physicalWorld_->debugDrawWorld();
     274                this->physicalWorld_->debugDrawWorld();
    272275        }
    273276    }
     
    313316    {
    314317        this->objects_.push_back(object);
    315         object->setScene(this, this->getObjectID());
    316318    }
    317319
     
    363365    {
    364366        // get the WorldEntity pointers
    365         SmartPtr<WorldEntity> object0 = static_cast<WorldEntity*>(colObj0->getUserPointer());
    366         SmartPtr<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());
    367369
    368370        // get the CollisionShape pointers
Note: See TracChangeset for help on using the changeset viewer.