History

more work on particle system

Jeffrey Ventrella committed 13 years ago

Commit e6b751e1 parent c348c5e3 files · +137 −60Browse files

Showing the changes to interface/src/ParticleSystem.h (1 of 3 files). Show all

Unified · Split

interface/src/ParticleSystem.h+13−4
@@ -9,6 +9,8 @@ · 8 unmodified lines
99 #ifndef hifi_ParticleSystem_h
1010 #define hifi_ParticleSystem_h
1111
12+#include <glm/gtc/quaternion.hpp>
13+
1214 const int MAX_PARTICLES = 5000;
1315 const int MAX_EMITTERS = 10;
1416
@@ -16,6 +18,7 @@ class ParticleSystem { · 1 unmodified line
1618 public:
1719 ParticleSystem();
1820
21+ void setEmitterPosition(int e, glm::vec3 position) { _emitter[e].position = position; }
1922 void simulate(float deltaTime);
2023 void render();
2124
@@ -27,11 +30,15 @@ private: · 5 unmodified lines
2730 glm::vec3 color;
2831 float age;
2932 float radius;
33+ int emitterIndex;
3034 };
3135
3236 struct Emitter {
3337 glm::vec3 position;
34− glm::vec3 direction;
38+ glm::quat rotation;
39+ glm::vec3 right;
40+ glm::vec3 up;
41+ glm::vec3 front;
3542 };
3643
3744 float _bounce;
@@ -39,9 +46,8 @@ private: · 1 unmodified line
3946 float _timer;
4047 Emitter _emitter[MAX_EMITTERS];
4148 Particle _particle[MAX_PARTICLES];
42− int _numberOfParticles;
43− glm::vec3 _home;
44− glm::vec3 _tornadoAxis;
49+ int _numParticles;
50+ int _numEmitters;
4551 float _airFriction;
4652 float _jitter;
4753 float _homeAttraction;
@@ -52,8 +58,11 @@ private: · 4 unmodified lines
5258 glm::vec3 _TEST_bigSpherePosition;
5359
5460 // private methods
61+ void updateEmitter(int e, float deltaTime);
5562 void updateParticle(int index, float deltaTime);
5663 void runSpecialEffectsTest(float deltaTime);
64+ void renderEmitter(int emitterIndex, float size);
65+ void renderParticle(int p);
5766 };
5867
5968 #endif

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t