From 0d6f10dff54d4866b7611f86a50d39f8ef67d171 Mon Sep 17 00:00:00 2001 From: Sem van der Hoeven Date: Fri, 18 Jun 2021 11:06:25 +0200 Subject: [PATCH] [ADD] comments and cleanup includes --- src/computervision/hand_detect_region.cpp | 2 +- src/scenes/in_Game_Scene.cpp | 14 ++---- src/scenes/in_Game_Scene.h | 54 ++++++++++++++++++++--- 3 files changed, 53 insertions(+), 17 deletions(-) diff --git a/src/computervision/hand_detect_region.cpp b/src/computervision/hand_detect_region.cpp index 206525c..d17ddb5 100644 --- a/src/computervision/hand_detect_region.cpp +++ b/src/computervision/hand_detect_region.cpp @@ -23,7 +23,7 @@ namespace computervision if (!background_calibrated || !skin_calibrated) if (time >= TIME_DURATION) { - std::cout << "timer finised, seconds left: " << seconds_left << std::endl; + //std::cout << "timer finised, seconds left: " << seconds_left << std::endl; seconds_left--; time = 0; } diff --git a/src/scenes/in_Game_Scene.cpp b/src/scenes/in_Game_Scene.cpp index da15efa..9535c72 100644 --- a/src/scenes/in_Game_Scene.cpp +++ b/src/scenes/in_Game_Scene.cpp @@ -102,10 +102,7 @@ namespace scene delete house_generator; } - /** - * @brief sets up the hand detection regions and sets the callbacks for the skin calibration. - * - */ + void In_Game_Scene::SetupHandDetection() { // set up squares according to size of camera input @@ -126,13 +123,8 @@ namespace scene reg_up.SetYPos(10); } - /** - * @brief loads a new chunk in front of the camera, and deletes the chunk behind the camera. - * - * @param model_pos the amount of models the camera has passed already. This is the rounded result of (z position of camera) / (size of model) - * - */ - void load_chunk(int model_pos) + + void In_Game_Scene::LoadChunk(int model_pos) { static unsigned int furniture_count = 0; std::cout << "loading model chunk" << std::endl; diff --git a/src/scenes/in_Game_Scene.h b/src/scenes/in_Game_Scene.h index 237e640..125d091 100644 --- a/src/scenes/in_Game_Scene.h +++ b/src/scenes/in_Game_Scene.h @@ -3,6 +3,18 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "startup_Scene.h" #include "scene.h" #include "../gui/gui_interactable.h" #include "../models/model.h" @@ -11,9 +23,12 @@ #include "../renderEngine/renderer.h" #include "../shaders/entity_shader.h" #include "../toolbox/toolbox.h" -#include -#include -#include +#include "../entities/main_character.h" +#include "../collision/collision_handler.h" +#include "../entities/house_generator.h" +#include "../computervision/hand_detect_region.h" +#include "../computervision/object_detection.h" + namespace scene @@ -56,7 +71,7 @@ namespace scene std::vector guis; //pause_guis is a list of components that will be rendered when the game is paused. std::vector pause_guis; - + // list of gui texture that holds the textures for the score std::vector> score_guis; void UpdateDeltaTime(); @@ -67,10 +82,39 @@ namespace scene * @return void */ void render_pause_menu(); + + /** + * @brief updates the hand detection with the deltatime and checks the hand detection for each region. als updates the camera display + * + */ void update_hand_detection(); + /** + * @brief sets up the hand detection regions and sets the callbacks for the skin calibration. + * + */ void SetupHandDetection(); + + /** + * @brief callback that gets called when the left skin detect region timout has been reached. sets the other regions with the skin data from the first region + * + */ void OnSkinCalibrationCallback(); + + /** + * @brief draws the score on the screen with the digit resources. + * + * @param score the score to display. + */ + void DrawScore(int score); + + /** + * @brief loads a new chunk in front of the camera, and deletes the chunk behind the camera. + * + * @param model_pos the amount of models the camera has passed already. This is the rounded result of (z position of camera) / (size of model) + * + */ + void LoadChunk(int model_pos); public: In_Game_Scene(); @@ -108,7 +152,7 @@ namespace scene */ void onKey(GLFWwindow* window, int key, int scancode, int action, int mods) override; - void DrawScore(int score); + }; }