2#include "threadpp/thread.h"
11#define POOLSTL_STD_SUPPLEMENT 1
12#include <poolstl/poolstl.hpp>
20 APPLOG_TRACE(
"{}::{}", hpp::type_name_str(*
this), __func__);
34 APPLOG_TRACE(
"{}::{}", hpp::type_name_str(*
this), __func__);
61 std::for_each(poolstl::par,
68 APP_SCOPE_PERF_THREAD(
"Particle/Update Emitter",
"Pool Thread");
69 auto& transform_comp = view.get<transform_component>(entity);
70 auto& emitter_comp = view.get<particle_emitter_component>(entity);
72 if(emitter_comp.is_newly_created())
74 emitter_comp.set_last_render_frame(uint64_t(gfx::get_render_frame()));
76 const auto& world_transform = transform_comp.get_transform_global();
77 emitter_comp.update_emitter(world_transform, dt);
Component that wraps the soa particle system emitter.
auto deinit(rtti::context &ctx) -> bool
Deinitializes the particle system.
auto init(rtti::context &ctx) -> bool
Initializes the particle system.
void on_frame_before_render(scene &scn, delta_t dt)
Updates all particle emitters in the scene.
std::chrono::duration< float > delta_t
#define APPLOG_TRACE(...)
void init(uint16_t max_emitters)
Initialize the soa particle system.
void shutdown()
Shutdown and free all emitters / GPU resources.
void sync_gpu_simulation()
Flush staged GPU spawns and advance resident GPU sim for awake emitters.
void init_gpu(rtti::context &ctx)
Load compute pack program and enable GPU backend when available.
#define APP_SCOPE_PERF(name_literal)
Create a scoped performance timer that records to the timeline profiler. Only accepts string literals...
Represents a scene in the ACE framework, managing entities and their relationships.
std::unique_ptr< entt::registry > registry
The registry that manages all entities in the scene.