-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathParticle.cpp
65 lines (45 loc) · 907 Bytes
/
Particle.cpp
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
* Particle.cpp
*
* Created on: 2011-02-17
* Author: zapo
*/
#include "Particle.h"
#include <iostream>
Particle::Particle() {
isVisible = false;
}
Particle::~Particle() {
}
float Particle::GetVelocity() const {
return velocity;
}
void Particle::SetVelocity(float velocity) {
this->velocity = velocity;
}
void Particle::SetIsVisible(bool visible) {
isVisible = visible;
}
bool Particle::GetIsVisible() const {
return isVisible;
}
void Particle::Render(sf::RenderTarget &) const {
}
sf::Vector2f Particle::GetDirection() const {
sf::Vector2f direction;
direction.x = cos(GetRotation() * M_PI / 180);
direction.y = -sin(GetRotation() * M_PI / 180);
return direction;
}
bool Particle::IsAlive() {
return TTL > 0;
}
int Particle::GetTTL() const {
return TTL;
}
void Particle::DecrementTTL(int num) {
TTL -= num;
}
void Particle::SetTTL(int TTL) {
this->TTL = TTL;
}