class_collisionobject3d.rst 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595
  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/4.2/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.2/doc/classes/CollisionObject3D.xml.
  6. .. _class_CollisionObject3D:
  7. CollisionObject3D
  8. =================
  9. **Inherits:** :ref:`Node3D<class_Node3D>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`Area3D<class_Area3D>`, :ref:`PhysicsBody3D<class_PhysicsBody3D>`
  11. Abstract base class for 3D physics objects.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. Abstract base class for 3D physics objects. **CollisionObject3D** can hold any number of :ref:`Shape3D<class_Shape3D>`\ s for collision. Each shape must be assigned to a *shape owner*. Shape owners are not nodes and do not appear in the editor, but are accessible through code using the ``shape_owner_*`` methods.
  16. \ **Warning:** With a non-uniform scale, this node will likely not behave as expected. It is advised to keep its scale the same on all axes and adjust its collision shape(s) instead.
  17. .. rst-class:: classref-reftable-group
  18. Properties
  19. ----------
  20. .. table::
  21. :widths: auto
  22. +--------------------------------------------------------+--------------------------------------------------------------------------------------+-----------+
  23. | :ref:`int<class_int>` | :ref:`collision_layer<class_CollisionObject3D_property_collision_layer>` | ``1`` |
  24. +--------------------------------------------------------+--------------------------------------------------------------------------------------+-----------+
  25. | :ref:`int<class_int>` | :ref:`collision_mask<class_CollisionObject3D_property_collision_mask>` | ``1`` |
  26. +--------------------------------------------------------+--------------------------------------------------------------------------------------+-----------+
  27. | :ref:`float<class_float>` | :ref:`collision_priority<class_CollisionObject3D_property_collision_priority>` | ``1.0`` |
  28. +--------------------------------------------------------+--------------------------------------------------------------------------------------+-----------+
  29. | :ref:`DisableMode<enum_CollisionObject3D_DisableMode>` | :ref:`disable_mode<class_CollisionObject3D_property_disable_mode>` | ``0`` |
  30. +--------------------------------------------------------+--------------------------------------------------------------------------------------+-----------+
  31. | :ref:`bool<class_bool>` | :ref:`input_capture_on_drag<class_CollisionObject3D_property_input_capture_on_drag>` | ``false`` |
  32. +--------------------------------------------------------+--------------------------------------------------------------------------------------+-----------+
  33. | :ref:`bool<class_bool>` | :ref:`input_ray_pickable<class_CollisionObject3D_property_input_ray_pickable>` | ``true`` |
  34. +--------------------------------------------------------+--------------------------------------------------------------------------------------+-----------+
  35. .. rst-class:: classref-reftable-group
  36. Methods
  37. -------
  38. .. table::
  39. :widths: auto
  40. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | void | :ref:`_input_event<class_CollisionObject3D_private_method__input_event>` **(** :ref:`Camera3D<class_Camera3D>` camera, :ref:`InputEvent<class_InputEvent>` event, :ref:`Vector3<class_Vector3>` position, :ref:`Vector3<class_Vector3>` normal, :ref:`int<class_int>` shape_idx **)** |virtual| |
  42. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | void | :ref:`_mouse_enter<class_CollisionObject3D_private_method__mouse_enter>` **(** **)** |virtual| |
  44. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | void | :ref:`_mouse_exit<class_CollisionObject3D_private_method__mouse_exit>` **(** **)** |virtual| |
  46. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  47. | :ref:`int<class_int>` | :ref:`create_shape_owner<class_CollisionObject3D_method_create_shape_owner>` **(** :ref:`Object<class_Object>` owner **)** |
  48. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  49. | :ref:`bool<class_bool>` | :ref:`get_collision_layer_value<class_CollisionObject3D_method_get_collision_layer_value>` **(** :ref:`int<class_int>` layer_number **)** |const| |
  50. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  51. | :ref:`bool<class_bool>` | :ref:`get_collision_mask_value<class_CollisionObject3D_method_get_collision_mask_value>` **(** :ref:`int<class_int>` layer_number **)** |const| |
  52. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | :ref:`RID<class_RID>` | :ref:`get_rid<class_CollisionObject3D_method_get_rid>` **(** **)** |const| |
  54. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  55. | :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`get_shape_owners<class_CollisionObject3D_method_get_shape_owners>` **(** **)** |
  56. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  57. | :ref:`bool<class_bool>` | :ref:`is_shape_owner_disabled<class_CollisionObject3D_method_is_shape_owner_disabled>` **(** :ref:`int<class_int>` owner_id **)** |const| |
  58. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  59. | void | :ref:`remove_shape_owner<class_CollisionObject3D_method_remove_shape_owner>` **(** :ref:`int<class_int>` owner_id **)** |
  60. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  61. | void | :ref:`set_collision_layer_value<class_CollisionObject3D_method_set_collision_layer_value>` **(** :ref:`int<class_int>` layer_number, :ref:`bool<class_bool>` value **)** |
  62. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  63. | void | :ref:`set_collision_mask_value<class_CollisionObject3D_method_set_collision_mask_value>` **(** :ref:`int<class_int>` layer_number, :ref:`bool<class_bool>` value **)** |
  64. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  65. | :ref:`int<class_int>` | :ref:`shape_find_owner<class_CollisionObject3D_method_shape_find_owner>` **(** :ref:`int<class_int>` shape_index **)** |const| |
  66. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  67. | void | :ref:`shape_owner_add_shape<class_CollisionObject3D_method_shape_owner_add_shape>` **(** :ref:`int<class_int>` owner_id, :ref:`Shape3D<class_Shape3D>` shape **)** |
  68. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  69. | void | :ref:`shape_owner_clear_shapes<class_CollisionObject3D_method_shape_owner_clear_shapes>` **(** :ref:`int<class_int>` owner_id **)** |
  70. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  71. | :ref:`Object<class_Object>` | :ref:`shape_owner_get_owner<class_CollisionObject3D_method_shape_owner_get_owner>` **(** :ref:`int<class_int>` owner_id **)** |const| |
  72. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | :ref:`Shape3D<class_Shape3D>` | :ref:`shape_owner_get_shape<class_CollisionObject3D_method_shape_owner_get_shape>` **(** :ref:`int<class_int>` owner_id, :ref:`int<class_int>` shape_id **)** |const| |
  74. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | :ref:`int<class_int>` | :ref:`shape_owner_get_shape_count<class_CollisionObject3D_method_shape_owner_get_shape_count>` **(** :ref:`int<class_int>` owner_id **)** |const| |
  76. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | :ref:`int<class_int>` | :ref:`shape_owner_get_shape_index<class_CollisionObject3D_method_shape_owner_get_shape_index>` **(** :ref:`int<class_int>` owner_id, :ref:`int<class_int>` shape_id **)** |const| |
  78. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | :ref:`Transform3D<class_Transform3D>` | :ref:`shape_owner_get_transform<class_CollisionObject3D_method_shape_owner_get_transform>` **(** :ref:`int<class_int>` owner_id **)** |const| |
  80. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. | void | :ref:`shape_owner_remove_shape<class_CollisionObject3D_method_shape_owner_remove_shape>` **(** :ref:`int<class_int>` owner_id, :ref:`int<class_int>` shape_id **)** |
  82. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. | void | :ref:`shape_owner_set_disabled<class_CollisionObject3D_method_shape_owner_set_disabled>` **(** :ref:`int<class_int>` owner_id, :ref:`bool<class_bool>` disabled **)** |
  84. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. | void | :ref:`shape_owner_set_transform<class_CollisionObject3D_method_shape_owner_set_transform>` **(** :ref:`int<class_int>` owner_id, :ref:`Transform3D<class_Transform3D>` transform **)** |
  86. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. .. rst-class:: classref-section-separator
  88. ----
  89. .. rst-class:: classref-descriptions-group
  90. Signals
  91. -------
  92. .. _class_CollisionObject3D_signal_input_event:
  93. .. rst-class:: classref-signal
  94. **input_event** **(** :ref:`Node<class_Node>` camera, :ref:`InputEvent<class_InputEvent>` event, :ref:`Vector3<class_Vector3>` position, :ref:`Vector3<class_Vector3>` normal, :ref:`int<class_int>` shape_idx **)**
  95. Emitted when the object receives an unhandled :ref:`InputEvent<class_InputEvent>`. ``position`` is the location in world space of the mouse pointer on the surface of the shape with index ``shape_idx`` and ``normal`` is the normal vector of the surface at that point.
  96. .. rst-class:: classref-item-separator
  97. ----
  98. .. _class_CollisionObject3D_signal_mouse_entered:
  99. .. rst-class:: classref-signal
  100. **mouse_entered** **(** **)**
  101. Emitted when the mouse pointer enters any of this object's shapes. Requires :ref:`input_ray_pickable<class_CollisionObject3D_property_input_ray_pickable>` to be ``true`` and at least one :ref:`collision_layer<class_CollisionObject3D_property_collision_layer>` bit to be set.
  102. \ **Note:** Due to the lack of continuous collision detection, this signal may not be emitted in the expected order if the mouse moves fast enough and the **CollisionObject3D**'s area is small. This signal may also not be emitted if another **CollisionObject3D** is overlapping the **CollisionObject3D** in question.
  103. .. rst-class:: classref-item-separator
  104. ----
  105. .. _class_CollisionObject3D_signal_mouse_exited:
  106. .. rst-class:: classref-signal
  107. **mouse_exited** **(** **)**
  108. Emitted when the mouse pointer exits all this object's shapes. Requires :ref:`input_ray_pickable<class_CollisionObject3D_property_input_ray_pickable>` to be ``true`` and at least one :ref:`collision_layer<class_CollisionObject3D_property_collision_layer>` bit to be set.
  109. \ **Note:** Due to the lack of continuous collision detection, this signal may not be emitted in the expected order if the mouse moves fast enough and the **CollisionObject3D**'s area is small. This signal may also not be emitted if another **CollisionObject3D** is overlapping the **CollisionObject3D** in question.
  110. .. rst-class:: classref-section-separator
  111. ----
  112. .. rst-class:: classref-descriptions-group
  113. Enumerations
  114. ------------
  115. .. _enum_CollisionObject3D_DisableMode:
  116. .. rst-class:: classref-enumeration
  117. enum **DisableMode**:
  118. .. _class_CollisionObject3D_constant_DISABLE_MODE_REMOVE:
  119. .. rst-class:: classref-enumeration-constant
  120. :ref:`DisableMode<enum_CollisionObject3D_DisableMode>` **DISABLE_MODE_REMOVE** = ``0``
  121. When :ref:`Node.process_mode<class_Node_property_process_mode>` is set to :ref:`Node.PROCESS_MODE_DISABLED<class_Node_constant_PROCESS_MODE_DISABLED>`, remove from the physics simulation to stop all physics interactions with this **CollisionObject3D**.
  122. Automatically re-added to the physics simulation when the :ref:`Node<class_Node>` is processed again.
  123. .. _class_CollisionObject3D_constant_DISABLE_MODE_MAKE_STATIC:
  124. .. rst-class:: classref-enumeration-constant
  125. :ref:`DisableMode<enum_CollisionObject3D_DisableMode>` **DISABLE_MODE_MAKE_STATIC** = ``1``
  126. When :ref:`Node.process_mode<class_Node_property_process_mode>` is set to :ref:`Node.PROCESS_MODE_DISABLED<class_Node_constant_PROCESS_MODE_DISABLED>`, make the body static. Doesn't affect :ref:`Area3D<class_Area3D>`. :ref:`PhysicsBody3D<class_PhysicsBody3D>` can't be affected by forces or other bodies while static.
  127. Automatically set :ref:`PhysicsBody3D<class_PhysicsBody3D>` back to its original mode when the :ref:`Node<class_Node>` is processed again.
  128. .. _class_CollisionObject3D_constant_DISABLE_MODE_KEEP_ACTIVE:
  129. .. rst-class:: classref-enumeration-constant
  130. :ref:`DisableMode<enum_CollisionObject3D_DisableMode>` **DISABLE_MODE_KEEP_ACTIVE** = ``2``
  131. When :ref:`Node.process_mode<class_Node_property_process_mode>` is set to :ref:`Node.PROCESS_MODE_DISABLED<class_Node_constant_PROCESS_MODE_DISABLED>`, do not affect the physics simulation.
  132. .. rst-class:: classref-section-separator
  133. ----
  134. .. rst-class:: classref-descriptions-group
  135. Property Descriptions
  136. ---------------------
  137. .. _class_CollisionObject3D_property_collision_layer:
  138. .. rst-class:: classref-property
  139. :ref:`int<class_int>` **collision_layer** = ``1``
  140. .. rst-class:: classref-property-setget
  141. - void **set_collision_layer** **(** :ref:`int<class_int>` value **)**
  142. - :ref:`int<class_int>` **get_collision_layer** **(** **)**
  143. The physics layers this CollisionObject3D **is in**. Collision objects can exist in one or more of 32 different layers. See also :ref:`collision_mask<class_CollisionObject3D_property_collision_mask>`.
  144. \ **Note:** Object A can detect a contact with object B only if object B is in any of the layers that object A scans. See `Collision layers and masks <../tutorials/physics/physics_introduction.html#collision-layers-and-masks>`__ in the documentation for more information.
  145. .. rst-class:: classref-item-separator
  146. ----
  147. .. _class_CollisionObject3D_property_collision_mask:
  148. .. rst-class:: classref-property
  149. :ref:`int<class_int>` **collision_mask** = ``1``
  150. .. rst-class:: classref-property-setget
  151. - void **set_collision_mask** **(** :ref:`int<class_int>` value **)**
  152. - :ref:`int<class_int>` **get_collision_mask** **(** **)**
  153. The physics layers this CollisionObject3D **scans**. Collision objects can scan one or more of 32 different layers. See also :ref:`collision_layer<class_CollisionObject3D_property_collision_layer>`.
  154. \ **Note:** Object A can detect a contact with object B only if object B is in any of the layers that object A scans. See `Collision layers and masks <../tutorials/physics/physics_introduction.html#collision-layers-and-masks>`__ in the documentation for more information.
  155. .. rst-class:: classref-item-separator
  156. ----
  157. .. _class_CollisionObject3D_property_collision_priority:
  158. .. rst-class:: classref-property
  159. :ref:`float<class_float>` **collision_priority** = ``1.0``
  160. .. rst-class:: classref-property-setget
  161. - void **set_collision_priority** **(** :ref:`float<class_float>` value **)**
  162. - :ref:`float<class_float>` **get_collision_priority** **(** **)**
  163. The priority used to solve colliding when occurring penetration. The higher the priority is, the lower the penetration into the object will be. This can for example be used to prevent the player from breaking through the boundaries of a level.
  164. .. rst-class:: classref-item-separator
  165. ----
  166. .. _class_CollisionObject3D_property_disable_mode:
  167. .. rst-class:: classref-property
  168. :ref:`DisableMode<enum_CollisionObject3D_DisableMode>` **disable_mode** = ``0``
  169. .. rst-class:: classref-property-setget
  170. - void **set_disable_mode** **(** :ref:`DisableMode<enum_CollisionObject3D_DisableMode>` value **)**
  171. - :ref:`DisableMode<enum_CollisionObject3D_DisableMode>` **get_disable_mode** **(** **)**
  172. Defines the behavior in physics when :ref:`Node.process_mode<class_Node_property_process_mode>` is set to :ref:`Node.PROCESS_MODE_DISABLED<class_Node_constant_PROCESS_MODE_DISABLED>`. See :ref:`DisableMode<enum_CollisionObject3D_DisableMode>` for more details about the different modes.
  173. .. rst-class:: classref-item-separator
  174. ----
  175. .. _class_CollisionObject3D_property_input_capture_on_drag:
  176. .. rst-class:: classref-property
  177. :ref:`bool<class_bool>` **input_capture_on_drag** = ``false``
  178. .. rst-class:: classref-property-setget
  179. - void **set_capture_input_on_drag** **(** :ref:`bool<class_bool>` value **)**
  180. - :ref:`bool<class_bool>` **get_capture_input_on_drag** **(** **)**
  181. If ``true``, the **CollisionObject3D** will continue to receive input events as the mouse is dragged across its shapes.
  182. .. rst-class:: classref-item-separator
  183. ----
  184. .. _class_CollisionObject3D_property_input_ray_pickable:
  185. .. rst-class:: classref-property
  186. :ref:`bool<class_bool>` **input_ray_pickable** = ``true``
  187. .. rst-class:: classref-property-setget
  188. - void **set_ray_pickable** **(** :ref:`bool<class_bool>` value **)**
  189. - :ref:`bool<class_bool>` **is_ray_pickable** **(** **)**
  190. If ``true``, this object is pickable. A pickable object can detect the mouse pointer entering/leaving, and if the mouse is inside it, report input events. Requires at least one :ref:`collision_layer<class_CollisionObject3D_property_collision_layer>` bit to be set.
  191. .. rst-class:: classref-section-separator
  192. ----
  193. .. rst-class:: classref-descriptions-group
  194. Method Descriptions
  195. -------------------
  196. .. _class_CollisionObject3D_private_method__input_event:
  197. .. rst-class:: classref-method
  198. void **_input_event** **(** :ref:`Camera3D<class_Camera3D>` camera, :ref:`InputEvent<class_InputEvent>` event, :ref:`Vector3<class_Vector3>` position, :ref:`Vector3<class_Vector3>` normal, :ref:`int<class_int>` shape_idx **)** |virtual|
  199. Receives unhandled :ref:`InputEvent<class_InputEvent>`\ s. ``position`` is the location in world space of the mouse pointer on the surface of the shape with index ``shape_idx`` and ``normal`` is the normal vector of the surface at that point. Connect to the :ref:`input_event<class_CollisionObject3D_signal_input_event>` signal to easily pick up these events.
  200. \ **Note:** :ref:`_input_event<class_CollisionObject3D_private_method__input_event>` requires :ref:`input_ray_pickable<class_CollisionObject3D_property_input_ray_pickable>` to be ``true`` and at least one :ref:`collision_layer<class_CollisionObject3D_property_collision_layer>` bit to be set.
  201. .. rst-class:: classref-item-separator
  202. ----
  203. .. _class_CollisionObject3D_private_method__mouse_enter:
  204. .. rst-class:: classref-method
  205. void **_mouse_enter** **(** **)** |virtual|
  206. Called when the mouse pointer enters any of this object's shapes. Requires :ref:`input_ray_pickable<class_CollisionObject3D_property_input_ray_pickable>` to be ``true`` and at least one :ref:`collision_layer<class_CollisionObject3D_property_collision_layer>` bit to be set. Note that moving between different shapes within a single **CollisionObject3D** won't cause this function to be called.
  207. .. rst-class:: classref-item-separator
  208. ----
  209. .. _class_CollisionObject3D_private_method__mouse_exit:
  210. .. rst-class:: classref-method
  211. void **_mouse_exit** **(** **)** |virtual|
  212. Called when the mouse pointer exits all this object's shapes. Requires :ref:`input_ray_pickable<class_CollisionObject3D_property_input_ray_pickable>` to be ``true`` and at least one :ref:`collision_layer<class_CollisionObject3D_property_collision_layer>` bit to be set. Note that moving between different shapes within a single **CollisionObject3D** won't cause this function to be called.
  213. .. rst-class:: classref-item-separator
  214. ----
  215. .. _class_CollisionObject3D_method_create_shape_owner:
  216. .. rst-class:: classref-method
  217. :ref:`int<class_int>` **create_shape_owner** **(** :ref:`Object<class_Object>` owner **)**
  218. Creates a new shape owner for the given object. Returns ``owner_id`` of the new owner for future reference.
  219. .. rst-class:: classref-item-separator
  220. ----
  221. .. _class_CollisionObject3D_method_get_collision_layer_value:
  222. .. rst-class:: classref-method
  223. :ref:`bool<class_bool>` **get_collision_layer_value** **(** :ref:`int<class_int>` layer_number **)** |const|
  224. Returns whether or not the specified layer of the :ref:`collision_layer<class_CollisionObject3D_property_collision_layer>` is enabled, given a ``layer_number`` between 1 and 32.
  225. .. rst-class:: classref-item-separator
  226. ----
  227. .. _class_CollisionObject3D_method_get_collision_mask_value:
  228. .. rst-class:: classref-method
  229. :ref:`bool<class_bool>` **get_collision_mask_value** **(** :ref:`int<class_int>` layer_number **)** |const|
  230. Returns whether or not the specified layer of the :ref:`collision_mask<class_CollisionObject3D_property_collision_mask>` is enabled, given a ``layer_number`` between 1 and 32.
  231. .. rst-class:: classref-item-separator
  232. ----
  233. .. _class_CollisionObject3D_method_get_rid:
  234. .. rst-class:: classref-method
  235. :ref:`RID<class_RID>` **get_rid** **(** **)** |const|
  236. Returns the object's :ref:`RID<class_RID>`.
  237. .. rst-class:: classref-item-separator
  238. ----
  239. .. _class_CollisionObject3D_method_get_shape_owners:
  240. .. rst-class:: classref-method
  241. :ref:`PackedInt32Array<class_PackedInt32Array>` **get_shape_owners** **(** **)**
  242. Returns an :ref:`Array<class_Array>` of ``owner_id`` identifiers. You can use these ids in other methods that take ``owner_id`` as an argument.
  243. .. rst-class:: classref-item-separator
  244. ----
  245. .. _class_CollisionObject3D_method_is_shape_owner_disabled:
  246. .. rst-class:: classref-method
  247. :ref:`bool<class_bool>` **is_shape_owner_disabled** **(** :ref:`int<class_int>` owner_id **)** |const|
  248. If ``true``, the shape owner and its shapes are disabled.
  249. .. rst-class:: classref-item-separator
  250. ----
  251. .. _class_CollisionObject3D_method_remove_shape_owner:
  252. .. rst-class:: classref-method
  253. void **remove_shape_owner** **(** :ref:`int<class_int>` owner_id **)**
  254. Removes the given shape owner.
  255. .. rst-class:: classref-item-separator
  256. ----
  257. .. _class_CollisionObject3D_method_set_collision_layer_value:
  258. .. rst-class:: classref-method
  259. void **set_collision_layer_value** **(** :ref:`int<class_int>` layer_number, :ref:`bool<class_bool>` value **)**
  260. Based on ``value``, enables or disables the specified layer in the :ref:`collision_layer<class_CollisionObject3D_property_collision_layer>`, given a ``layer_number`` between 1 and 32.
  261. .. rst-class:: classref-item-separator
  262. ----
  263. .. _class_CollisionObject3D_method_set_collision_mask_value:
  264. .. rst-class:: classref-method
  265. void **set_collision_mask_value** **(** :ref:`int<class_int>` layer_number, :ref:`bool<class_bool>` value **)**
  266. Based on ``value``, enables or disables the specified layer in the :ref:`collision_mask<class_CollisionObject3D_property_collision_mask>`, given a ``layer_number`` between 1 and 32.
  267. .. rst-class:: classref-item-separator
  268. ----
  269. .. _class_CollisionObject3D_method_shape_find_owner:
  270. .. rst-class:: classref-method
  271. :ref:`int<class_int>` **shape_find_owner** **(** :ref:`int<class_int>` shape_index **)** |const|
  272. Returns the ``owner_id`` of the given shape.
  273. .. rst-class:: classref-item-separator
  274. ----
  275. .. _class_CollisionObject3D_method_shape_owner_add_shape:
  276. .. rst-class:: classref-method
  277. void **shape_owner_add_shape** **(** :ref:`int<class_int>` owner_id, :ref:`Shape3D<class_Shape3D>` shape **)**
  278. Adds a :ref:`Shape3D<class_Shape3D>` to the shape owner.
  279. .. rst-class:: classref-item-separator
  280. ----
  281. .. _class_CollisionObject3D_method_shape_owner_clear_shapes:
  282. .. rst-class:: classref-method
  283. void **shape_owner_clear_shapes** **(** :ref:`int<class_int>` owner_id **)**
  284. Removes all shapes from the shape owner.
  285. .. rst-class:: classref-item-separator
  286. ----
  287. .. _class_CollisionObject3D_method_shape_owner_get_owner:
  288. .. rst-class:: classref-method
  289. :ref:`Object<class_Object>` **shape_owner_get_owner** **(** :ref:`int<class_int>` owner_id **)** |const|
  290. Returns the parent object of the given shape owner.
  291. .. rst-class:: classref-item-separator
  292. ----
  293. .. _class_CollisionObject3D_method_shape_owner_get_shape:
  294. .. rst-class:: classref-method
  295. :ref:`Shape3D<class_Shape3D>` **shape_owner_get_shape** **(** :ref:`int<class_int>` owner_id, :ref:`int<class_int>` shape_id **)** |const|
  296. Returns the :ref:`Shape3D<class_Shape3D>` with the given ID from the given shape owner.
  297. .. rst-class:: classref-item-separator
  298. ----
  299. .. _class_CollisionObject3D_method_shape_owner_get_shape_count:
  300. .. rst-class:: classref-method
  301. :ref:`int<class_int>` **shape_owner_get_shape_count** **(** :ref:`int<class_int>` owner_id **)** |const|
  302. Returns the number of shapes the given shape owner contains.
  303. .. rst-class:: classref-item-separator
  304. ----
  305. .. _class_CollisionObject3D_method_shape_owner_get_shape_index:
  306. .. rst-class:: classref-method
  307. :ref:`int<class_int>` **shape_owner_get_shape_index** **(** :ref:`int<class_int>` owner_id, :ref:`int<class_int>` shape_id **)** |const|
  308. Returns the child index of the :ref:`Shape3D<class_Shape3D>` with the given ID from the given shape owner.
  309. .. rst-class:: classref-item-separator
  310. ----
  311. .. _class_CollisionObject3D_method_shape_owner_get_transform:
  312. .. rst-class:: classref-method
  313. :ref:`Transform3D<class_Transform3D>` **shape_owner_get_transform** **(** :ref:`int<class_int>` owner_id **)** |const|
  314. Returns the shape owner's :ref:`Transform3D<class_Transform3D>`.
  315. .. rst-class:: classref-item-separator
  316. ----
  317. .. _class_CollisionObject3D_method_shape_owner_remove_shape:
  318. .. rst-class:: classref-method
  319. void **shape_owner_remove_shape** **(** :ref:`int<class_int>` owner_id, :ref:`int<class_int>` shape_id **)**
  320. Removes a shape from the given shape owner.
  321. .. rst-class:: classref-item-separator
  322. ----
  323. .. _class_CollisionObject3D_method_shape_owner_set_disabled:
  324. .. rst-class:: classref-method
  325. void **shape_owner_set_disabled** **(** :ref:`int<class_int>` owner_id, :ref:`bool<class_bool>` disabled **)**
  326. If ``true``, disables the given shape owner.
  327. .. rst-class:: classref-item-separator
  328. ----
  329. .. _class_CollisionObject3D_method_shape_owner_set_transform:
  330. .. rst-class:: classref-method
  331. void **shape_owner_set_transform** **(** :ref:`int<class_int>` owner_id, :ref:`Transform3D<class_Transform3D>` transform **)**
  332. Sets the :ref:`Transform3D<class_Transform3D>` of the given shape owner.
  333. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  334. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  335. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  336. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  337. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  338. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  339. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`