/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ #pragma once #include "CameraController.hpp" #include "Math/Math.hpp" #include #include #include namespace openVulkanoCpp { namespace AR { class ArSession; } class ArCameraController final : public CameraController { std::shared_ptr m_arSession; Math::Matrix4f m_registration; Math::Matrix4f m_viewMatrixToUpdate; std::mutex m_mutex; std::atomic m_updated; public: ArCameraController(); ArCameraController(Scene::Camera* camera, const std::shared_ptr& session = nullptr, const Math::Matrix4f& registration = Math::Matrix4f (1)); ~ArCameraController() override; void Init(Scene::Camera* camera, const std::shared_ptr& session = nullptr, const Math::Matrix4f& registration = Math::Matrix4f (1)); void Tick() override; void Close() override; [[nodiscard]] std::shared_ptr GetArSession() const { return m_arSession; } private: void Init(); void UpdateCameraViewMatrix(const Math::Matrix4f& transform); }; }