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

Added shortcut object state change

parent abb97574
No related branches found
No related tags found
No related merge requests found
......@@ -37,7 +37,7 @@ int main(int argc, char** argv) {
//Define materials
Material mat_gold{ glm::vec4(255.f / 256.f, 215.f / 256.f, 0.f, 1.f), glm::vec4(0.f,1.f,0.f,1.f), glm::vec4(0.f,0.f,0.3f,1.f), glm::vec4(0.3f,0.f,0.0f,1.f) };
Material mat_wafer{ glm::vec4(0.561f, 0.51f, 1.0f, 1.f), glm::vec4(0.f,1.f,0.f,1.f), glm::vec4(0.f,0.f,0.3f,1.f), glm::vec4(0.3f,0.f,0.0f,1.f) };
Material mat_drum{ glm::vec4(0.804f, 0.51f, 1.0f, 1.0f), glm::vec4(0.f,1.f,0.f,1.f), glm::vec4(0.f,0.f,0.3f,1.f), glm::vec4(0.3f,0.f,0.0f,1.f) };
Material mat_drum{ glm::vec4(0.804f, 0.51f, 1.0f, 1.0f), glm::vec4(0.f,0.85f,0.f,1.f), glm::vec4(0.f,0.f,0.15f,1.f), glm::vec4(0.15f,0.f,0.0f,1.f) };
//Load layers
Layer bottom_metal ("Bottom Metal", "C:\\Users\\Pascal\\repos\\rbcomb-sample-visualizer\\data_generation\\python\\models\\bottom_metal_single\\bottom_metal.obj", 0.0f, mat_gold);
......@@ -77,6 +77,42 @@ int main(int argc, char** argv) {
//reset view and selection
camera.SetCameraView(eye, lookAt, upVector);
}
else if (InputState::g_click) {
if (SelectionManager::selectedIndex != -1) {
MetadataManager::getData(SelectionManager::selectedLayerName, SelectionManager::selectedIndex).status = 0;
//Update layer data here, and push to GPU
if (SelectionManager::selectedLayerName == bottom_metal.name()) {
bottom_metal.setObjectState(SelectionManager::selectedIndex, 0);
}
else if (SelectionManager::selectedLayerName == bottom_drums.name()) {
bottom_drums.setObjectState(SelectionManager::selectedIndex, 0);
}
}
}
else if (InputState::s_click) {
if (SelectionManager::selectedIndex != -1) {
MetadataManager::getData(SelectionManager::selectedLayerName, SelectionManager::selectedIndex).status = 1;
//Update layer data here, and push to GPU
if (SelectionManager::selectedLayerName == bottom_metal.name()) {
bottom_metal.setObjectState(SelectionManager::selectedIndex, 1);
}
else if (SelectionManager::selectedLayerName == bottom_drums.name()) {
bottom_drums.setObjectState(SelectionManager::selectedIndex, 1);
}
}
}
else if (InputState::b_click) {
if (SelectionManager::selectedIndex != -1) {
MetadataManager::getData(SelectionManager::selectedLayerName, SelectionManager::selectedIndex).status = 2;
//Update layer data here, and push to GPU
if (SelectionManager::selectedLayerName == bottom_metal.name()) {
bottom_metal.setObjectState(SelectionManager::selectedIndex, 2);
}
else if (SelectionManager::selectedLayerName == bottom_drums.name()) {
bottom_drums.setObjectState(SelectionManager::selectedIndex, 2);
}
}
}
else if (InputState::lmb_click) {
//select object
int selected_index = bottom_metal.selectObject(InputState::umpos_x, HEIGHT - InputState::umpos_y, projection, view, model);
......
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