123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199 |
- #pragma once
-
- //addons
- #include "ofxOsc.h"
- #include "ofxWarp.h"
-
- //headers
- //#include "ofMain.h"
- #include "particleSystem.hpp"
- #include "greatWhole.hpp"
- #include "visitor.hpp"
- #include "objectPhysics.hpp"
- // #include "particle.hpp"
-
-
-
-
-
-
-
- // *** SETUP OSC INFORMATION *** SETUP OSC INFORMATION ***
-
- #define PORT 12345
- //#define HOST "192.168.178.52"
-
-
- //typeOfView will be used, to toggle between the views of the logical scene and the scene after all the particles have been mapped
- //enum typeOfView{
- // LOGIC,
- // MAPPED
- //};
- //
-
- class ofApp : public ofBaseApp{
-
- public:
-
- void setup();
- void setupWarpStuff();
-
- void update();
- void draw();
-
- void keyPressed(int key);
- void keyReleased(int key);
- void mouseMoved(int x, int y);
- void mouseDragged(int x, int y, int button);
- void mousePressed(int x, int y, int button);
- void mouseReleased(int x, int y, int button);
- void mouseEntered(int x, int y);
- void mouseExited(int x, int y);
- void windowResized(int w, int h);
- void dragEvent(ofDragInfo dragInfo);
- void gotMessage(ofMessage msg);
-
-
-
-
- void drawMappedScene(float x, float y);
- void drawLogicalScene(float x, float y);
-
- int getTypeForCheckin(float x);
- int getSteleForCheckin(float x);
-
- void drawGrid(float sceneWidth, float sceneHeight, int columns, int rows);
- void drawStelen(float sceneWidth, float sceneHeight);
-
- int getBeginOfVisitorsInObjectPhysics();
-
- void refreshCoordinatesOfVisitorAttraktors(int beginOfVisitorsInObjectPhysicsVector, float sceneHeight);
-
- ofImage logicalBackground;
-
- typeOfView activeTypeOfView;
- bool listeningForStelenInput;
-
- CheckedInVisitor checkedInVisitor;
-
- //global mode for the whole scene; particles & particlesystem & objectPhysics will know about this!
- particleMode currentMode;
-
- //shall be used for checking if there has be a Change in the mode,
- //to be able to generate stuff in the update method without generating it in every iteration
- particleMode lastMode;
-
- //mode for setting a Mode only for one or more particular system(s)
- particleMode particularMode;
-
- string getCurrentModeAsString();
- bool currentModeHasChanged;
-
- ofxXmlSettings xmlForSetup;
- ofxXmlSettings xmlSettings;
-
- // *** MAGIC INSIDE *** MAGIC INSIDE *** MAGIC INSIDE ***
-
- vector<ObjectPhysics*> objectPhysics;
-
- vector<ParticleSystem*> particleSystems;
-
- vector<Visitor*> visitors;
-
- vector<CheckedInVisitor*> checkedInVisitors;
-
-
- //important stuff that regulates, whether a tornado can be triggered or not.
- //tornadoIsPossible will be set false after the tornado has been triggered
- //tornadoIsPossible will be set true after some time has passed
- bool tornadoIsPossible;
- float tornadoTimer;
-
- // *** GLOBALS *** GLOBALS *** GLOBALS *** GLOBALS ****
-
- //Changes in the scene can done with these
- //We should load these coordinates in the ofApp/setup() depending on the rendered scene, maybe via xml?
-
- ofVec2f centerOfScene;
- ofVec2f stele1_bottom;
- ofVec2f stele1_top;
- ofVec2f stele2_bottom;
- ofVec2f stele2_top;
- ofVec2f stele3_bottom;
- ofVec2f stele3_top;
- ofVec2f stele4_bottom;
- ofVec2f stele4_top;
- ofVec2f stele5_bottom;
- ofVec2f stele5_top;
- ofVec2f stele6_bottom;
- ofVec2f stele6_top;
-
-
-
- //Supervision can be done with these
-
- int COUNT_PARTICLES;
- //+1 for every new Particle, -1 for every Particle that gets older than the defined maxLife
-
- int COUNT_VISITORS;
- //the visitor count will be fed with the nBlobs-value from incoming OSC messages
-
- int COUNT_VISITORS_LASTFRAME;
-
- int COUNT_PARTICLESYSTEMS;
-
- int COUNT_OBJECTPHYSICS;
-
- int COUNT_CHECKEDINVISITORS;
-
- //OSC Buffer (we will store the information here and wait for the "go" (checkin) message to use it)
- int stele;
- int playerType;
-
-
- float timerAfterCheckin;
-
-
-
- string oscMsg;
- ofxOscReceiver receiver;
-
-
- private:
-
- // *** MAPPING *** MAPPING *** MAPPING *** MAPPING *** MAPPING ***
-
- ofxWarpController warpControllerCircle;
- ofxWarpController warpControllerStele1;
- ofxWarpController warpControllerStele2;
- ofxWarpController warpControllerStele3;
-
- ofFbo fbo_warp;
- ofVec2f sceneSizeWarp;
-
-
-
-
- int sceneWidth;
- int sceneHeight;
- int sceneHeightLastFrame;
-
- // *** OSC *** OSC *** OSC *** OSC *** OSC ***
-
-
- float timeSent, timeReceived;
-
-
- float deltaT;
-
-
- GreatWhole dasGrosseGanze;
-
- int WINDOWSIZE_WIDTH = 1000;
- int WINDOWSIZE_HEIGHT = 1000;
-
-
- };
-
-
|