A few weeks ago my OnePlus 3 camera stopped focusing properly meaning I could no longer take photos of text or scan QR codes. After doing a bit of research on the OnePlus community forums I found that this was likely an issue with the hardware stablization of the camera getting stuck.
If your stabilizer is stuck you may be able to fix it by just giving your phone a good shake. However, the solution for me was to take a refrigerator magnet and move it over the external camera module several times (you should hear the camera moving back and forth inside).
If the magnet solution does not work it seems like some people have had success opening their phone and placing a metal object like paperclip or staple next to the camera module. Below is a video I found on YouTube of someone doing so. That said, I believe that opening your phone will void your warranty so if you are near a OnePlus service center I would recommend you give them a visit to see if they can fix your problem first.