Changeset 7028
- Timestamp:
- May 30, 2010, 10:21:41 PM (14 years ago)
- Location:
- code/branches/presentation3/src/modules/designtools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation3/src/modules/designtools/CreateStars.cc
r7022 r7028 29 29 #include "CreateStars.h" 30 30 31 #include "core/ConsoleCommand.h" 31 #include <OgreVector3.h> 32 32 33 #include "core/CoreIncludes.h" 33 #include "core/ConfigValueIncludes.h"34 #include "core/ScopedSingletonManager.h"35 #include "core/BaseObject.h"36 37 38 34 #include "core/XMLPort.h" 39 40 35 #include "graphics/Billboard.h" 41 42 #include <OgreVector3.h>43 #include "util/Math.h"44 36 45 37 namespace orxonox 46 38 { 47 48 39 CreateFactory(CreateStars); 49 40 41 static const float pi = 3.14159265359f; 42 50 43 CreateStars::CreateStars(BaseObject* creator) : BaseObject(creator) 51 52 44 { 53 45 RegisterObject(CreateStars); 54 46 this->material_ = "Examples/Flare"; 55 this->alpha_ = 0.7 ;56 this->alphaDiff_ = 0.5 ;57 this->radiusDiff_ = 0.9 ;47 this->alpha_ = 0.7f; 48 this->alphaDiff_ = 0.5f; 49 this->radiusDiff_ = 0.9f; 58 50 this->colour_.r = 1; 59 51 this->colour_.g = 1; 60 52 this->colour_.b = 1; 61 this->colourDiff_ = 0.1 ;53 this->colourDiff_ = 0.1f; 62 54 } 63 55 … … 98 90 while(1) 99 91 { 100 phi = rnd(2* M_PI);101 teta = rnd( M_PI);92 phi = rnd(2*pi); 93 teta = rnd(pi); 102 94 float random = rnd(1); 103 95 if(sin(teta)>random) break; -
code/branches/presentation3/src/modules/designtools/CreateStars.h
r6994 r7028 27 27 */ 28 28 29 #include "DesignToolsPrereqs.h" 29 30 31 #include <string> 32 #include "util/Math.h" 30 33 #include "core/BaseObject.h" 31 32 #include "graphics/Billboard.h"33 34 34 35 35 namespace orxonox … … 49 49 } 50 50 51 int getNumStars() {51 int getNumStars() const { 52 52 return this->numStars_; 53 53 } … … 57 57 } 58 58 59 std::string& getMaterial(){59 const std::string& getMaterial() const { 60 60 return this->material_; 61 61 } … … 65 65 } 66 66 67 ColourValue& getColour(){67 const ColourValue& getColour() const { 68 68 return this->colour_; 69 69 } … … 73 73 } 74 74 75 float getAlpha() {75 float getAlpha() const { 76 76 return this->alpha_; 77 77 } … … 81 81 } 82 82 83 float getColourDiff() {83 float getColourDiff() const { 84 84 return this->colourDiff_; 85 85 } … … 89 89 } 90 90 91 float getAlphaDiff() {91 float getAlphaDiff() const { 92 92 return this->alphaDiff_; 93 93 } … … 97 97 } 98 98 99 float getRadiusDiff() {99 float getRadiusDiff() const { 100 100 return this->radiusDiff_; 101 101 } … … 106 106 } 107 107 108 unsigned int getRadius() {108 unsigned int getRadius()const { 109 109 return this->radius_; 110 110 } … … 115 115 int numStars_; 116 116 std::string material_; 117 orxonox::ColourValue colour_;117 ColourValue colour_; 118 118 std::vector<Billboard*> billboards_; 119 float radius_;119 unsigned int radius_; 120 120 float alpha_; 121 121 float colourDiff_;
Note: See TracChangeset
for help on using the changeset viewer.