Shape2D.xml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="Shape2D" inherits="Resource" category="Core" version="3.1.2">
  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/3.1/tutorials/physics/physics_introduction.html</link>
  11. </tutorials>
  12. <methods>
  13. <method name="collide">
  14. <return type="bool">
  15. </return>
  16. <argument index="0" name="local_xform" type="Transform2D">
  17. </argument>
  18. <argument index="1" name="with_shape" type="Shape2D">
  19. </argument>
  20. <argument index="2" name="shape_xform" type="Transform2D">
  21. </argument>
  22. <description>
  23. Returns [code]true[/code] if this shape is colliding with another.
  24. 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]).
  25. </description>
  26. </method>
  27. <method name="collide_and_get_contacts">
  28. <return type="Array">
  29. </return>
  30. <argument index="0" name="local_xform" type="Transform2D">
  31. </argument>
  32. <argument index="1" name="with_shape" type="Shape2D">
  33. </argument>
  34. <argument index="2" name="shape_xform" type="Transform2D">
  35. </argument>
  36. <description>
  37. Returns a list of the points where this shape touches another. If there are no collisions the list is empty.
  38. 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]).
  39. </description>
  40. </method>
  41. <method name="collide_with_motion">
  42. <return type="bool">
  43. </return>
  44. <argument index="0" name="local_xform" type="Transform2D">
  45. </argument>
  46. <argument index="1" name="local_motion" type="Vector2">
  47. </argument>
  48. <argument index="2" name="with_shape" type="Shape2D">
  49. </argument>
  50. <argument index="3" name="shape_xform" type="Transform2D">
  51. </argument>
  52. <argument index="4" name="shape_motion" type="Vector2">
  53. </argument>
  54. <description>
  55. Returns whether this shape would collide with another, if a given movement was applied.
  56. 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]).
  57. </description>
  58. </method>
  59. <method name="collide_with_motion_and_get_contacts">
  60. <return type="Array">
  61. </return>
  62. <argument index="0" name="local_xform" type="Transform2D">
  63. </argument>
  64. <argument index="1" name="local_motion" type="Vector2">
  65. </argument>
  66. <argument index="2" name="with_shape" type="Shape2D">
  67. </argument>
  68. <argument index="3" name="shape_xform" type="Transform2D">
  69. </argument>
  70. <argument index="4" name="shape_motion" type="Vector2">
  71. </argument>
  72. <description>
  73. 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.
  74. 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]).
  75. </description>
  76. </method>
  77. </methods>
  78. <members>
  79. <member name="custom_solver_bias" type="float" setter="set_custom_solver_bias" getter="get_custom_solver_bias">
  80. </member>
  81. </members>
  82. <constants>
  83. </constants>
  84. </class>