Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/render/particle.h')
-rw-r--r--src/render/particle.h108
1 files changed, 108 insertions, 0 deletions
diff --git a/src/render/particle.h b/src/render/particle.h
new file mode 100644
index 0000000..f2b1788
--- /dev/null
+++ b/src/render/particle.h
@@ -0,0 +1,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__