[ADD] load bee in scene
This commit is contained in:
@@ -10,6 +10,8 @@ namespace entities
|
||||
void Camera::Move(GLFWwindow* window)
|
||||
{
|
||||
float movement_speed = 0;
|
||||
float up_down_speed = 0;
|
||||
float side_speed = 0;
|
||||
|
||||
if (glfwGetKey(window, GLFW_KEY_W) == GLFW_PRESS)
|
||||
{
|
||||
@@ -23,28 +25,21 @@ namespace entities
|
||||
|
||||
if (glfwGetKey(window, GLFW_KEY_D) == GLFW_PRESS)
|
||||
{
|
||||
rotation.y += ROT_SPEED;
|
||||
side_speed += SPEED;
|
||||
}
|
||||
|
||||
if (glfwGetKey(window, GLFW_KEY_A) == GLFW_PRESS)
|
||||
{
|
||||
rotation.y -= ROT_SPEED;
|
||||
side_speed -= SPEED;
|
||||
}
|
||||
|
||||
if (glfwGetKey(window, GLFW_KEY_SPACE) == GLFW_PRESS)
|
||||
{
|
||||
rotation.x -= ROT_SPEED;
|
||||
up_down_speed += UP_SPEED;
|
||||
}
|
||||
|
||||
if (glfwGetKey(window, GLFW_KEY_LEFT_SHIFT) == GLFW_PRESS)
|
||||
{
|
||||
rotation.x += ROT_SPEED;
|
||||
}
|
||||
|
||||
float dx = glm::cos(glm::radians(rotation.y + 90)) * movement_speed;
|
||||
float dz = glm::sin(glm::radians(rotation.y + 90)) * movement_speed;
|
||||
|
||||
position.x += dx;
|
||||
position.z += dz;
|
||||
position.x += side_speed;
|
||||
position.z += movement_speed;
|
||||
position.y += up_down_speed;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user