No doubt, the real modern 3D games are much more complex; they are not a simple ball or a box with a few triangles. Thousands of polygons for games is common, millions is not unheard of. As a technique, the differences in how to do collision detection between different shape objects are not that much. You should already know the core concept or idea behind how to do it. In this recipe, you will learn the idea of dealing with collisions between models of different shapes.
The following steps will show you how to perform collision detection between a ball and a curved surface:
1. Create a Windows Phone Game project named
BallCollideWithCurve
, changeGame1.cs
toBallCollideWithCurveGame.cs
. Then, addtriangle.cs
andTriangleSphereCollisionDetection.cs
to the project. Next, add the Content Pipeline Extension Project namedMeshVerticesProcessor
, replace theContentProcessor1.cs
withMeshVerticesProcessor.cs
. After that, insert the model...