Game Development Reference
In-Depth Information
The first important property of the rigid body is Drag , which is the amount of air resistance
applied to the object while moving. Larger air resistance leads to faster lose of speed for the
object. To test the effect of the drag, set the drag value for the balls to 0.1, 1.5, 0.2 and
2.5 starting from the top most ball. If you run the game now, all balls fall down, and each
one of them moves along its track. You can notice that the balls with smaller drag values
move faster and fall from the edge of the track, while the balls with larger drag values stop
moving before reaching the end of the track. This result is shown in Illustration 46, and it can
also be seen in scene13 in the accompanying project.
Illustration 46: The effect of the drag on the movement of the objects: upper balls have lower drag
values
The second important property of the rigid body is its mass. The mass of the rigid body
determines how strong is the gravity force applied to it. However, it does not affect the ve-
locity in which the object moves downwards. The next example is show in Listing 47. The
scene consists of four cubes with a mass of 0.25 (250 gram) for each one, and four balls
with masses of 10, 7.5, 5 and 1, starting from the top most ball.
Search WWH ::




Custom Search