74 lines
1.1 KiB
C++
74 lines
1.1 KiB
C++
|
//
|
||
|
// 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;
|
||
|
|
||
|
};
|
||
|
|
||
|
*/
|
||
|
|