ParticleEmitterSet3.hpp
Go to the documentation of this file.
1 // This code is based on Jet framework.
2 // Copyright (c) 2018 Doyub Kim
3 // CubbyFlow is voxel-based fluid simulation engine for computer games.
4 // Copyright (c) 2020 CubbyFlow Team
5 // Core Part: Chris Ohk, Junwoo Hwang, Jihong Sin, Seungwoo Yoo
6 // AI Part: Dongheon Cho, Minseo Kim
7 // We are making my contributions/submissions to this project solely in our
8 // personal capacity and are not conveying any rights to any intellectual
9 // property of any third parties.
10 
11 #ifndef CUBBYFLOW_PARTICLE_EMITTER_SET3_HPP
12 #define CUBBYFLOW_PARTICLE_EMITTER_SET3_HPP
13 
15 
16 namespace CubbyFlow
17 {
22 {
23  public:
24  class Builder;
25 
27  ParticleEmitterSet3() = default;
28 
30  explicit ParticleEmitterSet3(std::vector<ParticleEmitter3Ptr> emitters);
31 
33  ParticleEmitterSet3(const ParticleEmitterSet3&) = default;
34 
36  ParticleEmitterSet3(ParticleEmitterSet3&&) noexcept = default;
37 
39  ~ParticleEmitterSet3() override = default;
40 
43 
45  ParticleEmitterSet3& operator=(ParticleEmitterSet3&&) noexcept = default;
46 
48  void AddEmitter(const ParticleEmitter3Ptr& emitter);
49 
51  [[nodiscard]] static Builder GetBuilder();
52 
53  private:
54  std::vector<ParticleEmitter3Ptr> m_emitters;
55 
56  void OnSetTarget(const ParticleSystemData3Ptr& particles) override;
57 
58  void OnUpdate(double currentTimeInSeconds,
59  double timeIntervalInSecond) override;
60 };
61 
63 using ParticleEmitterSet3Ptr = std::shared_ptr<ParticleEmitterSet3>;
64 
69 {
70  public:
72  [[nodiscard]] Builder& WithEmitters(
73  const std::vector<ParticleEmitter3Ptr>& emitters);
74 
76  [[nodiscard]] ParticleEmitterSet3 Build() const;
77 
79  [[nodiscard]] ParticleEmitterSet3Ptr MakeShared() const;
80 
81  private:
82  std::vector<ParticleEmitter3Ptr> m_emitters;
83 };
84 } // namespace CubbyFlow
85 
86 #endif
Abstract base class for 3-D particle emitter.
Definition: ParticleEmitter3.hpp:21
std::shared_ptr< ParticleEmitter3 > ParticleEmitter3Ptr
Shared pointer for the ParticleEmitter3 type.
Definition: ParticleEmitter3.hpp:94
std::shared_ptr< ParticleSystemData3 > ParticleSystemData3Ptr
Shared pointer type of ParticleSystemData3.
Definition: ParticleSystemData.hpp:284
3-D particle-based emitter set.
Definition: ParticleEmitterSet3.hpp:21
ParticleEmitterSet3()=default
Default constructor.
Front-end to create ParticleEmitterSet3 objects step by step.
Definition: ParticleEmitterSet3.hpp:68
Definition: pybind11Utils.hpp:20
static Builder GetBuilder()
Returns builder fox ParticleEmitterSet3.
std::shared_ptr< ParticleEmitterSet3 > ParticleEmitterSet3Ptr
Shared pointer type for the ParticleEmitterSet3.
Definition: ParticleEmitterSet3.hpp:63
~ParticleEmitterSet3() override=default
Default virtual destructor.
ParticleEmitterSet3 & operator=(const ParticleEmitterSet3 &)=default
Default copy assignment operator.
void AddEmitter(const ParticleEmitter3Ptr &emitter)
Adds sub-emitter.