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;
33
33
float speed = 3 .0f ; // 3 units / second
34
34
float mouseSpeed = 0 .005f ;
35
35
36
-
37
-
38
36
void computeMatricesFromInputs (){
39
37
40
38
// glfwGetTime is called only once, the first time this function is called
@@ -44,6 +42,10 @@ void computeMatricesFromInputs(){
44
42
double currentTime = glfwGetTime ();
45
43
float deltaTime = float (currentTime - lastTime);
46
44
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
+
47
49
// Get mouse position
48
50
double xpos, ypos;
49
51
glfwGetCursorPos (window, &xpos, &ypos);
You can’t perform that action at this time.
0 commit comments