implement ray casting events

This commit is contained in:
ohyzha
2024-11-04 18:22:40 +02:00
parent 4956884d5f
commit 7febb370a8
9 changed files with 176 additions and 5 deletions

View File

@@ -8,6 +8,7 @@
#include "Base/FrameMetadata.hpp"
#include "Scene/Camera.hpp"
#include "Input/InputManager.hpp"
#include "Input/InputDeviceMouse.hpp"
#include "Input/InputKey.hpp"
namespace OpenVulkano
@@ -39,6 +40,8 @@ namespace OpenVulkano
vec *= m_boostFactor;
}
CameraController::Tick();
m_yaw -= input->GetAxis(m_actionLookSide) * timeScale / 2.0f;
m_pitch -= input->GetAxis(m_actionLookUp) * timeScale / 2.0f;
m_pitch = std::min(1.4f, std::max(-1.4f, m_pitch));
@@ -48,6 +51,7 @@ namespace OpenVulkano
Math::Matrix4f camTransformation = Math::Utils::toMat4(rot);
camTransformation[3] = Math::Vector4f(m_position, 1);
GetCamera()->SetMatrix(camTransformation);
//CameraController::Tick();
CURRENT_FRAME.needsRedraw = true;
}