class_collisionobject2d.rst 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517
  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/doc/classes/CollisionObject2D.xml.
  6. .. _class_CollisionObject2D:
  7. CollisionObject2D
  8. =================
  9. **Inherits:** :ref:`Node2D<class_Node2D>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`Area2D<class_Area2D>`, :ref:`PhysicsBody2D<class_PhysicsBody2D>`
  11. Base node for 2D collision objects.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. CollisionObject2D is the base class for 2D physics objects. It can hold any number of 2D collision :ref:`Shape2D<class_Shape2D>`\ s. Each shape must be assigned to a *shape owner*. The CollisionObject2D can have any number of shape owners. Shape owners are not nodes and do not appear in the editor, but are accessible through code using the ``shape_owner_*`` methods.
  16. \ **Note:** Only collisions between objects within the same canvas (:ref:`Viewport<class_Viewport>` canvas or :ref:`CanvasLayer<class_CanvasLayer>`) are supported. The behavior of collisions between objects in different canvases is undefined.
  17. .. rst-class:: classref-reftable-group
  18. Properties
  19. ----------
  20. .. table::
  21. :widths: auto
  22. +-------------------------+--------------------------------------------------------------------------+----------+
  23. | :ref:`int<class_int>` | :ref:`collision_layer<class_CollisionObject2D_property_collision_layer>` | ``1`` |
  24. +-------------------------+--------------------------------------------------------------------------+----------+
  25. | :ref:`int<class_int>` | :ref:`collision_mask<class_CollisionObject2D_property_collision_mask>` | ``1`` |
  26. +-------------------------+--------------------------------------------------------------------------+----------+
  27. | :ref:`bool<class_bool>` | :ref:`input_pickable<class_CollisionObject2D_property_input_pickable>` | ``true`` |
  28. +-------------------------+--------------------------------------------------------------------------+----------+
  29. .. rst-class:: classref-reftable-group
  30. Methods
  31. -------
  32. .. table::
  33. :widths: auto
  34. +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | void | :ref:`_input_event<class_CollisionObject2D_method__input_event>` **(** :ref:`Object<class_Object>` viewport, :ref:`InputEvent<class_InputEvent>` event, :ref:`int<class_int>` shape_idx **)** |virtual| |
  36. +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | :ref:`int<class_int>` | :ref:`create_shape_owner<class_CollisionObject2D_method_create_shape_owner>` **(** :ref:`Object<class_Object>` owner **)** |
  38. +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | :ref:`bool<class_bool>` | :ref:`get_collision_layer_bit<class_CollisionObject2D_method_get_collision_layer_bit>` **(** :ref:`int<class_int>` bit **)** |const| |
  40. +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | :ref:`bool<class_bool>` | :ref:`get_collision_mask_bit<class_CollisionObject2D_method_get_collision_mask_bit>` **(** :ref:`int<class_int>` bit **)** |const| |
  42. +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | :ref:`RID<class_RID>` | :ref:`get_rid<class_CollisionObject2D_method_get_rid>` **(** **)** |const| |
  44. +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | :ref:`float<class_float>` | :ref:`get_shape_owner_one_way_collision_margin<class_CollisionObject2D_method_get_shape_owner_one_way_collision_margin>` **(** :ref:`int<class_int>` owner_id **)** |const| |
  46. +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  47. | :ref:`Array<class_Array>` | :ref:`get_shape_owners<class_CollisionObject2D_method_get_shape_owners>` **(** **)** |
  48. +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  49. | :ref:`bool<class_bool>` | :ref:`is_shape_owner_disabled<class_CollisionObject2D_method_is_shape_owner_disabled>` **(** :ref:`int<class_int>` owner_id **)** |const| |
  50. +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  51. | :ref:`bool<class_bool>` | :ref:`is_shape_owner_one_way_collision_enabled<class_CollisionObject2D_method_is_shape_owner_one_way_collision_enabled>` **(** :ref:`int<class_int>` owner_id **)** |const| |
  52. +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | void | :ref:`remove_shape_owner<class_CollisionObject2D_method_remove_shape_owner>` **(** :ref:`int<class_int>` owner_id **)** |
  54. +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  55. | void | :ref:`set_collision_layer_bit<class_CollisionObject2D_method_set_collision_layer_bit>` **(** :ref:`int<class_int>` bit, :ref:`bool<class_bool>` value **)** |
  56. +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  57. | void | :ref:`set_collision_mask_bit<class_CollisionObject2D_method_set_collision_mask_bit>` **(** :ref:`int<class_int>` bit, :ref:`bool<class_bool>` value **)** |
  58. +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  59. | :ref:`int<class_int>` | :ref:`shape_find_owner<class_CollisionObject2D_method_shape_find_owner>` **(** :ref:`int<class_int>` shape_index **)** |const| |
  60. +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  61. | void | :ref:`shape_owner_add_shape<class_CollisionObject2D_method_shape_owner_add_shape>` **(** :ref:`int<class_int>` owner_id, :ref:`Shape2D<class_Shape2D>` shape **)** |
  62. +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  63. | void | :ref:`shape_owner_clear_shapes<class_CollisionObject2D_method_shape_owner_clear_shapes>` **(** :ref:`int<class_int>` owner_id **)** |
  64. +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  65. | :ref:`Object<class_Object>` | :ref:`shape_owner_get_owner<class_CollisionObject2D_method_shape_owner_get_owner>` **(** :ref:`int<class_int>` owner_id **)** |const| |
  66. +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  67. | :ref:`Shape2D<class_Shape2D>` | :ref:`shape_owner_get_shape<class_CollisionObject2D_method_shape_owner_get_shape>` **(** :ref:`int<class_int>` owner_id, :ref:`int<class_int>` shape_id **)** |const| |
  68. +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  69. | :ref:`int<class_int>` | :ref:`shape_owner_get_shape_count<class_CollisionObject2D_method_shape_owner_get_shape_count>` **(** :ref:`int<class_int>` owner_id **)** |const| |
  70. +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  71. | :ref:`int<class_int>` | :ref:`shape_owner_get_shape_index<class_CollisionObject2D_method_shape_owner_get_shape_index>` **(** :ref:`int<class_int>` owner_id, :ref:`int<class_int>` shape_id **)** |const| |
  72. +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | :ref:`Transform2D<class_Transform2D>` | :ref:`shape_owner_get_transform<class_CollisionObject2D_method_shape_owner_get_transform>` **(** :ref:`int<class_int>` owner_id **)** |const| |
  74. +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | void | :ref:`shape_owner_remove_shape<class_CollisionObject2D_method_shape_owner_remove_shape>` **(** :ref:`int<class_int>` owner_id, :ref:`int<class_int>` shape_id **)** |
  76. +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | void | :ref:`shape_owner_set_disabled<class_CollisionObject2D_method_shape_owner_set_disabled>` **(** :ref:`int<class_int>` owner_id, :ref:`bool<class_bool>` disabled **)** |
  78. +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | void | :ref:`shape_owner_set_one_way_collision<class_CollisionObject2D_method_shape_owner_set_one_way_collision>` **(** :ref:`int<class_int>` owner_id, :ref:`bool<class_bool>` enable **)** |
  80. +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. | void | :ref:`shape_owner_set_one_way_collision_margin<class_CollisionObject2D_method_shape_owner_set_one_way_collision_margin>` **(** :ref:`int<class_int>` owner_id, :ref:`float<class_float>` margin **)** |
  82. +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. | void | :ref:`shape_owner_set_transform<class_CollisionObject2D_method_shape_owner_set_transform>` **(** :ref:`int<class_int>` owner_id, :ref:`Transform2D<class_Transform2D>` transform **)** |
  84. +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. .. rst-class:: classref-section-separator
  86. ----
  87. .. rst-class:: classref-descriptions-group
  88. Signals
  89. -------
  90. .. _class_CollisionObject2D_signal_input_event:
  91. .. rst-class:: classref-signal
  92. **input_event** **(** :ref:`Node<class_Node>` viewport, :ref:`InputEvent<class_InputEvent>` event, :ref:`int<class_int>` shape_idx **)**
  93. Emitted when an input event occurs. Requires :ref:`input_pickable<class_CollisionObject2D_property_input_pickable>` to be ``true`` and at least one ``collision_layer`` bit to be set. See :ref:`_input_event<class_CollisionObject2D_method__input_event>` for details.
  94. .. rst-class:: classref-item-separator
  95. ----
  96. .. _class_CollisionObject2D_signal_mouse_entered:
  97. .. rst-class:: classref-signal
  98. **mouse_entered** **(** **)**
  99. Emitted when the mouse pointer enters any of this object's shapes. Requires :ref:`input_pickable<class_CollisionObject2D_property_input_pickable>` to be ``true`` and at least one ``collision_layer`` bit to be set.
  100. .. rst-class:: classref-item-separator
  101. ----
  102. .. _class_CollisionObject2D_signal_mouse_exited:
  103. .. rst-class:: classref-signal
  104. **mouse_exited** **(** **)**
  105. Emitted when the mouse pointer exits all this object's shapes. Requires :ref:`input_pickable<class_CollisionObject2D_property_input_pickable>` to be ``true`` and at least one ``collision_layer`` bit to be set.
  106. .. rst-class:: classref-section-separator
  107. ----
  108. .. rst-class:: classref-descriptions-group
  109. Property Descriptions
  110. ---------------------
  111. .. _class_CollisionObject2D_property_collision_layer:
  112. .. rst-class:: classref-property
  113. :ref:`int<class_int>` **collision_layer** = ``1``
  114. .. rst-class:: classref-property-setget
  115. - void **set_collision_layer** **(** :ref:`int<class_int>` value **)**
  116. - :ref:`int<class_int>` **get_collision_layer** **(** **)**
  117. The physics layers this CollisionObject2D is in. Collision objects can exist in one or more of 32 different layers. See also :ref:`collision_mask<class_CollisionObject2D_property_collision_mask>`.
  118. \ **Note:** A contact is detected if object A is in any of the layers that object B scans, or object B is in any 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.
  119. .. rst-class:: classref-item-separator
  120. ----
  121. .. _class_CollisionObject2D_property_collision_mask:
  122. .. rst-class:: classref-property
  123. :ref:`int<class_int>` **collision_mask** = ``1``
  124. .. rst-class:: classref-property-setget
  125. - void **set_collision_mask** **(** :ref:`int<class_int>` value **)**
  126. - :ref:`int<class_int>` **get_collision_mask** **(** **)**
  127. The physics layers this CollisionObject2D scans. Collision objects can scan one or more of 32 different layers. See also :ref:`collision_layer<class_CollisionObject2D_property_collision_layer>`.
  128. \ **Note:** A contact is detected if object A is in any of the layers that object B scans, or object B is in any 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.
  129. .. rst-class:: classref-item-separator
  130. ----
  131. .. _class_CollisionObject2D_property_input_pickable:
  132. .. rst-class:: classref-property
  133. :ref:`bool<class_bool>` **input_pickable** = ``true``
  134. .. rst-class:: classref-property-setget
  135. - void **set_pickable** **(** :ref:`bool<class_bool>` value **)**
  136. - :ref:`bool<class_bool>` **is_pickable** **(** **)**
  137. 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_CollisionObject2D_property_collision_layer>` bit to be set.
  138. .. rst-class:: classref-section-separator
  139. ----
  140. .. rst-class:: classref-descriptions-group
  141. Method Descriptions
  142. -------------------
  143. .. _class_CollisionObject2D_method__input_event:
  144. .. rst-class:: classref-method
  145. void **_input_event** **(** :ref:`Object<class_Object>` viewport, :ref:`InputEvent<class_InputEvent>` event, :ref:`int<class_int>` shape_idx **)** |virtual|
  146. Accepts unhandled :ref:`InputEvent<class_InputEvent>`\ s. Requires :ref:`input_pickable<class_CollisionObject2D_property_input_pickable>` to be ``true``. ``shape_idx`` is the child index of the clicked :ref:`Shape2D<class_Shape2D>`. Connect to the ``input_event`` signal to easily pick up these events.
  147. .. rst-class:: classref-item-separator
  148. ----
  149. .. _class_CollisionObject2D_method_create_shape_owner:
  150. .. rst-class:: classref-method
  151. :ref:`int<class_int>` **create_shape_owner** **(** :ref:`Object<class_Object>` owner **)**
  152. Creates a new shape owner for the given object. Returns ``owner_id`` of the new owner for future reference.
  153. .. rst-class:: classref-item-separator
  154. ----
  155. .. _class_CollisionObject2D_method_get_collision_layer_bit:
  156. .. rst-class:: classref-method
  157. :ref:`bool<class_bool>` **get_collision_layer_bit** **(** :ref:`int<class_int>` bit **)** |const|
  158. Returns whether or not the specified ``bit`` of the :ref:`collision_layer<class_CollisionObject2D_property_collision_layer>` is set.
  159. .. rst-class:: classref-item-separator
  160. ----
  161. .. _class_CollisionObject2D_method_get_collision_mask_bit:
  162. .. rst-class:: classref-method
  163. :ref:`bool<class_bool>` **get_collision_mask_bit** **(** :ref:`int<class_int>` bit **)** |const|
  164. Returns whether or not the specified ``bit`` of the :ref:`collision_mask<class_CollisionObject2D_property_collision_mask>` is set.
  165. .. rst-class:: classref-item-separator
  166. ----
  167. .. _class_CollisionObject2D_method_get_rid:
  168. .. rst-class:: classref-method
  169. :ref:`RID<class_RID>` **get_rid** **(** **)** |const|
  170. Returns the object's :ref:`RID<class_RID>`.
  171. .. rst-class:: classref-item-separator
  172. ----
  173. .. _class_CollisionObject2D_method_get_shape_owner_one_way_collision_margin:
  174. .. rst-class:: classref-method
  175. :ref:`float<class_float>` **get_shape_owner_one_way_collision_margin** **(** :ref:`int<class_int>` owner_id **)** |const|
  176. Returns the ``one_way_collision_margin`` of the shape owner identified by given ``owner_id``.
  177. .. rst-class:: classref-item-separator
  178. ----
  179. .. _class_CollisionObject2D_method_get_shape_owners:
  180. .. rst-class:: classref-method
  181. :ref:`Array<class_Array>` **get_shape_owners** **(** **)**
  182. 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.
  183. .. rst-class:: classref-item-separator
  184. ----
  185. .. _class_CollisionObject2D_method_is_shape_owner_disabled:
  186. .. rst-class:: classref-method
  187. :ref:`bool<class_bool>` **is_shape_owner_disabled** **(** :ref:`int<class_int>` owner_id **)** |const|
  188. If ``true``, the shape owner and its shapes are disabled.
  189. .. rst-class:: classref-item-separator
  190. ----
  191. .. _class_CollisionObject2D_method_is_shape_owner_one_way_collision_enabled:
  192. .. rst-class:: classref-method
  193. :ref:`bool<class_bool>` **is_shape_owner_one_way_collision_enabled** **(** :ref:`int<class_int>` owner_id **)** |const|
  194. Returns ``true`` if collisions for the shape owner originating from this **CollisionObject2D** will not be reported to collided with **CollisionObject2D**\ s.
  195. .. rst-class:: classref-item-separator
  196. ----
  197. .. _class_CollisionObject2D_method_remove_shape_owner:
  198. .. rst-class:: classref-method
  199. void **remove_shape_owner** **(** :ref:`int<class_int>` owner_id **)**
  200. Removes the given shape owner.
  201. .. rst-class:: classref-item-separator
  202. ----
  203. .. _class_CollisionObject2D_method_set_collision_layer_bit:
  204. .. rst-class:: classref-method
  205. void **set_collision_layer_bit** **(** :ref:`int<class_int>` bit, :ref:`bool<class_bool>` value **)**
  206. If ``value`` is ``true``, sets the specified ``bit`` in the :ref:`collision_layer<class_CollisionObject2D_property_collision_layer>`.
  207. If ``value`` is ``false``, clears the specified ``bit`` in the :ref:`collision_layer<class_CollisionObject2D_property_collision_layer>`.
  208. .. rst-class:: classref-item-separator
  209. ----
  210. .. _class_CollisionObject2D_method_set_collision_mask_bit:
  211. .. rst-class:: classref-method
  212. void **set_collision_mask_bit** **(** :ref:`int<class_int>` bit, :ref:`bool<class_bool>` value **)**
  213. If ``value`` is ``true``, sets the specified ``bit`` in the :ref:`collision_mask<class_CollisionObject2D_property_collision_mask>`.
  214. If ``value`` is ``false``, clears the specified ``bit`` in the :ref:`collision_mask<class_CollisionObject2D_property_collision_mask>`.
  215. .. rst-class:: classref-item-separator
  216. ----
  217. .. _class_CollisionObject2D_method_shape_find_owner:
  218. .. rst-class:: classref-method
  219. :ref:`int<class_int>` **shape_find_owner** **(** :ref:`int<class_int>` shape_index **)** |const|
  220. Returns the ``owner_id`` of the given shape.
  221. .. rst-class:: classref-item-separator
  222. ----
  223. .. _class_CollisionObject2D_method_shape_owner_add_shape:
  224. .. rst-class:: classref-method
  225. void **shape_owner_add_shape** **(** :ref:`int<class_int>` owner_id, :ref:`Shape2D<class_Shape2D>` shape **)**
  226. Adds a :ref:`Shape2D<class_Shape2D>` to the shape owner.
  227. .. rst-class:: classref-item-separator
  228. ----
  229. .. _class_CollisionObject2D_method_shape_owner_clear_shapes:
  230. .. rst-class:: classref-method
  231. void **shape_owner_clear_shapes** **(** :ref:`int<class_int>` owner_id **)**
  232. Removes all shapes from the shape owner.
  233. .. rst-class:: classref-item-separator
  234. ----
  235. .. _class_CollisionObject2D_method_shape_owner_get_owner:
  236. .. rst-class:: classref-method
  237. :ref:`Object<class_Object>` **shape_owner_get_owner** **(** :ref:`int<class_int>` owner_id **)** |const|
  238. Returns the parent object of the given shape owner.
  239. .. rst-class:: classref-item-separator
  240. ----
  241. .. _class_CollisionObject2D_method_shape_owner_get_shape:
  242. .. rst-class:: classref-method
  243. :ref:`Shape2D<class_Shape2D>` **shape_owner_get_shape** **(** :ref:`int<class_int>` owner_id, :ref:`int<class_int>` shape_id **)** |const|
  244. Returns the :ref:`Shape2D<class_Shape2D>` with the given id from the given shape owner.
  245. .. rst-class:: classref-item-separator
  246. ----
  247. .. _class_CollisionObject2D_method_shape_owner_get_shape_count:
  248. .. rst-class:: classref-method
  249. :ref:`int<class_int>` **shape_owner_get_shape_count** **(** :ref:`int<class_int>` owner_id **)** |const|
  250. Returns the number of shapes the given shape owner contains.
  251. .. rst-class:: classref-item-separator
  252. ----
  253. .. _class_CollisionObject2D_method_shape_owner_get_shape_index:
  254. .. rst-class:: classref-method
  255. :ref:`int<class_int>` **shape_owner_get_shape_index** **(** :ref:`int<class_int>` owner_id, :ref:`int<class_int>` shape_id **)** |const|
  256. Returns the child index of the :ref:`Shape2D<class_Shape2D>` with the given id from the given shape owner.
  257. .. rst-class:: classref-item-separator
  258. ----
  259. .. _class_CollisionObject2D_method_shape_owner_get_transform:
  260. .. rst-class:: classref-method
  261. :ref:`Transform2D<class_Transform2D>` **shape_owner_get_transform** **(** :ref:`int<class_int>` owner_id **)** |const|
  262. Returns the shape owner's :ref:`Transform2D<class_Transform2D>`.
  263. .. rst-class:: classref-item-separator
  264. ----
  265. .. _class_CollisionObject2D_method_shape_owner_remove_shape:
  266. .. rst-class:: classref-method
  267. void **shape_owner_remove_shape** **(** :ref:`int<class_int>` owner_id, :ref:`int<class_int>` shape_id **)**
  268. Removes a shape from the given shape owner.
  269. .. rst-class:: classref-item-separator
  270. ----
  271. .. _class_CollisionObject2D_method_shape_owner_set_disabled:
  272. .. rst-class:: classref-method
  273. void **shape_owner_set_disabled** **(** :ref:`int<class_int>` owner_id, :ref:`bool<class_bool>` disabled **)**
  274. If ``true``, disables the given shape owner.
  275. .. rst-class:: classref-item-separator
  276. ----
  277. .. _class_CollisionObject2D_method_shape_owner_set_one_way_collision:
  278. .. rst-class:: classref-method
  279. void **shape_owner_set_one_way_collision** **(** :ref:`int<class_int>` owner_id, :ref:`bool<class_bool>` enable **)**
  280. If ``enable`` is ``true``, collisions for the shape owner originating from this **CollisionObject2D** will not be reported to collided with **CollisionObject2D**\ s.
  281. .. rst-class:: classref-item-separator
  282. ----
  283. .. _class_CollisionObject2D_method_shape_owner_set_one_way_collision_margin:
  284. .. rst-class:: classref-method
  285. void **shape_owner_set_one_way_collision_margin** **(** :ref:`int<class_int>` owner_id, :ref:`float<class_float>` margin **)**
  286. Sets the ``one_way_collision_margin`` of the shape owner identified by given ``owner_id`` to ``margin`` pixels.
  287. .. rst-class:: classref-item-separator
  288. ----
  289. .. _class_CollisionObject2D_method_shape_owner_set_transform:
  290. .. rst-class:: classref-method
  291. void **shape_owner_set_transform** **(** :ref:`int<class_int>` owner_id, :ref:`Transform2D<class_Transform2D>` transform **)**
  292. Sets the :ref:`Transform2D<class_Transform2D>` of the given shape owner.
  293. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  294. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  295. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  296. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`