5 , m_cameraSideWayActive(false)
15 const float move_speed = 20.0f;
16 const float rot_speed = 0.5f;
22 auto move_delta = sideV * (float)(wnd.keyDown(GLFW_KEY_D) - wnd.keyDown(GLFW_KEY_A)) +
23 lookV * (
float)(wnd.keyDown(GLFW_KEY_S) - wnd.keyDown(GLFW_KEY_W));
28 if (wnd.getCursor().x <
m_mouseBorder) move_delta = move_delta - (sideV);
29 if (wnd.getCursor().x > wnd.getSize().x -
m_mouseBorder) move_delta = move_delta + (sideV);
30 if (wnd.getCursor().y <
m_mouseBorder) move_delta = move_delta - (lookV);
31 if (wnd.getCursor().y > wnd.getSize().y -
m_mouseBorder) move_delta = move_delta + (lookV);
34 if ( move_delta.x != 0 || move_delta.y != 0 || move_delta.z != 0 )
38 if (wnd.mouseDown(GLFW_MOUSE_BUTTON_RIGHT))
40 auto rot_delta = vec3(glm::radians(-wnd.getCursorDelta().y),
41 -glm::radians(wnd.getCursorDelta().x),
43 if ( rot_delta.x != 0 || rot_delta.y != 0 || rot_delta.z != 0 )
53 if (key == GLFW_KEY_SCROLL_LOCK)
bool m_cameraSideWayActive
void update(double time, double timeDelta)
bool const sideWayActive()
Transformation m_transformation
void onKeyStateChanged(int key, bool pressed)