From cf65929b99c52b3624b35b7e7f7c641d9c20cf0b Mon Sep 17 00:00:00 2001 From: numzero Date: Sun, 16 Nov 2025 15:15:42 +0300 Subject: [PATCH] show current values in the ui --- ui/src/main_window.cxx | 9 +++++++-- ui/src/main_window.ui | 8 ++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ui/src/main_window.cxx b/ui/src/main_window.cxx index 913d406..bdf890f 100644 --- a/ui/src/main_window.cxx +++ b/ui/src/main_window.cxx @@ -16,7 +16,7 @@ float deg_to_rad(float val) { } void PhotonLight::updateView() { - m_ui->viewport->setView(RedrawArgs{ + RedrawArgs args{ .camera_position = SphericalPosition{ .yaw = deg_to_rad(m_ui->cameraYaw->value()), .pitch = deg_to_rad(m_ui->cameraPitch->value()), @@ -29,7 +29,12 @@ void PhotonLight::updateView() { }, .light_radius = 0.125, .light_spread = 0.125, - }); + }; + m_ui->cameraYawLabel->setText(tr("Yaw: %1 deg").arg(QString::number(qRadiansToDegrees(args.camera_position.yaw)))); + m_ui->cameraPitchLabel->setText(tr("Pitch: %1 deg").arg(QString::number(qRadiansToDegrees(args.camera_position.pitch)))); + m_ui->lightYawLabel->setText(tr("Yaw: %1 deg").arg(QString::number(qRadiansToDegrees(args.light_position.yaw)))); + m_ui->lightPitchLabel->setText(tr("Pitch: %1 deg").arg(QString::number(qRadiansToDegrees(args.light_position.pitch)))); + m_ui->viewport->setView(args); } #include "moc_main_window.cpp" diff --git a/ui/src/main_window.ui b/ui/src/main_window.ui index 3974303..26cf5b6 100644 --- a/ui/src/main_window.ui +++ b/ui/src/main_window.ui @@ -47,7 +47,7 @@ - + Yaw @@ -73,7 +73,7 @@ - + Pitch @@ -108,7 +108,7 @@ - + Yaw @@ -131,7 +131,7 @@ - + Pitch