Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/pch/src/orxonox/interfaces/RadarViewable.h @ 3178

Last change on this file since 3178 was 3177, checked in by rgrieder, 15 years ago

Moved interface classes to orxonox/interfaces.
This resolves certain identity problems, for instance Tickable technically isn't an object.
Furthermore this saves the compilation of 6 files by using InterfaceCompilation.cc ;)

  • Property svn:eol-style set to native
File size: 4.0 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"
[3157]33
[1818]34#include <string>
35#include <cassert>
[3174]36#include <OgrePrerequisites.h>
[3157]37
[1818]38#include "util/Math.h"
39#include "util/Debug.h"
40#include "core/OrxonoxClass.h"
41
42namespace orxonox
43{
44    /**
45    @brief Interface for receiving window events.
46    */
47    class _OrxonoxExport RadarViewable : virtual public OrxonoxClass
48    {
49    public:
50        enum Shape
51        {
52            Square,
53            Dot,
54            Triangle
55        };
56
[3089]57
[1818]58    public:
59        RadarViewable();
[3089]60        virtual ~RadarViewable();
[1818]61
[2662]62        inline void setRadarObjectCamouflage(float camouflage)
63            { this->radarObjectCamouflage_ = camouflage; }
64        inline float getRadarObjectCamouflage() const
65            { return this->radarObjectCamouflage_; }
[1818]66
[2662]67        inline void setRadarObjectColour(const ColourValue& colour)
68            { this->radarObjectColour_ = colour; }
69        inline const ColourValue& getRadarObjectColour() const
70            { return this->radarObjectColour_; }
[1818]71
72        void setRadarObjectDescription(const std::string& str);
[2662]73        inline const std::string& getRadarObjectDescription() const
74            { return this->radarObjectDescription_; }
[1818]75
[3064]76        inline void setRadarVisibility(bool b)
77            { this->bVisibility_ = b; }
78        inline bool getRadarVisibility() const
79            { return this->bVisibility_; }
80
[2662]81        virtual const WorldEntity* getWorldEntity() const = 0;
[1818]82
[2662]83        const Vector3& getRVWorldPosition() const;
84        Vector3 getRVOrientedVelocity() const;
[1818]85
[2662]86        inline void setRadarObjectShape(Shape shape)
87            { this->radarObjectShape_ = shape; }
88        inline Shape getRadarObjectShape() const
89            { return this->radarObjectShape_; }
[1818]90
[3089]91/*
92        inline void setMapNode(Ogre::SceneNode * node)
93            { this->MapNode_ = node; }
94        inline Ogre::SceneNode * getMapNode() const
95            { return this->MapNode_; }
96        inline void setMapEntity(Ogre::Entity * ent)
97            { this->MapEntity_ = ent; }
98        inline Ogre::Entity * getMapEntity() const
99            { return this->MapEntity_; }
100*/
101        //Used for Map
102        Ogre::SceneNode * MapNode_;
103        Ogre::Entity * MapEntity_;
[3130]104        Ogre::DynamicLines* line_;
[3089]105        Ogre::SceneNode * LineNode_;
106        void addMapEntity();
107        void updateMapPosition();
108        bool isHumanShip_;
[3157]109        inline const std::string& getUniqueId()
[3089]110        {
111            return this->uniqueId_;
112        }
[3101]113        //friend class Map;
[3089]114
[1818]115    private:
[2662]116        void validate(const WorldEntity* object) const
117        {
118            if (!object)
119            {
120                COUT(1) << "Assertation: Every RadarViewable has to be assigned a WorldEntity pointer!" << std::endl;
121                assert(0);
122            }
123        }
[3089]124
[3064]125        bool bVisibility_;
[3089]126        //Map
127        std::string uniqueId_;
128
129
130        //Radar
[1818]131        float radarObjectCamouflage_;
[2662]132        Shape radarObjectShape_;
[1818]133        std::string radarObjectDescription_;
134        ColourValue radarObjectColour_;
[3089]135
[1818]136    };
137}
138
139#endif /* _RadarViewable_H__ */
Note: See TracBrowser for help on using the repository browser.