:github_url: hide .. _class_ArrayOccluder3D: ArrayOccluder3D =============== **繼承:** :ref:`Occluder3D` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` 用於 :ref:`OccluderInstance3D` 遮擋剔除的 3D 多邊形形狀。 .. rst-class:: classref-introduction-group 說明 ---- **ArrayOccluder3D** 儲存可供引擎遮擋剔除系統使用的任意 3D 多邊形形狀,概念上類似於 :ref:`ArrayMesh`\ ,但專用於遮擋物。 設定方法請參閱 :ref:`OccluderInstance3D` 文件。 .. rst-class:: classref-introduction-group 教學 ---- - :doc:`遮擋剔除 <../tutorials/3d/occlusion_culling>` .. rst-class:: classref-reftable-group 屬性 ---- .. table:: :widths: auto +-----------------------------------------------------+----------------------------------------------------------+--------------------------+ | :ref:`PackedInt32Array` | :ref:`indices` | ``PackedInt32Array()`` | +-----------------------------------------------------+----------------------------------------------------------+--------------------------+ | :ref:`PackedVector3Array` | :ref:`vertices` | ``PackedVector3Array()`` | +-----------------------------------------------------+----------------------------------------------------------+--------------------------+ .. rst-class:: classref-reftable-group 方法 ---- .. table:: :widths: auto +--------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_arrays`\ (\ vertices\: :ref:`PackedVector3Array`, indices\: :ref:`PackedInt32Array`\ ) | +--------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group 屬性說明 -------- .. _class_ArrayOccluder3D_property_indices: .. rst-class:: classref-property :ref:`PackedInt32Array` **indices** = ``PackedInt32Array()`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_indices**\ (\ value\: :ref:`PackedInt32Array`\ ) - :ref:`PackedInt32Array` **get_indices**\ (\ ) 遮擋物的索引位置。索引決定應從 :ref:`vertices` 陣列繪出哪些點及其繪製順序。 \ **注意:**\ 設定此值後遮擋物會立即更新。若以程式化方式建立遮擋物,建議改用 :ref:`set_arrays()` 以避免建立過程中更新兩次。 **Note:** The returned array is *copied* and any changes to it will not update the original property value. See :ref:`PackedInt32Array` for more details. .. rst-class:: classref-item-separator ---- .. _class_ArrayOccluder3D_property_vertices: .. rst-class:: classref-property :ref:`PackedVector3Array` **vertices** = ``PackedVector3Array()`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_vertices**\ (\ value\: :ref:`PackedVector3Array`\ ) - :ref:`PackedVector3Array` **get_vertices**\ (\ ) 遮擋物在本地 3D 座標中的頂點位置。 \ **注意:**\ 設定此值後遮擋物會立即更新。若以程式化方式建立遮擋物,建議改用 :ref:`set_arrays()` 以避免建立過程中更新兩次。 **Note:** The returned array is *copied* and any changes to it will not update the original property value. See :ref:`PackedVector3Array` for more details. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group 方法說明 -------- .. _class_ArrayOccluder3D_method_set_arrays: .. rst-class:: classref-method |void| **set_arrays**\ (\ vertices\: :ref:`PackedVector3Array`, indices\: :ref:`PackedInt32Array`\ ) :ref:`🔗` 同時設定 :ref:`indices` 與 :ref:`vertices`\ ,並於兩者皆完成後僅更新一次最終遮擋物。 .. |virtual| replace:: :abbr:`virtual (本方法通常需要使用者覆寫才能生效。)` .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)` .. |const| replace:: :abbr:`const (本方法沒有副作用。不會修改該實例的任何成員變數。)` .. |vararg| replace:: :abbr:`vararg (本方法除了這裡描述的參數外,還可以接受任意數量的參數。)` .. |constructor| replace:: :abbr:`constructor (本方法用於建構一個型別。)` .. |static| replace:: :abbr:`static (本方法無需實例即可呼叫,因此可以直接使用類別名稱呼叫。)` .. |operator| replace:: :abbr:`operator (本方法描述將本型別作為左運算元時可用的有效運算子。)` .. |bitfield| replace:: :abbr:`BitField (此值是由下列旗標組成的位元遮罩整數。)` .. |void| replace:: :abbr:`void (無回傳值。)`