Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 9, 2008, 4:25:52 AM (16 years ago)
Author:
landauf
Message:

merged core3 back to trunk

Location:
code/trunk
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/objects/Ambient.cc

    r1625 r1747  
    3939#include "util/Convert.h"
    4040#include "util/Math.h"
    41 #include "core/Debug.h"
     41#include "util/Debug.h"
    4242#include "core/CoreIncludes.h"
    43 #include "GraphicsEngine.h"
    4443#include "core/XMLPort.h"
    4544#include "core/ConsoleCommand.h"
     45#include "GraphicsEngine.h"
    4646
    4747namespace orxonox
    4848{
    49     SetConsoleCommand(Ambient, setAmbientLightTest, false).setDefaultValues(ColourValue(1, 1, 1, 1)).setAccessLevel(AccessLevel::Offline);
     49    SetConsoleCommandAlias(Ambient, setAmbientLightTest, "setAmbientLight", false).defaultValues(ColourValue(1, 1, 1, 1)).accessLevel(AccessLevel::Offline);
    5050
    5151    CreateFactory(Ambient);
     
    6464    }
    6565
    66     bool Ambient::create(){
    67       GraphicsEngine::getSingleton().getSceneManager()->setAmbientLight(ambientLight_);
    68       return Synchronisable::create();
     66    bool Ambient::create()
     67    {
     68        GraphicsEngine::getSingleton().getSceneManager()->setAmbientLight(ambientLight_);
     69        return Synchronisable::create();
    6970    }
    70    
    71     void Ambient::registerAllVariables(){
    72       registerVar(&ambientLight_, sizeof(ColourValue), network::DATA);
    73      
     71
     72    void Ambient::registerAllVariables()
     73    {
     74        registerVar(&ambientLight_, sizeof(ColourValue), network::DATA);
    7475    }
    7576
    7677    void Ambient::setAmbientLight(const ColourValue& colour)
    7778    {
    78             GraphicsEngine::getSingleton().getSceneManager()->setAmbientLight(colour);
    79       ambientLight_=colour;     
     79        GraphicsEngine::getSingleton().getSceneManager()->setAmbientLight(colour);
     80        ambientLight_=colour;
    8081    }
    8182
     
    8889    void Ambient::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    8990    {
    90         BaseObject::XMLPort(xmlelement, mode);
     91        SUPER(Ambient, XMLPort, xmlelement, mode);
    9192
    92         XMLPortParamLoadOnly(Ambient, "colourvalue", setAmbientLight, xmlelement, mode);
     93        XMLPortParam(Ambient, "colourvalue", setAmbientLight, getAmbienetLight, xmlelement, mode);
    9394        create();
    9495    }
  • code/trunk/src/orxonox/objects/Ambient.h

    r1735 r1747  
    4545
    4646            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    47             void setAmbientLight(const ColourValue& colour);
    4847            virtual bool create();
    4948            void registerAllVariables();
     49
     50            void setAmbientLight(const ColourValue& colour);
     51            inline const ColourValue& getAmbienetLight() const
     52                { return this->ambientLight_; }
    5053
    5154            static void setAmbientLightTest(const ColourValue& colour)
  • code/trunk/src/orxonox/objects/Backlight.cc

    r1608 r1747  
    103103    void Backlight::tick(float dt)
    104104    {
    105         WorldEntity::tick(dt);
     105        SUPER(Backlight, tick, dt);
    106106
    107107        if (this->isActive())
     
    147147    void Backlight::changedVisibility()
    148148    {
    149         WorldEntity::changedVisibility();
     149        SUPER(Backlight, changedVisibility);
    150150
    151151        this->billboard_.setVisible(this->isVisible());
  • code/trunk/src/orxonox/objects/BillboardProjectile.cc

    r1559 r1747  
    6363    void BillboardProjectile::changedVisibility()
    6464    {
    65         Projectile::changedVisibility();
     65        SUPER(BillboardProjectile, changedVisibility);
    6666        this->billboard_.setVisible(this->isVisible());
    6767    }
  • code/trunk/src/orxonox/objects/Camera.cc

    r1505 r1747  
    4242#include "util/Convert.h"
    4343#include "util/Math.h"
    44 #include "core/Debug.h"
     44#include "util/Debug.h"
    4545#include "core/CoreIncludes.h"
    4646#include "GraphicsEngine.h"
  • code/trunk/src/orxonox/objects/Model.cc

    r1627 r1747  
    6565    void Model::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    6666    {
    67         WorldEntity::XMLPort(xmlelement, mode);
     67        SUPER(Model, XMLPort, xmlelement, mode);
    6868
    69         XMLPortParamLoadOnly(Model, "mesh", setMesh, xmlelement, mode);
     69        XMLPortParam(Model, "mesh", setMesh, getMesh, xmlelement, mode);
    7070
    7171        Model::create();
    72     }
    73 
    74     void Model::setMesh(const std::string& meshname)
    75     {
    76         this->meshSrc_ = meshname;
    7772    }
    7873
     
    9893    void Model::changedVisibility()
    9994    {
    100         WorldEntity::changedVisibility();
     95        SUPER(Model, changedVisibility);
    10196        if (this->isInitialized())
    10297            this->mesh_.setVisible(this->isVisible());
  • code/trunk/src/orxonox/objects/Model.h

    r1558 r1747  
    4545            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    4646            virtual void changedVisibility();
    47             void setMesh(const std::string& meshname);
     47            inline void setMesh(const std::string& meshname)
     48                { this->meshSrc_ = meshname; }
     49            inline const std::string& getMesh() const
     50                { return this->meshSrc_; }
    4851            virtual bool create();
    4952
  • code/trunk/src/orxonox/objects/NPC.cc

    r1625 r1747  
    3131
    3232#include "core/CoreIncludes.h"
     33#include "core/Iterator.h"
    3334
    3435namespace orxonox {
     
    5657    movable_ = movable;
    5758  }
    58  
     59
    5960  void NPC::registerAllVariables(){
    6061    Model::registerAllVariables();
    6162    registerVar(&movable_, sizeof(movable_), network::DATA);
    6263  }
    63  
     64
    6465
    6566  /**
     
    112113    int numberOfNeighbour = 0;  //number of observed neighbours
    113114    float distance = 0;  // distance to the actual element
    114     for(Iterator<WorldEntity> it = ObjectList<WorldEntity>::start(); it; ++it) {  //go through all elements
     115    for(ObjectList<WorldEntity>::iterator it = ObjectList<WorldEntity>::begin(); it; ++it) {  //go through all elements
    115116      distance = getDistance(*it);  //get distance between this and actual
    116117      if ((distance > 0) && (distance < SEPERATIONDISTANCE)) {  //do only if actual is inside detectionradius
     
    139140    //float distance = 0;
    140141    //go through all elements
    141     for(Iterator<NPC> it = ObjectList<NPC>::start(); it; ++it) {  //just working with 3 elements at the moment
     142    for(ObjectList<NPC>::iterator it = ObjectList<NPC>::begin(); it; ++it) {  //just working with 3 elements at the moment
    142143      float distance = getDistance(*it);  //get distance between this and actual
    143144      if ((distance > 0) && (distance < ALIGNMENTDISTANCE)) {  //check if actual element is inside detectionradius
     
    159160    //float distance = 0;
    160161    //go through all elements
    161     for(Iterator<NPC> it = ObjectList<NPC>::start(); it; ++it) {  //just working with 3 elements at the moment
     162    for(ObjectList<NPC>::iterator it = ObjectList<NPC>::begin(); it; ++it) {  //just working with 3 elements at the moment
    162163      float distance = getDistance(*it);  //get distance between this and actual
    163164      if ((distance > 0) && (distance < COHESIONDISTANCE)) {  //check if actual element is inside detectionradius
  • code/trunk/src/orxonox/objects/NPC.h

    r1625 r1747  
    4848      NPC();
    4949      virtual ~NPC();
    50       void tick(float dt);
     50      virtual void tick(float dt);
    5151      void update();
    5252      void setValues(Vector3 location, Vector3 speed, Vector3 acceleration, bool movable);
  • code/trunk/src/orxonox/objects/ParticleProjectile.cc

    r1563 r1747  
    3232#include "SpaceShip.h"
    3333#include "core/CoreIncludes.h"
     34#include "core/ConfigValueIncludes.h"
    3435
    3536namespace orxonox
     
    5253            this->particles_ = 0;
    5354        }
     55
     56        this->setConfigValues();
    5457    }
    5558
     
    6063    }
    6164
     65    void ParticleProjectile::setConfigValues()
     66    {
     67        SetConfigValue(speed_, 5000.0).description("The speed of a projectile in units per second").callback((Projectile*)this, &ParticleProjectile::speedChanged);
     68    }
     69
    6270    void ParticleProjectile::changedVisibility()
    6371    {
    64         BillboardProjectile::changedVisibility();
     72        SUPER(ParticleProjectile, changedVisibility);
    6573        this->particles_->setEnabled(this->isVisible());
    6674    }
  • code/trunk/src/orxonox/objects/ParticleProjectile.h

    r1558 r1747  
    4444            virtual ~ParticleProjectile();
    4545            virtual void changedVisibility();
     46            void setConfigValues();
    4647
    4748        private:
  • code/trunk/src/orxonox/objects/Projectile.cc

    r1602 r1747  
    3535#include "core/Executor.h"
    3636#include "core/ConfigValueIncludes.h"
     37#include "core/Iterator.h"
    3738#include "tools/ParticleInterface.h"
    3839
     
    4344namespace orxonox
    4445{
    45     float Projectile::speed_ = 5000;
     46    float Projectile::speed_s = 5000;
    4647
    4748    Projectile::Projectile(SpaceShip* owner) : owner_(owner)
     
    7374        SetConfigValue(damage_, 15.0).description("The damage caused by the projectile");
    7475        SetConfigValue(lifetime_, 4.0).description("The time in seconds a projectile stays alive");
    75         SetConfigValue(speed_, 5000.0).description("The speed of a projectile in units per second");
     76        SetConfigValue(speed_, 5000.0).description("The speed of a projectile in units per second").callback(this, &Projectile::speedChanged);
     77    }
    7678
    77         if(this->owner_)
    78           this->setVelocity(this->owner_->getInitialDir() * this->speed_);
     79    void Projectile::speedChanged()
     80    {
     81        Projectile::speed_s = this->speed_;
     82        if (this->owner_)
     83            this->setVelocity(this->owner_->getInitialDir() * this->speed_);
    7984    }
    8085
    8186    void Projectile::tick(float dt)
    8287    {
    83         WorldEntity::tick(dt);
     88        SUPER(Projectile, tick, dt);
    8489
    8590        if (!this->isActive())
     
    8792
    8893        float radius;
    89         for (Iterator<Model> it = ObjectList<Model>::start(); it; ++it)
     94        for (ObjectList<Model>::iterator it = ObjectList<Model>::begin(); it; ++it)
    9095        {
    9196            if ((*it) != this->owner_)
    9297            {
    93                 radius = it->getScale().x * 3.0;
     98                radius = it->getScale3D().x * 3.0;
    9499
    95100                if (this->getPosition().squaredDistance(it->getPosition()) <= (radius*radius))
  • code/trunk/src/orxonox/objects/Projectile.h

    r1552 r1747  
    4242            virtual ~Projectile();
    4343            void setConfigValues();
     44            void speedChanged();
    4445            void destroyObject();
    4546            virtual void tick(float dt);
    4647
    4748            static float getSpeed()
    48                 { return Projectile::speed_; }
     49                { return Projectile::speed_s; }
    4950
    5051        protected:
     
    5556            std::string explosionTemplateName_;
    5657            std::string smokeTemplateName_;
    57             static float speed_;
     58        protected:
     59            static float speed_s;
     60            float speed_;
     61        private:
    5862            float lifetime_;
    5963            float damage_;
  • code/trunk/src/orxonox/objects/RotatingProjectile.cc

    r1558 r1747  
    6565    void RotatingProjectile::setConfigValues()
    6666    {
    67         SetConfigValue(colour_, ColourValue(1.0, 0.0, 0.0));
     67        SetConfigValue(colour_, ColourValue(1.0, 0.0, 0.0)).callback(this, &RotatingProjectile::colourChanged);
     68    }
    6869
    69         this->rotatingBillboard1_.getBillboardSet()->getBillboard(0)->setColour(this->colour_);
    70         this->rotatingBillboard2_.getBillboardSet()->getBillboard(0)->setColour(this->colour_);
     70    void RotatingProjectile::colourChanged()
     71    {
     72        if (this->isInitialized())
     73        {
     74            this->rotatingBillboard1_.getBillboardSet()->getBillboard(0)->setColour(this->colour_);
     75            this->rotatingBillboard2_.getBillboardSet()->getBillboard(0)->setColour(this->colour_);
     76        }
    7177    }
    7278
     
    8187        }
    8288
    83         Projectile::tick(dt);
     89        SUPER(RotatingProjectile, tick, dt);
    8490    }
    8591
    8692    void RotatingProjectile::changedVisibility()
    8793    {
    88         BillboardProjectile::changedVisibility();
     94        SUPER(RotatingProjectile, changedVisibility);
    8995        this->rotatingBillboard1_.setVisible(this->isVisible());
    9096        this->rotatingBillboard2_.setVisible(this->isVisible());
  • code/trunk/src/orxonox/objects/RotatingProjectile.h

    r1558 r1747  
    1414            virtual ~RotatingProjectile();
    1515            void setConfigValues();
     16            void colourChanged();
    1617            virtual void tick(float dt);
    1718            virtual void changedVisibility();
  • code/trunk/src/orxonox/objects/Skybox.cc

    r1558 r1747  
    3737#include "GraphicsEngine.h"
    3838#include "core/CoreIncludes.h"
    39 #include "core/Debug.h"
    4039#include "core/XMLPort.h"
     40#include "util/Debug.h"
    4141
    4242namespace orxonox
     
    5959    }
    6060
    61     void Skybox::setSkyboxSrc(const std::string& src)
    62     {
    63         this->skyboxSrc_ = src;
    64     }
    65 
    6661    /**
    6762        @brief XML loading and saving.
     
    7267    void Skybox::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    7368    {
    74         BaseObject::XMLPort(xmlelement, mode);
     69        SUPER(Skybox, XMLPort, xmlelement, mode);
    7570
    76         XMLPortParamLoadOnly(Skybox, "src", setSkyboxSrc, xmlelement, mode);
     71        XMLPortParam(Skybox, "src", setSkyboxSrc, getSkyboxSrc, xmlelement, mode);
    7772        create();
    7873    }
     
    9186    void Skybox::changedVisibility()
    9287    {
    93         BaseObject::changedVisibility();
     88        SUPER(Skybox, changedVisibility);
    9489        GraphicsEngine::getSingleton().getSceneManager()->setSkyBox(this->isVisible(), this->skyboxSrc_);
    9590    }
  • code/trunk/src/orxonox/objects/Skybox.h

    r1558 r1747  
    4949            virtual bool create();
    5050            void registerAllVariables();
    51             void setSkyboxSrc(const std::string &src);
     51
     52            inline void setSkyboxSrc(const std::string &src)
     53                { this->skyboxSrc_ = src; }
     54            inline const std::string& getSkyboxSrc() const
     55                { return this->skyboxSrc_; }
    5256
    5357        private:
  • code/trunk/src/orxonox/objects/SpaceShip.cc

    r1735 r1747  
    3737#include "util/Convert.h"
    3838#include "util/Math.h"
    39 
     39#include "util/Debug.h"
    4040#include "core/CoreIncludes.h"
    4141#include "core/ConfigValueIncludes.h"
    42 #include "core/Debug.h"
     42#include "core/Iterator.h"
     43#include "core/input/InputManager.h"
    4344#include "core/XMLPort.h"
    4445#include "core/ConsoleCommand.h"
    45 #include "network/Host.h"
    46 
    4746#include "tools/ParticleInterface.h"
    48 
    49 #include "GraphicsEngine.h"
     47#include "network/Client.h"
     48#include "Backlight.h"
     49#include "CameraHandler.h"
     50#include "ParticleSpawner.h"
    5051#include "RotatingProjectile.h"
    5152#include "ParticleProjectile.h"
    52 #include "ParticleSpawner.h"
    53 #include "Backlight.h"
    54 #include "CameraHandler.h"
     53#include "GraphicsEngine.h"
    5554
    5655namespace orxonox
    5756{
    58     SetConsoleCommand(SpaceShip, setMaxSpeedTest, false).setAccessLevel(AccessLevel::Debug);
    59     SetConsoleCommand(SpaceShip, whereAmI, true).setAccessLevel(AccessLevel::User);
    60     SetConsoleCommand(SpaceShip, moveLongitudinal, true).setAccessLevel(AccessLevel::User).setDefaultValue(0, 1.0f).setAxisParamIndex(0).setKeybindMode(KeybindMode::OnHold);
    61     SetConsoleCommand(SpaceShip, moveLateral, true).setAccessLevel(AccessLevel::User).setDefaultValue(0, 1.0f).setAxisParamIndex(0).setKeybindMode(KeybindMode::OnHold);
    62     SetConsoleCommand(SpaceShip, moveYaw, true).setAccessLevel(AccessLevel::User).setDefaultValue(0, 1.0f).setAxisParamIndex(0).setKeybindMode(KeybindMode::OnHold);
    63     SetConsoleCommand(SpaceShip, movePitch, true).setAccessLevel(AccessLevel::User).setDefaultValue(0, 1.0f).setAxisParamIndex(0).setKeybindMode(KeybindMode::OnHold);
    64     SetConsoleCommand(SpaceShip, moveRoll, true).setAccessLevel(AccessLevel::User).setDefaultValue(0, 1.0f).setAxisParamIndex(0).setKeybindMode(KeybindMode::OnHold);
    65     SetConsoleCommand(SpaceShip, fire, true).setAccessLevel(AccessLevel::User).setKeybindMode(KeybindMode::OnHold);
    66     SetConsoleCommandGeneric(test1, SpaceShip, createConsoleCommand(createFunctor(&SpaceShip::setMaxSpeedTest), "setMaxSpeed"), false).setAccessLevel(AccessLevel::Debug);
    67     SetConsoleCommandGeneric(test2, SpaceShip, createConsoleCommand(createFunctor(&SpaceShip::setMaxSpeedTest), "setMaxBlubber"), false).setAccessLevel(AccessLevel::Debug);
    68     SetConsoleCommandGeneric(test3, SpaceShip, createConsoleCommand(createFunctor(&SpaceShip::setMaxSpeedTest), "setRofl"), false).setAccessLevel(AccessLevel::Debug);
     57    SetConsoleCommand(SpaceShip, setMaxSpeedTest, false).accessLevel(AccessLevel::Debug);
     58    SetConsoleCommand(SpaceShip, whereAmI, true).accessLevel(AccessLevel::User);
     59    SetConsoleCommand(SpaceShip, moveLongitudinal, true).accessLevel(AccessLevel::User).defaultValue(0, 1.0f).axisParamIndex(0).keybindMode(KeybindMode::OnHold);
     60    SetConsoleCommand(SpaceShip, moveLateral, true).accessLevel(AccessLevel::User).defaultValue(0, 1.0f).axisParamIndex(0).keybindMode(KeybindMode::OnHold);
     61    SetConsoleCommand(SpaceShip, moveYaw, true).accessLevel(AccessLevel::User).defaultValue(0, 1.0f).axisParamIndex(0).keybindMode(KeybindMode::OnHold);
     62    SetConsoleCommand(SpaceShip, movePitch, true).accessLevel(AccessLevel::User).defaultValue(0, 1.0f).axisParamIndex(0).keybindMode(KeybindMode::OnHold);
     63    SetConsoleCommand(SpaceShip, moveRoll, true).accessLevel(AccessLevel::User).defaultValue(0, 1.0f).axisParamIndex(0).keybindMode(KeybindMode::OnHold);
     64    SetConsoleCommand(SpaceShip, fire, true).accessLevel(AccessLevel::User).keybindMode(KeybindMode::OnHold);
     65    SetConsoleCommandAliasMulti(SpaceShip, setMaxSpeedTest, "setMaxSpeed", 1, false).accessLevel(AccessLevel::Debug);
     66    SetConsoleCommandAliasMulti(SpaceShip, setMaxSpeedTest, "setMaxBlubber", 2, false).accessLevel(AccessLevel::Debug);
     67    SetConsoleCommandAliasMulti(SpaceShip, setMaxSpeedTest, "setRofl", 3, false).accessLevel(AccessLevel::Debug);
    6968
    7069    CreateFactory(SpaceShip);
     
    7473
    7574    SpaceShip *SpaceShip::getLocalShip(){
    76       Iterator<SpaceShip> it;
    77       for(it = ObjectList<SpaceShip>::start(); it; ++it){
     75      ObjectList<SpaceShip>::iterator it;
     76      for(it = ObjectList<SpaceShip>::begin(); it; ++it){
    7877        if( (it)->myShip_ )
    7978          return *it;
     
    289288    void SpaceShip::changedVisibility()
    290289    {
    291         Model::changedVisibility();
     290        SUPER(SpaceShip, changedVisibility);
    292291
    293292        this->tt1_->setEnabled(this->isVisible());
     
    306305    void SpaceShip::changedActivity()
    307306    {
    308         Model::changedActivity();
     307        SUPER(SpaceShip, changedActivity);
    309308
    310309        this->tt1_->setEnabled(this->isVisible());
     
    392391    void SpaceShip::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    393392    {
    394         Model::XMLPort(xmlelement, mode);
    395 
    396         XMLPortParamLoadOnly(SpaceShip, "camera", setCamera, xmlelement, mode);
    397         XMLPortParamLoadOnly(SpaceShip, "maxSpeed", setMaxSpeed, xmlelement, mode);
    398         XMLPortParamLoadOnly(SpaceShip, "maxSideAndBackSpeed", setMaxSideAndBackSpeed, xmlelement, mode);
    399         XMLPortParamLoadOnly(SpaceShip, "maxRotation", setMaxRotation, xmlelement, mode);
    400         XMLPortParamLoadOnly(SpaceShip, "transAcc", setTransAcc, xmlelement, mode);
    401         XMLPortParamLoadOnly(SpaceShip, "rotAcc", setRotAcc, xmlelement, mode);
    402         XMLPortParamLoadOnly(SpaceShip, "transDamp", setTransDamp, xmlelement, mode);
    403         XMLPortParamLoadOnly(SpaceShip, "rotDamp", setRotDamp, xmlelement, mode);
     393        SUPER(SpaceShip, XMLPort, xmlelement, mode);
     394
     395        XMLPortParam(SpaceShip, "camera", setCamera, getCamera, xmlelement, mode);
     396        XMLPortParam(SpaceShip, "maxSpeed", setMaxSpeed, getMaxSpeed, xmlelement, mode);
     397        XMLPortParam(SpaceShip, "maxSideAndBackSpeed", setMaxSideAndBackSpeed, getMaxSideAndBackSpeed, xmlelement, mode);
     398        XMLPortParam(SpaceShip, "maxRotation", setMaxRotation, getMaxRotation, xmlelement, mode);
     399        XMLPortParam(SpaceShip, "transAcc", setTransAcc, getTransAcc, xmlelement, mode);
     400        XMLPortParam(SpaceShip, "rotAcc", setRotAcc, getRotAcc, xmlelement, mode);
     401        XMLPortParam(SpaceShip, "transDamp", setTransDamp, getTransDamp, xmlelement, mode);
     402        XMLPortParam(SpaceShip, "rotDamp", setRotDamp, getRotDamp, xmlelement, mode);
    404403
    405404        myShip_=true; //TODO: this is a hack
     
    535534
    536535
    537         WorldEntity::tick(dt);
     536        SUPER(SpaceShip, tick, dt);
    538537
    539538        this->roll(this->mouseXRotation_ * dt);
  • code/trunk/src/orxonox/objects/SpaceShipAI.cc

    r1608 r1747  
    4444namespace orxonox
    4545{
    46     SetConsoleCommand(SpaceShipAI, createEnemy, true).setDefaultValue(0, 1);
    47     SetConsoleCommand(SpaceShipAI, killEnemies, true).setDefaultValue(0, 0);
     46    SetConsoleCommand(SpaceShipAI, createEnemy, true).defaultValue(0, 1);
     47    SetConsoleCommand(SpaceShipAI, killEnemies, true).defaultValue(0, 0);
    4848
    4949    CreateFactory(SpaceShipAI);
     
    7272    SpaceShipAI::~SpaceShipAI()
    7373    {
    74         for (Iterator<SpaceShipAI> it = ObjectList<SpaceShipAI>::begin(); it; ++it)
     74        for (ObjectList<SpaceShipAI>::iterator it = ObjectList<SpaceShipAI>::begin(); it; ++it)
    7575            it->shipDied(this);
    7676    }
     
    7878    void SpaceShipAI::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    7979    {
    80         SpaceShip::XMLPort(xmlelement, mode);
     80        SUPER(SpaceShipAI, XMLPort, xmlelement, mode);
    8181
    8282        this->actionTimer_.setTimer(ACTION_INTERVAL, true, this, createExecutor(createFunctor(&SpaceShipAI::action)));
     
    111111    {
    112112        int i = 0;
    113         for (Iterator<SpaceShipAI> it = ObjectList<SpaceShipAI>::begin(); it; )
     113        for (ObjectList<SpaceShipAI>::iterator it = ObjectList<SpaceShipAI>::begin(); it; )
    114114        {
    115115            (it++)->kill();
     
    229229            this->doFire();
    230230
    231         SpaceShip::tick(dt);
     231        SUPER(SpaceShipAI, tick, dt);
    232232    }
    233233
     
    263263        this->forgetTarget();
    264264
    265         for (Iterator<SpaceShip> it = ObjectList<SpaceShip>::begin(); it; ++it)
     265        for (ObjectList<SpaceShip>::iterator it = ObjectList<SpaceShip>::begin(); it; ++it)
    266266        {
    267267            if (it->getTeamNr() != this->getTeamNr())
  • code/trunk/src/orxonox/objects/SpaceShipAI.h

    r1552 r1747  
    4747
    4848            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     49            virtual void tick(float dt);
    4950            static void createEnemy(int num);
    5051            static void killEnemies(int num);
     
    5455
    5556        private:
    56             virtual void tick(float dt);
    5757            virtual ColourValue getProjectileColour() const;
    5858
  • code/trunk/src/orxonox/objects/Tickable.h

    r1535 r1747  
    4545
    4646#include "core/OrxonoxClass.h"
     47#include "core/Super.h"
    4748
    4849namespace orxonox
     
    6162            Tickable();
    6263    };
     64
     65    SUPER_FUNCTION(1, Tickable, tick, true);
    6366
    6467    //! The Tickable interface provides a tick(dt) function, that gets called every frame.
  • code/trunk/src/orxonox/objects/WorldEntity.cc

    r1625 r1747  
    9595    }
    9696
    97 
    9897    void WorldEntity::setYawPitchRoll(const Degree& yaw, const Degree& pitch, const Degree& roll)
    9998    {
     
    111110    void WorldEntity::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    112111    {
    113         BaseObject::XMLPort(xmlelement, mode);
     112        SUPER(WorldEntity, XMLPort, xmlelement, mode);
    114113
    115         XMLPortParam(WorldEntity, "position", setPositionLoader2, getPosition, xmlelement, mode);
    116         XMLPortParamLoadOnly(WorldEntity, "direction", setDirectionLoader, xmlelement, mode);
     114        XMLPortParamExternTemplate(WorldEntity, Ogre::Node, this->node_, "position", setPosition, getPosition, xmlelement, mode, Ogre::Node, const Vector3&);
     115        XMLPortParamLoadOnly(WorldEntity, "direction", setDirectionSimple, xmlelement, mode);
    117116        XMLPortParamLoadOnly(WorldEntity, "yawpitchroll", setYawPitchRoll, xmlelement, mode);
    118         XMLPortParam(WorldEntity, "scale", setTotalScale, getScale, xmlelement, mode);
    119         XMLPortParam(WorldEntity, "rotationAxis", setRotationAxisLoader, getRotationAxis, xmlelement, mode);
     117        XMLPortParam(WorldEntity, "scale", setScale, getScale, xmlelement, mode);
     118        XMLPortParamTemplate(WorldEntity, "rotationAxis", setRotationAxis, getRotationAxis, xmlelement, mode, WorldEntity, const Vector3&);
    120119        XMLPortParam(WorldEntity, "rotationRate", setRotationRate, getRotationRate, xmlelement, mode);
    121120
     
    150149      registerVar( (void*) &(this->getRotationAxis().z), sizeof(this->getRotationAxis().z), network::DATA, 0x3);
    151150      // register scale of node
    152       registerVar( (void*) &(this->getScale().x), sizeof(this->getScale().x), network::DATA, 0x3);
    153       registerVar( (void*) &(this->getScale().y), sizeof(this->getScale().y), network::DATA, 0x3);
    154       registerVar( (void*) &(this->getScale().z), sizeof(this->getScale().z), network::DATA, 0x3);
     151      registerVar( (void*) &(this->getScale3D().x), sizeof(this->getScale3D().x), network::DATA, 0x3);
     152      registerVar( (void*) &(this->getScale3D().y), sizeof(this->getScale3D().y), network::DATA, 0x3);
     153      registerVar( (void*) &(this->getScale3D().z), sizeof(this->getScale3D().z), network::DATA, 0x3);
    155154      //register staticity
    156155      registerVar( (void*) &(this->bStatic_), sizeof(this->bStatic_), network::DATA, 0x3);
  • code/trunk/src/orxonox/objects/WorldEntity.h

    r1625 r1747  
    6565            inline void setPosition(const Vector3& pos)
    6666                { this->node_->setPosition(pos); }
    67             inline void setPositionLoader1(const Vector3& pos)
    68                 { this->node_->setPosition(pos); }
    69             inline void setPositionLoader2(Real x, Real y, Real z)
    70                 { this->node_->setPosition(x, y, z); }
    7167            inline void setPosition(Real x, Real y, Real z)
    7268                { this->node_->setPosition(x, y, z); }
     
    108104            inline void rotate(const Vector3& axis, const Radian& angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
    109105              { this->node_->rotate(axis, angle, relativeTo); }
    110             inline void setDirectionLoader(Real x, Real y, Real z)
     106            inline void setDirectionSimple(Real x, Real y, Real z)
    111107              { this->setDirection(x, y, z); }
    112108            inline void setDirection(Real x, Real y, Real z, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL, const Vector3& localDirectionVector=Vector3::NEGATIVE_UNIT_Z)
     
    117113              { this->node_->lookAt(targetPoint, relativeTo, localDirectionVector); }
    118114
    119             inline void setScale(const Vector3& scale)
     115            inline void setScale3D(const Vector3 &scale)
    120116              { this->node_->setScale(scale); }
    121             inline void setScale(Real x, Real y, Real z)
     117            inline void setScale3D(Real x, Real y, Real z)
    122118              { this->node_->setScale(x, y, z); }
    123             inline void setScale(Real scale)
     119            inline const Vector3& getScale3D(void) const
     120              { return this->node_->getScale(); }
     121            inline void setScale(float scale)
    124122              { this->node_->setScale(scale, scale, scale); }
    125             inline void setTotalScale(Real scale)
    126               { this->node_->setScale(scale, scale, scale); }
    127             inline const Vector3& getScale(void) const
    128               { return this->node_->getScale(); }
    129             inline void scale(const Vector3& scale)
     123            inline float getScale() const
     124              { Vector3 scale = this->getScale3D(); return (scale.x == scale.y && scale.x == scale.z) ? scale.x : 1; }
     125            inline void scale3D(const Vector3 &scale)
    130126              { this->node_->scale(scale); }
    131             inline void scale(Real x, Real y, Real z)
     127            inline void scale3D(Real x, Real y, Real z)
    132128              { this->node_->scale(x, y, z); }
    133129            inline void scale(Real scale)
     
    159155                { return this->acceleration_; }
    160156
    161             inline void setRotationAxisLoader(const Vector3& axis)
    162                 { this->rotationAxis_ = axis; rotationAxis_.normalise(); }
    163157            inline void setRotationAxis(const Vector3& axis)
    164                 { this->rotationAxis_ = axis; rotationAxis_.normalise(); }
     158                { this->rotationAxis_ = axis; this->rotationAxis_.normalise(); }
    165159            inline void setRotationAxis(Real x, Real y, Real z)
    166160                { this->rotationAxis_.x = x; this->rotationAxis_.y = y; this->rotationAxis_.z = z; rotationAxis_.normalise(); }
Note: See TracChangeset for help on using the changeset viewer.