ParticleEmitterSet3.h
Go to the documentation of this file.
1 /*************************************************************************
2 > File Name: ParticleEmitterSet3.h
3 > Project Name: CubbyFlow
4 > Author: Chan-Ho Chris Ohk
5 > Purpose: 3-D particle-based emitter set.
6 > Created Time: 2017/05/10
7 > Copyright (c) 2018, Chan-Ho Chris Ohk
8 *************************************************************************/
9 #ifndef CUBBYFLOW_PARTICLE_EMITTER_SET3_H
10 #define CUBBYFLOW_PARTICLE_EMITTER_SET3_H
11 
13 
14 namespace CubbyFlow
15 {
20  {
21  public:
22  class Builder;
23 
26 
28  explicit ParticleEmitterSet3(const std::vector<ParticleEmitter3Ptr>& emitters);
29 
31  virtual ~ParticleEmitterSet3();
32 
34  void AddEmitter(const ParticleEmitter3Ptr& emitter);
35 
37  static Builder GetBuilder();
38 
39  private:
40  std::vector<ParticleEmitter3Ptr> m_emitters;
41 
42  void OnSetTarget(const ParticleSystemData3Ptr& particles) override;
43 
44  void OnUpdate(double currentTimeInSeconds, double timeIntervalInSecond) override;
45  };
46 
48  using ParticleEmitterSet3Ptr = std::shared_ptr<ParticleEmitterSet3>;
49 
54  {
55  public:
57  Builder& WithEmitters(const std::vector<ParticleEmitter3Ptr>& emitters);
58 
60  ParticleEmitterSet3 Build() const;
61 
64 
65  private:
66  std::vector<ParticleEmitter3Ptr> m_emitters;
67  };
68 }
69 
70 #endif
Abstract base class for 3-D particle emitter.
Definition: ParticleEmitter3.h:19
std::shared_ptr< ParticleEmitter3 > ParticleEmitter3Ptr
Shared pointer for the ParticleEmitter3 type.
Definition: ParticleEmitter3.h:71
std::shared_ptr< ParticleSystemData3 > ParticleSystemData3Ptr
Shared pointer type of ParticleSystemData3.
Definition: ParticleSystemData3.h:250
3-D particle-based emitter set.
Definition: ParticleEmitterSet3.h:19
ParticleEmitterSet3()
Constructs an emitter.
Front-end to create ParticleEmitterSet3 objects step by step.
Definition: ParticleEmitterSet3.h:53
Definition: pybind11Utils.h:24
virtual ~ParticleEmitterSet3()
Destructor.
Builder & WithEmitters(const std::vector< ParticleEmitter3Ptr > &emitters)
Returns builder with list of sub-emitters.
static Builder GetBuilder()
Returns builder fox ParticleEmitterSet3.
ParticleEmitterSet3Ptr MakeShared() const
Builds shared pointer of ParticleEmitterSet3 instance.
std::shared_ptr< ParticleEmitterSet3 > ParticleEmitterSet3Ptr
Shared pointer type for the ParticleEmitterSet3.
Definition: ParticleEmitterSet3.h:48
ParticleEmitterSet3 Build() const
Builds ParticleEmitterSet3.
void AddEmitter(const ParticleEmitter3Ptr &emitter)
Adds sub-emitter.