Move some controllers
This commit is contained in:
44
openVulkanoCpp/Controller/PlaneCameraController.hpp
Normal file
44
openVulkanoCpp/Controller/PlaneCameraController.hpp
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* 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) override { Init(camera, DefaultAxis::OXZ); }
|
||||
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);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user