PhysicsBody2D.xml 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="PhysicsBody2D" inherits="CollisionObject2D" version="3.2">
  3. <brief_description>
  4. Base class for all objects affected by physics in 2D space.
  5. </brief_description>
  6. <description>
  7. PhysicsBody2D is an abstract base class for implementing a physics body. All *Body2D types inherit from it.
  8. </description>
  9. <tutorials>
  10. <link>https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link>
  11. </tutorials>
  12. <methods>
  13. <method name="add_collision_exception_with">
  14. <return type="void">
  15. </return>
  16. <argument index="0" name="body" type="Node">
  17. </argument>
  18. <description>
  19. Adds a body to the list of bodies that this body can't collide with.
  20. </description>
  21. </method>
  22. <method name="get_collision_exceptions">
  23. <return type="Array">
  24. </return>
  25. <description>
  26. Returns an array of nodes that were added as collision exceptions for this body.
  27. </description>
  28. </method>
  29. <method name="get_collision_layer_bit" qualifiers="const">
  30. <return type="bool">
  31. </return>
  32. <argument index="0" name="bit" type="int">
  33. </argument>
  34. <description>
  35. Returns an individual bit on the [member collision_layer].
  36. </description>
  37. </method>
  38. <method name="get_collision_mask_bit" qualifiers="const">
  39. <return type="bool">
  40. </return>
  41. <argument index="0" name="bit" type="int">
  42. </argument>
  43. <description>
  44. Returns an individual bit on the [member collision_mask].
  45. </description>
  46. </method>
  47. <method name="remove_collision_exception_with">
  48. <return type="void">
  49. </return>
  50. <argument index="0" name="body" type="Node">
  51. </argument>
  52. <description>
  53. Removes a body from the list of bodies that this body can't collide with.
  54. </description>
  55. </method>
  56. <method name="set_collision_layer_bit">
  57. <return type="void">
  58. </return>
  59. <argument index="0" name="bit" type="int">
  60. </argument>
  61. <argument index="1" name="value" type="bool">
  62. </argument>
  63. <description>
  64. Sets individual bits on the [member collision_layer] bitmask. Use this if you only need to change one layer's value.
  65. </description>
  66. </method>
  67. <method name="set_collision_mask_bit">
  68. <return type="void">
  69. </return>
  70. <argument index="0" name="bit" type="int">
  71. </argument>
  72. <argument index="1" name="value" type="bool">
  73. </argument>
  74. <description>
  75. Sets individual bits on the [member collision_mask] bitmask. Use this if you only need to change one layer's value.
  76. </description>
  77. </method>
  78. </methods>
  79. <members>
  80. <member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" default="1">
  81. The physics layers this area is in.
  82. Collidable objects can exist in any of 32 different layers. These layers work like a tagging system, and are not visual. A collidable can use these layers to select with which objects it can collide, using the [member collision_mask] property.
  83. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A.
  84. </member>
  85. <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="1">
  86. The physics layers this area scans for collisions.
  87. </member>
  88. <member name="input_pickable" type="bool" setter="set_pickable" getter="is_pickable" override="true" default="false" />
  89. <member name="layers" type="int" setter="_set_layers" getter="_get_layers">
  90. Both [member collision_layer] and [member collision_mask]. Returns [member collision_layer] when accessed. Updates [member collision_layer] and [member collision_mask] when modified.
  91. </member>
  92. </members>
  93. <constants>
  94. </constants>
  95. </class>