Extend map camera controller

This commit is contained in:
Georg Hagen
2024-08-11 01:16:24 +02:00
parent 1e16b0ab48
commit 398074cad8
2 changed files with 10 additions and 1 deletions

View File

@@ -45,6 +45,13 @@ namespace OpenVulkano
} }
} }
void MapCameraController::SetSliceHeight(float height)
{
float diff = height - GetCamera()->GetPosition().y;
GetCamera()->SetMatrix(Math::Utils::translate(Math::Vector3f_SIMD{0,diff,0}) * GetCamera()->GetMatrix());
CURRENT_FRAME.needsRedraw = true;
}
void MapCameraController::SetDefaultKeybindings() void MapCameraController::SetDefaultKeybindings()
{ {
m_actionUp->BindKey(Input::InputKey::Controller::AXIS_LEFT_Y); m_actionUp->BindKey(Input::InputKey::Controller::AXIS_LEFT_Y);

View File

@@ -36,6 +36,8 @@ namespace OpenVulkano
m_dirSide = side; m_dirSide = side;
} }
void SetSliceHeight(float height);
void Tick() override; void Tick() override;
void SetDefaultKeybindings(); void SetDefaultKeybindings();