CurvedTestApp shows some ball and rectangle objects bouncing among some fixed ball and rectangle objects.

This app has a config function which looks at a set of options and rebuilds the simulation accordingly. UI controls are created to change the options.

Parameters Created

Hierarchy (view full)




  • Adds the given Observer to this Subject's list of Observers, so that the Observer will be notified of changes in this Subject. An Observer may call Subject.addObserver during its observe method.


    Returns void

  • Define short-cut name replacement rules. For example 'sim' is replaced by 'myApp.sim' when myName is 'myApp'.


    • myName: string

      the name of this object, valid in global Javascript context.

    Returns void

  • Parameters

    • script: string
    • output: boolean = true

      whether to print the result to the output text area and add the script to session history; default is true

    Returns any

    the result of evaluating the string

  • Sets whether this Subject will broadcast events, typically used to temporarily disable broadcasting. Intended to be used in situations where a subclass overrides a method that broadcasts an event. This allows the subclass to prevent the superclass broadcasting that event, so that the subclass can broadcast the event when the method is completed.


    • value: boolean

      whether this Subject should broadcast events

    Returns boolean

    the previous value

  • Returns a minimal string representation of this object, usually giving just identity information like the class name and name of the object.

    For an object whose main purpose is to represent another Printable object, it is recommended to include the result of calling toStringShort on that other object. For example, calling toStringShort() on a DisplayShape might return something like this:


    Returns string

    a minimal string representation of this object.

  • Adds a set of circular and rectangular Polygons to the ContactSim.


    • sim: ContactSim

      the ContactSim to add bodies to

    • gravity: GravityLaw

      the GravityLaw to connect bodies to

    • damping: DampingLaw

      the DampingLaw to connect bodies to

    • numBods: number

      number of free moving bodies to make, from 1 to 6.

    • simRect: DoubleRect

      rectangle for making a set of enclosing walls, in simulation coords.

    • displayList: null | DisplayList

    Returns void

Generated using TypeDoc