When creating custom camera systems, a “poppercam” is sometimes used to change the camera’s fixed distance from the avatar so that it does not clip objects such as walls and floors.
How does one best achieve a smooth transition between the distances? I have heard about some games using separate “whisker rays” to analyse the surfaces adjacent to the normal ray to help predict this smooth curve… but I am struggling to understand how it all fits together in practise.
This problem gets even more confusing to me when we have more extreme terrain with gaps and bumps:
Could anyone share some insight into how a system like this could be implemented at a general level?