Showing the changes to interface/src/ParticleSystem.h (1 of 8 files). Show all
Unified · Split
| @@ -0,0 +1,59 @@ | |||
| 1 | // | ||
| 2 | // ParticleSystem.h | ||
| 3 | // hifi | ||
| 4 | // | ||
| 5 | // Created by Jeffrey on July 10, 2013 | ||
| 6 | // | ||
| 7 | // | ||
| 8 | |||
| 9 | #ifndef hifi_ParticleSystem_h | ||
| 10 | #define hifi_ParticleSystem_h | ||
| 11 | |||
| 12 | const int MAX_PARTICLES = 5000; | ||
| 13 | const int MAX_EMITTERS = 10; | ||
| 14 | |||
| 15 | class ParticleSystem { | ||
| 16 | public: | ||
| 17 | ParticleSystem(); | ||
| 18 | |||
| 19 | void simulate(float deltaTime); | ||
| 20 | void render(); | ||
| 21 | |||
| 22 | private: | ||
| 23 | |||
| 24 | struct Particle { | ||
| 25 | glm::vec3 position; | ||
| 26 | glm::vec3 velocity; | ||
| 27 | glm::vec3 color; | ||
| 28 | float age; | ||
| 29 | float radius; | ||
| 30 | }; | ||
| 31 | |||
| 32 | struct Emitter { | ||
| 33 | glm::vec3 position; | ||
| 34 | glm::vec3 direction; | ||
| 35 | }; | ||
| 36 | |||
| 37 | float _bounce; | ||
| 38 | float _gravity; | ||
| 39 | float _timer; | ||
| 40 | Emitter _emitter[MAX_EMITTERS]; | ||
| 41 | Particle _particle[MAX_PARTICLES]; | ||
| 42 | int _numberOfParticles; | ||
| 43 | glm::vec3 _home; | ||
| 44 | glm::vec3 _tornadoAxis; | ||
| 45 | float _airFriction; | ||
| 46 | float _jitter; | ||
| 47 | float _homeAttraction; | ||
| 48 | float _tornadoForce; | ||
| 49 | float _neighborAttraction; | ||
| 50 | float _neighborRepulsion; | ||
| 51 | float _TEST_bigSphereRadius; | ||
| 52 | glm::vec3 _TEST_bigSpherePosition; | ||
| 53 | |||
| 54 | // private methods | ||
| 55 | void updateParticle(int index, float deltaTime); | ||
| 56 | void runSpecialEffectsTest(float deltaTime); | ||
| 57 | }; | ||
| 58 | |||
| 59 | #endif | ||