class_cullinstance.rst 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  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/CullInstance.xml.
  6. .. _class_CullInstance:
  7. CullInstance
  8. ============
  9. **Inherits:** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`VisibilityNotifier<class_VisibilityNotifier>`, :ref:`VisualInstance<class_VisualInstance>`
  11. Parent of all nodes that can be culled by the Portal system.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. Provides common functionality to nodes that can be culled by the :ref:`Portal<class_Portal>` system.
  16. \ ``Static`` and ``Dynamic`` objects are the most efficiently managed objects in the system, but there are some caveats. They are expected to be present initially when :ref:`Room<class_Room>`\ s are converted using the :ref:`RoomManager<class_RoomManager>` ``rooms_convert`` function, and their lifetime should be the same as the game level (i.e. present until you call ``rooms_clear`` on the :ref:`RoomManager<class_RoomManager>`. Although you shouldn't create / delete these objects during gameplay, you can manage their visibility with the standard ``hide`` and ``show`` commands.
  17. \ ``Roaming`` objects on the other hand, require extra processing to keep track of which :ref:`Room<class_Room>` they are within. This enables them to be culled effectively, wherever they are.
  18. \ ``Global`` objects are not culled by the portal system, and use view frustum culling only.
  19. Objects that are not ``Static`` or ``Dynamic`` can be freely created and deleted during the lifetime of the game level.
  20. .. rst-class:: classref-reftable-group
  21. Properties
  22. ----------
  23. .. table::
  24. :widths: auto
  25. +-------------------------------------------------+---------------------------------------------------------------------------+----------+
  26. | :ref:`bool<class_bool>` | :ref:`allow_merging<class_CullInstance_property_allow_merging>` | ``true`` |
  27. +-------------------------------------------------+---------------------------------------------------------------------------+----------+
  28. | :ref:`int<class_int>` | :ref:`autoplace_priority<class_CullInstance_property_autoplace_priority>` | ``0`` |
  29. +-------------------------------------------------+---------------------------------------------------------------------------+----------+
  30. | :ref:`bool<class_bool>` | :ref:`include_in_bound<class_CullInstance_property_include_in_bound>` | ``true`` |
  31. +-------------------------------------------------+---------------------------------------------------------------------------+----------+
  32. | :ref:`PortalMode<enum_CullInstance_PortalMode>` | :ref:`portal_mode<class_CullInstance_property_portal_mode>` | ``0`` |
  33. +-------------------------------------------------+---------------------------------------------------------------------------+----------+
  34. .. rst-class:: classref-section-separator
  35. ----
  36. .. rst-class:: classref-descriptions-group
  37. Enumerations
  38. ------------
  39. .. _enum_CullInstance_PortalMode:
  40. .. rst-class:: classref-enumeration
  41. enum **PortalMode**:
  42. .. _class_CullInstance_constant_PORTAL_MODE_STATIC:
  43. .. rst-class:: classref-enumeration-constant
  44. :ref:`PortalMode<enum_CullInstance_PortalMode>` **PORTAL_MODE_STATIC** = ``0``
  45. Use for instances within :ref:`Room<class_Room>`\ s that will **not move** - e.g. walls, floors.
  46. \ **Note:** If you attempt to delete a ``PORTAL_MODE_STATIC`` instance while the room graph is loaded (converted), it will unload the room graph and deactivate portal culling. This is because the **room graph** data has been invalidated. You will need to reconvert the rooms using the :ref:`RoomManager<class_RoomManager>` to activate the system again.
  47. .. _class_CullInstance_constant_PORTAL_MODE_DYNAMIC:
  48. .. rst-class:: classref-enumeration-constant
  49. :ref:`PortalMode<enum_CullInstance_PortalMode>` **PORTAL_MODE_DYNAMIC** = ``1``
  50. Use for instances within rooms that will move but **not change room** - e.g. moving platforms.
  51. \ **Note:** If you attempt to delete a ``PORTAL_MODE_DYNAMIC`` instance while the room graph is loaded (converted), it will unload the room graph and deactivate portal culling. This is because the **room graph** data has been invalidated. You will need to reconvert the rooms using the :ref:`RoomManager<class_RoomManager>` to activate the system again.
  52. .. _class_CullInstance_constant_PORTAL_MODE_ROAMING:
  53. .. rst-class:: classref-enumeration-constant
  54. :ref:`PortalMode<enum_CullInstance_PortalMode>` **PORTAL_MODE_ROAMING** = ``2``
  55. Use for instances that will move **between** :ref:`Room<class_Room>`\ s - e.g. players.
  56. .. _class_CullInstance_constant_PORTAL_MODE_GLOBAL:
  57. .. rst-class:: classref-enumeration-constant
  58. :ref:`PortalMode<enum_CullInstance_PortalMode>` **PORTAL_MODE_GLOBAL** = ``3``
  59. Use for instances that will be frustum culled only - e.g. first person weapon, debug.
  60. .. _class_CullInstance_constant_PORTAL_MODE_IGNORE:
  61. .. rst-class:: classref-enumeration-constant
  62. :ref:`PortalMode<enum_CullInstance_PortalMode>` **PORTAL_MODE_IGNORE** = ``4``
  63. Use for instances that will not be shown at all - e.g. **manual room bounds** (specified by prefix *'Bound\_'*).
  64. .. rst-class:: classref-section-separator
  65. ----
  66. .. rst-class:: classref-descriptions-group
  67. Property Descriptions
  68. ---------------------
  69. .. _class_CullInstance_property_allow_merging:
  70. .. rst-class:: classref-property
  71. :ref:`bool<class_bool>` **allow_merging** = ``true``
  72. .. rst-class:: classref-property-setget
  73. - void **set_allow_merging** **(** :ref:`bool<class_bool>` value **)**
  74. - :ref:`bool<class_bool>` **get_allow_merging** **(** **)**
  75. This allows fine control over the mesh merging feature in the :ref:`RoomManager<class_RoomManager>`.
  76. Setting this option to ``false`` can be used to prevent an instance being merged. When set to ``true`` (the default), merging will be determined by :ref:`Spatial.merging_mode<class_Spatial_property_merging_mode>`.
  77. \ *Deprecated.* This property has been deprecated and is only included for backward compatibility. Please use :ref:`Spatial.merging_mode<class_Spatial_property_merging_mode>` instead.
  78. .. rst-class:: classref-item-separator
  79. ----
  80. .. _class_CullInstance_property_autoplace_priority:
  81. .. rst-class:: classref-property
  82. :ref:`int<class_int>` **autoplace_priority** = ``0``
  83. .. rst-class:: classref-property-setget
  84. - void **set_portal_autoplace_priority** **(** :ref:`int<class_int>` value **)**
  85. - :ref:`int<class_int>` **get_portal_autoplace_priority** **(** **)**
  86. When set to ``0``, **CullInstance**\ s will be autoplaced in the :ref:`Room<class_Room>` with the highest priority.
  87. When set to a value other than ``0``, the system will attempt to autoplace in a :ref:`Room<class_Room>` with the ``autoplace_priority``, if it is present.
  88. This can be used to control autoplacement of building exteriors in an outer :ref:`RoomGroup<class_RoomGroup>`.
  89. .. rst-class:: classref-item-separator
  90. ----
  91. .. _class_CullInstance_property_include_in_bound:
  92. .. rst-class:: classref-property
  93. :ref:`bool<class_bool>` **include_in_bound** = ``true``
  94. .. rst-class:: classref-property-setget
  95. - void **set_include_in_bound** **(** :ref:`bool<class_bool>` value **)**
  96. - :ref:`bool<class_bool>` **get_include_in_bound** **(** **)**
  97. When a manual bound has not been explicitly specified for a :ref:`Room<class_Room>`, the convex hull bound will be estimated from the geometry of the objects within the room. This setting determines whether the geometry of an object is included in this estimate of the room bound.
  98. \ **Note:** This setting is only relevant when the object is set to ``PORTAL_MODE_STATIC`` or ``PORTAL_MODE_DYNAMIC``, and for :ref:`Portal<class_Portal>`\ s.
  99. .. rst-class:: classref-item-separator
  100. ----
  101. .. _class_CullInstance_property_portal_mode:
  102. .. rst-class:: classref-property
  103. :ref:`PortalMode<enum_CullInstance_PortalMode>` **portal_mode** = ``0``
  104. .. rst-class:: classref-property-setget
  105. - void **set_portal_mode** **(** :ref:`PortalMode<enum_CullInstance_PortalMode>` value **)**
  106. - :ref:`PortalMode<enum_CullInstance_PortalMode>` **get_portal_mode** **(** **)**
  107. When using :ref:`Room<class_Room>`\ s and :ref:`Portal<class_Portal>`\ s, this specifies how the **CullInstance** is processed in the system.
  108. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  109. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  110. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  111. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`