MCPcopy Create free account
hub / github.com/Illation/ETEngine / OnComponentAdded

Method OnComponentAdded

Engine/source/EtFramework/Systems/ModelInit.cpp:24–31  ·  view source on GitHub ↗

----------------------------------- ModelInit::OnComponentAdded Register models in the render scene when they are added to the ECS

Source from the content-addressed store, hash-verified

22// Register models in the render scene when they are added to the ECS
23//
24void ModelInit::OnComponentAdded(EcsController& controller, ModelComponent& component, T_EntityId const entity)
25{
26 render::I_Material const* const mat = component.m_Material.get_as<render::I_Material>();
27
28 component.m_InstanceId = UnifiedScene::Instance().GetRenderScene().AddInstance(mat,
29 component.m_Mesh,
30 controller.GetComponent<TransformComponent>(entity).GetNodeId());
31}
32
33//-------------------------------------
34// ModelInit::OnComponentRemoved

Callers

nothing calls this directly

Calls 2

AddInstanceMethod · 0.80
GetNodeIdMethod · 0.45

Tested by

no test coverage detected