| 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 |  *      Fabian 'x3n' Landau | 
|---|
| 24 |  *   Co-authors: | 
|---|
| 25 |  *      Maurus Kaufmann | 
|---|
| 26 |  *      ... | 
|---|
| 27 |  * | 
|---|
| 28 |  */ | 
|---|
| 29 |  | 
|---|
| 30 | #ifndef _Billboard_H__ | 
|---|
| 31 | #define _Billboard_H__ | 
|---|
| 32 |  | 
|---|
| 33 | #include "OrxonoxPrereqs.h" | 
|---|
| 34 |  | 
|---|
| 35 | #include "OgreBillboardSet.h" | 
|---|
| 36 |  | 
|---|
| 37 | #include "util/Math.h" | 
|---|
| 38 | #include "tools/BillboardSet.h" | 
|---|
| 39 | #include "interfaces/TeamColourable.h" | 
|---|
| 40 | #include "worldentities/StaticEntity.h" | 
|---|
| 41 |  | 
|---|
| 42 | namespace orxonox | 
|---|
| 43 | { | 
|---|
| 44 |     class _OrxonoxExport Billboard : public StaticEntity, public TeamColourable | 
|---|
| 45 |     { | 
|---|
| 46 |         public: | 
|---|
| 47 |             Billboard(BaseObject* creator); | 
|---|
| 48 |             virtual ~Billboard(); | 
|---|
| 49 |  | 
|---|
| 50 |             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); | 
|---|
| 51 |  | 
|---|
| 52 |             virtual void changedVisibility(); | 
|---|
| 53 |  | 
|---|
| 54 |             inline const BillboardSet& getBillboardSet() const | 
|---|
| 55 |                 { return this->billboard_; } | 
|---|
| 56 |  | 
|---|
| 57 |             inline void setMaterial(const std::string& material) | 
|---|
| 58 |                 { this->material_ = material; this->changedMaterial(); } | 
|---|
| 59 |             inline const std::string& getMaterial() const | 
|---|
| 60 |                 { return this->material_; } | 
|---|
| 61 |  | 
|---|
| 62 |             inline void setColour(const ColourValue& colour) | 
|---|
| 63 |                 { this->colour_ = colour; this->changedColour(); } | 
|---|
| 64 |             inline const ColourValue& getColour() const | 
|---|
| 65 |                 { return this->colour_; } | 
|---|
| 66 |  | 
|---|
| 67 |  | 
|---|
| 68 |             inline void setRotation(const Radian& rotation) | 
|---|
| 69 |                 { this->rotation_ = rotation; this->changedRotation(); } | 
|---|
| 70 |             inline const Radian& getRotation() const | 
|---|
| 71 |                 { return this->rotation_; } | 
|---|
| 72 |  | 
|---|
| 73 |  | 
|---|
| 74 |             virtual void setTeamColour(const ColourValue& colour) | 
|---|
| 75 |                 { this->setColour(colour); } | 
|---|
| 76 |                  | 
|---|
| 77 |             void setBillboardType(Ogre::BillboardType bbt); | 
|---|
| 78 |              | 
|---|
| 79 |             void setCommonDirection(Vector3 vec); //!< normalised Vector vec as argument | 
|---|
| 80 |              | 
|---|
| 81 |             void setCommonUpVector(Vector3 vec); //!< normalised Vector vec as argument | 
|---|
| 82 |              | 
|---|
| 83 |             void setDefaultDimensions(float width, float height); | 
|---|
| 84 |  | 
|---|
| 85 |  | 
|---|
| 86 |         protected: | 
|---|
| 87 |             inline BillboardSet& getBillboardSet() | 
|---|
| 88 |                 { return this->billboard_; } | 
|---|
| 89 |  | 
|---|
| 90 |             virtual void changedColour(); | 
|---|
| 91 |  | 
|---|
| 92 |         private: | 
|---|
| 93 |             void registerVariables(); | 
|---|
| 94 |             void changedMaterial(); | 
|---|
| 95 |             void changedRotation(); | 
|---|
| 96 |  | 
|---|
| 97 |             BillboardSet billboard_; | 
|---|
| 98 |             std::string material_; | 
|---|
| 99 |             ColourValue colour_; | 
|---|
| 100 |             Radian rotation_; | 
|---|
| 101 |     }; | 
|---|
| 102 | } | 
|---|
| 103 |  | 
|---|
| 104 | #endif /* _Billboard_H__ */ | 
|---|