class_gltfcollider.rst 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  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/GLTFCollider.xml.
  6. .. _class_GLTFCollider:
  7. GLTFCollider
  8. ============
  9. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  10. Represents a GLTF collider.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. Represents a collider as defined by the ``OMI_collider`` 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_collider GLTF extension <https://github.com/omigroup/gltf-extensions/tree/main/extensions/2.0/OMI_collider>`__
  19. .. rst-class:: classref-reftable-group
  20. Properties
  21. ----------
  22. .. table::
  23. :widths: auto
  24. +-----------------------------------+-----------------------------------------------------------+------------------------+
  25. | :ref:`ArrayMesh<class_ArrayMesh>` | :ref:`array_mesh<class_GLTFCollider_property_array_mesh>` | |
  26. +-----------------------------------+-----------------------------------------------------------+------------------------+
  27. | :ref:`float<class_float>` | :ref:`height<class_GLTFCollider_property_height>` | ``2.0`` |
  28. +-----------------------------------+-----------------------------------------------------------+------------------------+
  29. | :ref:`bool<class_bool>` | :ref:`is_trigger<class_GLTFCollider_property_is_trigger>` | ``false`` |
  30. +-----------------------------------+-----------------------------------------------------------+------------------------+
  31. | :ref:`int<class_int>` | :ref:`mesh_index<class_GLTFCollider_property_mesh_index>` | ``-1`` |
  32. +-----------------------------------+-----------------------------------------------------------+------------------------+
  33. | :ref:`float<class_float>` | :ref:`radius<class_GLTFCollider_property_radius>` | ``0.5`` |
  34. +-----------------------------------+-----------------------------------------------------------+------------------------+
  35. | :ref:`String<class_String>` | :ref:`shape_type<class_GLTFCollider_property_shape_type>` | ``""`` |
  36. +-----------------------------------+-----------------------------------------------------------+------------------------+
  37. | :ref:`Vector3<class_Vector3>` | :ref:`size<class_GLTFCollider_property_size>` | ``Vector3( 1, 1, 1 )`` |
  38. +-----------------------------------+-----------------------------------------------------------+------------------------+
  39. .. rst-class:: classref-reftable-group
  40. Methods
  41. -------
  42. .. table::
  43. :widths: auto
  44. +---------------------------------------------+----------------------------------------------------------------------------------------------------------+
  45. | :ref:`Dictionary<class_Dictionary>` | :ref:`to_dictionary<class_GLTFCollider_method_to_dictionary>` **(** **)** |const| |
  46. +---------------------------------------------+----------------------------------------------------------------------------------------------------------+
  47. | :ref:`CollisionShape<class_CollisionShape>` | :ref:`to_node<class_GLTFCollider_method_to_node>` **(** :ref:`bool<class_bool>` cache_shapes=false **)** |
  48. +---------------------------------------------+----------------------------------------------------------------------------------------------------------+
  49. .. rst-class:: classref-section-separator
  50. ----
  51. .. rst-class:: classref-descriptions-group
  52. Property Descriptions
  53. ---------------------
  54. .. _class_GLTFCollider_property_array_mesh:
  55. .. rst-class:: classref-property
  56. :ref:`ArrayMesh<class_ArrayMesh>` **array_mesh**
  57. .. rst-class:: classref-property-setget
  58. - void **set_array_mesh** **(** :ref:`ArrayMesh<class_ArrayMesh>` value **)**
  59. - :ref:`ArrayMesh<class_ArrayMesh>` **get_array_mesh** **(** **)**
  60. The :ref:`ArrayMesh<class_ArrayMesh>` resource of the collider. This is only used when the collider type is "hull" (convex hull) or "trimesh" (concave trimesh).
  61. .. rst-class:: classref-item-separator
  62. ----
  63. .. _class_GLTFCollider_property_height:
  64. .. rst-class:: classref-property
  65. :ref:`float<class_float>` **height** = ``2.0``
  66. .. rst-class:: classref-property-setget
  67. - void **set_height** **(** :ref:`float<class_float>` value **)**
  68. - :ref:`float<class_float>` **get_height** **(** **)**
  69. The height of the collider, in meters. This is only used when the collider type is "capsule" or "cylinder". This value should not be negative, and for "capsule" it should be at least twice the radius.
  70. .. rst-class:: classref-item-separator
  71. ----
  72. .. _class_GLTFCollider_property_is_trigger:
  73. .. rst-class:: classref-property
  74. :ref:`bool<class_bool>` **is_trigger** = ``false``
  75. .. rst-class:: classref-property-setget
  76. - void **set_is_trigger** **(** :ref:`bool<class_bool>` value **)**
  77. - :ref:`bool<class_bool>` **get_is_trigger** **(** **)**
  78. If ``true``, indicates that this collider is a trigger. For Godot, this means that the collider should be a child of an Area3D node.
  79. This is the only variable not used in the :ref:`to_node<class_GLTFCollider_method_to_node>` method, it's intended to be used alongside when deciding where to add the generated node as a child.
  80. .. rst-class:: classref-item-separator
  81. ----
  82. .. _class_GLTFCollider_property_mesh_index:
  83. .. rst-class:: classref-property
  84. :ref:`int<class_int>` **mesh_index** = ``-1``
  85. .. rst-class:: classref-property-setget
  86. - void **set_mesh_index** **(** :ref:`int<class_int>` value **)**
  87. - :ref:`int<class_int>` **get_mesh_index** **(** **)**
  88. The index of the collider's mesh in the GLTF file. This is only used when the collider type is "hull" (convex hull) or "trimesh" (concave trimesh).
  89. .. rst-class:: classref-item-separator
  90. ----
  91. .. _class_GLTFCollider_property_radius:
  92. .. rst-class:: classref-property
  93. :ref:`float<class_float>` **radius** = ``0.5``
  94. .. rst-class:: classref-property-setget
  95. - void **set_radius** **(** :ref:`float<class_float>` value **)**
  96. - :ref:`float<class_float>` **get_radius** **(** **)**
  97. The radius of the collider, in meters. This is only used when the collider type is "capsule", "cylinder", or "sphere". This value should not be negative.
  98. .. rst-class:: classref-item-separator
  99. ----
  100. .. _class_GLTFCollider_property_shape_type:
  101. .. rst-class:: classref-property
  102. :ref:`String<class_String>` **shape_type** = ``""``
  103. .. rst-class:: classref-property-setget
  104. - void **set_shape_type** **(** :ref:`String<class_String>` value **)**
  105. - :ref:`String<class_String>` **get_shape_type** **(** **)**
  106. The type of shape this collider represents. Valid values are "box", "capsule", "cylinder", "sphere", "hull", and "trimesh".
  107. .. rst-class:: classref-item-separator
  108. ----
  109. .. _class_GLTFCollider_property_size:
  110. .. rst-class:: classref-property
  111. :ref:`Vector3<class_Vector3>` **size** = ``Vector3( 1, 1, 1 )``
  112. .. rst-class:: classref-property-setget
  113. - void **set_size** **(** :ref:`Vector3<class_Vector3>` value **)**
  114. - :ref:`Vector3<class_Vector3>` **get_size** **(** **)**
  115. The size of the collider, in meters. This is only used when the collider type is "box", and it represents the "diameter" of the box. This value should not be negative.
  116. .. rst-class:: classref-section-separator
  117. ----
  118. .. rst-class:: classref-descriptions-group
  119. Method Descriptions
  120. -------------------
  121. .. _class_GLTFCollider_method_to_dictionary:
  122. .. rst-class:: classref-method
  123. :ref:`Dictionary<class_Dictionary>` **to_dictionary** **(** **)** |const|
  124. Serializes this GLTFCollider instance into a :ref:`Dictionary<class_Dictionary>`.
  125. .. rst-class:: classref-item-separator
  126. ----
  127. .. _class_GLTFCollider_method_to_node:
  128. .. rst-class:: classref-method
  129. :ref:`CollisionShape<class_CollisionShape>` **to_node** **(** :ref:`bool<class_bool>` cache_shapes=false **)**
  130. Converts this GLTFCollider instance into a Godot :ref:`CollisionShape<class_CollisionShape>` node.
  131. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  132. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  133. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  134. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`