blob: f2b178852e2bb782fd522f6c57fcae266c2b7326 (
plain)
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
|
/*
render/particle.h
This file is part of the Osirion project and is distributed under
the terms of the GNU General Public License version 2
*/
#ifndef __INCLUDED_RENDER_PARTICLE_H__
#define __INCLUDED_RENDER_PARTICLE_H__
#include "math/axis.h"
#include "math/color.h"
#include "math/vector3f.h"
namespace render {
/* ---- class Particle --------------------------------------------- */
/**
* @brief One particle
* */
class Particle
{
public:
Particle(const math::Vector3f &location, const unsigned long timestamp);
Particle(const math::Vector3f &location, const math::Vector3f &velocity, const unsigned long timestamp);
/**
* @brief location of the particle
* */
inline const math::Vector3f &location() const {
return particle_location;
}
/**
* @brief velocity vector of the particle
* */
inline const math::Vector3f &velocity() const {
return particle_velocity;
}
const float radius() const
{
return particle_radius;
}
const float alpha() const
{
return particle_alpha;
}
/**
* @brief creation timestamp
* */
inline const unsigned long timestamp() const {
return particle_timestamp;
}
/**
* @brief reference to the location of the particle
* */
inline math::Vector3f &get_location() {
return particle_location;
}
/**
* @brief reference velocity vector of the particle
* */
inline math::Vector3f &get_velocity() {
return particle_velocity;
}
/**
* @brief set the location of the particle
* */
inline void set_location(const math::Vector3f &location)
{
particle_location.assign(location);
}
/**
* @brief set the velocity of the particle
* */
inline void set_velocity(const math::Vector3f &velocity)
{
particle_velocity.assign(velocity);
}
inline void set_radius(const float radius)
{
particle_radius = radius;
}
inline void set_alpha(const float alpha)
{
particle_alpha = alpha;
}
protected:
math::Vector3f particle_location;
math::Vector3f particle_velocity;
float particle_radius;
float particle_alpha;
unsigned long particle_timestamp;
};
} // namespace
#endif // __INCLUDED_RENDER_PARTICLE_H__
|