Loading...
Searching...
No Matches
GridEmitter2.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_GRID_EMITTER2_HPP
12#define CUBBYFLOW_GRID_EMITTER2_HPP
13
14#include <functional>
15#include <memory>
16
17namespace CubbyFlow
18{
23{
24 public:
32 std::function<void(GridEmitter2*, double, double)>;
33
35 GridEmitter2() = default;
36
38 GridEmitter2(const GridEmitter2&) = default;
39
42
45
48
51
54 void Update(double currentTimeInSeconds, double timeIntervalInSeconds);
55
58
61
73
76 double timeIntervalInSeconds) = 0;
77
79 double timeIntervalInSeconds);
80
81 private:
82 OnBeginUpdateCallback m_onBeginUpdateCallback;
83 bool m_isEnabled = true;
84};
85
88} // namespace CubbyFlow
89
90#endif
Abstract base class for 2-D grid-based emitters.
Definition GridEmitter2.hpp:23
void Update(double currentTimeInSeconds, double timeIntervalInSeconds)
GridEmitter2(GridEmitter2 &&) noexcept=default
Default move constructor.
GridEmitter2(const GridEmitter2 &)=default
Default copy constructor.
virtual void OnUpdate(double currentTimeInSeconds, double timeIntervalInSeconds)=0
void SetIsEnabled(bool enabled)
Sets true/false to enable/disable the emitter.
void CallOnBeginUpdateCallback(double currentTimeInSeconds, double timeIntervalInSeconds)
std::function< void(GridEmitter2 *, double, double)> OnBeginUpdateCallback
Callback function type for update calls.
Definition GridEmitter2.hpp:32
void SetOnBeginUpdateCallback(const OnBeginUpdateCallback &callback)
Sets the callback function to be called when GridEmitter2::Update function is invoked.
bool GetIsEnabled() const
Returns true if the emitter is enabled.
GridEmitter2()=default
Default constructor.
Definition Matrix.hpp:30
Definition pybind11Utils.hpp:21
Matrix< T, Rows, 1 > Vector
Definition Matrix.hpp:738
std::shared_ptr< GridEmitter2 > GridEmitter2Ptr
Shared pointer type for the GridEmitter2.
Definition GridEmitter2.hpp:87