code refactoring
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user