Guys, I use basic ray casting in order to detect whether I've shot somebody in my first person shooter. But I found out that when I'm really close to the enemy, there are some small inaccuracies ( my crosshair is on the enemy, but there is no collision between the ray and the AABB ).
My first step was to actually draw the AABB, and draw the ray that I'm casting on screen in order to try and debug. And to my surprise, the AABB was perfectly fine, but the ray was totally wrong because it doesn't even start from the center of my screen, it starts from some bullsh*t place somewhere around my camera, although I used the camera's position as a startPoint of the ray.
Either I'm crazy or the camera position in world space and the center of the screen seem to be two completely different things. I have no idea wtf is happening here. SOMEONE HEEELP!