@@ -0,0 +1,146 @@ | |||
#pragma once | |||
#include "ofApp.h" | |||
// *** GLOBALS DEFINITION *** GLOBALS DEFINITION *** GLOBALS DEFINITION *** GLOBALS DEFINITION **** | |||
//-------------------------------------------------------------- | |||
void ofApp::setup(){ | |||
for (int i = 0; i < particleSystems.size(); i++){ | |||
} | |||
// *** OSC Setup *** OSC Setup *** OSC Setup *** | |||
receiver.setup(PORT); | |||
} | |||
//-------------------------------------------------------------- | |||
void ofApp::update(){ | |||
// *** OSC RECEIVER *** OSC RECEIVER *** OSC RECEIVER *** | |||
/* | |||
Here the program will read and convert the information from the tracking, probably count & coordinates of people entering the ground. | |||
We have to define, how this information will affect the particleSystems! | |||
Check for every particleSystem, if the information is relevant for its "update". | |||
*/ | |||
// *** RFID Input *** RFID Input *** RFID Input *** | |||
/* | |||
Here we have to define, how the particleSystems react to RFID input. | |||
Read ID of a visitor and let the particlesystems react to it. | |||
!!! Here in ofApp.cpp there will only be the transfer of incoming information about IDs, playertypes, etc. into the update-methods of the particleSystems. !!! | |||
For example: | |||
- Tell all particleSystems about a new checkedIn-Visitor | |||
- Set the playerType of one particular particleSystem to the checked in. | |||
*/ | |||
for (int p = 0; p < particleSystems.size();) | |||
{ | |||
// Update particle systems | |||
// particleSystems.at(p)->update("xxx , xxx , xxx , .... "); | |||
} | |||
} | |||
//-------------------------------------------------------------- | |||
void ofApp::draw(){ | |||
//draw all ParticleSystems that are in the particleSystems vector | |||
for(int p = 0; p < particleSystems.size(); p++) | |||
{ | |||
particleSystems.at(p)->draw(); | |||
} | |||
} | |||
//-------------------------------------------------------------- | |||
void ofApp::keyPressed(int key){ | |||
} | |||
//-------------------------------------------------------------- | |||
void ofApp::keyReleased(int key){ | |||
} | |||
//-------------------------------------------------------------- | |||
void ofApp::mouseMoved(int x, int y){ | |||
} | |||
//-------------------------------------------------------------- | |||
void ofApp::mouseDragged(int x, int y, int button){ | |||
} | |||
//-------------------------------------------------------------- | |||
void ofApp::mousePressed(int x, int y, int button){ | |||
} | |||
//-------------------------------------------------------------- | |||
void ofApp::mouseReleased(int x, int y, int button){ | |||
} | |||
//-------------------------------------------------------------- | |||
void ofApp::mouseEntered(int x, int y){ | |||
} | |||
//-------------------------------------------------------------- | |||
void ofApp::mouseExited(int x, int y){ | |||
} | |||
//-------------------------------------------------------------- | |||
void ofApp::windowResized(int w, int h){ | |||
} | |||
//-------------------------------------------------------------- | |||
void ofApp::gotMessage(ofMessage msg){ | |||
} | |||
//-------------------------------------------------------------- | |||
void ofApp::dragEvent(ofDragInfo dragInfo){ | |||
} | |||
//-------------------------------------------------------------- | |||
@@ -0,0 +1,77 @@ | |||
#pragma once | |||
#include "ofMain.h" | |||
#include "particleSystem.hpp" | |||
#include "greatWhole.hpp" | |||
#include "avatar.hpp" | |||
//#include "ofxOsc.h" | |||
int WINDOWSIZE_WIDTH = 1000; | |||
int WINDOWSIZE_HEIGHT = 1000; | |||
int PARTICLE_COUNT; | |||
//+1 for every new Particle, -1 for every Particle that gets older than the defined maxLife | |||
// *** SETUP OSC INFORMATION *** SETUP OSC INFORMATION *** | |||
#define PORT 12345 | |||
#define HOST "xxx.xxx.xxx.xxx" | |||
class ofApp : public ofBaseApp{ | |||
public: | |||
void setup(); | |||
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); | |||
private: | |||
// *** OSC *** OSC *** OSC *** | |||
string oscMsg; | |||
// ofxOscReceiver receiver; | |||
float timeSent, timeReceived; | |||
//Information about what is going on in the scene | |||
int nBlobs; //count of the tracked visitors | |||
vector<ParticleSystem*> particleSystems; | |||
GreatWhole dasGrosseGanze; | |||
}; | |||
@@ -0,0 +1,122 @@ | |||
// | |||
// particle.cpp | |||
// emptyExample | |||
// | |||
// Created by Sebastian Holzki on 16.04.19. | |||
// | |||
#pragma once | |||
#include "particle.hpp" | |||
#include "ofApp.h" | |||
Particle::Particle() | |||
{ | |||
} | |||
// ----------------------------------- | |||
Particle::~Particle() | |||
{ | |||
} | |||
// ----------------------------------- | |||
void Particle::setup(ofVec2f _position){ | |||
this->position = _position; | |||
velocity.set(0,0); | |||
age = 0.0; | |||
maxLife = 12.0; | |||
color.set(250,250,250); | |||
size = 2.0; | |||
mass = 100; | |||
} | |||
// ----------------------------------- | |||
void Particle::update(float deltaT, Attractor attractor){ | |||
} | |||
// ----------------------------------- | |||
void Particle::draw(){ | |||
ofDrawCircle(position,size); | |||
} | |||
//----------------------------------- | |||
float Particle::getMaxLife(){ | |||
return maxLife; | |||
} | |||
//----------------------------------- | |||
float Particle::getAge(){ | |||
return age; | |||
} | |||
//----------------------------------- | |||
void Particle::mapParticle(){ | |||
/* | |||
Put an if Statement before it: | |||
if(borderCollission == true){mapParticle()} | |||
The particle will be mapped to a new position, using information about: | |||
- old position | |||
- velocity (direction) | |||
- defined borders in the projection --> globals like window size, angle between "stelen", width of stelen, etc. | |||
if the particle hits a border | |||
*/ | |||
} | |||
@@ -0,0 +1,56 @@ | |||
// | |||
// particle.hpp | |||
// emptyExample | |||
// | |||
// Created by Sebastian Holzki on 16.04.19. | |||
// | |||
#pragma once | |||
#include <stdio.h> | |||
#include "ofMain.h" | |||
#include "attractor.hpp" | |||
class Particle { | |||
public: | |||
Particle(); | |||
~Particle(); | |||
void setup(ofVec2f position); | |||
void update(float deltaT, Attractor attractor); | |||
void draw(); | |||
float getMaxLife(); | |||
float getAge(); | |||
float getAgeNorm(); | |||
void mapParticle(); | |||
bool borderCollission(); | |||
private: | |||
ofVec2f velocity; | |||
ofVec2f position; | |||
float maxLife; | |||
float age; | |||
float size; | |||
float mass; | |||
ofColor color; | |||
int stele; | |||
//on which "stele" is the particle? --> will affect the movement (mapping), when it reaches borders of its "stele" ! | |||
//if border 1/2/3/4 (<,>,v,^), then map particle | |||
}; |
@@ -0,0 +1,73 @@ | |||
// | |||
// particleSystem.hpp | |||
// emptyExample | |||
// | |||
// Created by Sebastian Holzki on 16.04.19. | |||
// | |||
#pragma once | |||
#include <stdio.h> | |||
#include "attractor.hpp" | |||
#include "particle.hpp" | |||
#include "emitter.hpp" | |||
class ParticleSystem { | |||
ParticleSystem(); | |||
~ParticleSystem(); | |||
public: | |||
void setup(); | |||
void update(float deltaT, int playerType, bool attracted); | |||
void draw(); | |||
/* | |||
Where do we make the quick setting-changes? | |||
Like for exampe change direction of an emitter + its position? | |||
--> XML? | |||
*/ | |||
private: | |||
vector<Particle*> particles; | |||
vector<Attractor*> attractors; | |||
vector<Emitter*> emitters; | |||
//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 | |||
//like following: | |||
//vector<Vec2f> positionsToEmitFrom; | |||
float birthcount; | |||
bool attracted; | |||
int playerType; | |||
}; | |||
/* | |||
class AttractedSystem : public ParticleSystem { | |||
bool attracted = true; | |||
}; | |||
*/ | |||