Projektordner für das Team Deutsches Museum (FORUM).
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.

particle.cpp 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. //
  2. // particle.cpp
  3. // emptyExample
  4. //
  5. // Created by Sebastian Holzki on 16.04.19.
  6. //
  7. #include "particle.hpp"
  8. Particle::Particle()
  9. {
  10. }
  11. // -----------------------------------
  12. Particle::~Particle()
  13. {
  14. }
  15. // -----------------------------------
  16. void Particle::setup(ofVec2f _position){
  17. this->position = _position;
  18. velocity.set(0,0);
  19. age = 0.0;
  20. maxLife = 12.0;
  21. color.set(250,250,250);
  22. size = 2.0;
  23. mass = 100;
  24. }
  25. // -----------------------------------
  26. void Particle::update(float deltaT){
  27. }
  28. // -----------------------------------
  29. void Particle::draw(){
  30. ofDrawCircle(position,size);
  31. }
  32. //-----------------------------------
  33. float Particle::getMaxLife(){
  34. return maxLife;
  35. }
  36. //-----------------------------------
  37. float Particle::getAge(){
  38. return age;
  39. }
  40. //-----------------------------------
  41. void Particle::mapParticle(){
  42. /*
  43. Put an if Statement before it:
  44. if(borderCollission == true){mapParticle()}
  45. The particle will be mapped to a new position, using information about:
  46. - old position
  47. - velocity (direction)
  48. - defined borders in the projection --> globals like window size, angle between "stelen", width of stelen, etc.
  49. if the particle hits a border
  50. */
  51. }