show current values in the ui
This commit is contained in:
parent
8bed95f872
commit
cf65929b99
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@
|
|||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<widget class="QLabel" name="cameraYawLabel">
|
||||
<property name="text">
|
||||
<string>Yaw</string>
|
||||
</property>
|
||||
|
|
@ -73,7 +73,7 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<widget class="QLabel" name="cameraPitchLabel">
|
||||
<property name="text">
|
||||
<string>Pitch</string>
|
||||
</property>
|
||||
|
|
@ -108,7 +108,7 @@
|
|||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<widget class="QLabel" name="lightYawLabel">
|
||||
<property name="text">
|
||||
<string>Yaw</string>
|
||||
</property>
|
||||
|
|
@ -131,7 +131,7 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<widget class="QLabel" name="lightPitchLabel">
|
||||
<property name="text">
|
||||
<string>Pitch</string>
|
||||
</property>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user