class_collisionobject.rst 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the CollisionObject.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_CollisionObject:
  5. CollisionObject
  6. ===============
  7. **Inherits:** :ref:`Spatial<class_spatial>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
  8. **Inherited By:** :ref:`PhysicsBody<class_physicsbody>`, :ref:`Area<class_area>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. Member Functions
  13. ----------------
  14. +------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  15. | void | :ref:`_input_event<class_CollisionObject__input_event>` **(** :ref:`Object<class_object>` camera, :ref:`InputEvent<class_inputevent>` event, :ref:`Vector3<class_vector3>` click_position, :ref:`Vector3<class_vector3>` click_normal, :ref:`int<class_int>` shape_idx **)** virtual |
  16. +------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  17. | :ref:`int<class_int>` | :ref:`create_shape_owner<class_CollisionObject_create_shape_owner>` **(** :ref:`Object<class_object>` owner **)** |
  18. +------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  19. | :ref:`bool<class_bool>` | :ref:`get_capture_input_on_drag<class_CollisionObject_get_capture_input_on_drag>` **(** **)** const |
  20. +------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`RID<class_rid>` | :ref:`get_rid<class_CollisionObject_get_rid>` **(** **)** const |
  22. +------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  23. | :ref:`Array<class_array>` | :ref:`get_shape_owners<class_CollisionObject_get_shape_owners>` **(** **)** |
  24. +------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`bool<class_bool>` | :ref:`is_ray_pickable<class_CollisionObject_is_ray_pickable>` **(** **)** const |
  26. +------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. | :ref:`bool<class_bool>` | :ref:`is_shape_owner_disabled<class_CollisionObject_is_shape_owner_disabled>` **(** :ref:`int<class_int>` owner_id **)** const |
  28. +------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. | void | :ref:`remove_shape_owner<class_CollisionObject_remove_shape_owner>` **(** :ref:`int<class_int>` owner_id **)** |
  30. +------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | void | :ref:`set_capture_input_on_drag<class_CollisionObject_set_capture_input_on_drag>` **(** :ref:`bool<class_bool>` enable **)** |
  32. +------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | void | :ref:`set_ray_pickable<class_CollisionObject_set_ray_pickable>` **(** :ref:`bool<class_bool>` ray_pickable **)** |
  34. +------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | :ref:`int<class_int>` | :ref:`shape_find_owner<class_CollisionObject_shape_find_owner>` **(** :ref:`int<class_int>` shape_index **)** const |
  36. +------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | void | :ref:`shape_owner_add_shape<class_CollisionObject_shape_owner_add_shape>` **(** :ref:`int<class_int>` owner_id, :ref:`Shape<class_shape>` shape **)** |
  38. +------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | void | :ref:`shape_owner_clear_shapes<class_CollisionObject_shape_owner_clear_shapes>` **(** :ref:`int<class_int>` owner_id **)** |
  40. +------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | :ref:`Object<class_object>` | :ref:`shape_owner_get_owner<class_CollisionObject_shape_owner_get_owner>` **(** :ref:`int<class_int>` owner_id **)** const |
  42. +------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | :ref:`Shape<class_shape>` | :ref:`shape_owner_get_shape<class_CollisionObject_shape_owner_get_shape>` **(** :ref:`int<class_int>` owner_id, :ref:`int<class_int>` shape_id **)** const |
  44. +------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | :ref:`int<class_int>` | :ref:`shape_owner_get_shape_count<class_CollisionObject_shape_owner_get_shape_count>` **(** :ref:`int<class_int>` owner_id **)** const |
  46. +------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  47. | :ref:`int<class_int>` | :ref:`shape_owner_get_shape_index<class_CollisionObject_shape_owner_get_shape_index>` **(** :ref:`int<class_int>` owner_id, :ref:`int<class_int>` shape_id **)** const |
  48. +------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  49. | :ref:`Transform<class_transform>` | :ref:`shape_owner_get_transform<class_CollisionObject_shape_owner_get_transform>` **(** :ref:`int<class_int>` owner_id **)** const |
  50. +------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  51. | void | :ref:`shape_owner_remove_shape<class_CollisionObject_shape_owner_remove_shape>` **(** :ref:`int<class_int>` owner_id, :ref:`int<class_int>` shape_id **)** |
  52. +------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | void | :ref:`shape_owner_set_disabled<class_CollisionObject_shape_owner_set_disabled>` **(** :ref:`int<class_int>` owner_id, :ref:`bool<class_bool>` disabled **)** |
  54. +------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  55. | void | :ref:`shape_owner_set_transform<class_CollisionObject_shape_owner_set_transform>` **(** :ref:`int<class_int>` owner_id, :ref:`Transform<class_transform>` transform **)** |
  56. +------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  57. Signals
  58. -------
  59. - **input_event** **(** :ref:`Object<class_object>` camera, :ref:`Object<class_object>` event, :ref:`Vector3<class_vector3>` click_position, :ref:`Vector3<class_vector3>` click_normal, :ref:`int<class_int>` shape_idx **)**
  60. - **mouse_entered** **(** **)**
  61. - **mouse_exited** **(** **)**
  62. Member Variables
  63. ----------------
  64. - :ref:`bool<class_bool>` **input_capture_on_drag**
  65. - :ref:`bool<class_bool>` **input_ray_pickable**
  66. Member Function Description
  67. ---------------------------
  68. .. _class_CollisionObject__input_event:
  69. - void **_input_event** **(** :ref:`Object<class_object>` camera, :ref:`InputEvent<class_inputevent>` event, :ref:`Vector3<class_vector3>` click_position, :ref:`Vector3<class_vector3>` click_normal, :ref:`int<class_int>` shape_idx **)** virtual
  70. .. _class_CollisionObject_create_shape_owner:
  71. - :ref:`int<class_int>` **create_shape_owner** **(** :ref:`Object<class_object>` owner **)**
  72. Creates new holder for the shapes. Argument is a :ref:`CollisionShape<class_collisionshape>` node. It will return owner_id which usually you will want to save for later use.
  73. .. _class_CollisionObject_get_capture_input_on_drag:
  74. - :ref:`bool<class_bool>` **get_capture_input_on_drag** **(** **)** const
  75. .. _class_CollisionObject_get_rid:
  76. - :ref:`RID<class_rid>` **get_rid** **(** **)** const
  77. .. _class_CollisionObject_get_shape_owners:
  78. - :ref:`Array<class_array>` **get_shape_owners** **(** **)**
  79. Shape owner is a node which is holding concrete shape resources. This method will return an array which is holding an integer numbers that are representing unique ID of each owner. You can use those ids when you are using others shape_owner methods.
  80. .. _class_CollisionObject_is_ray_pickable:
  81. - :ref:`bool<class_bool>` **is_ray_pickable** **(** **)** const
  82. .. _class_CollisionObject_is_shape_owner_disabled:
  83. - :ref:`bool<class_bool>` **is_shape_owner_disabled** **(** :ref:`int<class_int>` owner_id **)** const
  84. .. _class_CollisionObject_remove_shape_owner:
  85. - void **remove_shape_owner** **(** :ref:`int<class_int>` owner_id **)**
  86. .. _class_CollisionObject_set_capture_input_on_drag:
  87. - void **set_capture_input_on_drag** **(** :ref:`bool<class_bool>` enable **)**
  88. .. _class_CollisionObject_set_ray_pickable:
  89. - void **set_ray_pickable** **(** :ref:`bool<class_bool>` ray_pickable **)**
  90. .. _class_CollisionObject_shape_find_owner:
  91. - :ref:`int<class_int>` **shape_find_owner** **(** :ref:`int<class_int>` shape_index **)** const
  92. .. _class_CollisionObject_shape_owner_add_shape:
  93. - void **shape_owner_add_shape** **(** :ref:`int<class_int>` owner_id, :ref:`Shape<class_shape>` shape **)**
  94. .. _class_CollisionObject_shape_owner_clear_shapes:
  95. - void **shape_owner_clear_shapes** **(** :ref:`int<class_int>` owner_id **)**
  96. Will remove all the shapes associated with given owner.
  97. .. _class_CollisionObject_shape_owner_get_owner:
  98. - :ref:`Object<class_object>` **shape_owner_get_owner** **(** :ref:`int<class_int>` owner_id **)** const
  99. .. _class_CollisionObject_shape_owner_get_shape:
  100. - :ref:`Shape<class_shape>` **shape_owner_get_shape** **(** :ref:`int<class_int>` owner_id, :ref:`int<class_int>` shape_id **)** const
  101. Will return a :ref:`Shape<class_shape>`. First argument owner_id is an integer that can be obtained from :ref:`get_shape_owners<class_CollisionObject_get_shape_owners>`. Shape_id is a position of the shape inside owner; it's a value in range from 0 to :ref:`shape_owner_get_shape_count<class_CollisionObject_shape_owner_get_shape_count>`.
  102. .. _class_CollisionObject_shape_owner_get_shape_count:
  103. - :ref:`int<class_int>` **shape_owner_get_shape_count** **(** :ref:`int<class_int>` owner_id **)** const
  104. Returns number of shapes to which given owner is associated to.
  105. .. _class_CollisionObject_shape_owner_get_shape_index:
  106. - :ref:`int<class_int>` **shape_owner_get_shape_index** **(** :ref:`int<class_int>` owner_id, :ref:`int<class_int>` shape_id **)** const
  107. .. _class_CollisionObject_shape_owner_get_transform:
  108. - :ref:`Transform<class_transform>` **shape_owner_get_transform** **(** :ref:`int<class_int>` owner_id **)** const
  109. Will return :ref:`Transform<class_transform>` of an owner node.
  110. .. _class_CollisionObject_shape_owner_remove_shape:
  111. - void **shape_owner_remove_shape** **(** :ref:`int<class_int>` owner_id, :ref:`int<class_int>` shape_id **)**
  112. Removes related shape from the owner.
  113. .. _class_CollisionObject_shape_owner_set_disabled:
  114. - void **shape_owner_set_disabled** **(** :ref:`int<class_int>` owner_id, :ref:`bool<class_bool>` disabled **)**
  115. .. _class_CollisionObject_shape_owner_set_transform:
  116. - void **shape_owner_set_transform** **(** :ref:`int<class_int>` owner_id, :ref:`Transform<class_transform>` transform **)**