void DrawMaze() { if (cur_layer){ M.PreviousLayer(); DrawWalls(cur_layer - 1); DrawFloor(cur_layer - 1); M.NextLayer(); } if (cur_layer < layers - 1){ M.NextLayer(); DrawWalls(cur_layer + 1); DrawCeiling(cur_layer + 1); M.PreviousLayer(); } DrawLayer(cur_layer); }
void Animate() { if (direction != 0){ double step_limit = 60; static double step = 0; m_center = glm::vec3(glm::translate(glm::mat4(1.0f), glm::vec3(0, direction * (1 / step_limit) * 4, 0))*glm::vec4(m_center, 1)); m_eye = glm::vec3(glm::translate(glm::mat4(1.0f), glm::vec3(0, direction * (1 / step_limit) * 4, 0))*glm::vec4(m_eye, 1)); step++; if (step >= step_limit) { step = 0; cur_layer += direction; if (direction == 1) M.NextLayer(); else M.PreviousLayer(); direction = 0; } else { DrawElevator(step,step_limit); } } }