Game Development Reference
In-Depth Information
There's one erroneous function call above, initializePolyhed-
ralFeatures() . This function can be called on a convex hull shape to convert the
data into a special format that gives us access to some convenient functions that
we'll need to render the object later. It essentially builds the indices and vertices for
us, so we don't have to.
Once again, we can throw this shape into our GameObject constructor and it is
none the wiser. The only part of our code that cares is our rendering code. Once
again we will skip providing the actual code here, but check out the new function
DrawConvexHull() and changes to DrawShape() to observe the process of ren-
dering these shapes. It is doing little more than grabbing the polyhedral vertex/index
data and rendering the relevant triangles.
The following screenshot shows our application, which now includes a white pyramid
shape falling from the sky along with our original shapes:
Search WWH ::




Custom Search