More lazy rendering stuff
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include "MapCameraController.hpp"
|
||||
#include "Input/InputManager.hpp"
|
||||
#include "Scene/Camera.hpp"
|
||||
#include "Base/FrameMetadata.hpp"
|
||||
|
||||
namespace OpenVulkano
|
||||
{
|
||||
@@ -22,7 +23,9 @@ namespace OpenVulkano
|
||||
{
|
||||
if (!GetCamera()) return;
|
||||
auto input = Input::InputManager::GetInstance();
|
||||
Math::Vector3f_SIMD vec = m_dirUp * input->GetAxis(m_actionUp) + m_dirSide * input->GetAxis(m_actionSide);
|
||||
float up = input->GetAxis(m_actionUp);
|
||||
float side = input->GetAxis(m_actionSide);
|
||||
Math::Vector3f_SIMD vec = m_dirUp * up + m_dirSide * side;
|
||||
vec /= GetCamera()->GetZoom();
|
||||
vec /= GetCamera()->GetContentScaleFactor();
|
||||
|
||||
@@ -35,7 +38,11 @@ namespace OpenVulkano
|
||||
GetCamera()->UpdateProjectionMatrix();
|
||||
}
|
||||
|
||||
GetCamera()->SetMatrix(Math::Utils::translate(vec) * GetCamera()->GetMatrix());
|
||||
if (zoom != 0 || up != 0 || side != 0)
|
||||
{
|
||||
GetCamera()->SetMatrix(Math::Utils::translate(vec) * GetCamera()->GetMatrix());
|
||||
CURRENT_FRAME.needsRedraw = true;
|
||||
}
|
||||
}
|
||||
|
||||
void MapCameraController::SetDefaultKeybindings()
|
||||
|
||||
Reference in New Issue
Block a user