Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 8, 2008, 5:46:52 AM (16 years ago)
Author:
landauf
Message:
  • several small changes in most of the HUD classes (code cleanup): removed obsolete variables, privatized all member variables, removed resizing functioncalls from tick, destroying overlayelements, added some const qualifiers.
  • moved calculation functions for RadarObject-position to Math.h and changed the phi/right/radius format to Vector2. the functions are used too by SpaceShipAI.
  • cycleNavigationFocus takes the nearest object if focus was NULL
  • BarOverlayElement works in both directions (left to right and right to left)
  • fixed bug causing SpaceShipAI to not stop shooting when losing target - this also speeds up orxonox a lot, because there are less projectiles

####################################

!! UPDATE YOUR MEDIA REPOSITORY !!

####################################
…or the BarOverlayElement will look strange

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/hud/Navigation.h

    r1505 r1564  
    3535#include <OgreTextAreaOverlayElement.h>
    3636#include <OgrePanelOverlayElement.h>
    37 #include "util/Math.h"
    3837
    3938namespace orxonox
    4039{
    41 
    4240    class _OrxonoxExport Navigation
    4341    {
    44       private:
    45         Ogre::OverlayManager* om;                                           // our one and only overlay manager
    46         Ogre::OverlayContainer* container_;
    47         Ogre::PanelOverlayElement* navMarker_;      // the panel used to show the arrow
    48         Ogre::TextAreaOverlayElement* navText_;     // displaying distance
    49         Ogre::Camera* navCam_;
    50         Vector3 navCamPos_;                         // position of ship
    51         Vector3 currentDir_;
    52         Vector3 currentOrth_;
    53         std::set<RadarObject*>::iterator it_;
    54         int windowW_, windowH_;
    55         void init();
    56         void updateMarker();
    57 
    5842      public:
    5943        Navigation(Ogre::OverlayContainer* container);
    6044        Navigation(Ogre::OverlayContainer* container, RadarObject* focus);
    6145        ~Navigation();
    62         RadarObject* focus_;                        // next pointer of linked list
    6346
    6447        void update();
    6548        void cycleFocus();
    66         float getDist2Focus();
     49        float getDist2Focus() const;
     50
     51        inline RadarObject* getFocus() const
     52            { return this->focus_; }
     53        inline void setFocus(RadarObject* object)
     54            { this->focus_ = object; this->updateFocus(); }
     55
     56      private:
     57        void init();
     58        void updateMarker();
     59        void updateFocus();
     60
     61        Ogre::OverlayContainer* container_;
     62        Ogre::PanelOverlayElement* navMarker_;      // the panel used to show the arrow
     63        Ogre::PanelOverlayElement* aimMarker_;
     64        Ogre::TextAreaOverlayElement* navText_;     // displaying distance
     65        std::list<RadarObject*>::iterator it_;
     66        RadarObject* focus_;                        // next pointer of linked list
    6767  };
    6868}
Note: See TracChangeset for help on using the changeset viewer.