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

Method InitCamera

Engine/source/EtEditor/Tools/SceneViewport.cpp:274–292  ·  view source on GitHub ↗

------------------------------------ SceneViewport::InitCamera

Source from the content-addressed store, hash-verified

272// SceneViewport::InitCamera
273//
274void SceneViewport::InitCamera()
275{
276 fw::EcsController& ecs = fw::UnifiedScene::Instance().GetEcs();
277 fw::T_EntityId const camEnt = fw::UnifiedScene::Instance().GetActiveCamera();
278
279 EditorCameraComponent edCamComp;
280 edCamComp.renderCamera = &m_SceneRenderer->GetCamera();
281 m_Camera = ecs.DuplicateEntity(camEnt, edCamComp);
282
283 if (ecs.HasComponent<fw::AudioListenerComponent>(camEnt))
284 {
285 ecs.RemoveComponents<fw::AudioListenerComponent>(camEnt);
286 }
287
288 if (ecs.HasComponent<fw::ActiveAudioListenerComponent>(camEnt))
289 {
290 ecs.RemoveComponents<fw::ActiveAudioListenerComponent>(camEnt);
291 }
292}
293
294
295} // namespace edit

Callers

nothing calls this directly

Calls 2

GetActiveCameraMethod · 0.80
DuplicateEntityMethod · 0.80

Tested by

no test coverage detected