// // objectPhysics.cpp // particle_combined // // Created by Sebastian Holzki on 11.06.19. // #include "objectPhysics.hpp" ObjectPhysics::ObjectPhysics(){ emitting = 0; attracting = 0; isAVisitorObject = false; age = 0; }; // ----------------------------------- ObjectPhysics::~ObjectPhysics() { }; // ----------------------------------- void ObjectPhysics::update(float deltaT){ aging(deltaT); } // ----------------------------------- void ObjectPhysics::setPosition(float x, float y){ position.set(x,y); } // ----------------------------------- void ObjectPhysics::setPosition(ofVec2f _position){ position = _position; } // ----------------------------------- ofVec2f ObjectPhysics::getPosition(){ return position; } // ----------------------------------- float ObjectPhysics::getAge(){ return age; } // ----------------------------------- void ObjectPhysics::setIsVisitor(bool isVisitor){ isAVisitorObject = isVisitor; } // ----------------------------------- bool ObjectPhysics::getIsVisitorObject(){ return isAVisitorObject; } // ----------------------------------- void ObjectPhysics::setEmitting(bool _emitting){ emitting = _emitting; } // ----------------------------------- void ObjectPhysics::setAttracting(bool _attracting){ attracting = _attracting; } // ----------------------------------- void ObjectPhysics::aging(float deltaT){ if(agingEnabled){ age += deltaT; } } // ---------------------------------------------------------------------- // *** ATTRAKTORS *** ATTRAKTORS *** ATTRAKTORS *** ATTRAKTORS *** // ---------------------------------------------------------------------- Attraktor::Attraktor(){ emitting = false; attracting = true; agingEnabled = false; type = "attraktor"; cout << "Attraktor Konstruktor" << endl; }; // ----------------------------------- Attraktor::Attraktor(float x, float y){ emitting = false; attracting = true; type = "attraktor"; position.set(x,y); cout << "Attraktor Konstruktor überladen" << endl; }; // ----------------------------------- Attraktor::Attraktor(ofVec2f _position){ emitting = false; attracting = true; type = "attraktor"; position.set(_position); // cout << "Attraktor Konstruktor überladen (ofVec2f position)" << endl; }; // ----------------------------------- Attraktor::~Attraktor(){ cout << "Attraktor Destruktor" << endl; }; // ---------------------------------------------------------------------- // *** EMITTERS *** EMITTERS *** EMITTERS *** EMITTERS *** // ---------------------------------------------------------------------- Emitter::Emitter(){ emitting = true; attracting = false; type = "emitter"; }; // ----------------------------------- Emitter::Emitter(float _x, float _y){ emitting = true; attracting = false; type = "emitter"; position.set(_x,_y); }; // ----------------------------------- Emitter::Emitter(ofVec2f _position){ emitting = true; attracting = false; type = "emitter"; position.set(_position); }; // ----------------------------------- Emitter::~Emitter(){ }; // ------------------------------------------------------------------ // *** EMITTER ON STELE *** EMITTER ON STELE *** EMITTER ON STELE *** // ------------------------------------------------------------------ EmitterOnStele::EmitterOnStele(){ emitting = true; attracting = false; agingEnabled = true; type = "emitterOnStele"; }; // ----------------------------------- EmitterOnStele::EmitterOnStele(float _x, float _y, bool _aging){ emitting = true; attracting = false; agingEnabled = _aging; type = "emitterOnStele"; position.set(_x,_y); }; // ----------------------------------- EmitterOnStele::EmitterOnStele(ofVec2f _position, bool _aging){ emitting = true; attracting = false; agingEnabled = _aging; type = "emitterOnStele"; position.set(_position); }; // ----------------------------------- EmitterOnStele::~EmitterOnStele(){ }; // ----------------------------------- // *** ATTRAKTOR ON STELE *** // ----------------------------------- AttraktorOnStele::AttraktorOnStele(){ emitting = false; attracting = true; type = "attraktorStele"; }; // ----------------------------------- AttraktorOnStele::AttraktorOnStele(float x, float y){ emitting = false; attracting = true; type = "attraktorStele"; position.set(x,y); // cout << "AttraktorStele Konstruktor überladen" << endl; }; // ----------------------------------- AttraktorOnStele::AttraktorOnStele(ofVec2f _position){ emitting = false; attracting = true; type = "attraktorStele"; position.set(_position); // cout << "Attraktor Konstruktor überladen (ofVec2f position)" << endl; }; // ----------------------------------- AttraktorOnStele::~AttraktorOnStele(){ cout << "AttraktorStelen Destruktor" << endl; }; // -----------------------------------