Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 20, 2008, 12:05:12 AM (16 years ago)
Author:
rgrieder
Message:
  • Radar now working like before
  • but more of a svn save..

There is class called Radar which takes care of the focus and all objects that can be displayed on a Radar.
The actual visual implementation is in HUDRadar.
To make a object radar viewable, simply implement RadarViewable and set the WorldEntitiy pointer in the constructor (assertation will fail otherwise!).
You can also set a camouflage value between 0 and 1 that tells how good a radar can see an object.
The HUDRadar (or another one) on the other side has a sensitivity between 0 and 1. So only if the sensitivity is higher than the camouflage value, the object gets displayed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/hud/src/orxonox/overlays/hud/HUDRadar.h

    r1609 r1613  
    9292
    9393
    94     class _OrxonoxExport HUDRadar : public OrxonoxOverlay, public Tickable, public RadarListener
     94    class _OrxonoxExport HUDRadar : public OrxonoxOverlay, public RadarListener//, public Tickable
    9595    {
    9696      public:
     
    100100        void XMLPort(Element& xmlElement, XMLPort::Mode mode);
    101101
    102         void addShape(RadarShape* shape);
    103         RadarShape* getShape(unsigned int index) const;
     102        /*void addShape(RadarShape* shape);
     103        RadarShape* getShape(unsigned int index) const;*/
    104104
    105         void tick(float dt);
     105        float getRadarSensitivity() const { return this->sensitivity_; }
     106        void setRadarSensitivity(float sensitivity) { this->sensitivity_ = sensitivity; }
    106107
    107         void listObjects();
     108        float getHalfDotSizeDistance() const { return this->halfDotSizeDistance_; }
     109        void setHalfDotSizeDistance(float distance) { this->halfDotSizeDistance_ = distance; }
     110
     111        float getMaximumDotSize() const { return this->maximumDotSize_; }
     112        void setMaximumDotSize(float size) { this->maximumDotSize_ = size; }
     113
     114        //void tick(float dt);
     115
     116        //void listObjects();
    108117
    109118      private:
    110         void addColour(RadarColour* colour);
    111         RadarColour* getColour(unsigned int index) const;
     119        void displayObject(RadarViewable* viewable, bool bIsMarked);
     120        void hideMarker() { this->marker_->hide(); }
     121        float getRadarSensitivity() { return 1.0f; }
     122        void radarTick(float dt);
    112123
    113         std::map<unsigned int, std::string> materialNames_;
    114         std::map<unsigned int, RadarColour*> colours_;
    115         std::map<unsigned int, RadarShape*> shapes_;
     124        std::map<RadarViewable::Shape, std::string> shapeMaterials_;
    116125
    117126        Ogre::PanelOverlayElement* background_;
    118127        std::map<RadarViewable*, Ogre::PanelOverlayElement*> radarDots_;
     128        Ogre::PanelOverlayElement* marker_;
     129
     130        float halfDotSizeDistance_;
     131        float maximumDotSize_;
     132
     133        float sensitivity_;
    119134    };
    120135}
Note: See TracChangeset for help on using the changeset viewer.