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

Method OnComponentAdded

Engine/source/EtFramework/Systems/PlanetInit.cpp:22–28  ·  view source on GitHub ↗

----------------------------------- PlanetInit::OnComponentAdded Register planets in the render scene when they are added to the ECS

Source from the content-addressed store, hash-verified

20// Register planets in the render scene when they are added to the ECS
21//
22void PlanetInit::OnComponentAdded(EcsController& controller, PlanetComponent& component, T_EntityId const entity)
23{
24 TransformComponent& transf = controller.GetComponent<TransformComponent>(entity);
25 transf.SetRotation(transf.GetRotation() * quat(vec3(0.0f, 1.0f, 0.0f), math::radians(270.f)));
26
27 component.m_PlanetId = UnifiedScene::Instance().GetRenderScene().AddPlanet(component.m_Params, transf.GetNodeId());
28}
29
30//-------------------------------------
31// PlanetInit::OnComponentRemoved

Callers

nothing calls this directly

Calls 4

radiansFunction · 0.85
SetRotationMethod · 0.80
AddPlanetMethod · 0.80
GetNodeIdMethod · 0.45

Tested by

no test coverage detected