Orxonox  0.0.5 Codename: Arcturus
CreateStars.h
Go to the documentation of this file.
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 #include "DesignToolsPrereqs.h"
30 
31 #include <string>
32 #include "util/Math.h"
33 #include "core/BaseObject.h"
34 
35 namespace orxonox
36 {
37  class CreateStars : public BaseObject
38  {
39  public:
40  CreateStars(Context* context);
41  virtual ~CreateStars();
42 
43  void createBillboards();
44 
45  virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
46 
47  void setNumStars(int num) {
48  this->numStars_ = num;
49  }
50 
51  int getNumStars() const {
52  return this->numStars_;
53  }
54 
55  void setMaterial(const std::string& material) {
56  this->material_ = material;
57  }
58 
59  const std::string& getMaterial() const {
60  return this->material_;
61  }
62 
63  void setColour(const orxonox::ColourValue& colour) {
64  this->colour_ = colour;
65  }
66 
67  const ColourValue& getColour() const {
68  return this->colour_;
69  }
70 
71  void setAlpha(float alpha) {
72  this->alpha_ = alpha;
73  }
74 
75  float getAlpha() const {
76  return this->alpha_;
77  }
78 
79  void setColourDiff(float colourDiff) {
80  this->colourDiff_ = colourDiff;
81  }
82 
83  float getColourDiff() const {
84  return this->colourDiff_;
85  }
86 
87  void setAlphaDiff(float alphaDiff) {
88  this->alphaDiff_ = alphaDiff;
89  }
90 
91  float getAlphaDiff() const {
92  return this->alphaDiff_;
93  }
94 
95  void setRadiusDiff(float radiusDiff) {
96  this->radiusDiff_ = radiusDiff;
97  }
98 
99  float getRadiusDiff() const {
100  return this->radiusDiff_;
101  }
102 
103  void setRadius(unsigned int dist) {
104  this->radius_ = dist;
105  this->createBillboards();
106  }
107 
108  unsigned int getRadius()const {
109  return this->radius_;
110  }
111 
112  Vector3 PolarToCartesian(float alpha, float beta, float radius);
113 
114  private:
117  ColourValue colour_;
118  std::vector<Billboard*> billboards_;
119  unsigned int radius_;
120  float alpha_;
121  float colourDiff_;
122  float alphaDiff_;
123  float radiusDiff_;
124 
125  };
126 }
The BaseObject is the parent of all classes representing an instance in the game. ...
Definition: BaseObject.h:63
float radiusDiff_
Definition: CreateStars.h:123
const ColourValue & getColour() const
Definition: CreateStars.h:67
float alphaDiff_
Definition: CreateStars.h:122
std::string material_
Definition: CreateStars.h:116
float getColourDiff() const
Definition: CreateStars.h:83
Definition: CreateStars.h:37
unsigned int radius_
Definition: CreateStars.h:119
void setColourDiff(float colourDiff)
Definition: CreateStars.h:79
::std::string string
Definition: gtest-port.h:756
float alpha_
Definition: CreateStars.h:120
int getNumStars() const
Definition: CreateStars.h:51
Ogre::ColourValue colour(const btVector3 &color, btScalar alpha)
Definition: OgreBulletUtils.h:41
void setMaterial(const std::string &material)
Definition: CreateStars.h:55
CreateStars(Context *context)
Definition: CreateStars.cc:41
void setAlphaDiff(float alphaDiff)
Definition: CreateStars.h:87
float colourDiff_
Definition: CreateStars.h:121
xmlelement
Definition: Super.h:519
float getRadiusDiff() const
Definition: CreateStars.h:99
Declaration and implementation of several math-functions, typedefs of some Ogre::Math classes to the ...
virtual ~CreateStars()
Definition: CreateStars.cc:54
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
int numStars_
Definition: CreateStars.h:115
float getAlpha() const
Definition: CreateStars.h:75
Mode
Definition: CorePrereqs.h:102
Declaration of BaseObject, the base class of all objects in Orxonox.
Definition: Context.h:45
virtual void XMLPort(Element &xmlelement, XMLPort::Mode mode) override
XML loading and saving.
Definition: CreateStars.cc:109
Vector3 PolarToCartesian(float alpha, float beta, float radius)
Definition: CreateStars.cc:101
void createBillboards()
Definition: CreateStars.cc:66
void setAlpha(float alpha)
Definition: CreateStars.h:71
std::vector< Billboard * > billboards_
Definition: CreateStars.h:118
Shared library macros, enums, constants and forward declarations for the pong module ...
const std::string & getMaterial() const
Definition: CreateStars.h:59
unsigned int getRadius() const
Definition: CreateStars.h:108
float getAlphaDiff() const
Definition: CreateStars.h:91
void setRadius(unsigned int dist)
Definition: CreateStars.h:103
void setNumStars(int num)
Definition: CreateStars.h:47
ColourValue colour_
Definition: CreateStars.h:117
void setColour(const orxonox::ColourValue &colour)
Definition: CreateStars.h:63
void setRadiusDiff(float radiusDiff)
Definition: CreateStars.h:95