GlobeEngine
Sphere.h
Go to the documentation of this file.
1 
8 #ifndef GlobeEngine_Sphere_h
9 #define GlobeEngine_Sphere_h
10 
11 #include "OpenGL_Includes.h"
12 #include "DrawableComponent.h"
13 #include "Texture.h"
14 #include <math.h>
15 #include "Common.h"
16 
17 namespace ge {
19  {
20  public:
21  Sphere();
22  ~Sphere();
23  void clear() override;
24  void create() override {
25  this->create(100, 100);
26  };
27  void create(int _vertCircles, int _pointsPerCircle);
28 
29  void update() override;
30  void draw(std::shared_ptr<ge::Camera> _cam) override;
31 
32  void setAlpha(GLfloat _alpha);
33  void setAmbient(vmml::Vector4f _ambient);
34  void setDiffuse(vmml::Vector4f _diffuse);
35  void setSpectrumColor(vmml::Vector4f _spectrumColor);
36 
37  virtual void setRotation(vmml::Vector3d _rotations) override;
38 
39  // static methods for spheres
40  static vmml::Vector3d convertPolarToEuclidean(double _theta, double _phi);
41  // returns a vector with x = theta and y = phi
42  // based on the coordinate and the radius of the sphere
43  static vmml::Vector2d convertEucledianToPolar(vmml::Vector3d _in, double _radius);
44 
45  void setLightPosition(vmml::Vector3d _position);
46 
47  protected:
48  GLfloat alpha;
49  vmml::Vector4f ambient;
50  vmml::Vector4f diffuse;
51  vmml::Vector3d lightPosition;
52  vmml::Vector4f spectrumColor;
53 
56  };
57 }
58 #endif
void clear() override
Definition: Sphere.cpp:15
vmml::Vector3d lightPosition
Definition: Sphere.h:51
Definition: DrawableComponent.h:25
int pointsPerCircle
Definition: Sphere.h:55
int vertCircles
Definition: Sphere.h:54
void draw(std::shared_ptr< ge::Camera > _cam) override
Definition: Sphere.cpp:174
void setAmbient(vmml::Vector4f _ambient)
Definition: Sphere.cpp:224
void create() override
Definition: Sphere.h:24
Definition: Sphere.h:18
void setDiffuse(vmml::Vector4f _diffuse)
Definition: Sphere.cpp:227
vmml::Vector4f diffuse
Definition: Sphere.h:50
virtual void setRotation(vmml::Vector3d _rotations) override
Definition: Sphere.cpp:239
vmml::Vector4f spectrumColor
Definition: Sphere.h:52
void setAlpha(GLfloat _alpha)
Definition: Sphere.cpp:221
~Sphere()
Definition: Sphere.cpp:10
void setSpectrumColor(vmml::Vector4f _spectrumColor)
Definition: Sphere.cpp:231
static vmml::Vector2d convertEucledianToPolar(vmml::Vector3d _in, double _radius)
Definition: Sphere.cpp:30
void update() override
Definition: Sphere.cpp:217
Sphere()
Definition: Sphere.cpp:4
vmml::Vector4f ambient
Definition: Sphere.h:49
static vmml::Vector3d convertPolarToEuclidean(double _theta, double _phi)
Definition: Sphere.cpp:24
Definition: AvalancheTrainingSimulationEngine.h:28
void setLightPosition(vmml::Vector3d _position)
Definition: Sphere.cpp:235
GLfloat alpha
Definition: Sphere.h:48