[2072] | 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: |
---|
[8614] | 25 | * Maurus Kaufmann |
---|
[2072] | 26 | * ... |
---|
| 27 | * |
---|
| 28 | */ |
---|
| 29 | |
---|
| 30 | #ifndef _Billboard_H__ |
---|
| 31 | #define _Billboard_H__ |
---|
| 32 | |
---|
| 33 | #include "OrxonoxPrereqs.h" |
---|
[3196] | 34 | |
---|
[8614] | 35 | #include "OgreBillboardSet.h" |
---|
| 36 | |
---|
[2072] | 37 | #include "util/Math.h" |
---|
| 38 | #include "tools/BillboardSet.h" |
---|
[3196] | 39 | #include "interfaces/TeamColourable.h" |
---|
[5737] | 40 | #include "worldentities/StaticEntity.h" |
---|
[2072] | 41 | |
---|
| 42 | namespace orxonox |
---|
| 43 | { |
---|
[3196] | 44 | class _OrxonoxExport Billboard : public StaticEntity, public TeamColourable |
---|
[2072] | 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_; } |
---|
[7491] | 66 | |
---|
[8614] | 67 | |
---|
[3053] | 68 | inline void setRotation(const Radian& rotation) |
---|
| 69 | { this->rotation_ = rotation; this->changedRotation(); } |
---|
| 70 | inline const Radian& getRotation() const |
---|
| 71 | { return this->rotation_; } |
---|
[7491] | 72 | |
---|
[8614] | 73 | |
---|
[2826] | 74 | virtual void setTeamColour(const ColourValue& colour) |
---|
| 75 | { this->setColour(colour); } |
---|
[8614] | 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); |
---|
[2826] | 84 | |
---|
[8614] | 85 | |
---|
[2662] | 86 | protected: |
---|
| 87 | inline BillboardSet& getBillboardSet() |
---|
| 88 | { return this->billboard_; } |
---|
| 89 | |
---|
| 90 | virtual void changedColour(); |
---|
| 91 | |
---|
[2072] | 92 | private: |
---|
[7163] | 93 | void registerVariables(); |
---|
[2072] | 94 | void changedMaterial(); |
---|
[8614] | 95 | void changedRotation(); |
---|
[2072] | 96 | |
---|
| 97 | BillboardSet billboard_; |
---|
| 98 | std::string material_; |
---|
| 99 | ColourValue colour_; |
---|
[8614] | 100 | Radian rotation_; |
---|
[2072] | 101 | }; |
---|
| 102 | } |
---|
| 103 | |
---|
| 104 | #endif /* _Billboard_H__ */ |
---|