123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337 |
- //
- // 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;
-
- };
-
- // -----------------------------------
-
-
-
-
-
-
-
-
-
-
|