History

add LOD to overlay display

ZappoMan committed 12 years ago

Commit 4b60c541 parent 8622f2d5 files · +56 −48Browse files

Showing the changes to interface/src/Menu.cpp (1 of 5 files). Show all

Unified · Split

interface/src/Menu.cpp+34−0
@@ -1087,6 +1087,40 @@ void Menu::octreeStatsDetailsClosed() { · 1086 unmodified lines
10871087 }
10881088 }
10891089
1090+QString Menu::getLODFeedbackText() {
1091+ // determine granularity feedback
1092+ int boundaryLevelAdjust = getBoundaryLevelAdjust();
1093+ QString granularityFeedback;
1094+
1095+ switch (boundaryLevelAdjust) {
1096+ case 0: {
1097+ granularityFeedback = QString("at standard granularity.");
1098+ } break;
1099+ case 1: {
1100+ granularityFeedback = QString("at half of standard granularity.");
1101+ } break;
1102+ case 2: {
1103+ granularityFeedback = QString("at a third of standard granularity.");
1104+ } break;
1105+ default: {
1106+ granularityFeedback = QString("at 1/%1th of standard granularity.").arg(boundaryLevelAdjust + 1);
1107+ } break;
1108+ }
1109+
1110+ // distance feedback
1111+ float voxelSizeScale = getVoxelSizeScale();
1112+ float relativeToDefault = voxelSizeScale / DEFAULT_OCTREE_SIZE_SCALE;
1113+ QString result;
1114+ if (relativeToDefault > 1.01) {
1115+ result = QString("%1 further %2").arg(relativeToDefault,8,'f',2).arg(granularityFeedback);
1116+ } else if (relativeToDefault > 0.99) {
1117+ result = QString("the default distance %1").arg(granularityFeedback);
1118+ } else {
1119+ result = QString("%1 of default %2").arg(relativeToDefault,8,'f',3).arg(granularityFeedback);
1120+ }
1121+ return result;
1122+}
1123+
10901124 void Menu::autoAdjustLOD(float currentFPS) {
10911125 // NOTE: our first ~100 samples at app startup are completely all over the place, and we don't
10921126 // really want to count them in our average, so we will ignore the real frame rates and stuff

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t