concepts.simulator.pymunk.body_utils.add_rectangle#

add_rectangle(world, mass=1.0, width=14.0, height=14.0, radius=2.0, pos=None, orientation=0.0, **kwargs)[source]#

Add a rectangle to the world.

Parameters:
  • world (PymunkWorld) – the world to add the rectangle to.

  • mass (float) – the mass of the rectangle.

  • width (float) – the width of the rectangle (along the x-axis).

  • height (float) – the height of the rectangle (along the y-axis).

  • radius (float) – the radius of the rectangle’s corners.

  • pos (Tuple[float, float] | None) – the position of the rectangle.

  • orientation (float) – the orientation of the rectangle, in degrees.

  • **kwargs – additional arguments to pass to the world.add_body method.