Files
OpenVulkano/openVulkanoCpp/Scene/MorphableCameraController.hpp
2025-01-26 19:08:01 +01:00

45 lines
1.2 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 "MorphableCamera.hpp"
#include "Controller/CameraController.hpp"
namespace OpenVulkano
{
namespace Input
{
class InputAction;
}
namespace Scene
{
class MorphableCameraController final : public CameraController
{
double m_animationDuration;
double m_currentTime;
bool m_isMorphing;
bool m_targetMorphStatePerspective; // true for perspective, false for orthographic
Input::InputAction* m_actionMorph;
bool m_wasMorphingKeyDown = false;
public:
MorphableCameraController(MorphableCamera* camera = nullptr);
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Woverloaded-virtual"
void Init(MorphableCamera* camera);
#pragma clang diagnostic pop
void Tick() override;
void SetDuration(const double duration) { m_animationDuration = duration; }
[[nodiscard]] double GetDuration() const { return m_animationDuration; }
void SetTargetState(bool toPerspective);
void Reset() { m_currentTime = 0; }
};
}
}