[6861] | 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 | * Gion-Andri Cantieni |
---|
| 24 | * Co-authors: |
---|
| 25 | * ... |
---|
| 26 | * |
---|
| 27 | */ |
---|
| 28 | |
---|
| 29 | |
---|
| 30 | #include "core/BaseObject.h" |
---|
| 31 | |
---|
| 32 | #include "graphics/Billboard.h" |
---|
[6936] | 33 | |
---|
[6861] | 34 | |
---|
| 35 | namespace orxonox |
---|
| 36 | { |
---|
| 37 | class CreateStars : public BaseObject |
---|
| 38 | { |
---|
| 39 | public: |
---|
| 40 | CreateStars(orxonox::BaseObject* creator); |
---|
| 41 | virtual ~CreateStars(); |
---|
| 42 | |
---|
| 43 | void createBillboards(); |
---|
| 44 | |
---|
| 45 | void XMLPort(Element& xmlelement, XMLPort::Mode mode); |
---|
| 46 | |
---|
| 47 | void setNumStars(int num) { |
---|
| 48 | this->numStars_ = num; |
---|
| 49 | } |
---|
| 50 | |
---|
| 51 | int getNumStars(){ |
---|
| 52 | return this->numStars_; |
---|
| 53 | } |
---|
| 54 | |
---|
| 55 | void setMaterial(const std::string& material) { |
---|
| 56 | this->material_ = material; |
---|
| 57 | } |
---|
| 58 | |
---|
| 59 | std::string& getMaterial(){ |
---|
| 60 | return this->material_; |
---|
| 61 | } |
---|
| 62 | |
---|
[6936] | 63 | void setColour(const orxonox::ColourValue& colour) { |
---|
| 64 | this->colour_ = colour; |
---|
| 65 | } |
---|
| 66 | |
---|
| 67 | ColourValue& getColour() { |
---|
| 68 | return this->colour_; |
---|
| 69 | } |
---|
| 70 | |
---|
| 71 | void setAlpha(float alpha) { |
---|
| 72 | this->alpha_ = alpha; |
---|
| 73 | } |
---|
| 74 | |
---|
| 75 | float getAlpha() { |
---|
| 76 | return this->alpha_; |
---|
| 77 | } |
---|
| 78 | |
---|
| 79 | void setColourDiff(float colourDiff) { |
---|
| 80 | this->colourDiff_ = colourDiff; |
---|
| 81 | } |
---|
| 82 | |
---|
| 83 | float getColourDiff() { |
---|
| 84 | return this->colourDiff_; |
---|
| 85 | } |
---|
| 86 | |
---|
| 87 | void setAlphaDiff(float alphaDiff) { |
---|
| 88 | this->alphaDiff_ = alphaDiff; |
---|
| 89 | } |
---|
| 90 | |
---|
| 91 | float getAlphaDiff() { |
---|
| 92 | return this->alphaDiff_; |
---|
| 93 | } |
---|
| 94 | |
---|
| 95 | void setRadiusDiff(float radiusDiff) { |
---|
| 96 | this->radiusDiff_ = radiusDiff; |
---|
| 97 | } |
---|
| 98 | |
---|
| 99 | float getRadiusDiff() { |
---|
| 100 | return this->radiusDiff_; |
---|
| 101 | } |
---|
| 102 | |
---|
[6861] | 103 | void setRadius(unsigned int dist) { |
---|
| 104 | this->radius_ = dist; |
---|
| 105 | this->createBillboards(); |
---|
| 106 | } |
---|
| 107 | |
---|
| 108 | unsigned int getRadius(){ |
---|
| 109 | return this->radius_; |
---|
| 110 | } |
---|
| 111 | |
---|
| 112 | Vector3 PolarToCartesian(float alpha, float beta, float radius); |
---|
| 113 | |
---|
| 114 | private: |
---|
| 115 | int numStars_; |
---|
| 116 | std::string material_; |
---|
[6936] | 117 | orxonox::ColourValue colour_; |
---|
[6861] | 118 | std::vector<Billboard*> billboards_; |
---|
[6936] | 119 | float radius_; |
---|
| 120 | float alpha_; |
---|
| 121 | float colourDiff_; |
---|
| 122 | float alphaDiff_; |
---|
| 123 | float radiusDiff_; |
---|
[6861] | 124 | |
---|
| 125 | }; |
---|
| 126 | } |
---|