class_shape2d.rst 7.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the Shape2D.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_Shape2D:
  5. Shape2D
  6. =======
  7. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  8. **Inherited By:** :ref:`RayShape2D<class_RayShape2D>`, :ref:`LineShape2D<class_LineShape2D>`, :ref:`CircleShape2D<class_CircleShape2D>`, :ref:`ConcavePolygonShape2D<class_ConcavePolygonShape2D>`, :ref:`ConvexPolygonShape2D<class_ConvexPolygonShape2D>`, :ref:`CapsuleShape2D<class_CapsuleShape2D>`, :ref:`RectangleShape2D<class_RectangleShape2D>`, :ref:`SegmentShape2D<class_SegmentShape2D>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. Base class for all 2D Shapes.
  13. Properties
  14. ----------
  15. +---------------------------+-------------------------------------------------------------+
  16. | :ref:`float<class_float>` | :ref:`custom_solver_bias<class_Shape2D_custom_solver_bias>` |
  17. +---------------------------+-------------------------------------------------------------+
  18. Methods
  19. -------
  20. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`bool<class_bool>` | :ref:`collide<class_Shape2D_collide>` **(** :ref:`Transform2D<class_Transform2D>` local_xform, :ref:`Shape2D<class_Shape2D>` with_shape, :ref:`Transform2D<class_Transform2D>` shape_xform **)** |
  22. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  23. | :ref:`Variant<class_Variant>` | :ref:`collide_and_get_contacts<class_Shape2D_collide_and_get_contacts>` **(** :ref:`Transform2D<class_Transform2D>` local_xform, :ref:`Shape2D<class_Shape2D>` with_shape, :ref:`Transform2D<class_Transform2D>` shape_xform **)** |
  24. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`bool<class_bool>` | :ref:`collide_with_motion<class_Shape2D_collide_with_motion>` **(** :ref:`Transform2D<class_Transform2D>` local_xform, :ref:`Vector2<class_Vector2>` local_motion, :ref:`Shape2D<class_Shape2D>` with_shape, :ref:`Transform2D<class_Transform2D>` shape_xform, :ref:`Vector2<class_Vector2>` shape_motion **)** |
  26. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. | :ref:`Variant<class_Variant>` | :ref:`collide_with_motion_and_get_contacts<class_Shape2D_collide_with_motion_and_get_contacts>` **(** :ref:`Transform2D<class_Transform2D>` local_xform, :ref:`Vector2<class_Vector2>` local_motion, :ref:`Shape2D<class_Shape2D>` with_shape, :ref:`Transform2D<class_Transform2D>` shape_xform, :ref:`Vector2<class_Vector2>` shape_motion **)** |
  28. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. Description
  30. -----------
  31. Base class for all 2D Shapes. All 2D shape types inherit from this.
  32. Tutorials
  33. ---------
  34. - :doc:`../tutorials/physics/physics_introduction`
  35. Property Descriptions
  36. ---------------------
  37. .. _class_Shape2D_custom_solver_bias:
  38. - :ref:`float<class_float>` **custom_solver_bias**
  39. +----------+-------------------------------+
  40. | *Setter* | set_custom_solver_bias(value) |
  41. +----------+-------------------------------+
  42. | *Getter* | get_custom_solver_bias() |
  43. +----------+-------------------------------+
  44. Method Descriptions
  45. -------------------
  46. .. _class_Shape2D_collide:
  47. - :ref:`bool<class_bool>` **collide** **(** :ref:`Transform2D<class_Transform2D>` local_xform, :ref:`Shape2D<class_Shape2D>` with_shape, :ref:`Transform2D<class_Transform2D>` shape_xform **)**
  48. Returns ``true`` if this shape is colliding with another.
  49. 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``).
  50. .. _class_Shape2D_collide_and_get_contacts:
  51. - :ref:`Variant<class_Variant>` **collide_and_get_contacts** **(** :ref:`Transform2D<class_Transform2D>` local_xform, :ref:`Shape2D<class_Shape2D>` with_shape, :ref:`Transform2D<class_Transform2D>` shape_xform **)**
  52. Returns a list of the points where this shape touches another. If there are no collisions the list is empty.
  53. 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``).
  54. .. _class_Shape2D_collide_with_motion:
  55. - :ref:`bool<class_bool>` **collide_with_motion** **(** :ref:`Transform2D<class_Transform2D>` local_xform, :ref:`Vector2<class_Vector2>` local_motion, :ref:`Shape2D<class_Shape2D>` with_shape, :ref:`Transform2D<class_Transform2D>` shape_xform, :ref:`Vector2<class_Vector2>` shape_motion **)**
  56. Return whether this shape would collide with another, if a given movement was applied.
  57. 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``).
  58. .. _class_Shape2D_collide_with_motion_and_get_contacts:
  59. - :ref:`Variant<class_Variant>` **collide_with_motion_and_get_contacts** **(** :ref:`Transform2D<class_Transform2D>` local_xform, :ref:`Vector2<class_Vector2>` local_motion, :ref:`Shape2D<class_Shape2D>` with_shape, :ref:`Transform2D<class_Transform2D>` shape_xform, :ref:`Vector2<class_Vector2>` shape_motion **)**
  60. Returns 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.
  61. 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``).