----------------------------------- ModelInit::OnComponentAdded Register models in the render scene when they are added to the ECS
| 22 | // Register models in the render scene when they are added to the ECS |
| 23 | // |
| 24 | void 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 |
nothing calls this directly
no test coverage detected