Shape2D.xml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="Shape2D" inherits="Resource" category="Core" version="3.1">
  3. <brief_description>
  4. Base class for all 2D Shapes.
  5. </brief_description>
  6. <description>
  7. Base class for all 2D Shapes. All 2D shape types inherit from this.
  8. </description>
  9. <tutorials>
  10. <link>https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link>
  11. </tutorials>
  12. <demos>
  13. </demos>
  14. <methods>
  15. <method name="collide">
  16. <return type="bool">
  17. </return>
  18. <argument index="0" name="local_xform" type="Transform2D">
  19. </argument>
  20. <argument index="1" name="with_shape" type="Shape2D">
  21. </argument>
  22. <argument index="2" name="shape_xform" type="Transform2D">
  23. </argument>
  24. <description>
  25. Returns [code]true[/code] if this shape is colliding with another.
  26. This method needs the transformation matrix for this shape ([code]local_xform[/code]), the shape to check collisions with ([code]with_shape[/code]), and the transformation matrix of that shape ([code]shape_xform[/code]).
  27. </description>
  28. </method>
  29. <method name="collide_and_get_contacts">
  30. <return type="Variant">
  31. </return>
  32. <argument index="0" name="local_xform" type="Transform2D">
  33. </argument>
  34. <argument index="1" name="with_shape" type="Shape2D">
  35. </argument>
  36. <argument index="2" name="shape_xform" type="Transform2D">
  37. </argument>
  38. <description>
  39. Returns 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 ([code]local_xform[/code]), the shape to check collisions with ([code]with_shape[/code]), and the transformation matrix of that shape ([code]shape_xform[/code]).
  41. </description>
  42. </method>
  43. <method name="collide_with_motion">
  44. <return type="bool">
  45. </return>
  46. <argument index="0" name="local_xform" type="Transform2D">
  47. </argument>
  48. <argument index="1" name="local_motion" type="Vector2">
  49. </argument>
  50. <argument index="2" name="with_shape" type="Shape2D">
  51. </argument>
  52. <argument index="3" name="shape_xform" type="Transform2D">
  53. </argument>
  54. <argument index="4" name="shape_motion" type="Vector2">
  55. </argument>
  56. <description>
  57. Return whether this shape would collide with another, if a given movement was applied.
  58. This method needs the transformation matrix for this shape ([code]local_xform[/code]), the movement to test on this shape ([code]local_motion[/code]), the shape to check collisions with ([code]with_shape[/code]), the transformation matrix of that shape ([code]shape_xform[/code]), and the movement to test onto the other object ([code]shape_motion[/code]).
  59. </description>
  60. </method>
  61. <method name="collide_with_motion_and_get_contacts">
  62. <return type="Variant">
  63. </return>
  64. <argument index="0" name="local_xform" type="Transform2D">
  65. </argument>
  66. <argument index="1" name="local_motion" type="Vector2">
  67. </argument>
  68. <argument index="2" name="with_shape" type="Shape2D">
  69. </argument>
  70. <argument index="3" name="shape_xform" type="Transform2D">
  71. </argument>
  72. <argument index="4" name="shape_motion" type="Vector2">
  73. </argument>
  74. <description>
  75. 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.
  76. This method needs the transformation matrix for this shape ([code]local_xform[/code]), the movement to test on this shape ([code]local_motion[/code]), the shape to check collisions with ([code]with_shape[/code]), the transformation matrix of that shape ([code]shape_xform[/code]), and the movement to test onto the other object ([code]shape_motion[/code]).
  77. </description>
  78. </method>
  79. </methods>
  80. <members>
  81. <member name="custom_solver_bias" type="float" setter="set_custom_solver_bias" getter="get_custom_solver_bias">
  82. </member>
  83. </members>
  84. <constants>
  85. </constants>
  86. </class>