Develop into master #9

Merged
SemvdH merged 126 commits from develop into main 2021-06-18 15:56:41 +00:00
3 changed files with 37 additions and 32 deletions
Showing only changes of commit e7a9cda9dd - Show all commits

View File

@@ -11,7 +11,7 @@
namespace computervision
{
cv::VideoCapture cap(1);
cv::VideoCapture cap(0);
cv::Mat img, imgGray, img2, img2Gray, img3, img4;

View File

@@ -76,12 +76,12 @@ namespace gui
{
double x_pos, y_pos;
glfwGetCursorPos(window, &x_pos, &y_pos);
std::cout << "Cursor pos in method: " << x_pos <<"::" << y_pos << std::endl;
//std::cout << "Cursor pos in method: " << x_pos <<"::" << y_pos << std::endl;
const float x_rel = (x_pos / SCALED_WIDTH / DEFAULT_WIDTH) * 2.0f - 1.0f;
const float y_rel = -((y_pos / SCALED_HEIGHT / DEFAULT_HEIGHT) * 2.0f - 1.0f);
std::cout << "x_rel And y_rel in method: " << x_rel << "::" << y_rel << std::endl;
//std::cout << "x_rel And y_rel in method: " << x_rel << "::" << y_rel << std::endl;
if (x_rel >= minXY.x && x_rel <= maxXY.x &&

View File

@@ -25,6 +25,7 @@ namespace scene
float item_number = 0;
bool hand_mode = false;
Startup_Scene::Startup_Scene() {
shaders::EntityShader shader;
@@ -120,7 +121,7 @@ namespace scene
if(new_button != NULL)
new_button->Update(window);
}
if (hand_mode) {
cameraFrame = objDetect.readCamera();
//Get hand state from camera
@@ -157,6 +158,7 @@ namespace scene
hand_closed = true;
}
}
}
glfwSwapBuffers(window);
glfwPollEvents();
@@ -185,5 +187,8 @@ namespace scene
{
return_value = scene::Scenes::INGAME;
}
else if (glfwGetKey(window, GLFW_KEY_BACKSPACE) == GLFW_PRESS) {
hand_mode = !hand_mode;
}
}
}