Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/map/src/orxonox/objects/RadarViewable.h @ 2956

Last change on this file since 2956 was 2956, checked in by Naaduun, 16 years ago

added rotate and zoom to map. using static mapscenemanager now

  • Property svn:eol-style set to native
File size: 3.8 KB
RevLine 
[1818]1/*
2 *   ORXONOX - the hottest 3D action shooter ever to exist
3 *                    > www.orxonox.net <
4 *
5 *
6 *   License notice:
7 *
8 *   This program is free software; you can redistribute it and/or
9 *   modify it under the terms of the GNU General Public License
10 *   as published by the Free Software Foundation; either version 2
11 *   of the License, or (at your option) any later version.
12 *
13 *   This program is distributed in the hope that it will be useful,
14 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
15 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 *   GNU General Public License for more details.
17 *
18 *   You should have received a copy of the GNU General Public License
19 *   along with this program; if not, write to the Free Software
20 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21 *
22 *   Author:
23 *      Reto Grieder
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29#ifndef _RadarViewable_H__
30#define _RadarViewable_H__
31
32#include "OrxonoxPrereqs.h"
33#include <string>
34#include <cassert>
35#include "util/Math.h"
36#include "util/Debug.h"
37#include "core/OrxonoxClass.h"
38
[2942]39#include <string>
[2913]40#include <OgreSceneNode.h>
41#include <OgreEntity.h>
[2942]42#include <OgreManualObject.h>
43#include "orxonox/tools/DynamicLines.h"
[2913]44
[1818]45namespace orxonox
46{
47    /**
48    @brief Interface for receiving window events.
49    */
50    class _OrxonoxExport RadarViewable : virtual public OrxonoxClass
51    {
52    public:
53        enum Shape
54        {
55            Square,
56            Dot,
57            Triangle
58        };
59
[2942]60
[1818]61    public:
62        RadarViewable();
[2942]63        virtual ~RadarViewable();
[1818]64
[2662]65        inline void setRadarObjectCamouflage(float camouflage)
66            { this->radarObjectCamouflage_ = camouflage; }
67        inline float getRadarObjectCamouflage() const
68            { return this->radarObjectCamouflage_; }
[1818]69
[2662]70        inline void setRadarObjectColour(const ColourValue& colour)
71            { this->radarObjectColour_ = colour; }
72        inline const ColourValue& getRadarObjectColour() const
73            { return this->radarObjectColour_; }
[1818]74
75        void setRadarObjectDescription(const std::string& str);
[2662]76        inline const std::string& getRadarObjectDescription() const
77            { return this->radarObjectDescription_; }
[1818]78
[2662]79        virtual const WorldEntity* getWorldEntity() const = 0;
[1818]80
[2662]81        const Vector3& getRVWorldPosition() const;
82        Vector3 getRVOrientedVelocity() const;
[1818]83
[2662]84        inline void setRadarObjectShape(Shape shape)
85            { this->radarObjectShape_ = shape; }
86        inline Shape getRadarObjectShape() const
87            { return this->radarObjectShape_; }
[1818]88
[2913]89/*
90        inline void setMapNode(Ogre::SceneNode * node)
91            { this->MapNode_ = node; }
92        inline Ogre::SceneNode * getMapNode() const
93            { return this->MapNode_; }
94        inline void setMapEntity(Ogre::Entity * ent)
95            { this->MapEntity_ = ent; }
96        inline Ogre::Entity * getMapEntity() const
97            { return this->MapEntity_; }
98*/
99        //Used for Map
100        Ogre::SceneNode * MapNode_;
101        Ogre::Entity * MapEntity_;
[2942]102        DynamicLines* line_;
[2956]103        Ogre::SceneNode * LineNode_;
[2942]104        void addMapEntity();
105        void updateMapPosition();
[2956]106        bool isHumanShip_;
107        inline std::string getUniqueId()
108        {
109            return this->uniqueId_;
110        }
111
[1818]112    private:
[2662]113        void validate(const WorldEntity* object) const
114        {
115            if (!object)
116            {
117                COUT(1) << "Assertation: Every RadarViewable has to be assigned a WorldEntity pointer!" << std::endl;
118                assert(0);
119            }
120        }
[1818]121
[2956]122        //Map
123        std::string uniqueId_;
[2942]124       
125
[2956]126        //Radar
[1818]127        float radarObjectCamouflage_;
[2662]128        Shape radarObjectShape_;
[1818]129        std::string radarObjectDescription_;
130        ColourValue radarObjectColour_;
[2913]131       
[1818]132    };
133}
134
135#endif /* _RadarViewable_H__ */
Note: See TracBrowser for help on using the repository browser.