PhysicsBody2D.xml 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="PhysicsBody2D" inherits="CollisionObject2D" version="3.3">
  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/3.3/tutorials/physics/physics_introduction.html</link>
  11. </tutorials>
  12. <methods>
  13. <method name="add_collision_exception_with">
  14. <return type="void" />
  15. <argument index="0" name="body" type="Node" />
  16. <description>
  17. Adds a body to the list of bodies that this body can't collide with.
  18. </description>
  19. </method>
  20. <method name="get_collision_exceptions">
  21. <return type="Array" />
  22. <description>
  23. Returns an array of nodes that were added as collision exceptions for this body.
  24. </description>
  25. </method>
  26. <method name="get_collision_layer_bit" qualifiers="const">
  27. <return type="bool" />
  28. <argument index="0" name="bit" type="int" />
  29. <description>
  30. Returns an individual bit on the [member collision_layer].
  31. </description>
  32. </method>
  33. <method name="get_collision_mask_bit" qualifiers="const">
  34. <return type="bool" />
  35. <argument index="0" name="bit" type="int" />
  36. <description>
  37. Returns an individual bit on the [member collision_mask].
  38. </description>
  39. </method>
  40. <method name="remove_collision_exception_with">
  41. <return type="void" />
  42. <argument index="0" name="body" type="Node" />
  43. <description>
  44. Removes a body from the list of bodies that this body can't collide with.
  45. </description>
  46. </method>
  47. <method name="set_collision_layer_bit">
  48. <return type="void" />
  49. <argument index="0" name="bit" type="int" />
  50. <argument index="1" name="value" type="bool" />
  51. <description>
  52. Sets individual bits on the [member collision_layer] bitmask. Use this if you only need to change one layer's value.
  53. </description>
  54. </method>
  55. <method name="set_collision_mask_bit">
  56. <return type="void" />
  57. <argument index="0" name="bit" type="int" />
  58. <argument index="1" name="value" type="bool" />
  59. <description>
  60. Sets individual bits on the [member collision_mask] bitmask. Use this if you only need to change one layer's value.
  61. </description>
  62. </method>
  63. </methods>
  64. <members>
  65. <member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" default="1">
  66. The physics layers this area is in.
  67. 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.
  68. 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. See [url=https://docs.godotengine.org/en/3.3/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.
  69. </member>
  70. <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="1">
  71. The physics layers this area scans for collisions. See [url=https://docs.godotengine.org/en/3.3/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.
  72. </member>
  73. <member name="input_pickable" type="bool" setter="set_pickable" getter="is_pickable" override="true" default="false" />
  74. <member name="layers" type="int" setter="_set_layers" getter="_get_layers">
  75. Both [member collision_layer] and [member collision_mask]. Returns [member collision_layer] when accessed. Updates [member collision_layer] and [member collision_mask] when modified.
  76. </member>
  77. </members>
  78. <constants>
  79. </constants>
  80. </class>