mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 14:29:03 +02:00
Update LODManager setter in TabletLODTools.qml
This commit is contained in:
parent
99a774c89c
commit
8347d9d23e
1 changed files with 7 additions and 1 deletions
|
@ -29,6 +29,12 @@ Rectangle {
|
||||||
|
|
||||||
// This controls the LOD. Larger number will make smaller objects visible at greater distance.
|
// This controls the LOD. Larger number will make smaller objects visible at greater distance.
|
||||||
readonly property real defaultMaxVisibilityDistance: 400.0
|
readonly property real defaultMaxVisibilityDistance: 400.0
|
||||||
|
readonly property real unitElementMaxExtent: Math.sqrt(3.0) * 0.5
|
||||||
|
|
||||||
|
function lodAngleDegToVisibilityDistance(var lodAngleDeg) {
|
||||||
|
var lodAngleRadians = lodAngleDeg * Math.PI / 180.0;
|
||||||
|
return unitElementMaxExtent / tan(lodAngleRadians);
|
||||||
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
anchors.margins: 10
|
anchors.margins: 10
|
||||||
|
@ -89,7 +95,7 @@ Rectangle {
|
||||||
value: defaultMaxVisibilityDistance
|
value: defaultMaxVisibilityDistance
|
||||||
tickmarksEnabled: false
|
tickmarksEnabled: false
|
||||||
onValueChanged: {
|
onValueChanged: {
|
||||||
LODManager.setVisibilityDistanceForUnitElement(value);
|
LODManager.setLODAngleDeg(lodAngleDegToVisibilityDistance(value));
|
||||||
whatYouCanSeeLabel.text = LODManager.getLODFeedbackText()
|
whatYouCanSeeLabel.text = LODManager.getLODFeedbackText()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue