Game Development Reference
In-Depth Information
btBoxShape(btVector3(1,50,50)), 0,
btVector3(0.2f, 0.6f, 0.6f), btVector3(0.0f,
0.0f, 0.0f));
// create a second box
btBoxShape(btVector3(1,1,1)), 1.0,
btVector3(0.0f, 0.2f, 0.8f), btVector3(1.25f,
20.0f, 0.0f));
Note that the increasing values of x in the initial position means the object starts
further left. This is because of the position of our camera relative to the objects.
Now if we run our application, we should see a blue box falling down, hitting the red
box, tilting, and falling over. It took us only two extra lines of code to create two new
objects; that's a pretty good effort-to-reward ratio! The following screenshot shows
our application with our new ground plane, and a new box colliding with our original
Search WWH ::

Custom Search