2020// Inherits from
2121#include " SceneNode.h"
2222
23+ // System headers
24+ #include < glm/vec4.hpp>
25+
2326// Common headers
2427#include " OpenGLLight.h"
2528
2629class BoltSceneNode : public SceneNode
2730{
2831public:
29- BoltSceneNode (const GLfloat pos[ 3 ] , const GLfloat vel[ 3 ] , bool super);
32+ BoltSceneNode (const glm::vec3 & pos, const glm::vec3 & vel, bool super);
3033 ~BoltSceneNode ();
3134
3235 void setFlares (bool );
3336 void setSize (float radius);
3437 void setColor (GLfloat r, GLfloat g, GLfloat b, GLfloat a = 1 .0f );
3538 void setTextureColor (GLfloat r, GLfloat g, GLfloat b, GLfloat a = 1 .0f );
36- void setColor (const GLfloat* rgb);
37- void setTeamColor (const GLfloat* rgb);
39+ void setColor (const glm::vec3 & rgb);
40+ void setTeamColor (const glm::vec3 & rgb);
3841 void setTexture (const int );
3942 void setTextureAnimation (int cu, int cv);
4043
4144 bool getColorblind () const ;
4245 void setColorblind (bool );
4346
44- bool getInvisible () const
45- {
46- return invisible;
47- }
48- void setInvisible (bool _invisible)
49- {
50- invisible = _invisible;
51- }
52-
53- void move (const GLfloat pos[3 ], const GLfloat forward[3 ]);
47+ void move (const glm::vec3 &pos, const glm::vec3 &forward);
5448 void addLight (SceneRenderer&);
5549
5650 void notifyStyleChange () override ;
@@ -64,10 +58,10 @@ class BoltSceneNode : public SceneNode
6458 public:
6559 BoltRenderNode (const BoltSceneNode*);
6660 ~BoltRenderNode ();
67- void setColor (const GLfloat* rgba);
68- void setTextureColor (const GLfloat* rgba);
61+ void setColor (const glm::vec4 & rgba);
62+ void setTextureColor (const glm::vec4 & rgba);
6963 void render () override ;
70- const GLfloat* getPosition () const override ;
64+ const glm::vec3 & getPosition () const override ;
7165 void setAnimation (int cu, int cv);
7266
7367 void renderGeoBolt ();
@@ -78,19 +72,18 @@ class BoltSceneNode : public SceneNode
7872 const BoltSceneNode* sceneNode;
7973 int u, v, cu, cv;
8074 GLfloat du, dv;
81- GLfloat mainColor[ 4 ] ;
82- GLfloat innerColor[ 4 ] ;
83- GLfloat outerColor[ 4 ] ;
84- GLfloat coronaColor[ 4 ] ;
85- GLfloat flareColor[ 4 ] ;
86- GLfloat textureColor[ 4 ] ;
75+ glm::vec4 mainColor;
76+ glm::vec4 innerColor;
77+ glm::vec4 outerColor;
78+ glm::vec4 coronaColor;
79+ glm::vec4 flareColor;
80+ glm::vec4 textureColor;
8781 int numFlares;
8882 float theta[6 ];
8983 float phi[6 ];
9084
91- static GLfloat core[9 ][2 ];
92- static GLfloat corona[8 ][2 ];
93- static const GLfloat ring[8 ][2 ];
85+ static glm::vec2 core[9 ];
86+ static const glm::vec2 corona[8 ];
9487 static const GLfloat CoreFraction;
9588 static const GLfloat FlareSize;
9689 static const GLfloat FlareSpread;
@@ -103,9 +96,9 @@ class BoltSceneNode : public SceneNode
10396 bool texturing;
10497 bool colorblind;
10598 float size;
106- float velocity[ 3 ] ;
107- GLfloat color[ 4 ] ;
108- fvec4 teamColor ;
99+ glm::vec4 color ;
100+ glm::vec4 teamColor ;
101+ glm::vec3 velocity ;
109102 OpenGLLight light;
110103 OpenGLGState gstate;
111104 OpenGLGState colorblindGState;
0 commit comments