Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 10, 2008, 12:05:03 AM (16 years ago)
Author:
landauf
Message:

merged revisions 2111-2170 from objecthierarchy branch back to trunk.

Location:
code/trunk
Files:
2 deleted
41 edited
2 copied

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/objects/CMakeLists.txt

    r2131 r2171  
    33  EventDispatcher.cc
    44  EventTarget.cc
     5  Level.cc
    56  Radar.cc
    67  RadarListener.cc
  • code/trunk/src/orxonox/objects/Scene.cc

    r2087 r2171  
    4343    CreateFactory(Scene);
    4444
    45     Scene::Scene(BaseObject* creator) : BaseObject(creator), network::Synchronisable(creator)
     45    Scene::Scene(BaseObject* creator) : BaseObject(creator), Synchronisable(creator)
    4646    {
    4747        RegisterObject(Scene);
     
    114114    void Scene::registerVariables()
    115115    {
    116         REGISTERSTRING(this->skybox_,     network::direction::toclient, new network::NetworkCallback<Scene>(this, &Scene::networkcallback_applySkybox));
    117         REGISTERDATA(this->ambientLight_, network::direction::toclient, new network::NetworkCallback<Scene>(this, &Scene::networkcallback_applyAmbientLight));
     116        REGISTERSTRING(this->skybox_,     direction::toclient, new NetworkCallback<Scene>(this, &Scene::networkcallback_applySkybox));
     117        REGISTERDATA(this->ambientLight_, direction::toclient, new NetworkCallback<Scene>(this, &Scene::networkcallback_applyAmbientLight));
    118118    }
    119119
     
    164164        return 0;
    165165    }
     166
     167    void Scene::tick(float dt)
     168    {
     169        if (!Core::showsGraphics())
     170        {
     171            // We need to update the scene nodes if we don't render
     172            this->rootSceneNode_->_update(true, false);
     173        }
     174    }
    166175}
  • code/trunk/src/orxonox/objects/Scene.h

    r2087 r2171  
    3535#include "core/BaseObject.h"
    3636#include "util/Math.h"
     37#include "objects/Tickable.h"
    3738
    3839namespace orxonox
    3940{
    40     class _OrxonoxExport Scene : public BaseObject, public network::Synchronisable
     41    class _OrxonoxExport Scene : public BaseObject, public Synchronisable, public Tickable
    4142    {
    4243        public:
     
    6465                { return this->bShadows_; }
    6566
     67            virtual void tick(float dt);
     68
    6669        private:
    6770            void addObject(BaseObject* object);
  • code/trunk/src/orxonox/objects/Test.cc

    r2087 r2171  
    3030#include "core/CoreIncludes.h"
    3131#include "core/ConfigValueIncludes.h"
     32#include "core/ConsoleCommand.h"
    3233#include "Test.h"
    3334
     
    3536{
    3637        CreateFactory ( Test );
     38 
     39  SetConsoleCommand(Test, printV1, true).accessLevel(AccessLevel::User);
     40  SetConsoleCommand(Test, printV2, true).accessLevel(AccessLevel::User);
     41  SetConsoleCommand(Test, printV3, true).accessLevel(AccessLevel::User);
     42  SetConsoleCommand(Test, printV4, true).accessLevel(AccessLevel::User);
     43 
     44  Test* Test::instance_ = 0;
    3745
    38         Test::Test(BaseObject* creator) : BaseObject(creator), network::Synchronisable(creator)
     46        Test::Test(BaseObject* creator) : BaseObject(creator), Synchronisable(creator)
    3947        {
     48    assert(instance_==0);
     49    instance_=this;
    4050                RegisterObject ( Test );
    41                 setConfigValues();
    42                 registerVariables();
     51    setConfigValues();
     52    registerVariables();
    4353                setObjectMode(0x3);
    4454        }
     
    4656        Test::~Test()
    4757        {
    48 
     58    instance_=0;
    4959        }
    5060
    5161        void Test::setConfigValues()
    5262        {
    53                 SetConfigValue ( v1, 1 ).callback ( this, &Test::checkV1 );
    54                 SetConfigValue ( v2, 2 ).callback ( this, &Test::checkV2 );
    55                 SetConfigValue ( v3, 3 ).callback ( this, &Test::checkV3 );
     63                SetConfigValue ( v1, 1 )/*.callback ( this, &Test::checkV1 )*/;
     64    SetConfigValue ( v2, 2 )/*.callback ( this, &Test::checkV2 )*/;
     65    SetConfigValue ( v3, 3 )/*.callback ( this, &Test::checkV3 )*/;
     66    SetConfigValue ( v4, 4 )/*.callback ( this, &Test::checkV4 )*/;
    5667        }
    5768
     
    5970        void Test::registerVariables()
    6071        {
    61                 REGISTERDATA ( v1,network::direction::toclient, new network::NetworkCallback<Test> ( this, &Test::checkV1 ) );
    62                 REGISTERDATA ( v2,network::direction::toserver, new network::NetworkCallback<Test> ( this, &Test::checkV2 ) );
    63                 REGISTERDATA ( v3,network::direction::bidirectional, new network::NetworkCallback<Test> ( this, &Test::checkV3 ) );
     72                REGISTERDATA ( v1,direction::toclient, new NetworkCallback<Test> ( this, &Test::checkV1 ) );
     73    REGISTERDATA ( v2,direction::toserver, new NetworkCallback<Test> ( this, &Test::checkV2 ) );
     74                REGISTERDATA ( v3,direction::serverMaster, new NetworkCallback<Test> ( this, &Test::checkV3 ) );
     75    REGISTERDATA ( v4,direction::clientMaster, new NetworkCallback<Test> ( this, &Test::checkV4 ) );
    6476        }
    6577
    66         void Test::checkV1(){
    67                 COUT(1) << "V1 changed: " << v1 << std::endl;
    68         }
     78  void Test::checkV1(){
     79    COUT(1) << "V1 changed: " << v1 << std::endl;
     80  }
    6981
    70         void Test::checkV2(){
    71                 COUT(1) << "V2 changed: " << v2 << std::endl;
    72         }
     82  void Test::checkV2(){
     83    COUT(1) << "V2 changed: " << v2 << std::endl;
     84  }
    7385
    74         void Test::checkV3(){
    75                 COUT(1) << "V3 changed: " << v3 << std::endl;
    76         }
     86  void Test::checkV3(){
     87    COUT(1) << "V3 changed: " << v3 << std::endl;
     88  }
     89 
     90  void Test::checkV4(){
     91    COUT(1) << "V4 changed: " << v4 << std::endl;
     92  }
    7793
    7894
  • code/trunk/src/orxonox/objects/Test.h

    r2087 r2171  
    3636namespace orxonox
    3737{
    38   class _OrxonoxExport Test: public BaseObject, public network::Synchronisable
     38  class _OrxonoxExport Test: public BaseObject, public Synchronisable
    3939  {
    4040    public:
     
    4848      void setV2(unsigned int value){ v2 = value; }
    4949      void setV3(unsigned int value){ v3 = value; }
     50      void setV4(unsigned int value){ v4 = value; }
    5051
    5152      void checkV1();
    5253      void checkV2();
    5354      void checkV3();
     55      void checkV4();
     56     
     57      void printV1(){ instance_->checkV1(); }
     58      void printV2(){ instance_->checkV2(); }
     59      void printV3(){ instance_->checkV3(); }
     60      void printV4(){ instance_->checkV4(); }
    5461
    5562    private:
     
    5764      unsigned int v2;
    5865      unsigned int v3;
     66      unsigned int v4;
     67     
     68      static Test* instance_;
    5969  };
    6070}
  • code/trunk/src/orxonox/objects/Tickable.h

    r1790 r2171  
    2828
    2929/*!
    30     @file Tickable.h
     30    @file
    3131    @brief Declaration of the Tickable interface.
    3232
  • code/trunk/src/orxonox/objects/gametypes/Gametype.cc

    r2087 r2171  
    6767        if (!this->bStarted_)
    6868            this->checkStart();
     69        else
     70            this->spawnDeadPlayersIfRequested();
    6971
    7072        this->assignDefaultPawnsIfNeeded();
    71         this->spawnDeadPlayersIfRequested();
    7273    }
    7374
     
    8889    void Gametype::playerEntered(PlayerInfo* player)
    8990    {
    90         this->players_.insert(player);
     91        this->players_[player] = PlayerState::Joined;
    9192
    9293        std::string message = player->getName() + " entered the game";
    9394        COUT(0) << message << std::endl;
    94         network::Host::Broadcast(message);
     95        Host::Broadcast(message);
    9596    }
    9697
    9798    void Gametype::playerLeft(PlayerInfo* player)
    9899    {
    99         std::set<PlayerInfo*>::iterator it = this->players_.find(player);
     100        std::map<PlayerInfo*, PlayerState::Enum>::iterator it = this->players_.find(player);
    100101        if (it != this->players_.end())
    101102        {
     
    104105            std::string message = player->getName() + " left the game";
    105106            COUT(0) << message << std::endl;
    106             network::Host::Broadcast(message);
     107            Host::Broadcast(message);
    107108        }
    108109    }
     
    124125                std::string message = player->getOldName() + " changed name to " + player->getName();
    125126                COUT(0) << message << std::endl;
    126                 network::Host::Broadcast(message);
     127                Host::Broadcast(message);
    127128            }
    128129        }
     
    165166    }
    166167
    167     void Gametype::assignDefaultPawnsIfNeeded() const
    168     {
    169         for (std::set<PlayerInfo*>::const_iterator it = this->players_.begin(); it != this->players_.end(); ++it)
    170         {
    171             if (!(*it)->getControllableEntity() && (!(*it)->isReadyToSpawn() || !this->bStarted_))
    172             {
    173                 SpawnPoint* spawn = this->getBestSpawnPoint(*it);
     168    void Gametype::assignDefaultPawnsIfNeeded()
     169    {
     170        for (std::map<PlayerInfo*, PlayerState::Enum>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
     171        {
     172            if (!it->first->getControllableEntity() && (!it->first->isReadyToSpawn() || !this->bStarted_))
     173            {
     174                SpawnPoint* spawn = this->getBestSpawnPoint(it->first);
    174175                if (spawn)
    175176                {
     
    177178                    ControllableEntity* entity = this->defaultControllableEntity_.fabricate(spawn);
    178179                    spawn->spawn(entity);
    179                     (*it)->startControl(entity);
     180                    it->first->startControl(entity);
     181                    it->second = PlayerState::Dead;
    180182                }
    181183                else
     
    210212                {
    211213                    bool allplayersready = true;
    212                     for (std::set<PlayerInfo*>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
     214                    for (std::map<PlayerInfo*, PlayerState::Enum>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
    213215                    {
    214                         if (!(*it)->isReadyToSpawn())
     216                        if (!it->first->isReadyToSpawn())
    215217                            allplayersready = false;
    216218                    }
     
    227229    void Gametype::spawnPlayersIfRequested()
    228230    {
    229         for (std::set<PlayerInfo*>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
    230             if ((*it)->isReadyToSpawn() || this->bForceSpawn_)
    231                 this->spawnPlayer(*it);
     231        for (std::map<PlayerInfo*, PlayerState::Enum>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
     232            if (it->first->isReadyToSpawn() || this->bForceSpawn_)
     233                this->spawnPlayer(it->first);
    232234    }
    233235
    234236    void Gametype::spawnDeadPlayersIfRequested()
    235237    {
    236         for (std::set<PlayerInfo*>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
    237             if (!(*it)->getControllableEntity())
    238                 if ((*it)->isReadyToSpawn() || this->bForceSpawn_)
    239                     this->spawnPlayer(*it);
     238        for (std::map<PlayerInfo*, PlayerState::Enum>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
     239            if (it->second == PlayerState::Dead)
     240                if (it->first->isReadyToSpawn() || this->bForceSpawn_)
     241                    this->spawnPlayer(it->first);
    240242    }
    241243
     
    246248        {
    247249            player->startControl(spawnpoint->spawn());
     250            this->players_[player] = PlayerState::Alive;
    248251        }
    249252        else
  • code/trunk/src/orxonox/objects/gametypes/Gametype.h

    r2087 r2171  
    4141namespace orxonox
    4242{
     43    namespace PlayerState
     44    {
     45        enum Enum
     46        {
     47            Uninitialized,
     48            Joined,
     49            Alive,
     50            Dead
     51        };
     52    }
     53
    4354    class _OrxonoxExport Gametype : public BaseObject, public Tickable
    4455    {
     
    7081            virtual void pawnPostSpawn(Pawn* pawn);
    7182
    72             inline const std::set<PlayerInfo*>& getPlayers() const
     83            inline const std::map<PlayerInfo*, PlayerState::Enum>& getPlayers() const
    7384                { return this->players_; }
    7485
     
    8798            void removePlayer(PlayerInfo* player);
    8899
    89             void assignDefaultPawnsIfNeeded() const;
     100            void assignDefaultPawnsIfNeeded();
    90101            void checkStart();
    91102            void spawnPlayer(PlayerInfo* player);
     
    102113            bool bStartCountdownRunning_;
    103114
    104             std::set<PlayerInfo*> players_;
     115            std::map<PlayerInfo*, PlayerState::Enum> players_;
    105116            std::set<SpawnPoint*> spawnpoints_;
    106117            SubclassIdentifier<ControllableEntity> defaultControllableEntity_;
  • code/trunk/src/orxonox/objects/infos/CMakeLists.txt

    r2131 r2171  
    11SET( SRC_FILES
    22  Info.cc
    3   Level.cc
    43  PlayerInfo.cc
    54  HumanPlayer.cc
  • code/trunk/src/orxonox/objects/infos/HumanPlayer.cc

    r2087 r2171  
    4646        RegisterObject(HumanPlayer);
    4747
    48         this->server_ready_ = Core::isMaster();
    49         this->client_ready_ = false;
     48        this->server_initialized_ = Core::isMaster();
     49        this->client_initialized_ = false;
    5050
    5151        this->bHumanPlayer_ = true;
     
    6767    void HumanPlayer::registerVariables()
    6868    {
    69         REGISTERSTRING(this->synchronize_nick_, network::direction::toserver, new network::NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_changednick));
     69        REGISTERSTRING(this->synchronize_nick_, direction::toserver, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_changednick));
    7070
    71         REGISTERDATA(this->clientID_,     network::direction::toclient, new network::NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_clientIDchanged));
    72         REGISTERDATA(this->server_ready_, network::direction::toclient, new network::NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_server_ready));
    73         REGISTERDATA(this->client_ready_, network::direction::toserver, new network::NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_client_ready));
     71        REGISTERDATA(this->clientID_,     direction::toclient, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_clientIDchanged));
     72        REGISTERDATA(this->server_initialized_, direction::toclient, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_server_initialized));
     73        REGISTERDATA(this->client_initialized_, direction::toserver, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_client_initialized));
    7474    }
    7575
     
    9292    void HumanPlayer::networkcallback_clientIDchanged()
    9393    {
    94         if (this->clientID_ == network::Host::getPlayerID())
     94        if (this->clientID_ == Host::getPlayerID())
    9595        {
    9696            this->bLocalPlayer_ = true;
    9797            this->synchronize_nick_ = this->nick_;
    98             this->client_ready_ = true;
     98            this->client_initialized_ = true;
    9999
    100100            if (!Core::isMaster())
    101                 this->setObjectMode(network::direction::bidirectional);
     101                this->setObjectMode(direction::bidirectional);
    102102            else
    103103                this->setName(this->nick_);
     
    107107    }
    108108
    109     void HumanPlayer::networkcallback_server_ready()
     109    void HumanPlayer::networkcallback_server_initialized()
    110110    {
    111         this->client_ready_ = true;
     111        this->client_initialized_ = true;
    112112    }
    113113
    114     void HumanPlayer::networkcallback_client_ready()
     114    void HumanPlayer::networkcallback_client_initialized()
    115115    {
    116116        if (this->getGametype())
     
    118118    }
    119119
    120     bool HumanPlayer::isReady() const
     120    bool HumanPlayer::isInitialized() const
    121121    {
    122         return (this->server_ready_ && this->client_ready_);
     122        return (this->server_initialized_ && this->client_initialized_);
    123123    }
    124124
    125125    float HumanPlayer::getPing() const
    126126    {
    127         return network::ClientInformation::findClient(this->getClientID())->getRTT();
     127        return ClientInformation::findClient(this->getClientID())->getRTT();
    128128    }
    129129
    130130    float HumanPlayer::getPacketLossRatio() const
    131131    {
    132         return network::ClientInformation::findClient(this->getClientID())->getPacketLoss();
     132        return ClientInformation::findClient(this->getClientID())->getPacketLoss();
    133133    }
    134134
  • code/trunk/src/orxonox/objects/infos/HumanPlayer.h

    r2087 r2171  
    4747            void setConfigValues();
    4848
    49             bool isReady() const;
     49            bool isInitialized() const;
    5050            float getPing() const;
    5151            float getPacketLossRatio() const;
     
    5757            void networkcallback_changednick();
    5858            void networkcallback_clientIDchanged();
    59             void networkcallback_server_ready();
    60             void networkcallback_client_ready();
     59            void networkcallback_server_initialized();
     60            void networkcallback_client_initialized();
    6161
    6262            std::string nick_;
    6363            std::string synchronize_nick_;
    64             bool server_ready_;
    65             bool client_ready_;
     64            bool server_initialized_;
     65            bool client_initialized_;
    6666    };
    6767}
  • code/trunk/src/orxonox/objects/infos/Info.cc

    r2087 r2171  
    3434namespace orxonox
    3535{
    36     Info::Info(BaseObject* creator) : BaseObject(creator), network::Synchronisable(creator)
     36    Info::Info(BaseObject* creator) : BaseObject(creator), Synchronisable(creator)
    3737    {
    3838        RegisterObject(Info);
  • code/trunk/src/orxonox/objects/infos/Info.h

    r2087 r2171  
    3737namespace orxonox
    3838{
    39     class _OrxonoxExport Info : public BaseObject, public network::Synchronisable
     39    class _OrxonoxExport Info : public BaseObject, public Synchronisable
    4040    {
    4141        public:
  • code/trunk/src/orxonox/objects/infos/PlayerInfo.cc

    r2087 r2171  
    4242        RegisterObject(PlayerInfo);
    4343
    44         this->clientID_ = network::CLIENTID_UNKNOWN;
     44        this->clientID_ = CLIENTID_UNKNOWN;
    4545        this->bHumanPlayer_ = false;
    4646        this->bLocalPlayer_ = false;
     
    4848        this->controller_ = 0;
    4949        this->controllableEntity_ = 0;
    50         this->controllableEntityID_ = network::CLIENTID_UNKNOWN;
     50        this->controllableEntityID_ = CLIENTID_UNKNOWN;
    5151
    5252        this->registerVariables();
     
    5555    PlayerInfo::~PlayerInfo()
    5656    {
    57         if (this->isInitialized())
     57        if (this->BaseObject::isInitialized())
    5858        {
    5959            this->stopControl(this->controllableEntity_);
     
    6969    void PlayerInfo::registerVariables()
    7070    {
    71         REGISTERSTRING(this->name_,                 network::direction::toclient, new network::NetworkCallback<PlayerInfo>(this, &PlayerInfo::changedName));
    72         REGISTERDATA  (this->controllableEntityID_, network::direction::toclient, new network::NetworkCallback<PlayerInfo>(this, &PlayerInfo::networkcallback_changedcontrollableentityID));
    73         REGISTERDATA  (this->bReadyToSpawn_,        network::direction::toserver);
     71        REGISTERSTRING(this->name_,                 direction::toclient, new NetworkCallback<PlayerInfo>(this, &PlayerInfo::changedName));
     72        REGISTERDATA  (this->controllableEntityID_, direction::toclient, new NetworkCallback<PlayerInfo>(this, &PlayerInfo::networkcallback_changedcontrollableentityID));
     73        REGISTERDATA  (this->bReadyToSpawn_,        direction::toserver);
    7474    }
    7575
    7676    void PlayerInfo::changedName()
    7777    {
    78         if (this->isReady() && this->getGametype())
     78        if (this->isInitialized() && this->getGametype())
    7979            this->getGametype()->playerChangedName(this);
    8080    }
     
    8282    void PlayerInfo::changedGametype()
    8383    {
    84         if (this->isReady())
     84        if (this->isInitialized())
    8585        {
    8686            if (this->getOldGametype())
     
    126126        else
    127127        {
    128             this->controllableEntityID_ = network::OBJECTID_UNKNOWN;
     128            this->controllableEntityID_ = OBJECTID_UNKNOWN;
    129129        }
    130130
     
    138138        {
    139139            this->controllableEntity_ = 0;
    140             this->controllableEntityID_ = network::OBJECTID_UNKNOWN;
     140            this->controllableEntityID_ = OBJECTID_UNKNOWN;
    141141
    142142            if (this->controller_)
     
    150150    void PlayerInfo::networkcallback_changedcontrollableentityID()
    151151    {
    152         if (this->controllableEntityID_ != network::OBJECTID_UNKNOWN)
     152        if (this->controllableEntityID_ != OBJECTID_UNKNOWN)
    153153        {
    154154            Synchronisable* temp = Synchronisable::getSynchronisable(this->controllableEntityID_);
  • code/trunk/src/orxonox/objects/infos/PlayerInfo.h

    r2087 r2171  
    5555            inline unsigned int getClientID() const
    5656                { return this->clientID_; }
    57             inline bool isReadyToSpawn() const
    58                 { return this->bReadyToSpawn_; }
    5957
    60             virtual bool isReady() const = 0;
     58            virtual bool isInitialized() const = 0;
    6159            virtual float getPing() const = 0;
    6260            virtual float getPacketLossRatio() const = 0;
     
    6462            inline void setReadyToSpawn(bool bReady)
    6563                { this->bReadyToSpawn_ = bReady; }
     64            inline bool isReadyToSpawn() const
     65                { return this->bReadyToSpawn_; }
    6666
    6767            void startControl(ControllableEntity* entity);
  • code/trunk/src/orxonox/objects/weaponSystem/WeaponSystem.h

  • code/trunk/src/orxonox/objects/worldentities/Backlight.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/worldentities/Backlight.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/worldentities/Billboard.cc

    r2087 r2171  
    6464    void Billboard::registerVariables()
    6565    {
    66         REGISTERSTRING(this->material_, network::direction::toclient, new network::NetworkCallback<Billboard>(this, &Billboard::changedMaterial));
    67         REGISTERDATA  (this->colour_,   network::direction::toclient, new network::NetworkCallback<Billboard>(this, &Billboard::changedColour));
     66        REGISTERSTRING(this->material_, direction::toclient, new NetworkCallback<Billboard>(this, &Billboard::changedMaterial));
     67        REGISTERDATA  (this->colour_,   direction::toclient, new NetworkCallback<Billboard>(this, &Billboard::changedColour));
    6868    }
    6969
     
    7575            {
    7676                this->billboard_.setBillboardSet(this->getScene()->getSceneManager(), this->material_, this->colour_, 1);
    77                 this->getNode()->attachObject(this->billboard_.getBillboardSet());
     77                if (this->billboard_.getBillboardSet())
     78                    this->getNode()->attachObject(this->billboard_.getBillboardSet());
    7879                this->billboard_.setVisible(this->isVisible());
    7980            }
     
    9091            {
    9192                this->billboard_.setBillboardSet(this->getScene()->getSceneManager(), this->material_, this->colour_, 1);
    92                 this->getNode()->attachObject(this->billboard_.getBillboardSet());
     93                if (this->billboard_.getBillboardSet())
     94                    this->getNode()->attachObject(this->billboard_.getBillboardSet());
    9395                this->billboard_.setVisible(this->isVisible());
    9496            }
  • code/trunk/src/orxonox/objects/worldentities/BlinkingBillboard.cc

    r2087 r2171  
    6868    void BlinkingBillboard::registerVariables()
    6969    {
    70 //        REGISTERDATA(this->amplitude_, network::direction::toclient);
    71 //        REGISTERDATA(this->frequency_, network::direction::toclient);
    72 //        REGISTERDATA(this->phase_,     network::direction::toclient);
     70//        REGISTERDATA(this->amplitude_, direction::toclient);
     71//        REGISTERDATA(this->frequency_, direction::toclient);
     72//        REGISTERDATA(this->phase_,     direction::toclient);
    7373    }
    7474
  • code/trunk/src/orxonox/objects/worldentities/Camera.cc

    r2103 r2171  
    3838#include <OgreViewport.h>
    3939
     40#include "util/Exception.h"
    4041#include "core/CoreIncludes.h"
    4142#include "core/ConfigValueIncludes.h"
     
    5152        RegisterObject(Camera);
    5253
    53         assert(this->getScene());
    54         assert(this->getScene()->getSceneManager());
     54        if (!this->getScene() || !this->getScene()->getSceneManager())
     55            ThrowException(AbortLoading, "Can't create Camera, no scene or no scene manager given.");
    5556
    5657        this->camera_ = this->getScene()->getSceneManager()->createCamera(getUniqueNumberString());
  • code/trunk/src/orxonox/objects/worldentities/Camera.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/worldentities/ControllableEntity.cc

    r2087 r2171  
    5252        this->client_overwrite_ = 0;
    5353        this->player_ = 0;
    54         this->playerID_ = network::OBJECTID_UNKNOWN;
     54        this->playerID_ = OBJECTID_UNKNOWN;
    5555        this->hud_ = 0;
    5656        this->camera_ = 0;
     
    165165                this->client_overwrite_ = this->server_overwrite_;
    166166COUT(0) << "CE: bidirectional synchronization" << std::endl;
    167                 this->setObjectMode(network::direction::bidirectional);
     167                this->setObjectMode(direction::bidirectional);
    168168            }
    169169        }
     
    176176
    177177        this->player_ = 0;
    178         this->playerID_ = network::OBJECTID_UNKNOWN;
     178        this->playerID_ = OBJECTID_UNKNOWN;
    179179        this->bControlled_ = false;
    180         this->setObjectMode(network::direction::toclient);
     180        this->setObjectMode(direction::toclient);
    181181
    182182        if (this->bDestroyWhenPlayerLeft_)
     
    187187    {
    188188        // just do this in case the entity wasn't yet synchronized when the corresponding PlayerInfo got our objectID
    189         if (this->playerID_ != network::OBJECTID_UNKNOWN)
    190         {
    191             this->player_ = dynamic_cast<PlayerInfo*>(network::Synchronisable::getSynchronisable(this->playerID_));
     189        if (this->playerID_ != OBJECTID_UNKNOWN)
     190        {
     191            this->player_ = dynamic_cast<PlayerInfo*>(Synchronisable::getSynchronisable(this->playerID_));
    192192            if (this->player_ && (this->player_->getControllableEntity() != this))
    193193                this->player_->startControl(this);
     
    248248    void ControllableEntity::registerVariables()
    249249    {
    250         REGISTERSTRING(this->cameraPositionTemplate_, network::direction::toclient);
    251 
    252         REGISTERDATA(this->server_position_,    network::direction::toclient, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerPosition));
    253         REGISTERDATA(this->server_velocity_,    network::direction::toclient, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerVelocity));
    254         REGISTERDATA(this->server_orientation_, network::direction::toclient, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerOrientation));
    255 
    256         REGISTERDATA(this->server_overwrite_,   network::direction::toclient, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::processOverwrite));
    257         REGISTERDATA(this->client_overwrite_,   network::direction::toserver);
    258 
    259         REGISTERDATA(this->client_position_,    network::direction::toserver, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientPosition));
    260         REGISTERDATA(this->client_velocity_,    network::direction::toserver, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientVelocity));
    261         REGISTERDATA(this->client_orientation_, network::direction::toserver, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientOrientation));
    262 
    263 
    264         REGISTERDATA(this->playerID_, network::direction::toclient, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::networkcallback_changedplayerID));
     250        REGISTERSTRING(this->cameraPositionTemplate_, direction::toclient);
     251
     252        REGISTERDATA(this->client_overwrite_,   direction::toserver);
     253       
     254        REGISTERDATA(this->server_position_,    direction::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerPosition));
     255        REGISTERDATA(this->server_velocity_,    direction::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerVelocity));
     256        REGISTERDATA(this->server_orientation_, direction::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerOrientation));
     257        REGISTERDATA(this->server_overwrite_,   direction::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processOverwrite));
     258
     259        REGISTERDATA(this->client_position_,    direction::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientPosition));
     260        REGISTERDATA(this->client_velocity_,    direction::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientVelocity));
     261        REGISTERDATA(this->client_orientation_, direction::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientOrientation));
     262
     263
     264        REGISTERDATA(this->playerID_, direction::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::networkcallback_changedplayerID));
    265265    }
    266266
  • code/trunk/src/orxonox/objects/worldentities/Light.cc

    r2087 r2171  
    7979    void Light::registerVariables()
    8080    {
    81         REGISTERDATA(this->type_, network::direction::toclient, new network::NetworkCallback<Light>(this, &Light::changedType));
    82         REGISTERDATA(this->light_->getDiffuseColour(), network::direction::toclient);
    83         REGISTERDATA(this->light_->getSpecularColour(), network::direction::toclient);
    84         REGISTERDATA(this->light_->getDirection(), network::direction::toclient);
     81        REGISTERDATA(this->type_, direction::toclient, new NetworkCallback<Light>(this, &Light::changedType));
     82        REGISTERDATA(this->light_->getDiffuseColour(), direction::toclient);
     83        REGISTERDATA(this->light_->getSpecularColour(), direction::toclient);
     84        REGISTERDATA(this->light_->getDirection(), direction::toclient);
    8585    }
    8686
  • code/trunk/src/orxonox/objects/worldentities/Model.cc

    r2087 r2171  
    6161    void Model::registerVariables()
    6262    {
    63         REGISTERSTRING(this->meshSrc_,    network::direction::toclient, new network::NetworkCallback<Model>(this, &Model::changedMesh));
    64         REGISTERDATA(this->bCastShadows_, network::direction::toclient, new network::NetworkCallback<Model>(this, &Model::changedShadows));
     63        REGISTERSTRING(this->meshSrc_,    direction::toclient, new NetworkCallback<Model>(this, &Model::changedMesh));
     64        REGISTERDATA(this->bCastShadows_, direction::toclient, new NetworkCallback<Model>(this, &Model::changedShadows));
    6565    }
    6666
  • code/trunk/src/orxonox/objects/worldentities/MovableEntity.cc

    r2087 r2171  
    8484    void MovableEntity::registerVariables()
    8585    {
    86         REGISTERDATA(this->velocity_.x, network::direction::toclient);
    87         REGISTERDATA(this->velocity_.y, network::direction::toclient);
    88         REGISTERDATA(this->velocity_.z, network::direction::toclient);
     86        REGISTERDATA(this->velocity_.x, direction::toclient);
     87        REGISTERDATA(this->velocity_.y, direction::toclient);
     88        REGISTERDATA(this->velocity_.z, direction::toclient);
    8989
    90         REGISTERDATA(this->rotationAxis_.x, network::direction::toclient);
    91         REGISTERDATA(this->rotationAxis_.y, network::direction::toclient);
    92         REGISTERDATA(this->rotationAxis_.z, network::direction::toclient);
     90        REGISTERDATA(this->rotationAxis_.x, direction::toclient);
     91        REGISTERDATA(this->rotationAxis_.y, direction::toclient);
     92        REGISTERDATA(this->rotationAxis_.z, direction::toclient);
    9393
    94         REGISTERDATA(this->rotationRate_, network::direction::toclient);
     94        REGISTERDATA(this->rotationRate_, direction::toclient);
    9595
    96         REGISTERDATA(this->overwrite_position_,    network::direction::toclient, new network::NetworkCallback<MovableEntity>(this, &MovableEntity::overwritePosition));
    97         REGISTERDATA(this->overwrite_orientation_, network::direction::toclient, new network::NetworkCallback<MovableEntity>(this, &MovableEntity::overwriteOrientation));
     96        REGISTERDATA(this->overwrite_position_,    direction::toclient, new NetworkCallback<MovableEntity>(this, &MovableEntity::overwritePosition));
     97        REGISTERDATA(this->overwrite_orientation_, direction::toclient, new NetworkCallback<MovableEntity>(this, &MovableEntity::overwriteOrientation));
    9898    }
    9999
  • code/trunk/src/orxonox/objects/worldentities/MovableEntity.h

    r2087 r2171  
    3838namespace orxonox
    3939{
    40     class _OrxonoxExport MovableEntity : public WorldEntity, public Tickable, public network::ClientConnectionListener
     40    class _OrxonoxExport MovableEntity : public WorldEntity, public Tickable, public ClientConnectionListener
    4141    {
    4242        public:
  • code/trunk/src/orxonox/objects/worldentities/ParticleEmitter.cc

    r2087 r2171  
    2828
    2929/**
    30 * @file ParticleInterface.cc
     30* @file
    3131* @brief class to control praticle effects
    3232*/
     
    3737
    3838#include "tools/ParticleInterface.h"
     39#include "util/Exception.h"
    3940#include "core/CoreIncludes.h"
    4041#include "core/XMLPort.h"
     
    4950        RegisterObject(ParticleEmitter);
    5051
    51         assert(this->getScene());
    52         assert(this->getScene()->getSceneManager());
     52        if (!this->getScene() || !this->getScene()->getSceneManager())
     53            ThrowException(AbortLoading, "Can't create Camera, no scene or no scene manager given.");
    5354
    5455        this->particles_ = 0;
     
    7475    void ParticleEmitter::registerVariables()
    7576    {
    76         REGISTERSTRING(this->source_, network::direction::toclient, new network::NetworkCallback<ParticleEmitter>(this, &ParticleEmitter::sourceChanged));
    77         REGISTERDATA  (this->LOD_,    network::direction::toclient, new network::NetworkCallback<ParticleEmitter>(this, &ParticleEmitter::LODchanged));
     77        REGISTERSTRING(this->source_, direction::toclient, new NetworkCallback<ParticleEmitter>(this, &ParticleEmitter::sourceChanged));
     78        REGISTERDATA  (this->LOD_,    direction::toclient, new NetworkCallback<ParticleEmitter>(this, &ParticleEmitter::LODchanged));
    7879    }
    7980
  • code/trunk/src/orxonox/objects/worldentities/ParticleSpawner.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/worldentities/ParticleSpawner.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/worldentities/PositionableEntity.cc

    r2087 r2171  
    4848    void PositionableEntity::registerVariables()
    4949    {
    50         REGISTERDATA(this->getPosition().x, network::direction::toclient);
    51         REGISTERDATA(this->getPosition().y, network::direction::toclient);
    52         REGISTERDATA(this->getPosition().z, network::direction::toclient);
     50        REGISTERDATA(this->getPosition().x, direction::toclient);
     51        REGISTERDATA(this->getPosition().y, direction::toclient);
     52        REGISTERDATA(this->getPosition().z, direction::toclient);
    5353
    54         REGISTERDATA(this->getOrientation().w, network::direction::toclient);
    55         REGISTERDATA(this->getOrientation().x, network::direction::toclient);
    56         REGISTERDATA(this->getOrientation().y, network::direction::toclient);
    57         REGISTERDATA(this->getOrientation().z, network::direction::toclient);
     54        REGISTERDATA(this->getOrientation().w, direction::toclient);
     55        REGISTERDATA(this->getOrientation().x, direction::toclient);
     56        REGISTERDATA(this->getOrientation().y, direction::toclient);
     57        REGISTERDATA(this->getOrientation().z, direction::toclient);
    5858    }
    5959}
  • code/trunk/src/orxonox/objects/worldentities/WorldEntity.cc

    r2087 r2171  
    3636#include "core/XMLPort.h"
    3737#include "util/Convert.h"
     38#include "util/Exception.h"
    3839
    3940#include "objects/Scene.h"
     
    4849    const Vector3 WorldEntity::UP    = Vector3::UNIT_Y;
    4950
    50     WorldEntity::WorldEntity(BaseObject* creator) : BaseObject(creator), network::Synchronisable(creator)
     51    WorldEntity::WorldEntity(BaseObject* creator) : BaseObject(creator), Synchronisable(creator)
    5152    {
    5253        RegisterObject(WorldEntity);
    5354
    54         assert(this->getScene());
    55         assert(this->getScene()->getRootSceneNode());
     55        if (!this->getScene() || !this->getScene()->getRootSceneNode())
     56            ThrowException(AbortLoading, "Can't create WorldEntity, no scene or no root-scenenode given.");
    5657
    5758        this->node_ = this->getScene()->getRootSceneNode()->createChildSceneNode();
    5859
    5960        this->parent_ = 0;
    60         this->parentID_ = (unsigned int)-1;
     61        this->parentID_ = OBJECTID_UNKNOWN;
    6162
    6263        this->node_->setPosition(Vector3::ZERO);
     
    9596    void WorldEntity::registerVariables()
    9697    {
    97         REGISTERDATA(this->bActive_,  network::direction::toclient, new network::NetworkCallback<WorldEntity>(this, &WorldEntity::changedActivity));
    98         REGISTERDATA(this->bVisible_, network::direction::toclient, new network::NetworkCallback<WorldEntity>(this, &WorldEntity::changedVisibility));
     98        REGISTERDATA(this->bActive_,  direction::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedActivity));
     99        REGISTERDATA(this->bVisible_, direction::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedVisibility));
    99100
    100         REGISTERDATA(this->getScale3D().x, network::direction::toclient);
    101         REGISTERDATA(this->getScale3D().y, network::direction::toclient);
    102         REGISTERDATA(this->getScale3D().z, network::direction::toclient);
     101        REGISTERDATA(this->getScale3D().x, direction::toclient);
     102        REGISTERDATA(this->getScale3D().y, direction::toclient);
     103        REGISTERDATA(this->getScale3D().z, direction::toclient);
    103104
    104         REGISTERDATA(this->parentID_, network::direction::toclient, new network::NetworkCallback<WorldEntity>(this, &WorldEntity::updateParent));
     105        REGISTERDATA(this->parentID_, direction::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::updateParent));
    105106    }
    106107
    107108    void WorldEntity::updateParent()
    108109    {
    109         WorldEntity* parent = dynamic_cast<WorldEntity*>(Synchronisable::getSynchronisable(this->parentID_));
    110         if (parent)
    111             this->attachToParent(parent);
     110        if (this->parentID_ != OBJECTID_UNKNOWN)
     111        {
     112            WorldEntity* parent = dynamic_cast<WorldEntity*>(Synchronisable::getSynchronisable(this->parentID_));
     113            if (parent)
     114                this->attachToParent(parent);
     115        }
    112116    }
    113117
     
    134138        this->children_.erase(object);
    135139        object->parent_ = 0;
    136         object->parentID_ = (unsigned int)-1;
     140        object->parentID_ = OBJECTID_UNKNOWN;
    137141
    138142//        this->getScene()->getRootSceneNode()->addChild(object->node_);
  • code/trunk/src/orxonox/objects/worldentities/WorldEntity.h

    r2087 r2171  
    4242namespace orxonox
    4343{
    44     class _OrxonoxExport WorldEntity : public BaseObject, public network::Synchronisable
     44    class _OrxonoxExport WorldEntity : public BaseObject, public Synchronisable
    4545    {
    4646        public:
  • code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.cc

    r2106 r2171  
    8080    void Pawn::registerVariables()
    8181    {
    82         REGISTERDATA(this->bAlive_, network::direction::toclient);
    83         REGISTERDATA(this->health_, network::direction::toclient);
     82        REGISTERDATA(this->bAlive_, direction::toclient);
     83        REGISTERDATA(this->health_, direction::toclient);
    8484    }
    8585
  • code/trunk/src/orxonox/objects/worldentities/pawns/SpaceShip.cc

    r2087 r2171  
    8282    void SpaceShip::registerVariables()
    8383    {
    84         REGISTERDATA(this->maxSpeed_,                network::direction::toclient);
    85         REGISTERDATA(this->maxSecondarySpeed_,       network::direction::toclient);
    86         REGISTERDATA(this->maxRotation_,             network::direction::toclient);
    87         REGISTERDATA(this->translationAcceleration_, network::direction::toclient);
    88         REGISTERDATA(this->rotationAcceleration_,    network::direction::toclient);
    89         REGISTERDATA(this->translationDamping_,      network::direction::toclient);
     84        REGISTERDATA(this->maxSpeed_,                direction::toclient);
     85        REGISTERDATA(this->maxSecondarySpeed_,       direction::toclient);
     86        REGISTERDATA(this->maxRotation_,             direction::toclient);
     87        REGISTERDATA(this->translationAcceleration_, direction::toclient);
     88        REGISTERDATA(this->rotationAcceleration_,    direction::toclient);
     89        REGISTERDATA(this->translationDamping_,      direction::toclient);
    9090    }
    9191
  • code/trunk/src/orxonox/objects/worldentities/pawns/Spectator.cc

    r2087 r2171  
    6262        this->greetingFlare_ = new BillboardSet();
    6363        this->greetingFlare_->setBillboardSet(this->getScene()->getSceneManager(), "Examples/Flare", ColourValue(1.0, 1.0, 0.8), Vector3(0, 20, 0), 1);
    64         this->getNode()->attachObject(this->greetingFlare_->getBillboardSet());
     64        if (this->greetingFlare_->getBillboardSet())
     65            this->getNode()->attachObject(this->greetingFlare_->getBillboardSet());
    6566        this->greetingFlare_->setVisible(false);
    6667        this->bGreetingFlareVisible_ = false;
     
    7677            if (this->greetingFlare_)
    7778            {
    78                 this->getNode()->detachObject(this->greetingFlare_->getBillboardSet());
     79                if (this->greetingFlare_->getBillboardSet())
     80                    this->getNode()->detachObject(this->greetingFlare_->getBillboardSet());
    7981                delete this->greetingFlare_;
    8082            }
     
    8486    void Spectator::registerVariables()
    8587    {
    86         REGISTERDATA(this->bGreetingFlareVisible_, network::direction::toclient, new network::NetworkCallback<Spectator>(this, &Spectator::changedFlareVisibility));
    87         REGISTERDATA(this->bGreeting_,             network::direction::toserver, new network::NetworkCallback<Spectator>(this, &Spectator::changedGreeting));
    88         REGISTERDATA(this->hudmode_,               network::direction::toclient);
     88        REGISTERDATA(this->bGreetingFlareVisible_, direction::toclient, new NetworkCallback<Spectator>(this, &Spectator::changedFlareVisibility));
     89        REGISTERDATA(this->bGreeting_,             direction::toserver, new NetworkCallback<Spectator>(this, &Spectator::changedGreeting));
     90        REGISTERDATA(this->hudmode_,               direction::toclient);
    8991    }
    9092
     
    129131        ControllableEntity::setPlayer(player);
    130132
    131 //        this->setObjectMode(network::direction::toclient);
     133//        this->setObjectMode(direction::toclient);
    132134    }
    133135
     
    203205                {
    204206                    if (this->getGametype()->isStartCountdownRunning())
    205                         this->hudmode_ = 2 + 10*ceil(this->getGametype()->getStartCountdown());
     207                        this->hudmode_ = 2 + 10*(int)ceil(this->getGametype()->getStartCountdown());
    206208                    else
    207209                        this->hudmode_ = 3;
  • code/trunk/src/orxonox/objects/worldentities/triggers/DistanceTrigger.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/worldentities/triggers/DistanceTrigger.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/worldentities/triggers/Trigger.cc

    r2103 r2171  
    6969      this->debugBillboard_.setBillboardSet(this->getScene()->getSceneManager(), "Examples/Flare", ColourValue(1.0, 0.0, 0.0), 1);
    7070      this->debugBillboard_.setVisible(false);
    71     }
    72 
    73     this->getNode()->attachObject(this->debugBillboard_.getBillboardSet());
     71
     72      if (this->debugBillboard_.getBillboardSet())
     73        this->getNode()->attachObject(this->debugBillboard_.getBillboardSet());
     74    }
     75
    7476    this->setObjectMode(0x0);
    7577  }
     
    310312  void Trigger::setBillboardColour(const ColourValue& colour)
    311313  {
    312     this->debugBillboard_.getBillboardSet()->getBillboard(0)->setColour(colour);
     314    this->debugBillboard_.setColour(colour);
    313315  }
    314316
  • code/trunk/src/orxonox/objects/worldentities/triggers/Trigger.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
Note: See TracChangeset for help on using the changeset viewer.