class_gltfphysicsbody.rst 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/modules/gltf/doc_classes/GLTFPhysicsBody.xml.
  6. .. _class_GLTFPhysicsBody:
  7. GLTFPhysicsBody
  8. ===============
  9. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Represents a GLTF physics body.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. Represents a physics body as defined by the ``OMI_physics_body`` GLTF extension. This class is an intermediary between the GLTF data and Godot's nodes, and it's abstracted in a way that allows adding support for different GLTF physics extensions in the future.
  15. .. rst-class:: classref-introduction-group
  16. Tutorials
  17. ---------
  18. - `OMI_physics_body GLTF extension <https://github.com/omigroup/gltf-extensions/tree/main/extensions/2.0/OMI_physics_body>`__
  19. .. rst-class:: classref-reftable-group
  20. Properties
  21. ----------
  22. .. table::
  23. :widths: auto
  24. +-------------------------------+--------------------------------------------------------------------------+--------------------------------------+
  25. | :ref:`Vector3<class_Vector3>` | :ref:`angular_velocity<class_GLTFPhysicsBody_property_angular_velocity>` | ``Vector3(0, 0, 0)`` |
  26. +-------------------------------+--------------------------------------------------------------------------+--------------------------------------+
  27. | :ref:`String<class_String>` | :ref:`body_type<class_GLTFPhysicsBody_property_body_type>` | ``"static"`` |
  28. +-------------------------------+--------------------------------------------------------------------------+--------------------------------------+
  29. | :ref:`Vector3<class_Vector3>` | :ref:`center_of_mass<class_GLTFPhysicsBody_property_center_of_mass>` | ``Vector3(0, 0, 0)`` |
  30. +-------------------------------+--------------------------------------------------------------------------+--------------------------------------+
  31. | :ref:`Basis<class_Basis>` | :ref:`inertia_tensor<class_GLTFPhysicsBody_property_inertia_tensor>` | ``Basis(0, 0, 0, 0, 0, 0, 0, 0, 0)`` |
  32. +-------------------------------+--------------------------------------------------------------------------+--------------------------------------+
  33. | :ref:`Vector3<class_Vector3>` | :ref:`linear_velocity<class_GLTFPhysicsBody_property_linear_velocity>` | ``Vector3(0, 0, 0)`` |
  34. +-------------------------------+--------------------------------------------------------------------------+--------------------------------------+
  35. | :ref:`float<class_float>` | :ref:`mass<class_GLTFPhysicsBody_property_mass>` | ``1.0`` |
  36. +-------------------------------+--------------------------------------------------------------------------+--------------------------------------+
  37. .. rst-class:: classref-reftable-group
  38. Methods
  39. -------
  40. .. table::
  41. :widths: auto
  42. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+
  43. | :ref:`GLTFPhysicsBody<class_GLTFPhysicsBody>` | :ref:`from_dictionary<class_GLTFPhysicsBody_method_from_dictionary>` **(** :ref:`Dictionary<class_Dictionary>` dictionary **)** |static| |
  44. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+
  45. | :ref:`GLTFPhysicsBody<class_GLTFPhysicsBody>` | :ref:`from_node<class_GLTFPhysicsBody_method_from_node>` **(** :ref:`CollisionObject3D<class_CollisionObject3D>` body_node **)** |static| |
  46. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+
  47. | :ref:`Dictionary<class_Dictionary>` | :ref:`to_dictionary<class_GLTFPhysicsBody_method_to_dictionary>` **(** **)** |const| |
  48. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+
  49. | :ref:`CollisionObject3D<class_CollisionObject3D>` | :ref:`to_node<class_GLTFPhysicsBody_method_to_node>` **(** **)** |const| |
  50. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+
  51. .. rst-class:: classref-section-separator
  52. ----
  53. .. rst-class:: classref-descriptions-group
  54. Property Descriptions
  55. ---------------------
  56. .. _class_GLTFPhysicsBody_property_angular_velocity:
  57. .. rst-class:: classref-property
  58. :ref:`Vector3<class_Vector3>` **angular_velocity** = ``Vector3(0, 0, 0)``
  59. .. rst-class:: classref-property-setget
  60. - void **set_angular_velocity** **(** :ref:`Vector3<class_Vector3>` value **)**
  61. - :ref:`Vector3<class_Vector3>` **get_angular_velocity** **(** **)**
  62. The angular velocity of the physics body, in radians per second. This is only used when the body type is "rigid" or "vehicle".
  63. .. rst-class:: classref-item-separator
  64. ----
  65. .. _class_GLTFPhysicsBody_property_body_type:
  66. .. rst-class:: classref-property
  67. :ref:`String<class_String>` **body_type** = ``"static"``
  68. .. rst-class:: classref-property-setget
  69. - void **set_body_type** **(** :ref:`String<class_String>` value **)**
  70. - :ref:`String<class_String>` **get_body_type** **(** **)**
  71. The type of the body. When importing, this controls what type of :ref:`CollisionObject3D<class_CollisionObject3D>` node Godot should generate. Valid values are "static", "kinematic", "character", "rigid", "vehicle", and "trigger".
  72. .. rst-class:: classref-item-separator
  73. ----
  74. .. _class_GLTFPhysicsBody_property_center_of_mass:
  75. .. rst-class:: classref-property
  76. :ref:`Vector3<class_Vector3>` **center_of_mass** = ``Vector3(0, 0, 0)``
  77. .. rst-class:: classref-property-setget
  78. - void **set_center_of_mass** **(** :ref:`Vector3<class_Vector3>` value **)**
  79. - :ref:`Vector3<class_Vector3>` **get_center_of_mass** **(** **)**
  80. The center of mass of the body, in meters. This is in local space relative to the body. By default, the center of the mass is the body's origin.
  81. .. rst-class:: classref-item-separator
  82. ----
  83. .. _class_GLTFPhysicsBody_property_inertia_tensor:
  84. .. rst-class:: classref-property
  85. :ref:`Basis<class_Basis>` **inertia_tensor** = ``Basis(0, 0, 0, 0, 0, 0, 0, 0, 0)``
  86. .. rst-class:: classref-property-setget
  87. - void **set_inertia_tensor** **(** :ref:`Basis<class_Basis>` value **)**
  88. - :ref:`Basis<class_Basis>` **get_inertia_tensor** **(** **)**
  89. The inertia tensor of the physics body, in kilogram meter squared (kg⋅m²). This is only used when the body type is "rigid" or "vehicle".
  90. When converted to a Godot :ref:`RigidBody3D<class_RigidBody3D>` node, if this value is zero, then the inertia will be calculated automatically.
  91. .. rst-class:: classref-item-separator
  92. ----
  93. .. _class_GLTFPhysicsBody_property_linear_velocity:
  94. .. rst-class:: classref-property
  95. :ref:`Vector3<class_Vector3>` **linear_velocity** = ``Vector3(0, 0, 0)``
  96. .. rst-class:: classref-property-setget
  97. - void **set_linear_velocity** **(** :ref:`Vector3<class_Vector3>` value **)**
  98. - :ref:`Vector3<class_Vector3>` **get_linear_velocity** **(** **)**
  99. The linear velocity of the physics body, in meters per second. This is only used when the body type is "rigid" or "vehicle".
  100. .. rst-class:: classref-item-separator
  101. ----
  102. .. _class_GLTFPhysicsBody_property_mass:
  103. .. rst-class:: classref-property
  104. :ref:`float<class_float>` **mass** = ``1.0``
  105. .. rst-class:: classref-property-setget
  106. - void **set_mass** **(** :ref:`float<class_float>` value **)**
  107. - :ref:`float<class_float>` **get_mass** **(** **)**
  108. The mass of the physics body, in kilograms. This is only used when the body type is "rigid" or "vehicle".
  109. .. rst-class:: classref-section-separator
  110. ----
  111. .. rst-class:: classref-descriptions-group
  112. Method Descriptions
  113. -------------------
  114. .. _class_GLTFPhysicsBody_method_from_dictionary:
  115. .. rst-class:: classref-method
  116. :ref:`GLTFPhysicsBody<class_GLTFPhysicsBody>` **from_dictionary** **(** :ref:`Dictionary<class_Dictionary>` dictionary **)** |static|
  117. Creates a new GLTFPhysicsBody instance by parsing the given :ref:`Dictionary<class_Dictionary>`.
  118. .. rst-class:: classref-item-separator
  119. ----
  120. .. _class_GLTFPhysicsBody_method_from_node:
  121. .. rst-class:: classref-method
  122. :ref:`GLTFPhysicsBody<class_GLTFPhysicsBody>` **from_node** **(** :ref:`CollisionObject3D<class_CollisionObject3D>` body_node **)** |static|
  123. Create a new GLTFPhysicsBody instance from the given Godot :ref:`CollisionObject3D<class_CollisionObject3D>` node.
  124. .. rst-class:: classref-item-separator
  125. ----
  126. .. _class_GLTFPhysicsBody_method_to_dictionary:
  127. .. rst-class:: classref-method
  128. :ref:`Dictionary<class_Dictionary>` **to_dictionary** **(** **)** |const|
  129. Serializes this GLTFPhysicsBody instance into a :ref:`Dictionary<class_Dictionary>`.
  130. .. rst-class:: classref-item-separator
  131. ----
  132. .. _class_GLTFPhysicsBody_method_to_node:
  133. .. rst-class:: classref-method
  134. :ref:`CollisionObject3D<class_CollisionObject3D>` **to_node** **(** **)** |const|
  135. Converts this GLTFPhysicsBody instance into a Godot :ref:`CollisionObject3D<class_CollisionObject3D>` node.
  136. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  137. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  138. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  139. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  140. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  141. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  142. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`