-
Notifications
You must be signed in to change notification settings - Fork 0
/
Emitter.h
42 lines (39 loc) · 987 Bytes
/
Emitter.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#pragma once
//----------------------------------------------------------------------------------
//
// Basic Sprite Emitter Class
//
//
// Kevin M. Smith - CS 134 SJSU
#include "Sprite.h"
// General purpose Emitter class for emitting sprites
// This works similar to a Particle emitter
//
class Emitter : public BaseObject {
public:
Emitter(SpriteSystem *);
void draw();
void start();
void stop();
void setLifespan(float); // in milliseconds
void setVelocity(ofVec3f); // pixel/sec
void setChildImage(ofImage);
void setChildSize(float w, float h) { childWidth = w; childHeight = h; }
void setImage(ofImage);
void setRate(float);
float maxDistPerFrame();
void update();
SpriteSystem *sys;
float rate;
ofVec3f velocity;
float lifespan;
bool started;
float lastSpawned;
ofImage childImage;
ofImage image;
bool drawable;
bool haveChildImage;
bool haveImage;
float width, height;
float childWidth, childHeight;
};