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

Method OnComponentAdded

Engine/source/EtFramework/Systems/AtmosphereInit.cpp:22–31  ·  view source on GitHub ↗

----------------------------------- AtmosphereInit::OnComponentAdded Register atmospheres in the render scene when they are added to the ECS

Source from the content-addressed store, hash-verified

20// Register atmospheres in the render scene when they are added to the ECS
21//
22void AtmosphereInit::OnComponentAdded(EcsController& controller, AtmosphereComponent& component, T_EntityId const entity)
23{
24 render::AtmosphereInstance atmoInst;
25 atmoInst.atmosphereId = component.m_AssetId;
26 atmoInst.nodeId = controller.GetComponent<TransformComponent>(entity).GetNodeId();
27 atmoInst.height = component.m_Height;
28 atmoInst.groundRadius = component.m_GroundHeight;
29
30 component.m_RenderId = UnifiedScene::Instance().GetRenderScene().AddAtmosphere(atmoInst);
31}
32
33//-------------------------------------
34// AtmosphereInit::OnComponentRemoved

Callers

nothing calls this directly

Calls 2

AddAtmosphereMethod · 0.80
GetNodeIdMethod · 0.45

Tested by

no test coverage detected