mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-18 19:19:19 +02:00
WIP
This commit is contained in:
35
entitysystem/systems/ParticlesSystem.h
Normal file
35
entitysystem/systems/ParticlesSystem.h
Normal file
@@ -0,0 +1,35 @@
|
||||
//
|
||||
// Created by Daniu
|
||||
//
|
||||
|
||||
#ifndef EU07_PARTICLESSYSTEM_H
|
||||
#define EU07_PARTICLESSYSTEM_H
|
||||
|
||||
#include "BaseSystem.h"
|
||||
#include "entitysystem/ECWorld.h"
|
||||
#include "entitysystem/components/RenderComponents.h"
|
||||
|
||||
class ParticlesSystem : public BaseSystem
|
||||
{
|
||||
public:
|
||||
ParticlesSystem();
|
||||
~ParticlesSystem();
|
||||
void Update(ECWorld& world, float dt) override;
|
||||
void Render(ECWorld& world) override;
|
||||
|
||||
private:
|
||||
void SpawnParticle(ECSComponent::ParticleEmitter& emitter);
|
||||
|
||||
// Per-instance data uploaded to GPU (one entry per live particle)
|
||||
struct GPUInstanceData {
|
||||
glm::vec3 position; // camera-relative world position
|
||||
float size;
|
||||
glm::vec4 color;
|
||||
};
|
||||
|
||||
// OpenGL resources — allocated lazily on first Render() call
|
||||
struct RenderState;
|
||||
std::unique_ptr<RenderState> m_renderState;
|
||||
};
|
||||
|
||||
#endif // EU07_PARTICLESSYSTEM_H
|
||||
Reference in New Issue
Block a user