Java Reference
In-Depth Information
Figure 6-3. Falling balls
Pendulum Example
This example explores some addition features of Phys2D, such as the Joint class and how to combine
Bodies with StaticBodies . The screenshot in Figure 6-4 shows a simulation of a popular toy. In the
figure, a number of balls are suspended with equal length string. When one ball is raised and released, it
swings down and collides with the other balls, causing the ball on the opposite side to be knocked
upward while leaving the middle balls relatively still. When the newly raised ball falls, it knocks the
original ball back up, and the action repeats until entropy and friction bring the entire system to a halt.
Search WWH ::




Custom Search