class_shape2d.rst 7.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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:`CapsuleShape2D<class_capsuleshape2d>`, :ref:`LineShape2D<class_lineshape2d>`, :ref:`CircleShape2D<class_circleshape2d>`, :ref:`ConcavePolygonShape2D<class_concavepolygonshape2d>`, :ref:`ConvexPolygonShape2D<class_convexpolygonshape2d>`, :ref:`RectangleShape2D<class_rectangleshape2d>`, :ref:`SegmentShape2D<class_segmentshape2d>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. Base class for all 2D Shapes.
  13. Member Functions
  14. ----------------
  15. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  16. | :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 **)** |
  17. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  18. | :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 **)** |
  19. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  20. | :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 **)** |
  21. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  22. | :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 **)** |
  23. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. Member Variables
  25. ----------------
  26. .. _class_Shape2D_custom_solver_bias:
  27. - :ref:`float<class_float>` **custom_solver_bias**
  28. Description
  29. -----------
  30. Base class for all 2D Shapes. All 2D shape types inherit from this.
  31. Member Function Description
  32. ---------------------------
  33. .. _class_Shape2D_collide:
  34. - :ref:`bool<class_bool>` **collide** **(** :ref:`Transform2D<class_transform2d>` local_xform, :ref:`Shape2D<class_shape2d>` with_shape, :ref:`Transform2D<class_transform2d>` shape_xform **)**
  35. Return whether this shape is colliding with another.
  36. 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``).
  37. .. _class_Shape2D_collide_and_get_contacts:
  38. - :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 **)**
  39. Return a list of the points where this shape touches another. If there are no collisions, the list is empty.
  40. 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``).
  41. .. _class_Shape2D_collide_with_motion:
  42. - :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 **)**
  43. Return whether this shape would collide with another, if a given movement was applied.
  44. 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``).
  45. .. _class_Shape2D_collide_with_motion_and_get_contacts:
  46. - :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 **)**
  47. 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.
  48. 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``).