Quelcode des Partikelsystems Boden
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

particleSystem.hpp 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. //
  2. // particleSystem.hpp
  3. // emptyExample
  4. //
  5. // Created by Sebastian Holzki on 16.04.19.
  6. //
  7. #pragma once
  8. #include <stdio.h>
  9. #include "attractor.hpp"
  10. #include "particle.hpp"
  11. #include "emitter.hpp"
  12. class ParticleSystem {
  13. ParticleSystem();
  14. ~ParticleSystem();
  15. public:
  16. void setup();
  17. void update(float deltaT, int playerType, bool attracted);
  18. void draw();
  19. /*
  20. Where do we make the quick setting-changes?
  21. Like for exampe change direction of an emitter + its position?
  22. --> XML?
  23. */
  24. private:
  25. vector<Particle*> particles;
  26. vector<Attractor*> attractors;
  27. vector<Emitter*> emitters;
  28. //Maybe the emitter does not have to be an own class, but is more like a Vector of Positions, so in the system.back it will setup particles for every position that is saved in this Vector
  29. //like following:
  30. //vector<Vec2f> positionsToEmitFrom;
  31. float birthcount;
  32. bool attracted;
  33. int playerType;
  34. };
  35. /*
  36. class AttractedSystem : public ParticleSystem {
  37. bool attracted = true;
  38. };
  39. */