In FPS game, when the character moves forward to a building or a wall and contacts the object, it will stop and stand there. And you know there is no object around you, because the camera is your eye in the FPS game. If you wonder how the game developers achieve this, you will find the answer in this recipe.
The following steps will show you the best practice of applying the sphere-triangle collision detection for first-person perspective camera:
CameraModelCollisionGame.cs. Meanwhile, add
TriangleSphereCollisionDetection.csto the project. Then, create a Content Pipeline Extension Library ...