Simulant  21.12-194
A portable game engine for Windows, OSX, Linux, Dreamcast, and PSP
size_manipulator.h
1 #pragma once
2 
3 #include "../particle_script.h"
4 #include "curves.h"
5 
6 namespace smlt {
7 
8 class SizeManipulator : public Manipulator {
9 public:
11  Manipulator(script, "scalar") {}
12 
13  void set_bell_curve(float peak, float deviation) override {
14  is_bell_curve_ = true;
15  is_linear_curve_ = false;
16  peak_ = peak;
17  deviation_ = deviation;
18 
19  Manipulator::set_bell_curve(peak, deviation);
20  }
21 
22  void set_linear_curve(float rate) override {
23  is_linear_curve_ = true;
24  is_bell_curve_ = false;
25 
26  rate_ = rate;
27 
28  Manipulator::set_linear_curve(rate);
29  }
30 
31 private:
32  void do_manipulate(ParticleSystem* system, Particle* particles, std::size_t particle_count, float dt) const override;
33 
34  bool is_bell_curve_ = false;
35  bool is_linear_curve_ = false;
36 
37  float peak_ = 0.0f;
38  float rate_ = 0.0f;
39  float deviation_ = 0.0f;
40 };
41 
42 }
smlt::SizeManipulator
Definition: size_manipulator.h:8
smlt::Manipulator
Definition: particle_script.h:38
smlt
Definition: animation.cpp:25
smlt::ParticleSystem
Definition: particle_system.h:43
smlt::Particle
Definition: particle_system.h:21
smlt::ParticleScript
Definition: particle_script.h:71