5 #include "Mountain/core.hpp" 6 #include "Mountain/rendering/gpu_buffer.hpp" 7 #include "Mountain/rendering/gpu_vertex_array.hpp" 8 #include "Mountain/rendering/particle_system_modules.hpp" 9 #include "Mountain/resource/compute_shader.hpp" 41 float_t duration = 5.f;
42 bool_t looping =
true;
44 bool_t useUnscaledDeltaTime =
false;
48 float_t emissionRateOverTime = 10.f;
49 float_t emissionRateOverDistance = 0.f;
54 float_t particleLifetime = 5.f;
55 float_t particleSpeed = 5.f;
61 ParticleSystemModules::Types enabledModules = ParticleSystemModules::Types::Default;
65 MOUNTAIN_API
virtual ~ParticleSystem();
67 DEFAULT_COPY_MOVE_OPERATIONS(ParticleSystem)
69 MOUNTAIN_API
void Update();
70 MOUNTAIN_API
void Render();
71 MOUNTAIN_API
void RenderImGui();
72 MOUNTAIN_API
void RenderDebug();
74 MOUNTAIN_API
void TogglePlay();
75 MOUNTAIN_API
void Restart();
76 MOUNTAIN_API
void Stop();
81 MOUNTAIN_API uint32_t GetCurrentParticles();
84 MOUNTAIN_API uint32_t GetMaxParticles()
const;
87 MOUNTAIN_API
void SetMaxParticles(uint32_t newMaxParticles);
90 MOUNTAIN_API bool_t IsPlaying()
const;
93 uint32_t m_MaxParticles = 0;
94 int32_t* m_LiveParticles =
nullptr;
95 __GLsync* m_SyncObject =
nullptr;
97 float_t m_PlaybackTime = 0.f;
98 float_t m_LastPlaybackTime = 0.f;
99 double_t m_SpawnTimer = 0.0;
100 bool_t m_Playing =
true;
109 bool_t m_GuiParticleBurstTimeHeld =
false;
112 void SetComputeShaderUniforms(float_t deltaTime)
const;
113 void SpawnNewParticles();
116 static void WaitBufferSync(__GLsync* syncObject);
118 static void LockBuffer(__GLsync*& syncObject);
Defines the Mountain::List class.
Defines the Mountain::Shader class.
float_t interval
The time interval between each burst cycle.
A dynamic array implementation. Wrapper around the std::vector class.
Defines multiple color structs.
uint32_t cycles
How many times the burst should repeat.
Custom Mountain smart pointer. Represents both a std::shared_ptr and a std::weak_ptr.
float_t probability
The probability for the burst to happen.
static constexpr Color White()
Constant for White.
The Color struct represents a color in RGBA color space.
uint32_t count
The number of particle to spawn in the burst.
Low-level interface for OpenGL vertex arrays.
Low-level interface for OpenGL buffers.
float_t time
The time at which the burst should occur.
Contains all declarations of the Mountain Framework.