class_clippedcamera.rst 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the ClippedCamera.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_ClippedCamera:
  6. ClippedCamera
  7. =============
  8. **Inherits:** :ref:`Camera<class_Camera>` **<** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. A :ref:`Camera<class_Camera>` that includes collision.
  10. Description
  11. -----------
  12. This node extends :ref:`Camera<class_Camera>` to add collisions with :ref:`Area<class_Area>` and/or :ref:`PhysicsBody<class_PhysicsBody>` nodes. The camera cannot move through colliding objects.
  13. Properties
  14. ----------
  15. +----------------------------------------------------+--------------------------------------------------------------------+-----------+
  16. | :ref:`bool<class_bool>` | :ref:`clip_to_areas<class_ClippedCamera_property_clip_to_areas>` | ``false`` |
  17. +----------------------------------------------------+--------------------------------------------------------------------+-----------+
  18. | :ref:`bool<class_bool>` | :ref:`clip_to_bodies<class_ClippedCamera_property_clip_to_bodies>` | ``true`` |
  19. +----------------------------------------------------+--------------------------------------------------------------------+-----------+
  20. | :ref:`int<class_int>` | :ref:`collision_mask<class_ClippedCamera_property_collision_mask>` | ``1`` |
  21. +----------------------------------------------------+--------------------------------------------------------------------+-----------+
  22. | :ref:`float<class_float>` | :ref:`margin<class_ClippedCamera_property_margin>` | ``0.0`` |
  23. +----------------------------------------------------+--------------------------------------------------------------------+-----------+
  24. | :ref:`ProcessMode<enum_ClippedCamera_ProcessMode>` | :ref:`process_mode<class_ClippedCamera_property_process_mode>` | ``0`` |
  25. +----------------------------------------------------+--------------------------------------------------------------------+-----------+
  26. Methods
  27. -------
  28. +---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. | void | :ref:`add_exception<class_ClippedCamera_method_add_exception>` **(** :ref:`Object<class_Object>` node **)** |
  30. +---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | void | :ref:`add_exception_rid<class_ClippedCamera_method_add_exception_rid>` **(** :ref:`RID<class_RID>` rid **)** |
  32. +---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | void | :ref:`clear_exceptions<class_ClippedCamera_method_clear_exceptions>` **(** **)** |
  34. +---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | :ref:`float<class_float>` | :ref:`get_clip_offset<class_ClippedCamera_method_get_clip_offset>` **(** **)** |const| |
  36. +---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | :ref:`bool<class_bool>` | :ref:`get_collision_mask_bit<class_ClippedCamera_method_get_collision_mask_bit>` **(** :ref:`int<class_int>` bit **)** |const| |
  38. +---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | void | :ref:`remove_exception<class_ClippedCamera_method_remove_exception>` **(** :ref:`Object<class_Object>` node **)** |
  40. +---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | void | :ref:`remove_exception_rid<class_ClippedCamera_method_remove_exception_rid>` **(** :ref:`RID<class_RID>` rid **)** |
  42. +---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | void | :ref:`set_collision_mask_bit<class_ClippedCamera_method_set_collision_mask_bit>` **(** :ref:`int<class_int>` bit, :ref:`bool<class_bool>` value **)** |
  44. +---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. Enumerations
  46. ------------
  47. .. _enum_ClippedCamera_ProcessMode:
  48. .. _class_ClippedCamera_constant_CLIP_PROCESS_PHYSICS:
  49. .. _class_ClippedCamera_constant_CLIP_PROCESS_IDLE:
  50. enum **ProcessMode**:
  51. - **CLIP_PROCESS_PHYSICS** = **0** --- The camera updates with the ``_physics_process`` callback.
  52. - **CLIP_PROCESS_IDLE** = **1** --- The camera updates with the ``_process`` callback.
  53. Property Descriptions
  54. ---------------------
  55. .. _class_ClippedCamera_property_clip_to_areas:
  56. - :ref:`bool<class_bool>` **clip_to_areas**
  57. +-----------+----------------------------+
  58. | *Default* | ``false`` |
  59. +-----------+----------------------------+
  60. | *Setter* | set_clip_to_areas(value) |
  61. +-----------+----------------------------+
  62. | *Getter* | is_clip_to_areas_enabled() |
  63. +-----------+----------------------------+
  64. If ``true``, the camera stops on contact with :ref:`Area<class_Area>`\ s.
  65. ----
  66. .. _class_ClippedCamera_property_clip_to_bodies:
  67. - :ref:`bool<class_bool>` **clip_to_bodies**
  68. +-----------+-----------------------------+
  69. | *Default* | ``true`` |
  70. +-----------+-----------------------------+
  71. | *Setter* | set_clip_to_bodies(value) |
  72. +-----------+-----------------------------+
  73. | *Getter* | is_clip_to_bodies_enabled() |
  74. +-----------+-----------------------------+
  75. If ``true``, the camera stops on contact with :ref:`PhysicsBody<class_PhysicsBody>`\ s.
  76. ----
  77. .. _class_ClippedCamera_property_collision_mask:
  78. - :ref:`int<class_int>` **collision_mask**
  79. +-----------+---------------------------+
  80. | *Default* | ``1`` |
  81. +-----------+---------------------------+
  82. | *Setter* | set_collision_mask(value) |
  83. +-----------+---------------------------+
  84. | *Getter* | get_collision_mask() |
  85. +-----------+---------------------------+
  86. The camera's collision mask. Only objects in at least one collision layer matching the mask will be detected. See `Collision layers and masks <https://docs.godotengine.org/en/3.4/tutorials/physics/physics_introduction.html#collision-layers-and-masks>`__ in the documentation for more information.
  87. ----
  88. .. _class_ClippedCamera_property_margin:
  89. - :ref:`float<class_float>` **margin**
  90. +-----------+-------------------+
  91. | *Default* | ``0.0`` |
  92. +-----------+-------------------+
  93. | *Setter* | set_margin(value) |
  94. +-----------+-------------------+
  95. | *Getter* | get_margin() |
  96. +-----------+-------------------+
  97. The camera's collision margin. The camera can't get closer than this distance to a colliding object.
  98. ----
  99. .. _class_ClippedCamera_property_process_mode:
  100. - :ref:`ProcessMode<enum_ClippedCamera_ProcessMode>` **process_mode**
  101. +-----------+-------------------------+
  102. | *Default* | ``0`` |
  103. +-----------+-------------------------+
  104. | *Setter* | set_process_mode(value) |
  105. +-----------+-------------------------+
  106. | *Getter* | get_process_mode() |
  107. +-----------+-------------------------+
  108. The camera's process callback. See :ref:`ProcessMode<enum_ClippedCamera_ProcessMode>`.
  109. Method Descriptions
  110. -------------------
  111. .. _class_ClippedCamera_method_add_exception:
  112. - void **add_exception** **(** :ref:`Object<class_Object>` node **)**
  113. Adds a collision exception so the camera does not collide with the specified node.
  114. ----
  115. .. _class_ClippedCamera_method_add_exception_rid:
  116. - void **add_exception_rid** **(** :ref:`RID<class_RID>` rid **)**
  117. Adds a collision exception so the camera does not collide with the specified :ref:`RID<class_RID>`.
  118. ----
  119. .. _class_ClippedCamera_method_clear_exceptions:
  120. - void **clear_exceptions** **(** **)**
  121. Removes all collision exceptions.
  122. ----
  123. .. _class_ClippedCamera_method_get_clip_offset:
  124. - :ref:`float<class_float>` **get_clip_offset** **(** **)** |const|
  125. Returns the distance the camera has been offset due to a collision.
  126. ----
  127. .. _class_ClippedCamera_method_get_collision_mask_bit:
  128. - :ref:`bool<class_bool>` **get_collision_mask_bit** **(** :ref:`int<class_int>` bit **)** |const|
  129. Returns ``true`` if the specified bit index is on.
  130. **Note:** Bit indices range from 0-19.
  131. ----
  132. .. _class_ClippedCamera_method_remove_exception:
  133. - void **remove_exception** **(** :ref:`Object<class_Object>` node **)**
  134. Removes a collision exception with the specified node.
  135. ----
  136. .. _class_ClippedCamera_method_remove_exception_rid:
  137. - void **remove_exception_rid** **(** :ref:`RID<class_RID>` rid **)**
  138. Removes a collision exception with the specified :ref:`RID<class_RID>`.
  139. ----
  140. .. _class_ClippedCamera_method_set_collision_mask_bit:
  141. - void **set_collision_mask_bit** **(** :ref:`int<class_int>` bit, :ref:`bool<class_bool>` value **)**
  142. Sets the specified bit index to the ``value``.
  143. **Note:** Bit indices range from 0-19.
  144. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  145. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  146. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`