Skip to content
Snippets Groups Projects
Commit 53c5d300 authored by Pascal Engeler's avatar Pascal Engeler
Browse files

Include heightmap index in tooltip

parent 3b164c26
No related branches found
No related tags found
No related merge requests found
......@@ -127,15 +127,18 @@ int main(int argc, char** argv) {
/*Check if we want to get the height*/
float height_measured = NOT_ON_SURFACE;
size_t hmap_hovered_index = 99999;
if (InputState::lmb_pressed && !(ImGui::GetIO().WantCaptureMouse)) {
for (size_t i = 0; i < heightmaps.size(); ++i) {
height_measured = heightmaps[i]->getSurfaceHeight(InputState::umpos_x, HEIGHT - InputState::umpos_y, projection, view, models[i]);
if (height_measured != NOT_ON_SURFACE) {
hmap_hovered_index = i;
break;
}
}
ImGui::BeginTooltip();
std::string tool_tip_str = "Height: ";
std::string tool_tip_str = "Height (";
tool_tip_str += (height_measured != NOT_ON_SURFACE) ? std::to_string(hmap_hovered_index) + "): " : "-1";
tool_tip_str += (height_measured != NOT_ON_SURFACE) ? std::to_string(height_measured) + " um" : "N/A";
ImGui::Text(tool_tip_str.c_str());
ImGui::EndTooltip();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment