Browse Source

Dateien hochladen nach „“

Basti_Master
Fritz Lenssen 5 years ago
parent
commit
fc3f1be555
5 changed files with 343 additions and 0 deletions
  1. 38
    0
      Emitter.hpp
  2. 99
    0
      avatar.cpp
  3. 51
    0
      avatar.hpp
  4. 80
    0
      greatWhole.cpp
  5. 75
    0
      particleSystem.cpp

+ 38
- 0
Emitter.hpp View File

//
// Emitter.hpp
// emptyExample
//
// Created by Sebastian Holzki on 17.04.19.
//

#pragma once
#include <stdio.h>
#include "ofMain.h"


class Emitter {
public:
Emitter();
~Emitter();
void setEmitterPosition(ofVec2f _position);
ofVec2f getEmitterPosition();
int getEmitterX();
int getEmitterY();

private:
bool emitting;
void emitParticles(ofVec2f _positionOfEmission, bool _emitting);
ofVec2f direction;
ofVec2f position;
};

+ 99
- 0
avatar.cpp View File

//
// avatar.cpp
// emptyExample
//
// Created by Sebastian Holzki on 17.04.19.
//

#include "avatar.hpp"



Avatar::Avatar(int playerType){
setup(playerType);
}


// -----------------------------------------


Avatar::~Avatar(){
}


// -----------------------------------------


void Avatar::setup(int playerType){
//Load the right icon from data in ofImage, by using the transmitted info about the playerType
// --> icon = ....
}

// -----------------------------------------


void Avatar::update(){
}

// -----------------------------------------

void Avatar::draw(){
icon.draw(position);

}

// -----------------------------------------

ofVec2f Avatar::getPosition(){
return position;
}

// -----------------------------------------

void Avatar::setPosition(int _x, int _y){
position.x = _x;
position.y = _y;
}

void Avatar::setPosition(ofVec2f _position){
position = _position;
}


// -----------------------------------------

void Avatar::clipToAvatar(Avatar _avatar){
//Read coordinates to clip to:
ofVec2f tempCoords = _avatar.getPosition();
if( tempCoords.y == 0 ){
position.x = tempCoords.x + 20 ;
position.y = tempCoords.y + 20 ;
}else{
position.x = tempCoords.x + 20 ;
position.y = tempCoords.y - 20 ;
}
}

+ 51
- 0
avatar.hpp View File

//
// avatar.hpp
// emptyExample
//
// Created by Sebastian Holzki on 17.04.19.
//

#pragma once
#include <stdio.h>
#include "ofMain.h"




class Avatar {
public:
Avatar(int playerType);
~Avatar();
void setup(int playerType);
// void update();
void draw();
void setPlayerType();
int getPlayerType();
ofVec2f getPosition();
void setPosition(int x, int y);
void setPosition(ofVec2f position);
void clipToAvatar(Avatar avatar); //A particular avatar can clip its position, depending on the position of another avatar, compared to a beehive-structure)

private:
ofImage icon;
int playerType;
ofVec2f position;
};


+ 80
- 0
greatWhole.cpp View File

//
// greatWhole.cpp
// emptyExample
//
// Created by Sebastian Holzki on 17.04.19.
//

#include "greatWhole.hpp"
//#include "main.h"




GreatWhole::GreatWhole()
{
}

// -----------------------------------

GreatWhole::~GreatWhole()
{
}

// -----------------------------------



void GreatWhole::setup(){
}

// -----------------------------------------------


void GreatWhole::update(vector<Avatar*> avatars){
}

// -----------------------------------------------


void GreatWhole::draw(){
/*
draw the whole avatar vector
*/
}


// -----------------------------------------------


void GreatWhole::addAvatar(Avatar avatar){
avatars.push_back(avatar);
/*
Set coordinates in abhängigkeit vom letzten also bei avatars at (max-1)
*/
}



+ 75
- 0
particleSystem.cpp View File

//
// particleSystem.cpp
// emptyExample
//
// Created by Sebastian Holzki on 16.04.19.
//
#pragma once

#include "particleSystem.hpp"



ParticleSystem::ParticleSystem(){
}

// -----------------------------------

ParticleSystem::~ParticleSystem(){
}

// -----------------------------------



void ParticleSystem::setup(){
}

// -----------------------------------------------


void ParticleSystem::update(float deltaT, int visitorID, bool attracted){
/*

- wenn attracted, dann springe in Berechnung der Attraktion durch die vorhandenen Attraktoren
*/
/*
VisitorID stellt bekannten Besucher dar, also fertiges, auswertbares Profil.
visitorID steuert die Optik des Partikelsystems, aktiviert also eine Art Preset
z.B. Switch-Anweisung (visitorID 1-8):
case 0: default mode, attraction
case 1: load xml blabla1
case 2: load xml blabla2
...
*/
}

// -----------------------------------------------


void ParticleSystem::draw(){
/*
draw all the particles from the vector in the ParticleSystem
*/
}

Loading…
Cancel
Save