// // particle.hpp // // Created by Sebastian Holzki on 16.04.19. // #pragma once #include #include "ofMain.h" #include "objectPhysics.hpp" #include "visitor.hpp" #include "checkedInVisitor.hpp" enum typeOfView{ LOGIC, MAPPED }; enum particleMode{ PARTICLE_MODE_DEFAULT, PARTICLE_MODE_POLYMESH, PARTICLE_MODE_RFID, PARTICLE_MODE_TORNADO }; class Particle { public: Particle(); Particle(ofVec2f _position); ~Particle(); void setup(ofVec2f position, float sceneHeight); bool isTheSetupPositionOnTheGround(ofVec2f position, float sceneHeight); void update(float deltaT, particleMode currentModeParticle, vector* objectPhysics, vector* checkedInVisitors, float sceneWidth, float sceneHeight); void draw(typeOfView activeTypeOfView); float getMaxLife(); float getAgeNorm(); float getAngle(); ofVec2f getPosition(); void setRandomVelocity(); void setRandomVelocityOnlyGoingUp(); void updateColor(); // void setColor(int r, int g, int b); void attractParticle(vector* objectPhysics, vector* checkedInVisitors); void updateAngleToCenter(float centerX, float centerY); void updateDistanceToCenter(float centerX, float centerY, float sceneHeight); bool particleIsOnGround; bool particleJumpedOffGround; bool particleJumpedOnGround; void mapParticle(float sceneWidth, float sceneHeight); bool borderCollission(); typeOfView activeTypeOfView; particleMode currentMode; particleMode lastMode; float sceneWidth; float sceneHeight; private: ofVec2f velocity; ofVec2f position; ofVec2f mappedPosition; float factorOfSlowingDown; float activeSlowingDown; float factorOfSpeedingUp; float activeSpeedingUp; //Mapping information float angleToCenter; float distanceToCenter; float distanceToCenterLastFrame; float age; float maxLife; bool aging; float size; float scaleFactorPerDeltaT; 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 };