src/camera.c
// processes input received from a mouse input system. Expects the offset value in both the x and y direction.
processes input received from a mouse input system. Expects the offset value in both the x and y direction.
processes input received from a mouse input system . Expects the offset value in both the x and y direction .
void camera_processMouseMovement(camera *camera, float x_offset, float y_offset, bool constrainPitch) {
    x_offset *= camera->MouseSensitivity;
    y_offset *= camera->MouseSensitivity;
    camera->Yaw += x_offset;
    camera->Pitch += -y_offset;
    if (constrainPitch) {
        if (camera->Pitch > 89.0f)
            camera->Pitch = 89.0f;
        if (camera->Pitch < -89.0f)
            camera->Pitch = -89.0f;
    }
    updateCameraVectors(camera);
}
void camera_processMouseMovement ( camera * camera , float x_offset , float y_offset , bool constrainPitch ) { x_offset *= camera -> MouseSensitivity ; y_offset *= camera -> MouseSensitivity ; camera -> Yaw += x_offset ; camera -> Pitch += - y_offset ; if ( constrainPitch ) { if ( camera -> Pitch > 89.0f ) camera -> Pitch = 89.0f ; if ( camera -> Pitch < -89.0f ) camera -> Pitch = -89.0f ; } updateCameraVectors ( camera ) ; }
processes input received from a mouse input system.
processes input received from a mouse input system .
// make sure that when pitch is out of bounds, screen doesn't get flipped // update Front, Right and Up Vectors using the updated Euler angles