62#pragma region static_functions
73#pragma region overriden_functions
77 return std::make_unique<ParticleGenerator>(*
this);
82 auto onUpdate(
float dt) ->
void override;
88 auto load(
const Stream& stream) ->
void override;
89 auto save(
Stream& stream)
const ->
void override;
98#pragma region ParticleGenerator_functions
119#pragma region messaging_functions
125#pragma region member_variables
129 std::vector<std::unique_ptr<ParticleEmitter>>
emitters;
138#pragma region helper_functions
142#pragma region static_variables
sys::Json Stream
Definition AudioObject.h:20
The base class for components, holding all of their shared All components should inherit from this.
nlohmann::json json
Definition Json.cpp:19
An object that manages many of a single type of particle.
Component(ComponentTypeEnum type, const char *typeName)
Definition Component.cpp:72
GameObject(std::string typeName, gobj::Type parentType, gobj::Type type)
constructor for gameobject.
Definition GameObject.cpp:23
An object that manages many of a single type of particle.
Definition ParticleEmitter.h:32
A Component that generates several types of particles, by holding several ParticleEmitters.
Definition ParticleGenerator.h:60
std::vector< std::unique_ptr< ParticleEmitter > > emitters
All the particle emitters inside the generator.
Definition ParticleGenerator.h:129
auto endWindow() -> void override
currently unused, but intended to but was assumed to be necessary for a proper ImGui editor
Definition ParticleGenerator.h:84
auto activate() -> void
Activates the particle generator, and all it's emitters If the particle generator is set to repeat,...
Definition ParticleGenerator.cpp:182
auto onEnterEngine() -> void override
hook that is called when a GameObject enters the Engine tree.
Definition ParticleGenerator.cpp:131
auto onRender() -> void override
called every frame after update has been called for every object.
Definition ParticleGenerator.cpp:117
~ParticleGenerator() override=default
friend auto to_json(json &j, const ParticleGenerator &n) -> void
Definition ParticleGenerator.cpp:139
auto operator=(const ParticleGenerator &) -> ParticleGenerator &=default
auto operator=(ParticleGenerator &&other) noexcept -> ParticleGenerator &=default
ParticleGenerator()
Definition ParticleGenerator.cpp:27
bool active
whether the generator should currently emit particles
Definition ParticleGenerator.h:132
bool repeats
whether the generator continuously emits particles (true), or emits on a burst
Definition ParticleGenerator.h:134
auto save(Stream &stream) const -> void override
Implementations will load the state of a GameObject to a th::Json object.
Definition ParticleGenerator.cpp:126
auto linkMessages() -> void
Definition ParticleGenerator.cpp:199
ParticleGenerator(ParticleGenerator &&other) noexcept=default
auto addEmitter() -> void
Creates a new, default constructed Particle Emitter.
Definition ParticleGenerator.cpp:176
friend auto from_json(const json &j, ParticleGenerator &n) -> void
Definition ParticleGenerator.cpp:152
auto onUpdate(float dt) -> void override
called once every frame.
Definition ParticleGenerator.cpp:86
auto clone() const -> std::unique_ptr< GameObject > override
makes a copy a GameObject even if it's held polymorphically
Definition ParticleGenerator.h:75
auto deactivate() -> void
deactivates the particle generator, and all of it's emitters If the particle generator is set to repe...
Definition ParticleGenerator.cpp:192
auto load(const Stream &stream) -> void override
Implementations will load the state of a GameObject from a th::Json Object.
Definition ParticleGenerator.cpp:121
auto componentShowMenu() -> void override
Definition ParticleGenerator.cpp:50