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.
Checking the stable version of the documentation...
CollisionPolygon3D
向 CollisionObject3D 父級提供加厚多邊形形狀(角柱體)的節點。
說明
向 CollisionObject3D 父級提供加厚多邊形形狀(角柱體)的節點,並允許對其編輯。該多邊形可以是凹多邊形,也可以是凸多邊形。能夠為 Area3D 提供檢測形狀,也能夠將 PhysicsBody3D 變為實體。
警告:非均勻縮放的 CollisionShape3D 可能不會按預期執行。請確保在所有軸上保持其縮放相同並改為調整其形狀資源。
屬性
|
||
|
||
|
||
|
||
|
||
|
屬性說明
Color debug_color = Color(0, 0, 0, 0) 🔗
碰撞形狀的顏色,在編輯器中顯示,勾選編輯器頂部的 除錯 > 顯示碰撞形狀 時也會在執行專案時顯示。
注意:預設值為 ProjectSettings.debug/shapes/collision/shape_color。這裡記錄的 Color(0, 0, 0, 0) 值是佔位符,不是實際的預設除錯顏色。
如果為 true,則顯示形狀時除了顯示線框外還會顯示填充顏色。
產生的碰撞沿著與 2D 多邊形垂直的任意方向深入的長度。
如果為 true,則不會產生碰撞。該屬性應使用 Object.set_deferred() 進行更改。
生成的 Shape3D 的碰撞邊距。詳情見 Shape3D.margin。
PackedVector2Array polygon = PackedVector2Array() 🔗
void set_polygon(value: PackedVector2Array)
PackedVector2Array get_polygon()
在區域 XY 平面中定義 2D 多邊形的頂點陣列。
Note: The returned array is copied and any changes to it will not update the original property value. See PackedVector2Array for more details.