ABSTRACT

2D game physics programmers can cycle through various types of bodies and they can apply impulses to them to see how they react. The toy starts with the body in the air, from which position it drops under gravity to rest at the bottom of the screen. The class CBody represents a body made up of particles and springs. The class instances that go into a body that is made up of two particles joined by a spring. The spring forces all balance out, but the body is all tied up in a knot, which mirrors what is prone to happen in real life if a young child gets hold of bouncy toy. There is really no way to prevent this from happening other than setting the magnitudes of the constraints and impulses so that there is insufficient force to turn a body inside out.