Demonstrates that collision handling policies produce different results.

  • One Hits Two: two stationary blocks in resting contact; one block hits them

  • Two Hit One: central block is stationary; 2 blocks come in from left and right to hit it. See Physics-Based Animation chapter 6.2 'Multiple Points of Collision' by Erleben, et. al, which describes this scenario. This should result in an infinite loop for the serial collision handler, and it would except for some 'panic mode' error handling that occurs.

  • One Hits Two On Wall: two stationary blocks in resting contact against wall; one block hits them.

  • Two On Wall: row of two balls in contact with each other and a wall; only the ball touching the wall is moving (colliding into the wall).

to do: another to add: 1x3 block on ground, lying horizontally, pick up one corner (so the other corner still in contact) and let go. With simultaneous solver, the corner in contact stays in contact (unrealistic). With hybrid or serial it alternates which corner is bouncing.

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.

Hierarchy (view full)

Implements

Constructors

Methods

  • 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.

    Parameters

    Returns void

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

    Parameters

    • 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.

    Parameters

    • 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:

    DisplayShape{polygon:Polygon{'chain3'}}
    

    Returns string

    a minimal string representation of this object.

  • Returns dark color for heavier mass, light color for light mass.

    mass log10(mass) rgb 0.1 -1 229 1.0 0 186 10 1 143 100 2 100

    This translates to equation:

    rgb = 100 + 43 (-log10(mass) + 2)

    Parameters

    • mass: number

    Returns string

    color corresponding to mass

Generated using TypeDoc