11#define POOLSTL_STD_SUPPLEMENT 1
12#include <poolstl/poolstl.hpp>
19 APPLOG_TRACE(
"{}::{}", hpp::type_name_str(*
this), __func__);
20 auto& ev = ctx.get_cached<
events>();
29 APPLOG_TRACE(
"{}::{}", hpp::type_name_str(*
this), __func__);
36 APPLOG_TRACE(
"{}::{}", hpp::type_name_str(*
this), __func__);
44 std::for_each(
view.begin(),
48 auto& model_comp = view.get<model_component>(entity);
49 model_comp.init_armature(true);
60 std::for_each(
view.begin(),
64 auto& model_comp = view.get<model_component>(entity);
65 model_comp.init_armature(false);
72 static const std::string thread_name =
"Model/Skinning Pool Thread";
78 std::for_each(poolstl::par,
83 APP_SCOPE_PERF_THREAD(
"Model/Skinning/Update Armature",
"Pool Thread");
85 tpp::this_thread::register_this_thread(thread_name, true);
87 auto& model_comp = view.get<model_component>(entity);
90 model_comp.cleanup_stale_lod_data(frame, 120);
92 if(model_comp.is_newly_created())
94 model_comp.set_last_render_frame(frame);
105 model_comp.update_armature();
108 model_comp.update_world_bounds(transform_comp.get_transform_global());
113void model_system::on_play_begin(hpp::span<const entt::handle> entities,
delta_t dt)
115 for(
auto entity : entities)
119 model_comp->init_armature(
false);
123 model_comp->update_world_bounds(transform_comp.get_transform_global());
Class that contains core data for meshes.
auto deinit(rtti::context &ctx) -> bool
void on_frame_before_render(scene &scn, delta_t dt)
void on_play_begin(rtti::context &ctx)
void on_frame_update(scene &scn, delta_t dt)
auto init(rtti::context &ctx) -> bool
std::chrono::duration< float > delta_t
#define APPLOG_TRACE(...)
uint32_t get_render_frame()
#define APP_SCOPE_PERF(name_literal)
Create a scoped performance timer that records to the timeline profiler. Only accepts string literals...
Manages the entity-component-system (ECS) operations for the ACE framework.
auto get_scene() -> scene &
Gets the current scene.
hpp::event< void(rtti::context &)> on_play_begin
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.