code refactoring

This commit is contained in:
ohyzha
2024-11-04 22:48:35 +02:00
parent 3d96889778
commit e2df88ca22
7 changed files with 71 additions and 45 deletions

View File

@@ -14,9 +14,8 @@ namespace OpenVulkano
m_camera = camera;
m_actionCastRay = m_inputManager->GetAction("cast ray");
m_actionCastRay->BindKey(Input::InputKey::Mouse::BUTTON_1);
// BIND FOR TOUCH
m_actionCastRay->BindKey(Input::InputKey::Touch::AXIS_TAP_X);
m_actionCastRay->BindKey(Input::InputKey::Touch::AXIS_TAP_X);
m_actionCastRay->BindKey(Input::InputKey::Touch::AXIS_TAP_Y);
}
void CameraController::Tick()
@@ -30,7 +29,9 @@ namespace OpenVulkano
Math::Vector2i pos = mouse->GetMousePosition();
mouse->onLeftButtonClick.NotifyAll(pos);
}
else if (touch)
// not sure about second condition here, but here should be something
else if (touch && (touch->GetAxis(Input::InputKey::Touch::AXIS_TAP_X) != 0
|| touch->GetAxis(Input::InputKey::Touch::AXIS_TAP_Y) != 0))
{
Math::Vector2i pos = touch->GetTapPosition();
touch->OnTap.NotifyAll(pos);