diff options
author | Chris Xiong <chirs241097@gmail.com> | 2016-05-15 23:53:05 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2016-05-15 23:53:05 +0800 |
commit | 9dd9574270473021cb92c285fe1d39354d31b106 (patch) | |
tree | a505293d7e46083e7363e897eb7611f26e685bf9 /visualization/extrasmeltutils.hpp | |
parent | 2c975039ea25cc2c6ebdd3372b454db4766b813d (diff) | |
download | QMidiPlayer-9dd9574270473021cb92c285fe1d39354d31b106.tar.xz |
Initial stubs for the particle system.
Use layouts in the effects window.
Diffstat (limited to 'visualization/extrasmeltutils.hpp')
-rw-r--r-- | visualization/extrasmeltutils.hpp | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/visualization/extrasmeltutils.hpp b/visualization/extrasmeltutils.hpp index 8a4a1bc..092fbfb 100644 --- a/visualization/extrasmeltutils.hpp +++ b/visualization/extrasmeltutils.hpp @@ -29,5 +29,59 @@ class smEntity3DBuffer void drawBatch(); }; +class smPSEmissionPositionGenerator +{ + public: + virtual smvec3d genPos(); +}; +class smParticleSystemInfo +{ + public: + smvec3d vel,velvar,acc,accvar; + smvec3d rotv,rotvvar,rota,rotavar; + double lifespan,lifespanvar; + int maxcount,emissioncount,ecvar; + double emissiondelay,edvar; + double initsize,initsizevar; + double finalsize,finalsizevar; + DWORD initcolor,initcolorvar; + DWORD finalcolor,finalcolorvar; + SMTEX texture;int blend; +}; +class smParticle +{ + friend class smParticleSystem; + private: + static SMELT* sm; + smvec3d pos,rot; + smvec3d vel,accel,rotv,rota; + double lifespan,clifespan; + double initsize,finalsize,size; + DWORD color,initcolor,finalcolor; + smQuad q; + public: + smParticle(); + ~smParticle(); + void render(); + void update(); +}; +class smParticleSystem +{ + private: + std::vector<smParticle*> particles; + smParticleSystemInfo psinfo; + smvec3d pos; + smPSEmissionPositionGenerator* posGenerator; + public: + smParticleSystem(); + ~smParticleSystem(); + void setParticleSystemInfo(smParticleSystemInfo _psinfo); + void setPos(smvec3d _pos); + void setPSEmissionPosGen(smPSEmissionPositionGenerator* _gen); + void startPS(); + void stopPS(); + void updatePS(); + void renderPS(); +}; extern smVertex makeVertex(float x,float y,float z,DWORD color,float tx,float ty); #endif // EXTRASMELTUTILS_H |