Okay, it's broken. Theres a lot of code here! Please help
It's basically the one from opengl-tutorial.com. Using glm but not glfw.
The camera kind of works but doesn't.. it's jerky and when I go left with the mouse it goes and looks up etc.. when I go up it goes down..
all sorts of crazy
If we can fix this maybe we can fix the keyboard input :/
void UpdateFromMouse( int w, int h, int mousex, int mousey )
{
/*
Handle the mouse input
*/
_mx = mousex; _my = mousey;
m_horizontalAngle += m_mouseSpeed * m_frameTime * float( w / 2 - _mx );
m_verticalAngle += m_mouseSpeed * m_frameTime * float( h / 2 - _my );
m_direction = glm::vec3
(
cos( m_verticalAngle ) * sin( m_horizontalAngle ),
sin( m_verticalAngle ),
cos( m_verticalAngle ) * cos( m_horizontalAngle )
);
m_right = glm::vec3
(
sin( m_horizontalAngle - 3.14f / 2.0f ),
0,
cos( m_horizontalAngle - 3.14f / 2.0f )
);
m_up = glm::cross( m_right, m_direction );
/*
Update the view matrix
*/
m_viewMatrix = glm::lookAt( position, position + m_direction, m_up );
}