by Spike » Thu Apr 18, 2013 9:03 pm
most chasecam games seem to just make the player transparent if the camera comes too close.
In which case, check the distance and update the player's .alpha value when you move the camera.
doing it inside customizeentityforclient is a better choice if you want multiplayer to work, of course, but this is an extension which might not be available to you. do it in both placeas, and it'll work in multiplayer in engines that support the extension, without crashing engines that don't - it'll just look goofy in those, but hey, at least singleplayer will work okay!
you'll also need to ensure that the camera does not get within the near-clip-distance of walls. this is typically 4qu. sadly there is no mechanism that allows you to traceline with that precision however.
DP_QC_GETSURFACE can be used to find if there's a wall nearby, but its a real pain when doors etc are involved, it is possible though.
if you just want to clamp the player's view pitch range, cl_minpitch or cl_maxpitch work for some engines, or pq_minpitch/pq_maxpitch in proquake, or "serverinfo minpitch -30" for most quakeworld clients (where extened pitch ranges are considered a cheat).
because things would be boring if there was only one standard.
or you can use svc_setangles to force the angle to some other value. this sucks though. you can change the user's m_pitch cvar to 0, which will prevent the user from being able to change pitch angle with the mouse, which means you won't end up having to spam it endlessly, which can only be a good thing.
.