[1494] | 1 | /* * ORXONOX - the hottest 3D action shooter ever to exist * > www.orxonox.net < * * * License notice: * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * |
---|
[1454] | 2 | * Author: |
---|
| 3 | * Yuning Chai |
---|
| 4 | * Co-authors: |
---|
| 5 | * Felix Schulthess |
---|
| 6 | * |
---|
| 7 | */ |
---|
[1283] | 8 | |
---|
[1410] | 9 | #ifndef _RadarOverlayElement_H__ |
---|
| 10 | #define _RadarOverlayElement_H__ |
---|
[1283] | 11 | |
---|
[1410] | 12 | #include "OrxonoxPrereqs.h" |
---|
| 13 | |
---|
[1346] | 14 | #include <OgrePrerequisites.h> |
---|
[1408] | 15 | #include <OgrePanelOverlayElement.h> |
---|
[1410] | 16 | #include "util/Math.h" |
---|
[1283] | 17 | |
---|
| 18 | namespace orxonox |
---|
| 19 | { |
---|
[1329] | 20 | class _OrxonoxExport RadarOverlayElement : public Ogre::PanelOverlayElement |
---|
| 21 | { |
---|
[1410] | 22 | private: |
---|
| 23 | Ogre::OverlayManager* om; // our one and only overlay manager |
---|
| 24 | Ogre::OverlayContainer* container_; // pointer to the container we're in |
---|
| 25 | Vector3 currentDir_; |
---|
| 26 | Vector3 currentOrth_; |
---|
| 27 | Vector3 shipPos_; // position of ship |
---|
[1339] | 28 | |
---|
[1410] | 29 | Ogre::Real leftRel_, topRel_, dimRel_; // relative position/dimension |
---|
| 30 | int left_, top_, dim_; // absolute position/dimension |
---|
| 31 | int windowW_, windowH_; // absolute window dimensions |
---|
[1283] | 32 | |
---|
[1410] | 33 | public: |
---|
| 34 | RadarOverlayElement(const Ogre::String& name); |
---|
| 35 | ~RadarOverlayElement(); |
---|
| 36 | void init(Real leftRel, Real topRel, Real dimRel, Ogre::OverlayContainer* container); |
---|
| 37 | void resize(); |
---|
| 38 | void update(); |
---|
| 39 | void listObjects(); |
---|
[1350] | 40 | |
---|
[1410] | 41 | static float calcRadius(Vector3 pos, Vector3 dir, Vector3 orth, RadarObject* obj); |
---|
| 42 | static float calcPhi(Vector3 pos, Vector3 dir, Vector3 orth, RadarObject* obj); |
---|
| 43 | static bool calcRight(Vector3 pos, Vector3 dir, Vector3 orth, RadarObject* obj); |
---|
| 44 | }; |
---|
[1302] | 45 | } |
---|
[1283] | 46 | |
---|
[1410] | 47 | #endif /* _RadarOverlayElement_H__ */ |
---|