Showing the changes to interface/src/ParticleSystem.h (1 of 3 files). Show all
Unified · Split
| @@ -9,6 +9,8 @@ · 8 unmodified lines | |||
| 9 | #ifndef hifi_ParticleSystem_h | 9 | #ifndef hifi_ParticleSystem_h |
| 10 | #define hifi_ParticleSystem_h | 10 | #define hifi_ParticleSystem_h |
| 11 | 11 | ||
| 12 | #include <glm/gtc/quaternion.hpp> | ||
| 13 | |||
| 12 | const int MAX_PARTICLES = 5000; | 14 | const int MAX_PARTICLES = 5000; |
| 13 | const int MAX_EMITTERS = 10; | 15 | const int MAX_EMITTERS = 10; |
| 14 | 16 | ||
| @@ -16,6 +18,7 @@ class ParticleSystem { · 1 unmodified line | |||
| 16 | public: | 18 | public: |
| 17 | ParticleSystem(); | 19 | ParticleSystem(); |
| 18 | 20 | ||
| 21 | void setEmitterPosition(int e, glm::vec3 position) { _emitter[e].position = position; } | ||
| 19 | void simulate(float deltaTime); | 22 | void simulate(float deltaTime); |
| 20 | void render(); | 23 | void render(); |
| 21 | 24 | ||
| @@ -27,11 +30,15 @@ private: · 5 unmodified lines | |||
| 27 | glm::vec3 color; | 30 | glm::vec3 color; |
| 28 | float age; | 31 | float age; |
| 29 | float radius; | 32 | float radius; |
| 33 | int emitterIndex; | ||
| 30 | }; | 34 | }; |
| 31 | 35 | ||
| 32 | struct Emitter { | 36 | struct Emitter { |
| 33 | glm::vec3 position; | 37 | glm::vec3 position; |
| 34 | glm::vec3 direction; | 38 | glm::quat rotation; |
| 39 | glm::vec3 right; | ||
| 40 | glm::vec3 up; | ||
| 41 | glm::vec3 front; | ||
| 35 | }; | 42 | }; |
| 36 | 43 | ||
| 37 | float _bounce; | 44 | float _bounce; |
| @@ -39,9 +46,8 @@ private: · 1 unmodified line | |||
| 39 | float _timer; | 46 | float _timer; |
| 40 | Emitter _emitter[MAX_EMITTERS]; | 47 | Emitter _emitter[MAX_EMITTERS]; |
| 41 | Particle _particle[MAX_PARTICLES]; | 48 | Particle _particle[MAX_PARTICLES]; |
| 42 | int _numberOfParticles; | 49 | int _numParticles; |
| 43 | glm::vec3 _home; | 50 | int _numEmitters; |
| 44 | glm::vec3 _tornadoAxis; | ||
| 45 | float _airFriction; | 51 | float _airFriction; |
| 46 | float _jitter; | 52 | float _jitter; |
| 47 | float _homeAttraction; | 53 | float _homeAttraction; |
| @@ -52,8 +58,11 @@ private: · 4 unmodified lines | |||
| 52 | glm::vec3 _TEST_bigSpherePosition; | 58 | glm::vec3 _TEST_bigSpherePosition; |
| 53 | 59 | ||
| 54 | // private methods | 60 | // private methods |
| 61 | void updateEmitter(int e, float deltaTime); | ||
| 55 | void updateParticle(int index, float deltaTime); | 62 | void updateParticle(int index, float deltaTime); |
| 56 | void runSpecialEffectsTest(float deltaTime); | 63 | void runSpecialEffectsTest(float deltaTime); |
| 64 | void renderEmitter(int emitterIndex, float size); | ||
| 65 | void renderParticle(int p); | ||
| 57 | }; | 66 | }; |
| 58 | 67 | ||
| 59 | #endif | 68 | #endif |