Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 2913 was 2913, checked in by Naaduun, 15 years ago

Added own scenemanager to map, added 2 pointer to contain mapentity and mapscenenod to radarviewable

  • Property svn:eol-style set to native
File size: 3.4 KB
Line 
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
39#include <OgreSceneNode.h>
40#include <OgreEntity.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
57    public:
58        RadarViewable();
59        virtual ~RadarViewable() { }
60
61        inline void setRadarObjectCamouflage(float camouflage)
62            { this->radarObjectCamouflage_ = camouflage; }
63        inline float getRadarObjectCamouflage() const
64            { return this->radarObjectCamouflage_; }
65
66        inline void setRadarObjectColour(const ColourValue& colour)
67            { this->radarObjectColour_ = colour; }
68        inline const ColourValue& getRadarObjectColour() const
69            { return this->radarObjectColour_; }
70
71        void setRadarObjectDescription(const std::string& str);
72        inline const std::string& getRadarObjectDescription() const
73            { return this->radarObjectDescription_; }
74
75        virtual const WorldEntity* getWorldEntity() const = 0;
76
77        const Vector3& getRVWorldPosition() const;
78        Vector3 getRVOrientedVelocity() const;
79
80        inline void setRadarObjectShape(Shape shape)
81            { this->radarObjectShape_ = shape; }
82        inline Shape getRadarObjectShape() const
83            { return this->radarObjectShape_; }
84
85/*
86        inline void setMapNode(Ogre::SceneNode * node)
87            { this->MapNode_ = node; }
88        inline Ogre::SceneNode * getMapNode() const
89            { return this->MapNode_; }
90        inline void setMapEntity(Ogre::Entity * ent)
91            { this->MapEntity_ = ent; }
92        inline Ogre::Entity * getMapEntity() const
93            { return this->MapEntity_; }
94*/
95        //Used for Map
96        Ogre::SceneNode * MapNode_;
97        Ogre::Entity * MapEntity_;
98
99    private:
100        void validate(const WorldEntity* object) const
101        {
102            if (!object)
103            {
104                COUT(1) << "Assertation: Every RadarViewable has to be assigned a WorldEntity pointer!" << std::endl;
105                assert(0);
106            }
107        }
108
109        float radarObjectCamouflage_;
110        Shape radarObjectShape_;
111        std::string radarObjectDescription_;
112        ColourValue radarObjectColour_;
113       
114    };
115}
116
117#endif /* _RadarViewable_H__ */
Note: See TracBrowser for help on using the repository browser.