.. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead. .. _class_Shape2D: Shape2D ======= **Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` **Inherited By:** :ref:`RayShape2D`, :ref:`CapsuleShape2D`, :ref:`LineShape2D`, :ref:`CircleShape2D`, :ref:`ConcavePolygonShape2D`, :ref:`ConvexPolygonShape2D`, :ref:`RectangleShape2D`, :ref:`SegmentShape2D` **Category:** Core Brief Description ----------------- Base class for all 2D Shapes. Member Functions ---------------- +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`collide` **(** :ref:`Transform2D` local_xform, :ref:`Shape2D` with_shape, :ref:`Transform2D` shape_xform **)** | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`collide_and_get_contacts` **(** :ref:`Transform2D` local_xform, :ref:`Shape2D` with_shape, :ref:`Transform2D` shape_xform **)** | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`collide_with_motion` **(** :ref:`Transform2D` local_xform, :ref:`Vector2` local_motion, :ref:`Shape2D` with_shape, :ref:`Transform2D` shape_xform, :ref:`Vector2` shape_motion **)** | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`collide_with_motion_and_get_contacts` **(** :ref:`Transform2D` local_xform, :ref:`Vector2` local_motion, :ref:`Shape2D` with_shape, :ref:`Transform2D` shape_xform, :ref:`Vector2` shape_motion **)** | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_custom_solver_bias` **(** **)** const | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_custom_solver_bias` **(** :ref:`float` bias **)** | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Member Variables ---------------- - :ref:`float` **custom_solver_bias** Description ----------- Base class for all 2D Shapes. All 2D shape types inherit from this. Member Function Description --------------------------- .. _class_Shape2D_collide: - :ref:`bool` **collide** **(** :ref:`Transform2D` local_xform, :ref:`Shape2D` with_shape, :ref:`Transform2D` shape_xform **)** Return whether this shape is colliding with another. This method needs the transformation matrix for this shape (``local_xform``), the shape to check collisions with (``with_shape``), and the transformation matrix of that shape (``shape_xform``). .. _class_Shape2D_collide_and_get_contacts: - :ref:`Variant` **collide_and_get_contacts** **(** :ref:`Transform2D` local_xform, :ref:`Shape2D` with_shape, :ref:`Transform2D` shape_xform **)** Return a list of the points where this shape touches another. If there are no collisions, the list is empty. This method needs the transformation matrix for this shape (``local_xform``), the shape to check collisions with (``with_shape``), and the transformation matrix of that shape (``shape_xform``). .. _class_Shape2D_collide_with_motion: - :ref:`bool` **collide_with_motion** **(** :ref:`Transform2D` local_xform, :ref:`Vector2` local_motion, :ref:`Shape2D` with_shape, :ref:`Transform2D` shape_xform, :ref:`Vector2` shape_motion **)** Return whether this shape would collide with another, if a given movement was applied. This method needs the transformation matrix for this shape (``local_xform``), the movement to test on this shape (``local_motion``), the shape to check collisions with (``with_shape``), the transformation matrix of that shape (``shape_xform``), and the movement to test onto the other object (``shape_motion``). .. _class_Shape2D_collide_with_motion_and_get_contacts: - :ref:`Variant` **collide_with_motion_and_get_contacts** **(** :ref:`Transform2D` local_xform, :ref:`Vector2` local_motion, :ref:`Shape2D` with_shape, :ref:`Transform2D` shape_xform, :ref:`Vector2` shape_motion **)** Return a list of the points where this shape would touch another, if a given movement was applied. If there are no collisions, the list is empty. This method needs the transformation matrix for this shape (``local_xform``), the movement to test on this shape (``local_motion``), the shape to check collisions with (``with_shape``), the transformation matrix of that shape (``shape_xform``), and the movement to test onto the other object (``shape_motion``). .. _class_Shape2D_get_custom_solver_bias: - :ref:`float` **get_custom_solver_bias** **(** **)** const Return the custom solver bias. .. _class_Shape2D_set_custom_solver_bias: - void **set_custom_solver_bias** **(** :ref:`float` bias **)** Use a custom solver bias. No need to change this unless you really know what you are doing. The solver bias is a factor controlling how much two objects "rebound" off each other, when colliding, to avoid them getting into each other because of numerical imprecision.