class_physicalbone2d.rst 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. :github_url: hide
  2. .. meta::
  3. :keywords: ragdoll
  4. .. DO NOT EDIT THIS FILE!!!
  5. .. Generated automatically from Godot engine sources.
  6. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  7. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/PhysicalBone2D.xml.
  8. .. _class_PhysicalBone2D:
  9. PhysicalBone2D
  10. ==============
  11. **Inherits:** :ref:`RigidBody2D<class_RigidBody2D>` **<** :ref:`PhysicsBody2D<class_PhysicsBody2D>` **<** :ref:`CollisionObject2D<class_CollisionObject2D>` **<** :ref:`Node2D<class_Node2D>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  12. A :ref:`RigidBody2D<class_RigidBody2D>`-derived node used to make :ref:`Bone2D<class_Bone2D>`\ s in a :ref:`Skeleton2D<class_Skeleton2D>` react to physics.
  13. .. rst-class:: classref-introduction-group
  14. Description
  15. -----------
  16. The **PhysicalBone2D** node is a :ref:`RigidBody2D<class_RigidBody2D>`-based node that can be used to make :ref:`Bone2D<class_Bone2D>`\ s in a :ref:`Skeleton2D<class_Skeleton2D>` react to physics.
  17. \ **Note:** To make the :ref:`Bone2D<class_Bone2D>`\ s visually follow the **PhysicalBone2D** node, use a :ref:`SkeletonModification2DPhysicalBones<class_SkeletonModification2DPhysicalBones>` modification on the :ref:`Skeleton2D<class_Skeleton2D>` parent.
  18. \ **Note:** The **PhysicalBone2D** node does not automatically create a :ref:`Joint2D<class_Joint2D>` node to keep **PhysicalBone2D** nodes together. They must be created manually. For most cases, you want to use a :ref:`PinJoint2D<class_PinJoint2D>` node. The **PhysicalBone2D** node will automatically configure the :ref:`Joint2D<class_Joint2D>` node once it's been added as a child node.
  19. .. rst-class:: classref-reftable-group
  20. Properties
  21. ----------
  22. .. table::
  23. :widths: auto
  24. +---------------------------------+-----------------------------------------------------------------------------------------------+------------------+
  25. | :ref:`bool<class_bool>` | :ref:`auto_configure_joint<class_PhysicalBone2D_property_auto_configure_joint>` | ``true`` |
  26. +---------------------------------+-----------------------------------------------------------------------------------------------+------------------+
  27. | :ref:`int<class_int>` | :ref:`bone2d_index<class_PhysicalBone2D_property_bone2d_index>` | ``-1`` |
  28. +---------------------------------+-----------------------------------------------------------------------------------------------+------------------+
  29. | :ref:`NodePath<class_NodePath>` | :ref:`bone2d_nodepath<class_PhysicalBone2D_property_bone2d_nodepath>` | ``NodePath("")`` |
  30. +---------------------------------+-----------------------------------------------------------------------------------------------+------------------+
  31. | :ref:`bool<class_bool>` | :ref:`follow_bone_when_simulating<class_PhysicalBone2D_property_follow_bone_when_simulating>` | ``false`` |
  32. +---------------------------------+-----------------------------------------------------------------------------------------------+------------------+
  33. | :ref:`bool<class_bool>` | :ref:`simulate_physics<class_PhysicalBone2D_property_simulate_physics>` | ``false`` |
  34. +---------------------------------+-----------------------------------------------------------------------------------------------+------------------+
  35. .. rst-class:: classref-reftable-group
  36. Methods
  37. -------
  38. .. table::
  39. :widths: auto
  40. +-------------------------------+-----------------------------------------------------------------------------------------------+
  41. | :ref:`Joint2D<class_Joint2D>` | :ref:`get_joint<class_PhysicalBone2D_method_get_joint>`\ (\ ) |const| |
  42. +-------------------------------+-----------------------------------------------------------------------------------------------+
  43. | :ref:`bool<class_bool>` | :ref:`is_simulating_physics<class_PhysicalBone2D_method_is_simulating_physics>`\ (\ ) |const| |
  44. +-------------------------------+-----------------------------------------------------------------------------------------------+
  45. .. rst-class:: classref-section-separator
  46. ----
  47. .. rst-class:: classref-descriptions-group
  48. Property Descriptions
  49. ---------------------
  50. .. _class_PhysicalBone2D_property_auto_configure_joint:
  51. .. rst-class:: classref-property
  52. :ref:`bool<class_bool>` **auto_configure_joint** = ``true`` :ref:`🔗<class_PhysicalBone2D_property_auto_configure_joint>`
  53. .. rst-class:: classref-property-setget
  54. - |void| **set_auto_configure_joint**\ (\ value\: :ref:`bool<class_bool>`\ )
  55. - :ref:`bool<class_bool>` **get_auto_configure_joint**\ (\ )
  56. If ``true``, the **PhysicalBone2D** will automatically configure the first :ref:`Joint2D<class_Joint2D>` child node. The automatic configuration is limited to setting up the node properties and positioning the :ref:`Joint2D<class_Joint2D>`.
  57. .. rst-class:: classref-item-separator
  58. ----
  59. .. _class_PhysicalBone2D_property_bone2d_index:
  60. .. rst-class:: classref-property
  61. :ref:`int<class_int>` **bone2d_index** = ``-1`` :ref:`🔗<class_PhysicalBone2D_property_bone2d_index>`
  62. .. rst-class:: classref-property-setget
  63. - |void| **set_bone2d_index**\ (\ value\: :ref:`int<class_int>`\ )
  64. - :ref:`int<class_int>` **get_bone2d_index**\ (\ )
  65. The index of the :ref:`Bone2D<class_Bone2D>` that this **PhysicalBone2D** should simulate.
  66. .. rst-class:: classref-item-separator
  67. ----
  68. .. _class_PhysicalBone2D_property_bone2d_nodepath:
  69. .. rst-class:: classref-property
  70. :ref:`NodePath<class_NodePath>` **bone2d_nodepath** = ``NodePath("")`` :ref:`🔗<class_PhysicalBone2D_property_bone2d_nodepath>`
  71. .. rst-class:: classref-property-setget
  72. - |void| **set_bone2d_nodepath**\ (\ value\: :ref:`NodePath<class_NodePath>`\ )
  73. - :ref:`NodePath<class_NodePath>` **get_bone2d_nodepath**\ (\ )
  74. The :ref:`NodePath<class_NodePath>` to the :ref:`Bone2D<class_Bone2D>` that this **PhysicalBone2D** should simulate.
  75. .. rst-class:: classref-item-separator
  76. ----
  77. .. _class_PhysicalBone2D_property_follow_bone_when_simulating:
  78. .. rst-class:: classref-property
  79. :ref:`bool<class_bool>` **follow_bone_when_simulating** = ``false`` :ref:`🔗<class_PhysicalBone2D_property_follow_bone_when_simulating>`
  80. .. rst-class:: classref-property-setget
  81. - |void| **set_follow_bone_when_simulating**\ (\ value\: :ref:`bool<class_bool>`\ )
  82. - :ref:`bool<class_bool>` **get_follow_bone_when_simulating**\ (\ )
  83. If ``true``, the **PhysicalBone2D** will keep the transform of the bone it is bound to when simulating physics.
  84. .. rst-class:: classref-item-separator
  85. ----
  86. .. _class_PhysicalBone2D_property_simulate_physics:
  87. .. rst-class:: classref-property
  88. :ref:`bool<class_bool>` **simulate_physics** = ``false`` :ref:`🔗<class_PhysicalBone2D_property_simulate_physics>`
  89. .. rst-class:: classref-property-setget
  90. - |void| **set_simulate_physics**\ (\ value\: :ref:`bool<class_bool>`\ )
  91. - :ref:`bool<class_bool>` **get_simulate_physics**\ (\ )
  92. If ``true``, the **PhysicalBone2D** will start simulating using physics. If ``false``, the **PhysicalBone2D** will follow the transform of the :ref:`Bone2D<class_Bone2D>` node.
  93. \ **Note:** To have the :ref:`Bone2D<class_Bone2D>`\ s visually follow the **PhysicalBone2D**, use a :ref:`SkeletonModification2DPhysicalBones<class_SkeletonModification2DPhysicalBones>` modification on the :ref:`Skeleton2D<class_Skeleton2D>` node with the :ref:`Bone2D<class_Bone2D>` nodes.
  94. .. rst-class:: classref-section-separator
  95. ----
  96. .. rst-class:: classref-descriptions-group
  97. Method Descriptions
  98. -------------------
  99. .. _class_PhysicalBone2D_method_get_joint:
  100. .. rst-class:: classref-method
  101. :ref:`Joint2D<class_Joint2D>` **get_joint**\ (\ ) |const| :ref:`🔗<class_PhysicalBone2D_method_get_joint>`
  102. Returns the first :ref:`Joint2D<class_Joint2D>` child node, if one exists. This is mainly a helper function to make it easier to get the :ref:`Joint2D<class_Joint2D>` that the **PhysicalBone2D** is autoconfiguring.
  103. .. rst-class:: classref-item-separator
  104. ----
  105. .. _class_PhysicalBone2D_method_is_simulating_physics:
  106. .. rst-class:: classref-method
  107. :ref:`bool<class_bool>` **is_simulating_physics**\ (\ ) |const| :ref:`🔗<class_PhysicalBone2D_method_is_simulating_physics>`
  108. Returns a boolean that indicates whether the **PhysicalBone2D** is running and simulating using the Godot 2D physics engine. When ``true``, the PhysicalBone2D node is using physics.
  109. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  110. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  111. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  112. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  113. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  114. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  115. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  116. .. |void| replace:: :abbr:`void (No return value.)`