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

Fixed bug (lmb_click <-> lmb_pressed)

parent 8aae8254
No related branches found
No related tags found
No related merge requests found
...@@ -44,7 +44,7 @@ int main(int argc, char** argv) { ...@@ -44,7 +44,7 @@ int main(int argc, char** argv) {
std::cout << "Loading Heightmap" << std::endl << std::flush; std::cout << "Loading Heightmap" << std::endl << std::flush;
heightmaps.push_back(ResourceManager::fetch_heightmap(std::string(HEIGHTMAP_LOC)+"drum1.asc")); heightmaps.push_back(ResourceManager::fetch_heightmap(std::string(HEIGHTMAP_LOC)+"drum1.asc"));
float zRangeUmReference = heightmaps.back()->zRangeUm(); float zRangeUmReference = heightmaps.back()->zRangeUm();
//positions.push_back(glm::vec3(-0.5, -0.5, 0)); positions.push_back(glm::vec3(-0.5, -0.5, 0));
positions.push_back(glm::vec3(0.0, 0.0, 0)); positions.push_back(glm::vec3(0.0, 0.0, 0));
models.push_back(glm::translate(scale_z(heightmaps.back()->minZ(), scale), positions.back())); models.push_back(glm::translate(scale_z(heightmaps.back()->minZ(), scale), positions.back()));
std::cout << "Loading complete" << std::endl << std::flush; std::cout << "Loading complete" << std::endl << std::flush;
...@@ -127,7 +127,7 @@ int main(int argc, char** argv) { ...@@ -127,7 +127,7 @@ int main(int argc, char** argv) {
/*Check if we want to get the height*/ /*Check if we want to get the height*/
float height_measured = NOT_ON_SURFACE; float height_measured = NOT_ON_SURFACE;
if (InputState::lmb_click && !(ImGui::GetIO().WantCaptureMouse)) { if (InputState::lmb_pressed && !(ImGui::GetIO().WantCaptureMouse)) {
for (size_t i = 0; i < heightmaps.size(); ++i) { 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]); height_measured = heightmaps[i]->getSurfaceHeight(InputState::umpos_x, HEIGHT - InputState::umpos_y, projection, view, models[i]);
if (height_measured != NOT_ON_SURFACE) { if (height_measured != NOT_ON_SURFACE) {
...@@ -147,7 +147,7 @@ int main(int argc, char** argv) { ...@@ -147,7 +147,7 @@ int main(int argc, char** argv) {
if (Leveler::fetchingP1 || Leveler::fetchingP2 || Leveler::fetchingP3) { if (Leveler::fetchingP1 || Leveler::fetchingP2 || Leveler::fetchingP3) {
//get highlighting point //get highlighting point
glm::vec2 mowopos = camera.GetWorldXyFromMouse(InputState::mpos_x, InputState::mpos_y); glm::vec2 mowopos = camera.GetWorldXyFromMouse(InputState::mpos_x, InputState::mpos_y);
if (InputState::lmb_pressed && height_measured != NOT_ON_SURFACE) {//Have new point if (InputState::lmb_click && height_measured != NOT_ON_SURFACE) {//Have new point
Leveler::place(mowopos); Leveler::place(mowopos);
} }
for (auto heightmap : heightmaps) { //highlight selection for (auto heightmap : heightmaps) { //highlight selection
......
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