Files
OpenVulkano/openVulkanoCpp/Scene/PlaneCameraController.hpp
2024-07-01 11:52:57 +03:00

43 lines
1.1 KiB
C++

/*
* 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 "Controller/CameraController.hpp"
#include "Input/InputAction.hpp"
#include "Math/Math.hpp"
namespace OpenVulkano::Scene
{
class PlaneCameraController final : public CameraController
{
Math::Vector3f m_planeNormal;
Math::Vector3f m_position;
Math::Vector3f m_planeRight;
Math::Vector3f m_planeForward;
Input::InputAction* m_actionForward;
Input::InputAction* m_actionBackward;
Input::InputAction* m_actionLeft;
Input::InputAction* m_actionRight;
Input::InputAction* m_actionUp;
public:
enum class DefaultAxis
{
OXY,
OXZ,
OYZ,
};
PlaneCameraController(Camera* camera = nullptr);
void Init(Camera* camera, const Math::Vector3f& planeNormal);
void Init(Camera* camera, DefaultAxis axis);
void Tick() override;
void SetDefaultKeybindings();
void SetPlaneNormal(const Math::Vector3f& planeNormal);
};
}