File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -33,8 +33,6 @@ float initialFoV = 45.0f;
3333float speed = 3 .0f ; // 3 units / second
3434float mouseSpeed = 0 .005f ;
3535
36-
37-
3836void computeMatricesFromInputs (){
3937
4038 // glfwGetTime is called only once, the first time this function is called
@@ -44,6 +42,10 @@ void computeMatricesFromInputs(){
4442 double currentTime = glfwGetTime ();
4543 float deltaTime = float (currentTime - lastTime);
4644
45+ // First time this function is called, the cursor position is reset since
46+ // an unintended movement will otherwise register on the first frame
47+ static boolean center_cursor = glfwSetCursorPos (window, 1024 /2 , 768 /2 );
48+
4749 // Get mouse position
4850 double xpos, ypos;
4951 glfwGetCursorPos (window, &xpos, &ypos);
You can’t perform that action at this time.
0 commit comments