88 Chapter 5 Adding General Forces
5.5 Exercises
Ex ercise 5.1
Implement an uplift force generator. The force generator should have an origin rep-
resenting the center of the uplift. When the force generator is asked to apply its force,
it should test the X-Z coordinate of the object against the origin. If this coordinate
is within a given distance of the origin, then the uplift should be applied. Otherwise
there is no force. We use only the X-Z coordinates to represent a chimney of rising
uplift above a particular point, so the Y coordinate is irrelevant.
Ex ercise 5.2
Implement an airbrake force generator . This should contain a Boolean value. When
the value is false (the airbrake is off), the generator should provide no force. When
the value is true ...