diff options
Diffstat (limited to 'src/render/particleejectorscript.h')
-rw-r--r-- | src/render/particleejectorscript.h | 54 |
1 files changed, 50 insertions, 4 deletions
diff --git a/src/render/particleejectorscript.h b/src/render/particleejectorscript.h index 535458e..ef2be4c 100644 --- a/src/render/particleejectorscript.h +++ b/src/render/particleejectorscript.h @@ -126,6 +126,14 @@ public: } /** + * @brief true if particle color is interpolated between color() and color_second() + * */ + inline const bool color_interpolated() const + { + return script_color_interpolated; + } + + /** * @brief ejector particles and speed are scaled according to modelscale * */ inline const bool scaled() const @@ -156,6 +164,14 @@ public: } /** + * @brief secondary color used to render ejected particles + * */ + inline const math::Color &color_second() const + { + return script_color_second; + } + + /** * @brief radius vector for ejected particles, start, middle, end * The radius is interpolated depending on the age and lifespan of the particle * */ @@ -249,13 +265,21 @@ public: } /** - * @brief return a reference to particle color + * @brief return a reference to primary particle color * */ inline math::Color &get_color() { return script_color; } + /** + * @brief return a reference to secondary particle color + * */ + inline math::Color &get_color_second() + { + return script_color_second; + } + /** * @brief set the ejector type * */ @@ -408,19 +432,35 @@ public: script_attached = attached; } + /** + * @brief set to true to interpolate particle color between color() and color_second() + * */ + inline void set_color_interpolated(const bool color_interpolated) + { + script_color_interpolated = color_interpolated; + } + inline void set_scaled(const bool scaled) { script_scaled = scaled; } /** - * @brief set the particle color + * @brief set the particle color at the begin of lifespan * */ inline void set_color(const math::Color &color) { script_color.assign(color); } + /** + * @brief set the particle color at the end of lifespane + * */ + inline void set_color_second(const math::Color &color_second) + { + script_color_second.assign(color_second); + } + private: /// type of ejector Type script_type; @@ -450,9 +490,15 @@ private: /// spawn radius float script_spawn_radius; - /// color of ejected particles + /// color of ejected particles at start of lifespan math::Color script_color; - + + /// color of ejected particles at end of lifespan + math::Color script_color_second; + + /// true of the particle color has to be interpolated betwoon color and color_second + bool script_color_interpolated; + /// particles have entity primary color bool script_entity; /// particles have entity secondary color |