Factory for making a set of four walls arranged in rectangle to form an enclosed space. See Shapes.makeWall.

Methods

Methods

  • Makes four walls of given thickness, with interior rectangle of given width and height and centered at the given location. Each wall is given infinite mass. The walls are named WALL_BOTTOM, WALL_TOP, WALL_LEFT, WALL_RIGHT.

    Parameters

    • sim: RigidBodySim

      the RigidBodySim to which the walls are added

    • width: number

      the horizontal distance between the walls

    • height: number

      the vertical distance between the walls

    • Optional opt_thickness: number

      the thickness of each wall; default is 1.

    • Optional opt_center: Vector

      location of the center of the rectangle formed by the walls, in world coordinates; default is origin.

    Returns number

    suggested zero potential energy level -- the top of the bottom wall.

  • Makes four walls of given thickness, with interior rectangle equal to the given rectangle.

    Parameters

    • sim: RigidBodySim

      the RigidBodySim to which the walls are added

    • rect: DoubleRect

      the interior rectangle of the walls

    • Optional opt_thickness: number

      the thickness of each wall

    Returns number

    suggested zero potential energy level -- the top of the bottom wall.

Generated using TypeDoc