GlistEngine
Loading...
Searching...
No Matches
gBaseParticles.h
Go to the documentation of this file.
1/*
2 * gParticles.h
3 *
4 * Created on: 22 Aug 2022
5 * Author: noyan
6 */
7
8#ifndef SRC_GPARTICLES_H_
9#define SRC_GPARTICLES_H_
10
11#include "gRenderObject.h"
12#include "gPlane.h"
13
14
15class gParticle : public gRenderObject {
16public:
17 gColor currentcolor; //Current color of the particle
18 gColor fadecolor; //Increment the color by
19
20 glm::vec3 direction; //Change the position by
21 glm::vec3 gravity; //Change the position by
22
23 glm::vec3 topleft; //Upper Left corner to the square
24 glm::vec3 bottomright; //Lower right corner of the square
25
26 int frameno; //How many times has the particle been displayed
27 float age; //How many "seconds" elapsed (for gravity calculations)
28
29 float life;
31 float fadelife;
33
34public:
36 void draw();
37 void advance();
38
40};
41
42
44public:
46 virtual ~gBaseParticles();
47
48 virtual void init(int particleNum);
49 virtual void resetParticle(int particleNo);
50
51 void loadTexture(std::string texturePath);
52 void setTexture(gTexture* texture);
53 void draw();
54 void destroy();
55
56 void setLimit(float fLimitL, float fLimitR, float fLimitT, float fLimitB);
57 void setLimit(bool bLimit);
58 void setCurrentColor(int nParticle, float fRed, float fGreen, float fBlue, float fAlpha);
59 void setFadeColor(int nParticle, float fRed, float fGreen, float fBlue, float fAlpha);
60 void setDirection(int nParticle, float fX, float fY, float fZ);
61 void setGravity(int nParticle, float fX, float fY, float fZ);
62 void setLR(int nParticle, float fX, float fY, float fZ);
63 void setUL(int nParticle, float fX, float fY, float fZ);
64 void setAge(int nParticle, float fAge);
65 void setFrame(int nParticle, int nFrame);
66 void setGravityFactor(int nParticle, float fGravityFactor);
67 void setLife(int nParticle, float fLife);
68 void setFadeLife(int nParticle, float fFadeLife);
69 void setImgPath(std::string szImgPath);
70 void setInitialColor(float fRed, float fGreen, float fBlue, float fAlpha);
71
73
74protected:
79 int m_nAge;
80
81 float m_fLimitR;
82 float m_fLimitL;
83 float m_fLimitT;
84 float m_fLimitB;
85
86 std::string imagepath;
87
90
93};
94
95#endif /* SRC_GIPPARTICLES_H_ */
Definition gBaseParticles.h:43
virtual void init(int particleNum)
void setLR(int nParticle, float fX, float fY, float fZ)
void setCurrentColor(int nParticle, float fRed, float fGreen, float fBlue, float fAlpha)
gTexture * g
Definition gBaseParticles.h:88
gColor m_clrParticleColor
Definition gBaseParticles.h:89
void setGravity(int nParticle, float fX, float fY, float fZ)
void setInitialColor(float fRed, float fGreen, float fBlue, float fAlpha)
virtual ~gBaseParticles()
int m_nAge
Definition gBaseParticles.h:79
float m_fLimitL
Definition gBaseParticles.h:82
void setAge(int nParticle, float fAge)
void setLimit(float fLimitL, float fLimitR, float fLimitT, float fLimitB)
void setLife(int nParticle, float fLife)
void setGravityFactor(int nParticle, float fGravityFactor)
void loadTexture(std::string texturePath)
void setTexture(gTexture *texture)
void setImgPath(std::string szImgPath)
float m_fLimitT
Definition gBaseParticles.h:83
gParticle * particle
Definition gBaseParticles.h:76
void setFadeColor(int nParticle, float fRed, float fGreen, float fBlue, float fAlpha)
float m_fLimitR
Definition gBaseParticles.h:81
void setLimit(bool bLimit)
bool previousalpha
Definition gBaseParticles.h:92
virtual void resetParticle(int particleNo)
void setUL(int nParticle, float fX, float fY, float fZ)
std::string imagepath
Definition gBaseParticles.h:86
int particlenum
Definition gBaseParticles.h:78
bool m_bLimit
Definition gBaseParticles.h:75
float m_fLimitB
Definition gBaseParticles.h:84
int particleno
Definition gBaseParticles.h:91
bool m_bEngineActive
Definition gBaseParticles.h:77
void setDirection(int nParticle, float fX, float fY, float fZ)
void setFrame(int nParticle, int nFrame)
gPlane gp
Definition gBaseParticles.h:72
void setFadeLife(int nParticle, float fFadeLife)
Definition gColor.h:17
Definition gBaseParticles.h:15
int particleno
Definition gBaseParticles.h:32
glm::vec3 bottomright
Definition gBaseParticles.h:24
void advance()
gColor fadecolor
Definition gBaseParticles.h:18
float gravityfactor
Definition gBaseParticles.h:30
class gBaseParticles * pengine
Definition gBaseParticles.h:39
glm::vec3 direction
Definition gBaseParticles.h:20
float life
Definition gBaseParticles.h:29
float fadelife
Definition gBaseParticles.h:31
glm::vec3 topleft
Definition gBaseParticles.h:23
int frameno
Definition gBaseParticles.h:26
gColor currentcolor
Definition gBaseParticles.h:17
float age
Definition gBaseParticles.h:27
glm::vec3 gravity
Definition gBaseParticles.h:21
void draw()
Definition gPlane.h:29
Definition gRenderObject.h:25
Definition gTexture.h:17