Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

PolygonOccluder3D

繼承: Occluder3D < Resource < RefCounted < Object

平面 2D 多邊形形狀,用於 OccluderInstance3D 的遮擋剔除。

說明

PolygonOccluder3D 儲存的是多邊形形狀,可用於引擎的遮擋剔除系統。在編輯器中選中具有 PolygonOccluder3DOccluderInstance3D 時,3D 視口的頂部會出現用於新增/移除頂點的編輯器。所有的頂點都必須在相同的 2D 平面中放置,也就是說,使用單個 PolygonOccluder3D 是無法任意建立 3D 形狀的。要將任意 3D 形狀作為遮擋器,請改用 ArrayOccluder3DOccluderInstance3D 的烘焙功能。

設定遮擋剔除的步驟見 OccluderInstance3D 的文件。

教學

屬性

PackedVector2Array

polygon

PackedVector2Array()


屬性說明

PackedVector2Array polygon = PackedVector2Array() 🔗

用於遮擋剔除的多邊形。既可以是凸多邊形,也可以是凹多邊形,但只有讓頂點的數量盡可能地少,才能夠讓性能最大化。

多邊形必須不存在相交的線。否則三角形化會失敗(同時會輸出錯誤資訊)。

Note: The returned array is copied and any changes to it will not update the original property value. See PackedVector2Array for more details.