Merge pull request #4 from SemvdH/feature/point-count
point count into develop
This commit is contained in:
@@ -41,7 +41,9 @@ namespace scene
|
|||||||
shaders::GuiShader* gui_shader;
|
shaders::GuiShader* gui_shader;
|
||||||
entities::Camera camera(glm::vec3(0, -50, 0), glm::vec3(0, 0, 0));
|
entities::Camera camera(glm::vec3(0, -50, 0), glm::vec3(0, 0, 0));
|
||||||
std::vector<gui::GuiTexture*> guis;
|
std::vector<gui::GuiTexture*> guis;
|
||||||
|
|
||||||
|
int furniture_count_old;
|
||||||
|
int score;
|
||||||
|
|
||||||
std::vector<computervision::HandDetectRegion> regions;
|
std::vector<computervision::HandDetectRegion> regions;
|
||||||
computervision::HandDetectRegion reg_left("left", 0, 0, 150, 150), reg_right("right", 0, 0, 150, 150), reg_up("up", 0, 0, 150, 150);
|
computervision::HandDetectRegion reg_left("left", 0, 0, 150, 150), reg_right("right", 0, 0, 150, 150), reg_up("up", 0, 0, 150, 150);
|
||||||
@@ -54,6 +56,7 @@ namespace scene
|
|||||||
|
|
||||||
gui_shader = new shaders::GuiShader();
|
gui_shader = new shaders::GuiShader();
|
||||||
gui_shader->Init();
|
gui_shader->Init();
|
||||||
|
score = 0;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* temporary!!!!
|
* temporary!!!!
|
||||||
@@ -82,6 +85,7 @@ namespace scene
|
|||||||
void load_chunk(int model_pos)
|
void load_chunk(int model_pos)
|
||||||
{
|
{
|
||||||
static unsigned int furniture_count = 0;
|
static unsigned int furniture_count = 0;
|
||||||
|
|
||||||
// set up squares according to size of camera input
|
// set up squares according to size of camera input
|
||||||
cv::Mat camera_frame;
|
cv::Mat camera_frame;
|
||||||
static_camera::getCap().read(camera_frame); // get camera frame to know the width and heigth
|
static_camera::getCap().read(camera_frame); // get camera frame to know the width and heigth
|
||||||
@@ -91,7 +95,6 @@ namespace scene
|
|||||||
reg_right.SetYPos(camera_frame.rows / 2 - reg_right.GetHeight()/2);
|
reg_right.SetYPos(camera_frame.rows / 2 - reg_right.GetHeight()/2);
|
||||||
reg_up.SetXPos(camera_frame.cols / 2 - reg_up.GetWidth() / 2);
|
reg_up.SetXPos(camera_frame.cols / 2 - reg_up.GetWidth() / 2);
|
||||||
reg_up.SetYPos(10);
|
reg_up.SetYPos(10);
|
||||||
|
|
||||||
std::cout << "loading model chunk" << std::endl;
|
std::cout << "loading model chunk" << std::endl;
|
||||||
if (house_models.size() >= MAX_MODEL_DEQUE_SIZE * furniture_count)
|
if (house_models.size() >= MAX_MODEL_DEQUE_SIZE * furniture_count)
|
||||||
{
|
{
|
||||||
@@ -106,6 +109,8 @@ namespace scene
|
|||||||
furniture_count = furniture.size();
|
furniture_count = furniture.size();
|
||||||
|
|
||||||
house_models.insert(house_models.end(), furniture.begin(), furniture.end());
|
house_models.insert(house_models.end(), furniture.begin(), furniture.end());
|
||||||
|
std::cout << "funriture_count in load chunk (house included): " << furniture_count << std::endl;
|
||||||
|
furniture_count_old = furniture_count -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -200,9 +205,13 @@ namespace scene
|
|||||||
if (last_model_pos != model_pos)
|
if (last_model_pos != model_pos)
|
||||||
{
|
{
|
||||||
load_chunk(model_pos + UPCOMING_MODEL_AMOUNT);
|
load_chunk(model_pos + UPCOMING_MODEL_AMOUNT);
|
||||||
|
score += furniture_count_old;
|
||||||
|
std::cout << "Score: " << score << std::endl;
|
||||||
|
std::cout << "Funriture_count_old in model (house excluded): " << furniture_count_old << std::endl;
|
||||||
}
|
}
|
||||||
// remember the position at which the new model was added
|
// remember the position at which the new model was added
|
||||||
last_model_pos = model_pos;
|
last_model_pos = model_pos;
|
||||||
|
|
||||||
collision::CheckCollisions(collision_entities);
|
collision::CheckCollisions(collision_entities);
|
||||||
update_hand_detection();
|
update_hand_detection();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user