From d3b1053f21cd522f39fa2e68e938b6be22dad6ed Mon Sep 17 00:00:00 2001 From: sippeangelo Date: Mon, 1 Feb 2016 10:29:59 +0100 Subject: [PATCH] Fixes #59 --- src/Engine/Editor/EditorSystem.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Engine/Editor/EditorSystem.cpp b/src/Engine/Editor/EditorSystem.cpp index 6ffd0e24..16023b18 100644 --- a/src/Engine/Editor/EditorSystem.cpp +++ b/src/Engine/Editor/EditorSystem.cpp @@ -82,11 +82,17 @@ void EditorSystem::Update(double dt) void EditorSystem::Enable() { m_EditorCameraInputController->Enable(); + m_EventBroker->Publish(Events::UnlockMouse()); - Events::SetCamera e; - e.CameraEntity = m_EditorCamera; - m_EventBroker->Publish(e); - (glm::vec3&)m_EditorCamera["Transform"]["Position"] = Transform::AbsolutePosition(m_ActualCamera); + + // Enable editor camera + Events::SetCamera eSetCamera; + eSetCamera.CameraEntity = m_EditorCamera; + m_EventBroker->Publish(eSetCamera); + if (m_ActualCamera.Valid()) { + (glm::vec3&)m_EditorCamera["Transform"]["Position"] = Transform::AbsolutePosition(m_ActualCamera); + } + m_Enabled = true; }