Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2435


Ignore:
Timestamp:
Dec 14, 2008, 1:42:17 AM (15 years ago)
Author:
rgrieder
Message:
  • updated msvc files
  • Fixed build by including util/Integer.h in NetworkPrereqs.h instead of util/Math.h
  • Fixed issue with a this pointer used in the base class c'tor initialisation
  • Fixed build under windows: INFINITE seems to be a macro, defined in winbase.h. Constant was somewhere in the quest files.
  • Fixed build: Only integral types can have header-file value when declared as static const. Float is not supported by the standard.
  • Fixed a potential bug in Planet.cc: "if (cond) doOne; doTwo" —> missing brances (indentation was correct, so I assume there have to be brances)
  • Corrected lots of indentation problems with tabs/spaces mix.
  • Changed all "@file Blubb.h" to "@file": Doxygen then assumes the actual filename. This gives more flexibility.
Location:
code/branches/presentation
Files:
48 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation/src/network/NetworkPrereqs.h

    r2415 r2435  
    5959// Includes
    6060//-----------------------------------------------------------------------
    61 #include "util/Math.h"
     61#include "util/Integers.h"
    6262
     63//-----------------------------------------------------------------------
     64// Library global contants
     65//-----------------------------------------------------------------------
     66namespace orxonox
     67{
     68  static const unsigned int GAMESTATEID_INITIAL = (unsigned int)-1;
     69  static const unsigned int CLIENTID_UNKNOWN    = (unsigned int)-2;
     70  static const uint32_t     OBJECTID_UNKNOWN    = (uint32_t)(-1);
     71}
    6372
    6473//-----------------------------------------------------------------------
     
    6776namespace orxonox
    6877{
    69 
    70 // Constants definition
    71 
    72   static const unsigned int GAMESTATEID_INITIAL = (unsigned int)-1;
    73   static const unsigned int CLIENTID_UNKNOWN = (unsigned int)-2;
    74   static const uint32_t OBJECTID_UNKNOWN = static_cast<uint32_t>(-1);
    75 
    76  
    77 
    78  
    7978  class Client;
    8079  class ClientConnection;
     
    102101  class obj;
    103102  class objInfo;
    104   namespace packet{
     103
     104  namespace packet
     105  {
    105106    class Gamestate;
    106107    class Packet;
  • code/branches/presentation/src/network/packet/Gamestate.cc

    r2419 r2435  
    355355  uint32_t objectOffset;
    356356  unsigned int objectsize, destsize=0;
    357   Synchronisable *object;
     357  // TODO: Why is this variable not used?
     358  //Synchronisable *object;
    358359
    359360  //call TrafficControl
  • code/branches/presentation/src/orxonox/objects/quest/AddQuest.cc

    r2420 r2435  
    2828
    2929/**
    30     @file AddQuest.cc
     30    @file
    3131    @brief Implementation of the AddQuest class.
    3232*/
     
    4444#include "Quest.h"
    4545
    46 namespace orxonox {
    47 
     46namespace orxonox
     47{
    4848    CreateFactory(AddQuest);
    4949
  • code/branches/presentation/src/orxonox/objects/quest/AddQuest.h

    r2420 r2435  
    2828
    2929/**
    30     @file AddQuest.h
     30    @file
    3131    @brief Definition of the AddQuest class.
    3232*/
     
    4242#include "ChangeQuestStatus.h"
    4343
    44 namespace orxonox {
    45 
     44namespace orxonox
     45{
    4646    /**
    4747    @brief
  • code/branches/presentation/src/orxonox/objects/quest/AddQuestHint.cc

    r2420 r2435  
    2828
    2929/**
    30     @file AddQuestHint.cc
     30    @file
    3131    @brief Implementation of the AddQuestHint class.
    3232*/
     
    4343#include "QuestHint.h"
    4444
    45 namespace orxonox {
    46 
     45namespace orxonox
     46{
    4747    CreateFactory(AddQuestHint);
    4848
  • code/branches/presentation/src/orxonox/objects/quest/AddQuestHint.h

    r2420 r2435  
    2828
    2929/**
    30     @file AddQuestHint.h
     30    @file
    3131    @brief Definition of the AddQuestHint class.
    3232*/
     
    4141#include "QuestEffect.h"
    4242
    43 namespace orxonox {
    44 
     43namespace orxonox
     44{
    4545    /**
    4646    @brief
  • code/branches/presentation/src/orxonox/objects/quest/AddReward.cc

    r2420 r2435  
    2828
    2929/**
    30     @file AddReward.cc
     30    @file
    3131    @brief Implementation of the AddReward class.
    3232*/
     
    4040#include "Rewardable.h"
    4141
    42 namespace orxonox {
    43 
     42namespace orxonox
     43{
    4444    CreateFactory(AddReward);
    4545
  • code/branches/presentation/src/orxonox/objects/quest/AddReward.h

    r2420 r2435  
    2828
    2929/**
    30     @file AddReward.h
     30    @file
    3131    @brief Definition of the AddReward class.
    3232*/
     
    4242#include "QuestEffect.h"
    4343
    44 namespace orxonox {
    45 
     44namespace orxonox
     45{
    4646    /**
    4747    @brief
  • code/branches/presentation/src/orxonox/objects/quest/ChangeQuestStatus.cc

    r2420 r2435  
    2828
    2929/**
    30     @file ChangeQuestStatus.cc
     30    @file
    3131    @brief Implementation of the ChangeQuestStatus class.
    3232*/
     
    3939#include "QuestItem.h"
    4040
    41 namespace orxonox {
    42 
     41namespace orxonox
     42{
    4343    /**
    4444    @brief
  • code/branches/presentation/src/orxonox/objects/quest/ChangeQuestStatus.h

    r2420 r2435  
    2828
    2929/**
    30     @file ChangeQuestStatus.h
     30    @file
    3131    @brief Definition of the ChangeQuestStatus class.
    3232*/
     
    4242#include "QuestEffect.h"
    4343
    44 namespace orxonox {
    45 
     44namespace orxonox
     45{
    4646    /**
    4747    @brief
  • code/branches/presentation/src/orxonox/objects/quest/CompleteQuest.cc

    r2420 r2435  
    2828 
    2929/**
    30     @file CompleteQuest.cc
     30    @file
    3131    @brief Implementation of the CompleteQuest class.
    3232*/
     
    4242#include "Quest.h"
    4343
    44 namespace orxonox {
    45 
     44namespace orxonox
     45{
    4646    CreateFactory(CompleteQuest);
    4747
  • code/branches/presentation/src/orxonox/objects/quest/CompleteQuest.h

    r2420 r2435  
    2828
    2929/**
    30     @file CompleteQuest.h
     30    @file
    3131    @brief Definition of the CompleteQuest class.
    3232*/
     
    4242#include "ChangeQuestStatus.h"
    4343
    44 namespace orxonox {
    45 
     44namespace orxonox
     45{
    4646    /**
    4747    @brief
  • code/branches/presentation/src/orxonox/objects/quest/FailQuest.cc

    r2420 r2435  
    2828 
    2929/**
    30     @file FailQuest.cc
     30    @file
    3131    @brief Implementation of the FailQuest class.
    3232*/
     
    4242#include "Quest.h"
    4343
    44 namespace orxonox {
    45 
     44namespace orxonox
     45{
    4646    CreateFactory(FailQuest);
    4747
  • code/branches/presentation/src/orxonox/objects/quest/FailQuest.h

    r2420 r2435  
    2828
    2929/**
    30     @file FailQuest.h
     30    @file
    3131    @brief Definition of the FailQuest class.
    3232*/
     
    4242#include "ChangeQuestStatus.h"
    4343
    44 namespace orxonox {
    45 
     44namespace orxonox
     45{
    4646    /**
    4747    @brief
  • code/branches/presentation/src/orxonox/objects/quest/GlobalQuest.cc

    r2420 r2435  
    2828 
    2929/**
    30     @file GlobalQuest.cc
     30    @file
    3131    @brief Implementation of the GlobalQuest class.
    3232*/
     
    4242#include "QuestEffect.h"
    4343
    44 namespace orxonox {
    45 
     44namespace orxonox
     45{
    4646    CreateFactory(GlobalQuest);
    4747
  • code/branches/presentation/src/orxonox/objects/quest/GlobalQuest.h

    r2420 r2435  
    2828 
    2929/**
    30     @file GlobalQuest.h
     30    @file
    3131    @brief Definition of the GlobalQuest class.
    3232*/
     
    4343#include "Quest.h"
    4444
    45 namespace orxonox {
    46 
     45namespace orxonox
     46{
    4747    /**
    4848    @brief
  • code/branches/presentation/src/orxonox/objects/quest/LocalQuest.cc

    r2420 r2435  
    2828
    2929/**
    30     @file LocalQuest.cc
     30    @file
    3131    @brief Implementation of the LocalQuest class.
    3232*/
     
    4242#include "QuestEffect.h"
    4343
    44 namespace orxonox {
    45 
     44namespace orxonox
     45{
    4646    CreateFactory(LocalQuest);
    4747
  • code/branches/presentation/src/orxonox/objects/quest/LocalQuest.h

    r2420 r2435  
    2828 
    2929/**
    30     @file LocalQuest.h
     30    @file
    3131    @brief Definition of the LocalQuest class.
    3232*/
     
    4343#include "Quest.h"
    4444
    45 namespace orxonox {
    46 
     45namespace orxonox
     46{
    4747    /**
    4848    @brief
  • code/branches/presentation/src/orxonox/objects/quest/Quest.cc

    r2420 r2435  
    2828 
    2929/**
    30     @file Quest.cc
     30    @file
    3131    @brief Implementation of the Quest class.
    3232*/
     
    4444#include "QuestListener.h"
    4545
    46 namespace orxonox {
    47 
     46namespace orxonox
     47{
    4848    /**
    4949    @brief
  • code/branches/presentation/src/orxonox/objects/quest/Quest.h

    r2420 r2435  
    2828 
    2929/**
    30     @file Quest.h
     30    @file
    3131    @brief Definition of the Quest class.
    3232        The Quest is the parent class of LocalQuest and GlobalQuest.
     
    4545#include "QuestItem.h"
    4646
    47 namespace questStatus
     47namespace orxonox
    4848{
     49    namespace questStatus
     50    {
    4951
    50     //!Different states of a Quest.
    51     enum Enum
    52     {
    53         inactive,
    54         active,
    55         failed,
    56         completed
    57     };
     52        //!Different states of a Quest.
     53        enum Enum
     54        {
     55            inactive,
     56            active,
     57            failed,
     58            completed
     59        };
    5860
    59 }
    60 
    61 namespace orxonox {
     61    }
    6262
    6363    /**
  • code/branches/presentation/src/orxonox/objects/quest/QuestDescription.cc

    r2420 r2435  
    2828
    2929/**
    30     @file QuestDescription.cc
     30    @file
    3131    @brief Implementation of the QuestDescription class.
    3232*/
     
    3939#include "orxonox/overlays/notifications/Notification.h"
    4040
    41 namespace orxonox {
    42 
     41namespace orxonox
     42{
    4343    CreateFactory(QuestDescription);
    4444
     
    128128        }
    129129       
    130         Notification* notification = new Notification(message, title, 30);
     130        Notification* notification = new Notification(0, message, title, 30);
    131131        notification->send();
    132132        return true;
  • code/branches/presentation/src/orxonox/objects/quest/QuestDescription.h

    r2420 r2435  
    2828
    2929/**
    30     @file QuestDescription.h
     30    @file
    3131    @brief Definition of the QuestDescription class.
    3232*/
     
    4242#include "core/XMLPort.h"
    4343
    44 namespace orxonox {
    45 
     44namespace orxonox
     45{
    4646    /**
    4747    @brief
     
    5555        Damian 'Mozork' Frick
    5656    */
    57     class _OrxonoxExport QuestDescription : public BaseObject {
    58 
     57    class _OrxonoxExport QuestDescription : public BaseObject
     58    {
    5959        public:
    6060            QuestDescription(BaseObject* creator);
  • code/branches/presentation/src/orxonox/objects/quest/QuestEffect.cc

    r2420 r2435  
    2828
    2929/**
    30     @file QuestEffect.cc
     30    @file
    3131    @brief Implementation of the QuestEffect class.
    3232*/
     
    3939#include "orxonox/objects/infos/PlayerInfo.h"
    4040
    41 namespace orxonox {
    42 
     41namespace orxonox
     42{
    4343    /**
    4444    @brief
  • code/branches/presentation/src/orxonox/objects/quest/QuestEffect.h

    r2420 r2435  
    2828 
    2929/**
    30     @file QuestEffect.h
     30    @file
    3131    @brief Definition of the QuestEffect class.
    3232*/
     
    4141#include "core/BaseObject.h"
    4242
    43 namespace orxonox {
    44 
     43namespace orxonox
     44{
    4545    /**
    4646    @brief
  • code/branches/presentation/src/orxonox/objects/quest/QuestEffectBeacon.cc

    r2385 r2435  
    2828
    2929/**
    30     @file QuestEffectBeacon.cc
     30    @file
    3131    @brief Implementation of the QuestEffectBeacon class.
    3232*/
     
    4545#include "QuestEffect.h"
    4646
    47 namespace orxonox {
    48 
     47namespace orxonox
     48{
    4949    CreateFactory(QuestEffectBeacon);
    5050
     
    5858       
    5959        this->status_ = QuestEffectBeaconStatus::active;
    60         this->times_ = INFINITE;
     60        this->times_ = INFINITE_TIME;
    6161    }
    6262
     
    186186            return false;
    187187        }
    188         if(this->getTimes() == INFINITE) //!< If times is infinity the QuestEffectBeacon can be executed an infinite number fo times.
     188        if(this->getTimes() == INFINITE_TIME) //!< If times is infinity the QuestEffectBeacon can be executed an infinite number fo times.
    189189        {
    190190            return true;
     
    212212    bool QuestEffectBeacon::setTimes(const int & n)
    213213    {
    214         if(n < 0 && n != INFINITE)
     214        if(n < 0 && n != INFINITE_TIME)
    215215        {
    216216            return false;
  • code/branches/presentation/src/orxonox/objects/quest/QuestEffectBeacon.h

    r2385 r2435  
    2828
    2929/**
    30     @file QuestEffectBeacon.h
     30    @file
    3131    @brief Definition of the QuestEffectBeacon class.
    3232*/
     
    3939#include "orxonox/objects/worldentities/PositionableEntity.h"
    4040
    41 namespace QuestEffectBeaconStatus
     41namespace orxonox
    4242{
     43    namespace QuestEffectBeaconStatus
     44    {
    4345
    44     //! The status of the beacon, can be either active or inactive.
    45     enum Enum
    46     {
    47         inactive,
    48         active
    49     };
     46        //! The status of the beacon, can be either active or inactive.
     47        enum Enum
     48        {
     49            inactive,
     50            active
     51        };
    5052
    51 }
    52 
    53 namespace orxonox {
     53    }
    5454
    5555    /**
     
    112112   
    113113        private:
    114             static const int INFINITE = -1; //!< Constant to avoid using magic numbers.
     114            static const int INFINITE_TIME = -1; //!< Constant to avoid using magic numbers.
    115115           
    116116            std::list<QuestEffect*> effects_; //!< The list of QuestEffects to be invoked on the executing player.
  • code/branches/presentation/src/orxonox/objects/quest/QuestHint.cc

    r2420 r2435  
    2828 
    2929/**
    30     @file QuestHint.cc
     30    @file
    3131    @brief Implementation of the QuestHint class.
    3232*/
     
    4343#include "Quest.h"
    4444
    45 namespace orxonox {
    46 
     45namespace orxonox
     46{
    4747    CreateFactory(QuestHint);
    4848
  • code/branches/presentation/src/orxonox/objects/quest/QuestHint.h

    r2420 r2435  
    2828 
    2929/**
    30     @file QuestHint.h
     30    @file
    3131    @brief Definition of the QuestHint class.
    3232*/
     
    4343#include "QuestItem.h"
    4444
    45 namespace questHintStatus
    46 {
    47 
    48     //! The state of the hint.
    49     enum Enum
    50     {
    51         inactive,
    52         active
    53     };
    54 
    55 }
    56 
    5745namespace orxonox
    5846{
     47    namespace questHintStatus
     48    {
     49
     50        //! The state of the hint.
     51        enum Enum
     52        {
     53            inactive,
     54            active
     55        };
     56
     57    }
    5958
    6059    /**
  • code/branches/presentation/src/orxonox/objects/quest/QuestItem.cc

    r2420 r2435  
    2828 
    2929/**
    30     @file QuestItem.cc
     30    @file
    3131    @brief Implementation of the QuestItem class.
    3232*/
     
    3939#include "QuestDescription.h"
    4040
    41 namespace orxonox {
    42 
     41namespace orxonox
     42{
    4343    /**
    4444    @brief
  • code/branches/presentation/src/orxonox/objects/quest/QuestItem.h

    r2420 r2435  
    2828 
    2929/**
    30     @file QuestItem.h
     30    @file
    3131    @brief Definition of the QuestItem class.
    3232        The QuestItem is the parent class of Quest and QuestHint.
     
    4444#include "core/XMLPort.h"
    4545
    46 namespace orxonox {
    47 
    48 
     46namespace orxonox
     47{
    4948    /**
    5049    @brief
  • code/branches/presentation/src/orxonox/objects/quest/QuestListener.cc

    r2385 r2435  
    2828
    2929/**
    30     @file QuestListener.cc
     30    @file
    3131    @brief Implementation of the QuestListener class.
    3232*/
     
    4242#include "QuestManager.h"
    4343
    44 namespace orxonox {
    45 
     44namespace orxonox
     45{
    4646    CreateFactory(QuestListener);
    4747
     
    152152        {
    153153            COUT(2) << "QuestListener with invalid mode '" << mode << "' created. Mode set to 'all'." << std::endl;
    154             this->mode_ = questListenerMode::all;
    155             return false;
     154        this->mode_ = questListenerMode::all;
     155        return false;
    156156        }
    157157       
     
    186186        {
    187187            COUT(1) << "An unforseen, never to happen, Error has occured. This is impossible!" << std::endl;
    188             return "";
     188        return "";
    189189        }
    190190    }
  • code/branches/presentation/src/orxonox/objects/quest/QuestListener.h

    r2385 r2435  
    2828
    2929/**
    30     @file QuestListener.h
     30    @file
    3131    @brief Definition of the QuestListener class.
    3232*/
     
    4444#include "Quest.h"
    4545
    46 namespace questListenerMode
     46namespace orxonox
    4747{
     48    namespace questListenerMode
     49    {
    4850
    49     //! The mode of the QuestListener.
    50     enum Enum
    51     {
    52         all,
    53         start,
    54         fail,
    55         complete
    56     };
     51        //! The mode of the QuestListener.
     52        enum Enum
     53        {
     54            all,
     55            start,
     56            fail,
     57            complete
     58        };
    5759
    58 }
    59 
    60 namespace orxonox {
     60    }
    6161
    6262    /**
     
    7575        </BaseObject>
    7676    @author
    77         Damian 'Mozork' Frick
     77    Damian 'Mozork' Frick
    7878    */
    7979    class _OrxonoxExport QuestListener : public BaseObject
    8080    {
    81         public:
    82             QuestListener(BaseObject* creator);
    83             virtual ~QuestListener();
    84            
    85             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestListener object through XML.
    86            
    87             static void advertiseStatusChange(std::list<QuestListener*> & listeners, const std::string & status); //!< Makes all QuestListener in the list aware that a certain status change has occured.
    88            
    89             bool setQuestId(const std::string & id); //!< Sets the questId of the Quest the QuestListener reacts to.
    90             bool setMode(const std::string & mode); //!< Sets the mode of the QuestListener.
    91            
    92             const std::string getMode(void); //!< Get the mode of the QuestListener.
    93            
    94             /**
    95             @brief Get the questId of the Quest the QuestListener reacts to.
    96             @return Returns the questId of the Quest the QuestListener reacts to.
    97             */
    98             inline const std::string & getQuestId(void)
     81    public:
     82        QuestListener(BaseObject* creator);
     83        virtual ~QuestListener();
     84       
     85        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestListener object through XML.
     86       
     87        static void advertiseStatusChange(std::list<QuestListener*> & listeners, const std::string & status); //!< Makes all QuestListener in the list aware that a certain status change has occured.
     88       
     89        bool setQuestId(const std::string & id); //!< Sets the questId of the Quest the QuestListener reacts to.
     90        bool setMode(const std::string & mode); //!< Sets the mode of the QuestListener.
     91       
     92        const std::string getMode(void); //!< Get the mode of the QuestListener.
     93       
     94        /**
     95        @brief Get the questId of the Quest the QuestListener reacts to.
     96        @return Returns the questId of the Quest the QuestListener reacts to.
     97        */
     98        inline const std::string & getQuestId(void)
    9999                { return this->quest_->getId(); }
    100            
    101             bool execute(void); //!< Executes the QuestListener, resp. fires an Event.
    102            
    103         private:
    104             questListenerMode::Enum mode_; //!< The mode of the QuestListener.
    105             Quest* quest_; //!< A pointer to the Quest the QuestListener is reacting to.
     100       
     101        bool execute(void); //!< Executes the QuestListener, resp. fires an Event.
     102       
     103    private:
     104        questListenerMode::Enum mode_; //!< The mode of the QuestListener.
     105        Quest* quest_; //!< A pointer to the Quest the QuestListener is reacting to.
    106106   
    107107    };
  • code/branches/presentation/src/orxonox/objects/quest/QuestManager.cc

    r2420 r2435  
    2828
    2929/**
    30     @file QuestManager.cc
     30    @file
    3131    @brief Implementation of the QuestManager class.
    3232*/
     
    4141#include "QuestHint.h"
    4242
    43 namespace orxonox {
    44 
     43namespace orxonox
     44{
    4545    //! All Quests registered by their id's.
    4646    std::map<std::string, Quest*> QuestManager::questMap_s;
  • code/branches/presentation/src/orxonox/objects/quest/QuestManager.h

    r2420 r2435  
    2828
    2929/**
    30     @file QuestManager.h
     30    @file
    3131    @brief Definition of the QuestManager class.
    3232*/
     
    4242#include "core/BaseObject.h"
    4343
    44 namespace orxonox {
    45 
     44namespace orxonox
     45{
    4646    /**
    4747    @brief
  • code/branches/presentation/src/orxonox/objects/quest/Rewardable.cc

    r2420 r2435  
    2828
    2929/**
    30     @file Rewardable.cc
     30    @file
    3131    @brief Implementation of the Rewardable class.
    3232*/
     
    3737#include "core/CoreIncludes.h"
    3838
    39 namespace orxonox {
    40 
     39namespace orxonox
     40{
    4141    /**
    4242    @brief
  • code/branches/presentation/src/orxonox/objects/quest/Rewardable.h

    r2420 r2435  
    2828
    2929/**
    30     @file Rewardable.h
     30    @file
    3131    @brief Definition of the Rewardable class.
    3232*/
     
    3939#include "core/BaseObject.h"
    4040
    41 namespace orxonox {
    42 
     41namespace orxonox
     42{
    4343    /**
    4444    @brief
     
    5151    class _OrxonoxExport Rewardable : public BaseObject
    5252    {
    53 
    5453        public:
    5554            Rewardable(BaseObject* creator);
  • code/branches/presentation/src/orxonox/objects/worldentities/Planet.cc

    r2420 r2435  
    2727 */
    2828
    29 
    3029#include "OrxonoxStableHeaders.h"
    3130#include "Planet.h"
    3231
    33 #include "tinyxml/tinyxml.h"
    34 #include "core/CoreIncludes.h"
    35 #include "GraphicsEngine.h"
    36 #include "core/XMLPort.h"
    37 #include "CameraManager.h"
    38 #include "objects/Scene.h"
    39 #include "Camera.h"
    4032#include <math.h>
    4133
     
    4537#include <OgreMeshManager.h>
    4638
     39#include "core/CoreIncludes.h"
     40#include "core/XMLPort.h"
     41#include "objects/Scene.h"
     42#include "CameraManager.h"
     43#include "Camera.h"
     44#include "GraphicsEngine.h"
    4745
    4846namespace orxonox
     
    6765            this->getNode()->detachObject(this->mesh_.getEntity());
    6866    }   
    69    
     67
    7068    void Planet::tick(float dt)
    7169    {
    7270        if(!this->isVisible())
    7371            return;
    74            
     72
    7573        Camera* activeCamera = CameraManager::getInstance().getActiveCamera();
    76         if(activeCamera)
    77         {
     74        if(activeCamera)
     75        {
    7876            Real distance = this->getPosition().distance( activeCamera->getWorldPosition() );
    79 //             COUT(2) << distance << std::endl;
     77            //             COUT(2) << distance << std::endl;
    8078            Real planetRadius = this->getScale();
    81        
     79
    8280            Real newScale = 2 * distance / sqrt(distance*distance - planetRadius*planetRadius);
    8381            Real tempTest = newScale*(1+Real(this->atmosphereSize)/Real(this->imageSize));
    8482            newScale = tempTest;
    85        
     83
    8684            this->billboard_.getBillboardSet()->setDefaultDimensions(newScale, newScale);
    87         }
    88                
     85        }
     86
    8987        SUPER(Planet, tick, dt);
    9088    }
    91  
    92     void Planet::init(){
    93    
     89
     90    void Planet::init()
     91    {
    9492        Real scaleFactor = this->getScale();
    95        
     93
    9694        this->distList.push_back(10.0*scaleFactor);
    9795        this->distList.push_back(19.0*scaleFactor);
     
    104102        this->distList.push_back(54.0*scaleFactor);
    105103        this->distList.push_back(55.0*scaleFactor);
    106        
     104
    107105        Real reductionValue = 0.2;
    108        
     106
    109107        this->mesh_.getEntity()->getMesh()->generateLodLevels(distList, Ogre::ProgressiveMesh::VRQ_PROPORTIONAL, reductionValue);
    110108        billboard_.setBillboardSet(this->getScene()->getSceneManager(), this->atmosphere_, Vector3(0,0,0));
    111        
     109
    112110        this->getNode()->attachObject(this->billboard_.getBillboardSet());   
    113111        this->billboard_.getBillboardSet()->setUseAccurateFacing(true);
     
    116114        this->mesh_.setCastShadows(true);
    117115    }
    118    
     116
    119117    void Planet::changedMesh()
    120118    {
     
    147145    {
    148146        SUPER(Planet, XMLPort, xmlelement, mode);
    149        
     147
    150148        XMLPortParam(Planet, "atmosphere", setAtmosphere, getAtmosphere, xmlelement, mode).defaultValues("planet/Atmosphere");
    151149        XMLPortParam(Planet, "atmospheresize", setAtmosphereSize, getAtmosphereSize, xmlelement,mode);     
     
    153151        XMLPortParam(Planet, "mesh", setMeshSource, getMeshSource, xmlelement, mode);
    154152        XMLPortParam(Planet, "shadow", setCastShadows, getCastShadows, xmlelement, mode).defaultValues(true);
    155        
    156153    }
    157154
    158     void Planet::registerVariables(){
     155    void Planet::registerVariables()
     156    {
    159157        registerVariable(this->atmosphere_, variableDirection::toclient);
    160158        registerVariable(this->meshSrc_, variableDirection::toclient, new NetworkCallback<Planet>(this, &Planet::changedMesh));
     
    168166        SUPER(Planet, changedVisibility);
    169167        if (this->isInitialized())
     168        {
    170169            this->mesh_.setVisible(this->isVisible());
    171170            this->billboard_.setVisible(this->isVisible());
     171        }
    172172    }
    173173}
  • code/branches/presentation/src/orxonox/objects/worldentities/Planet.h

    r2420 r2435  
    2929#ifndef _Planet_H__
    3030#define _Planet_H__
    31 #include "tools/BillboardSet.h"
     31
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include "tools/BillboardSet.h"
     35#include "tools/Mesh.h"
    3436#include "MovableEntity.h"
    35 #include "tools/Mesh.h"
    3637#include "objects/Tickable.h"
    3738
    3839namespace orxonox
    3940{
    40 
    4141    class _OrxonoxExport Planet : public MovableEntity
    4242    {
  • code/branches/presentation/src/orxonox/objects/worldentities/triggers/PlayerTrigger.cc

    r2262 r2435  
    2828
    2929/**
    30     @file PlayerTrigger.cc
     30    @file
    3131    @brief
    32         Implementation of the PlayerTrigger class.
     32    Implementation of the PlayerTrigger class.
    3333*/
    3434
     
    3838#include "core/CoreIncludes.h"
    3939
    40 namespace orxonox {
    41 
     40namespace orxonox
     41{
    4242    /**
    4343    @brief
     
    4747    {
    4848        RegisterObject(PlayerTrigger);
    49        
     49
    5050        this->player_ = NULL;
    5151        this->isForPlayer_ = true;
    5252    }
    53    
     53
    5454    /**
    5555    @brief
     
    6666    void PlayerTrigger::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    6767    {
    68         SUPER(PlayerTrigger, XMLPort, xmlelement, mode);
     68        SUPER(PlayerTrigger, XMLPort, xmlelement, mode);
    6969    }
    70 
    7170}
  • code/branches/presentation/src/orxonox/objects/worldentities/triggers/PlayerTrigger.h

    r2262 r2435  
    2828
    2929/**
    30     @file PlayerTrigger.h
     30    @file
    3131    @brief
    32         Definition of the PlayerTrigger class.
     32    Definition of the PlayerTrigger class.
    3333*/
    3434
     
    4040#include "Trigger.h"
    4141
    42 namespace orxonox {
    43    
     42namespace orxonox
     43{
    4444    /**
    4545    @brief
     
    5050    class _OrxonoxExport PlayerTrigger : public Trigger
    5151    {
    52         public:
    53             PlayerTrigger(BaseObject* creator);
    54             virtual ~PlayerTrigger();
    55            
    56             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a PlayerTrigger object through XML.
     52    public:
     53        PlayerTrigger(BaseObject* creator);
     54        virtual ~PlayerTrigger();
     55       
     56        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a PlayerTrigger object through XML.
     57       
     58        /**
     59        @brief Returns the player that triggered the PlayerTrigger.
     60        @return Returns a pointer to the ControllableEntity that triggered the PlayerTrigger.
     61        */
     62        inline ControllableEntity* getTriggeringPlayer(void) const
     63            { return this->player_; }
     64       
     65        /**
     66        @brief Checks whether the PlayerTrigger normally returns a ControllableEntity.
     67        @return Returns true if the PlayerTrigger normally returns a ControllableEntity.
     68        */
     69        inline bool isForPlayer(void) const
     70           { return this->isForPlayer_; }
    5771           
    58             /**
    59             @brief Returns the player that triggered the PlayerTrigger.
    60             @return Returns a pointer to the ControllableEntity that triggered the PlayerTrigger.
    61             */
    62             inline ControllableEntity* getTriggeringPlayer(void) const
    63                 { return this->player_; }
    64            
    65             /**
    66             @brief Checks whether the PlayerTrigger normally returns a ControllableEntity.
    67             @return Returns true if the PlayerTrigger normally returns a ControllableEntity.
    68             */
    69             inline bool isForPlayer(void) const
    70                { return this->isForPlayer_; }
    71            
    72         protected:
    73             virtual bool isTriggered(TriggerMode mode) = 0;
    74            
    75             /**
    76             @brief Set the player that triggered the PlayerTrigger. This is normally done by classes inheriting vom PlayerTrigger.
    77             @param player A pointer to the ControllableEntity that triggered the PlayerTrigger.
    78             */
    79             inline void setTriggeringPlayer(ControllableEntity* player)
    80                { this->player_ = player; }
     72    protected:
     73        virtual bool isTriggered(TriggerMode mode) = 0;
     74       
     75        /**
     76        @brief Set the player that triggered the PlayerTrigger. This is normally done by classes inheriting vom PlayerTrigger.
     77        @param player A pointer to the ControllableEntity that triggered the PlayerTrigger.
     78        */
     79        inline void setTriggeringPlayer(ControllableEntity* player)
     80           { this->player_ = player; }
    8181
    8282            /**
     
    8484            @param isForPlayer Should be true when the PlayerTrigger schould be set to normally be triggered by ControllableEntities, false if not.
    8585            */
    86             inline void setForPlayer(bool isForPlayer)
    87                { this->isForPlayer_ = isForPlayer; }
    88            
    89         private:
    90             ControllableEntity* player_; //!< The player that triggered the PlayerTrigger.
    91             bool isForPlayer_; //!< Is true when the PlayerTrigger schould be set to normally be triggered by ControllableEntities.
    92        
     86        inline void setForPlayer(bool isForPlayer)
     87           { this->isForPlayer_ = isForPlayer; }
     88       
     89    private:
     90        ControllableEntity* player_; //!< The player that triggered the PlayerTrigger.
     91        bool isForPlayer_; //!< Is true when the PlayerTrigger schould be set to normally be triggered by ControllableEntities.
     92   
    9393    };
    9494
  • code/branches/presentation/src/orxonox/overlays/notifications/Notification.cc

    r2385 r2435  
    3434#include "NotificationManager.h"
    3535
    36 namespace orxonox {
    37 
     36namespace orxonox
     37{
    3838    Notification::Notification(BaseObject* creator) : BaseObject(creator)
    3939    {
     
    4141    }
    4242   
    43     Notification::Notification(const std::string & message, const std::string & title, float time) : BaseObject(this)
     43    Notification::Notification(BaseObject* creator, const std::string & message, const std::string & title, float time) : BaseObject(creator)
    4444    {
    4545        this->title_ = title;
     
    5959        this->title_ = "";
    6060        this->message_ = "";
    61         this->displayTime_ = DISPLAY_TIME;
     61        this->displayTime_ = NOTIFICATION_DISPLAY_TIME;
    6262        this->sent_ = false;
    6363    }
     
    6868        if(successful)
    6969            this->sent_ = true;
    70         return successful;
     70        return successful;
    7171    }
    7272   
     
    7575        if(this->isSent())
    7676            return false;
    77         this->title_ = title;
    78         return true;
     77        this->title_ = title;
     78        return true;
    7979    }
    8080   
     
    8383        if(this->isSent())
    8484            return false;
    85         this->message_ = message;
    86         return true;
     85        this->message_ = message;
     86        return true;
    8787    }
    8888   
     
    9292        {
    9393            return false;
    94         }
    95         if(time > 0)
    96         {
    97             this->displayTime_ = time;
    98             return true;
    99         }
    100         return false;
     94        }
     95        if(time > 0)
     96        {
     97            this->displayTime_ = time;
     98            return true;
     99        }
     100        return false;
    101101    }
    102 
    103102}
  • code/branches/presentation/src/orxonox/overlays/notifications/Notification.h

    r2385 r2435  
    3636#include "core/BaseObject.h"
    3737
    38 namespace orxonox {
     38namespace orxonox
     39{
     40    static const float NOTIFICATION_DISPLAY_TIME = 4.0;
    3941
    4042    /**
    4143    @brief
    42         This is rather temporary, so don't start relying on it, some better version will come soon but the Interface will not likely be the same.
     44        This is rather temporary, so don't start relying on it, some better version will come soon but the Interface will not likely be the same.
    4345    @author
    4446        Damian 'Mozork' Frick
     
    4648    class _OrxonoxExport Notification : public BaseObject
    4749    {
    48         public:
    49             Notification(BaseObject* creator);
    50             Notification(const std::string & message, const std::string & title = "", float time = DISPLAY_TIME);
    51             virtual ~Notification();
    52            
    53             bool send(void);
    54            
    55             inline bool isSent(void) const
    56                 { return this->sent_; }
    57             inline const std::string & getTitle(void) const
    58                 { return this->title_; }
    59             inline const std::string & getMessage(void) const
    60                 { return this->message_; }
    61             inline const float getDisplayTime(void) const
    62                 { return displayTime_; }
    63            
    64             bool setTitle(const std::string & title);
    65             bool setMessage(const std::string & message);
    66             bool setDisplayTime(float time);
    67            
    68         private:
    69             static const float DISPLAY_TIME = 4.0;
    70        
    71             std::string title_; //!< The title of the Notification.
    72             std::string message_; //!< The Notification message.
    73             float displayTime_; //!< The time duration the Notification is displayed in seconds.
    74             bool sent_; //!< Whether Notification has been sent, if so it cannot be changed.
    75            
    76             void initialize(void);
    77        
     50    public:
     51        Notification(BaseObject* creator);
     52        Notification(BaseObject* creator, const std::string & message, const std::string & title = "", float time = NOTIFICATION_DISPLAY_TIME);
     53        virtual ~Notification();
     54       
     55        bool send(void);
     56       
     57        inline bool isSent(void) const
     58            { return this->sent_; }
     59        inline const std::string & getTitle(void) const
     60            { return this->title_; }
     61        inline const std::string & getMessage(void) const
     62            { return this->message_; }
     63        inline const float getDisplayTime(void) const
     64            { return displayTime_; }
     65       
     66        bool setTitle(const std::string & title);
     67        bool setMessage(const std::string & message);
     68        bool setDisplayTime(float time);
     69       
     70    private:
     71        std::string title_; //!< The title of the Notification.
     72        std::string message_; //!< The Notification message.
     73        float displayTime_; //!< The time duration the Notification is displayed in seconds.
     74        bool sent_; //!< Whether Notification has been sent, if so it cannot be changed.
     75       
     76        void initialize(void);
    7877    };
    79 
    8078}
    8179
  • code/branches/presentation/src/orxonox/overlays/notifications/NotificationManager.cc

    r2385 r2435  
    3636#include "NotificationQueue.h"
    3737
    38 namespace orxonox {
    39 
     38namespace orxonox
     39{
    4040    std::list<NotificationContainer*> NotificationManager::notifications_s;
    4141
     
    5555   
    5656        for (std::list<NotificationContainer*>::iterator notification = notifications_s.begin(); notification != notifications_s.end(); ++notification)
    57         {
     57        {
    5858            NotificationContainer* container = *notification;
    5959            if(container->remainingTime == 0)
    6060            {
    6161                continue;
    62             }
    63             else if(container->remainingTime - dt <= 0)
    64             {
    65                container->remainingTime = 0;
    66                update = true;
    67             }
    68             else
    69             {
     62            }
     63            else if(container->remainingTime - dt <= 0)
     64            {
     65                container->remainingTime = 0;
     66                update = true;
     67            }
     68            else
     69            {
    7070                container->remainingTime = container->remainingTime -dt;
    71             }
    72         }
    73        
    74         if(update)
     71            }
     72        }
     73   
     74        if(update)
    7575            updateQueue();
    7676    }
     
    8181            return false;
    8282           
    83         NotificationContainer* container = new NotificationContainer;
    84         container->notification = notification;
    85         container->remainingTime = notification->getDisplayTime();
     83        NotificationContainer* container = new NotificationContainer;
     84        container->notification = notification;
     85        container->remainingTime = notification->getDisplayTime();
    8686        notifications_s.push_front(container);
    8787       
     
    105105                continue;
    106106           
    107             text = text + "\n\n\n------------\n\n" + clipMessage(container->notification->getTitle()) + "\n\n" + clipMessage(container->notification->getMessage());
     107            text = text + "\n\n\n------------\n\n" + clipMessage(container->notification->getTitle()) + "\n\n" + clipMessage(container->notification->getMessage());
    108108        }
    109109       
  • code/branches/presentation/src/orxonox/overlays/notifications/NotificationManager.h

    r2385 r2435  
    3737#include <string>
    3838
    39 namespace orxonox {
    40 
     39namespace orxonox
     40{
    4141    struct NotificationContainer
    4242    {
     
    5454    {
    5555   
    56         public:
    57             NotificationManager(BaseObject* creator);
    58             virtual ~NotificationManager();
    59            
    60             static bool insertNotification(Notification* notification);
    61            
    62             static void tick(float dt);
    63            
    64         private:
    65             static std::list<NotificationContainer*> notifications_s;
    66            
    67             static void updateQueue(void);
    68             static const std::string clipMessage(const std::string & message);
     56    public:
     57        NotificationManager(BaseObject* creator);
     58        virtual ~NotificationManager();
     59       
     60        static bool insertNotification(Notification* notification);
     61       
     62        static void tick(float dt);
     63       
     64    private:
     65        static std::list<NotificationContainer*> notifications_s;
     66       
     67        static void updateQueue(void);
     68        static const std::string clipMessage(const std::string & message);
    6969
    7070    };
  • code/branches/presentation/src/orxonox/overlays/notifications/NotificationQueue.cc

    r2385 r2435  
    3535#include "NotificationManager.h"
    3636
    37 namespace orxonox {
    38 
     37namespace orxonox
     38{
    3939    NotificationQueue* NotificationQueue::queue_s = 0;
    4040   
     
    4646        //TDO: Does this work?
    4747        if(queue_s != NULL)
    48         {
    49             COUT(2) << "There is now more than one NotificationQueue, this shouldn't happen, since only the first NotificationQueue will be targeted by the NotificationManager." << std::endl;
    50         }
    51         else
    52         {
    53             queue_s = this;
    54         }
    55        
    56         this->length_ = 3;
    57         this->width_ = 50;
     48        {
     49                COUT(2) << "There is now more than one NotificationQueue, this shouldn't happen, since only the first NotificationQueue will be targeted by the NotificationManager." << std::endl;
     50        }
     51        else
     52        {
     53                queue_s = this;
     54        }
     55       
     56        this->length_ = 3;
     57        this->width_ = 50;
    5858    }
    5959   
  • code/branches/presentation/src/orxonox/overlays/notifications/NotificationQueue.h

    r2385 r2435  
    3838#include <string>
    3939
    40 namespace orxonox {
    41 
     40namespace orxonox
     41{
    4242    /**
    4343    @brief
     
    4848    class _OrxonoxExport NotificationQueue : public OverlayText, public Tickable
    4949    {
    50         public:
    51             NotificationQueue(BaseObject* creator);
    52             virtual ~NotificationQueue();
    53            
    54             static NotificationQueue* queue_s; //TDO Singleton? oder im level.
    55            
    56             virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
    57            
    58             virtual void tick(float dt);
    59            
    60             void update(void);
    61            
    62             int getLength(void) const
     50    public:
     51        NotificationQueue(BaseObject* creator);
     52        virtual ~NotificationQueue();
     53       
     54        static NotificationQueue* queue_s; //TDO Singleton? oder im level.
     55       
     56        virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
     57       
     58        virtual void tick(float dt);
     59       
     60        void update(void);
     61       
     62        int getLength(void) const
    6363                { return this->length_; }
    64             int getWidth(void) const
     64        int getWidth(void) const
    6565                { return this->width_; }
    66            
    67             void setQueueText(const std::string & text);
    68             bool setLength(int length);
    69             bool setWidth(int width);
    70            
    71         private:
    72             Ogre::UTFString queueText_;
    73             int length_;
    74             int width_;
     66       
     67        void setQueueText(const std::string & text);
     68        bool setLength(int length);
     69        bool setWidth(int width);
     70       
     71    private:
     72        Ogre::UTFString queueText_;
     73        int length_;
     74        int width_;
    7575   
    7676    };
  • code/branches/presentation/visual_studio/vc8/network.vcproj

    r2371 r2435  
    196196                                >
    197197                        </File>
     198                        <File
     199                                RelativePath="..\..\src\network\TrafficControl.cc"
     200                                >
     201                        </File>
    198202                        <Filter
    199203                                Name="packet"
     
    306310                                >
    307311                        </File>
     312                        <File
     313                                RelativePath="..\..\src\network\TrafficControl.h"
     314                                >
     315                        </File>
    308316                        <Filter
    309317                                Name="packet"
  • code/branches/presentation/visual_studio/vc8/orxonox.vcproj

    r2171 r2435  
    305305                                        </File>
    306306                                        <File
     307                                                RelativePath="..\..\src\orxonox\objects\worldentities\Planet.cc"
     308                                                >
     309                                        </File>
     310                                        <File
    307311                                                RelativePath="..\..\src\orxonox\objects\worldentities\PositionableEntity.cc"
    308312                                                >
     
    341345                                                <File
    342346                                                        RelativePath="..\..\src\orxonox\objects\worldentities\triggers\EventTrigger.cc"
     347                                                        >
     348                                                </File>
     349                                                <File
     350                                                        RelativePath="..\..\src\orxonox\objects\worldentities\triggers\PlayerTrigger.cc"
    343351                                                        >
    344352                                                </File>
     
    589597                                        </File>
    590598                                        <File
     599                                                RelativePath="..\..\src\orxonox\objects\quest\QuestEffectBeacon.cc"
     600                                                >
     601                                        </File>
     602                                        <File
    591603                                                RelativePath="..\..\src\orxonox\objects\quest\QuestHint.cc"
    592604                                                >
     
    594606                                        <File
    595607                                                RelativePath="..\..\src\orxonox\objects\quest\QuestItem.cc"
     608                                                >
     609                                        </File>
     610                                        <File
     611                                                RelativePath="..\..\src\orxonox\objects\quest\QuestListener.cc"
    596612                                                >
    597613                                        </File>
     
    743759                                        </File>
    744760                                </Filter>
     761                                <Filter
     762                                        Name="notifications"
     763                                        >
     764                                        <File
     765                                                RelativePath="..\..\src\orxonox\overlays\notifications\Notification.cc"
     766                                                >
     767                                        </File>
     768                                        <File
     769                                                RelativePath="..\..\src\orxonox\overlays\notifications\NotificationManager.cc"
     770                                                >
     771                                        </File>
     772                                        <File
     773                                                RelativePath="..\..\src\orxonox\overlays\notifications\NotificationQueue.cc"
     774                                                >
     775                                        </File>
     776                                </Filter>
    745777                        </Filter>
    746778                        <Filter
     
    933965                                        </File>
    934966                                        <File
     967                                                RelativePath="..\..\src\orxonox\objects\worldentities\Planet.h"
     968                                                >
     969                                        </File>
     970                                        <File
    935971                                                RelativePath="..\..\src\orxonox\objects\worldentities\PositionableEntity.h"
    936972                                                >
     
    9721008                                                </File>
    9731009                                                <File
     1010                                                        RelativePath="..\..\src\orxonox\objects\worldentities\triggers\PlayerTrigger.h"
     1011                                                        >
     1012                                                </File>
     1013                                                <File
    9741014                                                        RelativePath="..\..\src\orxonox\objects\worldentities\triggers\Trigger.h"
    9751015                                                        >
     
    10571097                                        </File>
    10581098                                        <File
     1099                                                RelativePath="..\..\src\orxonox\objects\quest\QuestEffectBeacon.h"
     1100                                                >
     1101                                        </File>
     1102                                        <File
    10591103                                                RelativePath="..\..\src\orxonox\objects\quest\QuestHint.h"
    10601104                                                >
     
    10621106                                        <File
    10631107                                                RelativePath="..\..\src\orxonox\objects\quest\QuestItem.h"
     1108                                                >
     1109                                        </File>
     1110                                        <File
     1111                                                RelativePath="..\..\src\orxonox\objects\quest\QuestListener.h"
    10641112                                                >
    10651113                                        </File>
     
    12261274                                        <File
    12271275                                                RelativePath="..\..\src\orxonox\overlays\debug\DebugRTRText.h"
     1276                                                >
     1277                                        </File>
     1278                                </Filter>
     1279                                <Filter
     1280                                        Name="notifications"
     1281                                        >
     1282                                        <File
     1283                                                RelativePath="..\..\src\orxonox\overlays\notifications\Notification.h"
     1284                                                >
     1285                                        </File>
     1286                                        <File
     1287                                                RelativePath="..\..\src\orxonox\overlays\notifications\NotificationManager.h"
     1288                                                >
     1289                                        </File>
     1290                                        <File
     1291                                                RelativePath="..\..\src\orxonox\overlays\notifications\NotificationQueue.h"
    12281292                                                >
    12291293                                        </File>
Note: See TracChangeset for help on using the changeset viewer.