10 #include "imstkAnimationModel.h" 11 #include "imstkColor.h" 15 struct RenderParticle;
27 Vec3f m_acceleration = Vec3f(0, 0, 0);
28 float m_rotationalAcceleration = 0;
62 const float time = 3000.0f,
63 Mode mode = Mode::Continuous);
69 virtual void setGeometry(std::shared_ptr<Geometry> renderParticles);
81 void setEmitterSize(
const float size);
97 void setInitialVelocityRange(
const Vec3f minDirection,
98 const Vec3f maxDirection,
100 const float maxSpeed,
101 const float minRotationSpeed,
102 const float maxRotationSpeed);
121 std::vector<RenderParticleKeyFrame>& getKeyFrames();
127 virtual void reset();
132 virtual void update();
138 void initializeParticles();
143 void interpolateColor(
Color& destination,
144 const Color& sourceA,
145 const Color& sourceB,
151 void emitParticle(std::unique_ptr<RenderParticle>& particle);
157 float getRandomNormalizedFloat();
164 = RenderParticleEmitter::Shape::Cube;
166 Vec3f m_minDirection;
167 Vec3f m_maxDirection;
170 float m_minRotationSpeed;
171 float m_maxRotationSpeed;
176 std::unique_ptr<StopWatch> m_stopWatch;
178 double m_lastUpdateTime = 0.0;
179 bool m_started =
false;
181 float m_emitterSize = 1.0f;
183 const int c_maxNumKeyFrames = 16;
185 std::shared_ptr<Geometry> m_animationGeometry =
nullptr;
186 std::vector<std::unique_ptr<RenderParticle>>* m_particles;
Keyframe for particle animation.
std::vector< RenderParticleKeyFrame > m_keyFrames
Particle keyframes.
Emitter continuously releases/recycles particles.
float m_time
total time for particle system
Contains geometric and animation render information.
static Color White
Various commonly used colors.
Animation method for rendering particles Common use cases include smoke and fire. ...