mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 20:17:01 +02:00
Fix new bugs in TabletLODTools.qml
This commit is contained in:
parent
8347d9d23e
commit
49f1ecb1bf
1 changed files with 6 additions and 5 deletions
|
@ -31,9 +31,10 @@ Rectangle {
|
||||||
readonly property real defaultMaxVisibilityDistance: 400.0
|
readonly property real defaultMaxVisibilityDistance: 400.0
|
||||||
readonly property real unitElementMaxExtent: Math.sqrt(3.0) * 0.5
|
readonly property real unitElementMaxExtent: Math.sqrt(3.0) * 0.5
|
||||||
|
|
||||||
function lodAngleDegToVisibilityDistance(var lodAngleDeg) {
|
function visibilityDistanceToLODAngleDeg(visibilityDistance) {
|
||||||
var lodAngleRadians = lodAngleDeg * Math.PI / 180.0;
|
var lodHalfAngle = Math.atan(unitElementMaxExtent / visibilityDistance);
|
||||||
return unitElementMaxExtent / tan(lodAngleRadians);
|
var lodAngle = lodHalfAngle * 2.0;
|
||||||
|
return lodAngle * 180.0 / Math.PI;
|
||||||
}
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
|
@ -74,7 +75,7 @@ Rectangle {
|
||||||
id: adjustCheckbox
|
id: adjustCheckbox
|
||||||
boxSize: 20
|
boxSize: 20
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
onCheckedChanged: LODManager.setAutomaticLODAdjust(!checked);
|
onCheckedChanged: LODManager.setAutomaticLODAdjust(!adjustCheckbox.checked);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,7 +96,7 @@ Rectangle {
|
||||||
value: defaultMaxVisibilityDistance
|
value: defaultMaxVisibilityDistance
|
||||||
tickmarksEnabled: false
|
tickmarksEnabled: false
|
||||||
onValueChanged: {
|
onValueChanged: {
|
||||||
LODManager.setLODAngleDeg(lodAngleDegToVisibilityDistance(value));
|
LODManager.lodAngleDeg = visibilityDistanceToLODAngleDeg(slider.value);
|
||||||
whatYouCanSeeLabel.text = LODManager.getLODFeedbackText()
|
whatYouCanSeeLabel.text = LODManager.getLODFeedbackText()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue