show current values in the ui

This commit is contained in:
numzero 2025-11-16 15:15:42 +03:00
parent 8bed95f872
commit cf65929b99
2 changed files with 11 additions and 6 deletions

View File

@ -16,7 +16,7 @@ float deg_to_rad(float val) {
} }
void PhotonLight::updateView() { void PhotonLight::updateView() {
m_ui->viewport->setView(RedrawArgs{ RedrawArgs args{
.camera_position = SphericalPosition{ .camera_position = SphericalPosition{
.yaw = deg_to_rad(m_ui->cameraYaw->value()), .yaw = deg_to_rad(m_ui->cameraYaw->value()),
.pitch = deg_to_rad(m_ui->cameraPitch->value()), .pitch = deg_to_rad(m_ui->cameraPitch->value()),
@ -29,7 +29,12 @@ void PhotonLight::updateView() {
}, },
.light_radius = 0.125, .light_radius = 0.125,
.light_spread = 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" #include "moc_main_window.cpp"

View File

@ -47,7 +47,7 @@
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<widget class="QLabel" name="label"> <widget class="QLabel" name="cameraYawLabel">
<property name="text"> <property name="text">
<string>Yaw</string> <string>Yaw</string>
</property> </property>
@ -73,7 +73,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="cameraPitchLabel">
<property name="text"> <property name="text">
<string>Pitch</string> <string>Pitch</string>
</property> </property>
@ -108,7 +108,7 @@
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_3"> <layout class="QVBoxLayout" name="verticalLayout_3">
<item> <item>
<widget class="QLabel" name="label_3"> <widget class="QLabel" name="lightYawLabel">
<property name="text"> <property name="text">
<string>Yaw</string> <string>Yaw</string>
</property> </property>
@ -131,7 +131,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_4"> <widget class="QLabel" name="lightPitchLabel">
<property name="text"> <property name="text">
<string>Pitch</string> <string>Pitch</string>
</property> </property>