Bouncer


A Bouncer is an object that is very similar to a Floor. A particle hitting a bouncer will bounce off like a tennis ball. However, unlike a Floor, a bouncer is a line segment that is added by a press/drag/release sequence as in the Segment mode. Bouncers are very powerful objects for creating environmental limits to a simulation scenario. The following picture demonstrates a bouncing ball inside a polygonal region. Each edge of the region is an individual bouncer.

Starting a mass in a polygonal region
The trace of the mass


Bouncers are also essential for many physically oriented games that one might be interested in implementing in CindyLab, such as billiards and table tennis. The following picture shows a simple scenario in which bouncers and Gravity are combined.

A ball on a staircase



Inspecting Bouncers


The bouncer inspector is almost identical to the Floor inspector.

The bouncer inspector


In addition, it has a checkbox Motor Changer. If this box is checked, the animation direction of the internal spring actuators will be reversed whenever a particle hits the bouncer. For details on the actuation see Spring and Environment. This behavior would be very useful in the construction of walking engines that reverse their direction whenever they hit a wall.


Bouncers and CindyScript


Like any CindyLab object, a bouncer provides several fields that can be read and set by CindyScript. The following list shows the accessible fields for bouncers:

  • xdamp: handle to the X-Damp factor (real number, set and read)
  • ydamp: handle to the Y-Damp factor (real number, set and read)
  • simulate: turn on/off simulation for the bouncer (Boolean, set and read)






Page last modified on Thursday 17 of November, 2005 [20:46:47 UTC].
The original document is available at http://doc.cinderella.de/tiki-index.php?page=Bouncer