41 lines
1022 B
C++
41 lines
1022 B
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 "Base/ITickable.hpp"
|
|
#include "Base/Event.hpp"
|
|
#include "Scene/Ray.hpp"
|
|
#include "Input/InputAction.hpp"
|
|
#include "Scene/Camera.hpp"
|
|
#include <cstddef>
|
|
|
|
namespace OpenVulkano::Scene
|
|
{
|
|
class SceneIntersectionTestController : public ITickable
|
|
{
|
|
public:
|
|
SceneIntersectionTestController(): m_camera(nullptr) {};
|
|
|
|
SceneIntersectionTestController(Camera* camera) : m_camera(camera) {}
|
|
|
|
void SetCamera(Camera* camera) { m_camera = camera; }
|
|
|
|
[[nodiscard]] Camera* GetCamera() const { return m_camera; }
|
|
|
|
void Tick() override;
|
|
|
|
void SetDefaultKeybindings();
|
|
|
|
Event<DrawableRayHit> OnHit;
|
|
|
|
private:
|
|
Input::InputAction* m_actionClick = nullptr;
|
|
Input::InputAction* m_actionClickX = nullptr;
|
|
Input::InputAction* m_actionClickY = nullptr;
|
|
Camera* m_camera;
|
|
};
|
|
}
|