class_gltfphysicsbody.rst 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/modules/gltf/doc_classes/GLTFPhysicsBody.xml.
  6. .. _class_GLTFPhysicsBody:
  7. GLTFPhysicsBody
  8. ===============
  9. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :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:`linear_velocity<class_GLTFPhysicsBody_property_linear_velocity>` | ``Vector3( 0, 0, 0 )`` |
  30. +-------------------------------+--------------------------------------------------------------------------+------------------------+
  31. | :ref:`float<class_float>` | :ref:`mass<class_GLTFPhysicsBody_property_mass>` | ``1.0`` |
  32. +-------------------------------+--------------------------------------------------------------------------+------------------------+
  33. .. rst-class:: classref-reftable-group
  34. Methods
  35. -------
  36. .. table::
  37. :widths: auto
  38. +-----------------------------------------------+--------------------------------------------------------------------------------------+
  39. | :ref:`Dictionary<class_Dictionary>` | :ref:`to_dictionary<class_GLTFPhysicsBody_method_to_dictionary>` **(** **)** |const| |
  40. +-----------------------------------------------+--------------------------------------------------------------------------------------+
  41. | :ref:`CollisionObject<class_CollisionObject>` | :ref:`to_node<class_GLTFPhysicsBody_method_to_node>` **(** **)** |const| |
  42. +-----------------------------------------------+--------------------------------------------------------------------------------------+
  43. .. rst-class:: classref-section-separator
  44. ----
  45. .. rst-class:: classref-descriptions-group
  46. Property Descriptions
  47. ---------------------
  48. .. _class_GLTFPhysicsBody_property_angular_velocity:
  49. .. rst-class:: classref-property
  50. :ref:`Vector3<class_Vector3>` **angular_velocity** = ``Vector3( 0, 0, 0 )``
  51. .. rst-class:: classref-property-setget
  52. - void **set_angular_velocity** **(** :ref:`Vector3<class_Vector3>` value **)**
  53. - :ref:`Vector3<class_Vector3>` **get_angular_velocity** **(** **)**
  54. The angular velocity of the physics body, in radians per second. This is only used when the body type is "rigid" or "vehicle".
  55. .. rst-class:: classref-item-separator
  56. ----
  57. .. _class_GLTFPhysicsBody_property_body_type:
  58. .. rst-class:: classref-property
  59. :ref:`String<class_String>` **body_type** = ``"static"``
  60. .. rst-class:: classref-property-setget
  61. - void **set_body_type** **(** :ref:`String<class_String>` value **)**
  62. - :ref:`String<class_String>` **get_body_type** **(** **)**
  63. The type of the body. Valid values are "static", "kinematic", "character", "rigid", "vehicle", and "trigger".
  64. .. rst-class:: classref-item-separator
  65. ----
  66. .. _class_GLTFPhysicsBody_property_linear_velocity:
  67. .. rst-class:: classref-property
  68. :ref:`Vector3<class_Vector3>` **linear_velocity** = ``Vector3( 0, 0, 0 )``
  69. .. rst-class:: classref-property-setget
  70. - void **set_linear_velocity** **(** :ref:`Vector3<class_Vector3>` value **)**
  71. - :ref:`Vector3<class_Vector3>` **get_linear_velocity** **(** **)**
  72. The linear velocity of the physics body, in meters per second. This is only used when the body type is "rigid" or "vehicle".
  73. .. rst-class:: classref-item-separator
  74. ----
  75. .. _class_GLTFPhysicsBody_property_mass:
  76. .. rst-class:: classref-property
  77. :ref:`float<class_float>` **mass** = ``1.0``
  78. .. rst-class:: classref-property-setget
  79. - void **set_mass** **(** :ref:`float<class_float>` value **)**
  80. - :ref:`float<class_float>` **get_mass** **(** **)**
  81. The mass of the physics body, in kilograms. This is only used when the body type is "rigid" or "vehicle".
  82. .. rst-class:: classref-section-separator
  83. ----
  84. .. rst-class:: classref-descriptions-group
  85. Method Descriptions
  86. -------------------
  87. .. _class_GLTFPhysicsBody_method_to_dictionary:
  88. .. rst-class:: classref-method
  89. :ref:`Dictionary<class_Dictionary>` **to_dictionary** **(** **)** |const|
  90. Serializes this GLTFPhysicsBody instance into a :ref:`Dictionary<class_Dictionary>`.
  91. .. rst-class:: classref-item-separator
  92. ----
  93. .. _class_GLTFPhysicsBody_method_to_node:
  94. .. rst-class:: classref-method
  95. :ref:`CollisionObject<class_CollisionObject>` **to_node** **(** **)** |const|
  96. Converts this GLTFPhysicsBody instance into a Godot :ref:`CollisionObject<class_CollisionObject>` node.
  97. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  98. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  99. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  100. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`