class_shape2d.rst 8.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
  3. .. _class_Shape2D:
  4. Shape2D
  5. =======
  6. **Inherits:** :ref:`Resource<class_resource>` **<** :ref:`Reference<class_reference>` **<** :ref:`Object<class_object>`
  7. **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>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Base class for all 2D Shapes.
  12. Member Functions
  13. ----------------
  14. +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  15. | :ref:`bool<class_bool>` | :ref:`collide<class_Shape2D_collide>` **(** :ref:`Matrix32<class_matrix32>` local_xform, :ref:`Shape2D<class_shape2d>` with_shape, :ref:`Matrix32<class_matrix32>` shape_xform **)** |
  16. +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  17. | :ref:`Variant<class_variant>` | :ref:`collide_and_get_contacts<class_Shape2D_collide_and_get_contacts>` **(** :ref:`Matrix32<class_matrix32>` local_xform, :ref:`Shape2D<class_shape2d>` with_shape, :ref:`Matrix32<class_matrix32>` shape_xform **)** |
  18. +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  19. | :ref:`bool<class_bool>` | :ref:`collide_with_motion<class_Shape2D_collide_with_motion>` **(** :ref:`Matrix32<class_matrix32>` local_xform, :ref:`Vector2<class_vector2>` local_motion, :ref:`Shape2D<class_shape2d>` with_shape, :ref:`Matrix32<class_matrix32>` shape_xform, :ref:`Vector2<class_vector2>` shape_motion **)** |
  20. +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`Variant<class_variant>` | :ref:`collide_with_motion_and_get_contacts<class_Shape2D_collide_with_motion_and_get_contacts>` **(** :ref:`Matrix32<class_matrix32>` local_xform, :ref:`Vector2<class_vector2>` local_motion, :ref:`Shape2D<class_shape2d>` with_shape, :ref:`Matrix32<class_matrix32>` shape_xform, :ref:`Vector2<class_vector2>` shape_motion **)** |
  22. +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  23. | :ref:`float<class_float>` | :ref:`get_custom_solver_bias<class_Shape2D_get_custom_solver_bias>` **(** **)** const |
  24. +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | void | :ref:`set_custom_solver_bias<class_Shape2D_set_custom_solver_bias>` **(** :ref:`float<class_float>` bias **)** |
  26. +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. Description
  28. -----------
  29. Base class for all 2D Shapes. All 2D shape types inherit from this.
  30. Member Function Description
  31. ---------------------------
  32. .. _class_Shape2D_collide:
  33. - :ref:`bool<class_bool>` **collide** **(** :ref:`Matrix32<class_matrix32>` local_xform, :ref:`Shape2D<class_shape2d>` with_shape, :ref:`Matrix32<class_matrix32>` shape_xform **)**
  34. Return whether this shape is colliding with another.
  35. 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``).
  36. .. _class_Shape2D_collide_and_get_contacts:
  37. - :ref:`Variant<class_variant>` **collide_and_get_contacts** **(** :ref:`Matrix32<class_matrix32>` local_xform, :ref:`Shape2D<class_shape2d>` with_shape, :ref:`Matrix32<class_matrix32>` shape_xform **)**
  38. Return a list of the points where this shape touches another. If there are no collisions, the list is empty.
  39. 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``).
  40. .. _class_Shape2D_collide_with_motion:
  41. - :ref:`bool<class_bool>` **collide_with_motion** **(** :ref:`Matrix32<class_matrix32>` local_xform, :ref:`Vector2<class_vector2>` local_motion, :ref:`Shape2D<class_shape2d>` with_shape, :ref:`Matrix32<class_matrix32>` shape_xform, :ref:`Vector2<class_vector2>` shape_motion **)**
  42. Return whether this shape would collide with another, if a given movement was applied.
  43. 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``).
  44. .. _class_Shape2D_collide_with_motion_and_get_contacts:
  45. - :ref:`Variant<class_variant>` **collide_with_motion_and_get_contacts** **(** :ref:`Matrix32<class_matrix32>` local_xform, :ref:`Vector2<class_vector2>` local_motion, :ref:`Shape2D<class_shape2d>` with_shape, :ref:`Matrix32<class_matrix32>` shape_xform, :ref:`Vector2<class_vector2>` shape_motion **)**
  46. 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.
  47. 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``).
  48. .. _class_Shape2D_get_custom_solver_bias:
  49. - :ref:`float<class_float>` **get_custom_solver_bias** **(** **)** const
  50. Return the custom solver bias.
  51. .. _class_Shape2D_set_custom_solver_bias:
  52. - void **set_custom_solver_bias** **(** :ref:`float<class_float>` bias **)**
  53. Use a custom solver bias. No need to change this unless you really know what you are doing.
  54. 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.