So, it seems I made some progress. I changed this code:
Code:
var distance = c_trace ( vecOrigin, vecTarget, IGNORE_ME |
                            IGNORE_PASSABLE | IGNORE_SPRITES |
                            USE_POLYGON );


...to this:
Code:
var distance = c_trace ( player.x, vecTarget, IGNORE_ME |
                            IGNORE_PASSABLE | IGNORE_SPRITES |
                            USE_POLYGON );


The beep() just after the HIT_TARGET now beeps whenever the camera touches the wall (which is great), and the camera does not go behind the wall (which is also great), at least not entirely (which still gives me an issue).

The issue is, lets say you are the player, and your player's front side is facing a wall. You move your mouse left, making the player rotate left. The camera rotates with and behind the player, facing the player's back at all times, all while the right side of the camera moves closer toward the wall given that the player is rotating. The camera's right side makes contact with the wall, and glides along the wall, making it move closer to the player's back as the player keeps rotating, all the way till the player rotates so far to the point that its back is not facing the wall anymore, at which point the camera detaches from the wall and moves back to its original distance behind the player.

In the first half of this rotation where the camera makes contact with the wall, I can see a vertical sliver of blue on the right side of the screen past the wall (which is not great). The camera is not entirely moving through the wall like before, but it feels like a small section on the right side of the camera is peeking through the wall, as the camera glides along the wall. Once the camera reaches the middle of the rotation, making the camera face directly away from the wall and toward the player's back, the blue disappears (which is great). Once the camera reaches the opposite side of this same rotation, no blueness is present at all (which is great). This gives the feeling like the right side of the camera peeks through the wall, and the left side of the camera does not.

Does anyone have a clue on how to prevent the camera from peeking past the wall for the entire rotation, while the player's back is facing the wall?

Last edited by Ruben; 02/20/18 01:52.