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.

ofApp.h 4.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. #pragma once
  2. //addons
  3. #include "ofxOsc.h"
  4. #include "ofxWarp.h"
  5. //headers
  6. //#include "ofMain.h"
  7. #include "particleSystem.hpp"
  8. #include "greatWhole.hpp"
  9. #include "visitor.hpp"
  10. #include "objectPhysics.hpp"
  11. // #include "particle.hpp"
  12. // *** SETUP OSC INFORMATION *** SETUP OSC INFORMATION ***
  13. #define PORT 12345
  14. //#define HOST "192.168.178.52"
  15. //typeOfView will be used, to toggle between the views of the logical scene and the scene after all the particles have been mapped
  16. //enum typeOfView{
  17. // LOGIC,
  18. // MAPPED
  19. //};
  20. //
  21. class ofApp : public ofBaseApp{
  22. public:
  23. void setup();
  24. void setupWarpStuff();
  25. void update();
  26. void draw();
  27. void keyPressed(int key);
  28. void keyReleased(int key);
  29. void mouseMoved(int x, int y);
  30. void mouseDragged(int x, int y, int button);
  31. void mousePressed(int x, int y, int button);
  32. void mouseReleased(int x, int y, int button);
  33. void mouseEntered(int x, int y);
  34. void mouseExited(int x, int y);
  35. void windowResized(int w, int h);
  36. void dragEvent(ofDragInfo dragInfo);
  37. void gotMessage(ofMessage msg);
  38. void drawMappedScene(float x, float y);
  39. void drawLogicalScene(float x, float y);
  40. int getTypeForCheckin(float x);
  41. int getSteleForCheckin(float x);
  42. void drawGrid(float sceneWidth, float sceneHeight, int columns, int rows);
  43. void drawStelen(float sceneWidth, float sceneHeight);
  44. int getBeginOfVisitorsInObjectPhysics();
  45. void refreshCoordinatesOfVisitorAttraktors(int beginOfVisitorsInObjectPhysicsVector, float sceneHeight);
  46. ofImage logicalBackground;
  47. typeOfView activeTypeOfView;
  48. bool listeningForStelenInput;
  49. CheckedInVisitor checkedInVisitor;
  50. //global mode for the whole scene; particles & particlesystem & objectPhysics will know about this!
  51. particleMode currentMode;
  52. //shall be used for checking if there has be a Change in the mode,
  53. //to be able to generate stuff in the update method without generating it in every iteration
  54. particleMode lastMode;
  55. //mode for setting a Mode only for one or more particular system(s)
  56. particleMode particularMode;
  57. string getCurrentModeAsString();
  58. bool currentModeHasChanged;
  59. ofxXmlSettings xmlForSetup;
  60. ofxXmlSettings xmlSettings;
  61. // *** MAGIC INSIDE *** MAGIC INSIDE *** MAGIC INSIDE ***
  62. vector<ObjectPhysics*> objectPhysics;
  63. vector<ParticleSystem*> particleSystems;
  64. vector<Visitor*> visitors;
  65. vector<CheckedInVisitor*> checkedInVisitors;
  66. //important stuff that regulates, whether a tornado can be triggered or not.
  67. //tornadoIsPossible will be set false after the tornado has been triggered
  68. //tornadoIsPossible will be set true after some time has passed
  69. bool tornadoIsPossible;
  70. float tornadoTimer;
  71. // *** GLOBALS *** GLOBALS *** GLOBALS *** GLOBALS ****
  72. //Changes in the scene can done with these
  73. //We should load these coordinates in the ofApp/setup() depending on the rendered scene, maybe via xml?
  74. ofVec2f centerOfScene;
  75. ofVec2f stele1_bottom;
  76. ofVec2f stele1_top;
  77. ofVec2f stele2_bottom;
  78. ofVec2f stele2_top;
  79. ofVec2f stele3_bottom;
  80. ofVec2f stele3_top;
  81. ofVec2f stele4_bottom;
  82. ofVec2f stele4_top;
  83. ofVec2f stele5_bottom;
  84. ofVec2f stele5_top;
  85. ofVec2f stele6_bottom;
  86. ofVec2f stele6_top;
  87. //Supervision can be done with these
  88. int COUNT_PARTICLES;
  89. //+1 for every new Particle, -1 for every Particle that gets older than the defined maxLife
  90. int COUNT_VISITORS;
  91. //the visitor count will be fed with the nBlobs-value from incoming OSC messages
  92. int COUNT_VISITORS_LASTFRAME;
  93. int COUNT_PARTICLESYSTEMS;
  94. int COUNT_OBJECTPHYSICS;
  95. int COUNT_CHECKEDINVISITORS;
  96. //OSC Buffer (we will store the information here and wait for the "go" (checkin) message to use it)
  97. int stele;
  98. int playerType;
  99. float timerAfterCheckin;
  100. string oscMsg;
  101. ofxOscReceiver receiver;
  102. private:
  103. // *** MAPPING *** MAPPING *** MAPPING *** MAPPING *** MAPPING ***
  104. ofxWarpController warpControllerCircle;
  105. ofxWarpController warpControllerStele1;
  106. ofxWarpController warpControllerStele2;
  107. ofxWarpController warpControllerStele3;
  108. ofFbo fbo_warp;
  109. ofVec2f sceneSizeWarp;
  110. int sceneWidth;
  111. int sceneHeight;
  112. int sceneHeightLastFrame;
  113. // *** OSC *** OSC *** OSC *** OSC *** OSC ***
  114. float timeSent, timeReceived;
  115. float deltaT;
  116. GreatWhole dasGrosseGanze;
  117. int WINDOWSIZE_WIDTH = 1000;
  118. int WINDOWSIZE_HEIGHT = 1000;
  119. };