Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 26, 2008, 2:13:17 PM (16 years ago)
Author:
rgrieder
Message:

merged hud branch back to trunk

Location:
code/trunk/src/orxonox/objects
Files:
1 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/objects/Ambient.cc

    r1505 r1625  
    7373     
    7474    }
    75    
    76     void Ambient::loadParams(TiXmlElement* xmlElem)
     75
     76    void Ambient::setAmbientLight(const ColourValue& colour)
    7777    {
    78         if (xmlElem->Attribute("colourvalue"))
    79         {
    80         SubString colourvalues(xmlElem->Attribute("colourvalue"), ',');
    81 
    82                 float r, g, b;
    83         convertValue<std::string, float>(&r, colourvalues[0]);
    84         convertValue<std::string, float>(&g, colourvalues[1]);
    85         convertValue<std::string, float>(&b, colourvalues[2]);
    86 
    87                 this->setAmbientLight(ColourValue(r, g, b));
    88 
    89                 COUT(4) << "Loader: Set ambient light: "<<r<<" " << g << " " << b  << std::endl << std::endl;
    90         }
    91    }
    92 
    93    void Ambient::setAmbientLight(const ColourValue& colour)
    94    {
    95         GraphicsEngine::getSingleton().getSceneManager()->setAmbientLight(colour);
     78            GraphicsEngine::getSingleton().getSceneManager()->setAmbientLight(colour);
    9679      ambientLight_=colour;     
    97    }
     80    }
    9881
    9982    /**
  • code/trunk/src/orxonox/objects/Ambient.h

    r1505 r1625  
    4444            virtual ~Ambient();
    4545
    46             void loadParams(TiXmlElement* xmlElem);
    4746            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    4847            void setAmbientLight(const ColourValue& colour);
  • code/trunk/src/orxonox/objects/NPC.cc

    r1505 r1625  
    4545  NPC::~NPC()
    4646  {
    47   }
    48 
    49   void NPC::loadParams(TiXmlElement* xmlElem)
    50   {
    51     Model::loadParams(xmlElem);
    5247  }
    5348
  • code/trunk/src/orxonox/objects/NPC.h

    r1505 r1625  
    4848      NPC();
    4949      virtual ~NPC();
    50       virtual void loadParams(TiXmlElement* xmlElem);
    5150      void tick(float dt);
    5251      void update();
  • code/trunk/src/orxonox/objects/SpaceShip.cc

    r1608 r1625  
    4343#include "core/XMLPort.h"
    4444#include "core/ConsoleCommand.h"
    45 #include "core/input/InputManager.h"
    4645
    4746#include "network/Client.h"
    4847
    49 #include "hud/HUD.h"
    5048#include "tools/ParticleInterface.h"
    5149
     
    118116        this->timeToReload_ = 0;
    119117
    120         this->setMouseEventCallback_ = false;
    121118        this->bLMousePressed_ = false;
    122119        this->bRMousePressed_ = false;
    123120        this->mouseXRotation_ = 0;
    124121        this->mouseYRotation_ = 0;
    125         this->mouseX_ = 0;
    126         this->mouseY_ = 0;
    127122        this->myShip_ = false;
    128123
     
    142137        this->teamNr_ = 0;
    143138        this->health_ = 100;
     139
     140        this->radarObject_ = static_cast<WorldEntity*>(this);
    144141    }
    145142
     
    161158                delete this->backlight_;
    162159
    163             if (this->setMouseEventCallback_)
    164                 InputManager::removeMouseHandler("SpaceShip");
    165 
    166160            if (this->cam_)
    167161                delete this->cam_;
    168 
    169             if (!this->myShip_)
    170                 HUD::getSingleton().removeRadarObject(this);
    171162        }
    172163    }
     
    177168          myShip_=true;
    178169        else
    179           HUD::getSingleton().addRadarObject(this, this->getProjectileColour());
     170          this->setRadarObjectColour(this->getProjectileColour());
    180171      }
    181172      if(Model::create())
     
    418409
    419410        currentDir_ = getOrientation()*initialDir_;
    420                 currentOrth_ = getOrientation()*initialOrth_;
     411        currentOrth_ = getOrientation()*initialOrth_;
    421412
    422413        if (this->cam_)
  • code/trunk/src/orxonox/objects/SpaceShip.h

    r1608 r1625  
    3636#include "Camera.h"
    3737#include "Model.h"
     38#include "RadarViewable.h"
    3839#include "tools/BillboardSet.h"
    3940
    4041namespace orxonox
    4142{
    42     class _OrxonoxExport SpaceShip : public Model
     43    class _OrxonoxExport SpaceShip : public Model, public RadarViewable
    4344    {
    4445        public:
     
    131132            Vector3 currentOrth_;
    132133            bool bInvertYAxis_;
    133             bool setMouseEventCallback_;
    134134            bool bLMousePressed_;
    135135            bool bRMousePressed_;
  • code/trunk/src/orxonox/objects/WorldEntity.cc

    r1602 r1625  
    9595    }
    9696
    97     void WorldEntity::loadParams(TiXmlElement* xmlElem)
    98     {
    99 
    100         BaseObject::loadParams(xmlElem);
    101         create();
    102     }
    103 
    10497
    10598    void WorldEntity::setYawPitchRoll(const Degree& yaw, const Degree& pitch, const Degree& roll)
  • code/trunk/src/orxonox/objects/WorldEntity.h

    r1602 r1625  
    5151
    5252            virtual void tick(float dt);
    53             virtual void loadParams(TiXmlElement* xmlElem);
    5453            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    5554            virtual inline bool create(){ return Synchronisable::create(); }
     
    7473            inline const Vector3& getPosition() const
    7574                { return this->node_->getPosition(); }
     75            inline const Vector3& getWorldPosition() const
     76                { return this->node_->getWorldPosition(); }
    7677
    7778            inline void translate(const Vector3& d, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT)
     
    101102            inline const Ogre::Quaternion& getOrientation()
    102103              { return this->node_->getOrientation(); }
     104            inline const Ogre::Quaternion& getWorldOrientation()
     105              { return this->node_->getWorldOrientation(); }
    103106            inline void setOrientation(const Ogre::Quaternion& quat)
    104107              { this->node_->setOrientation(quat); }
Note: See TracChangeset for help on using the changeset viewer.