Files
godot-docs-l10n/classes/zh_TW/class_collisionpolygon3d.rst
Max Hilbrunner 2ba6d25aa9 Revert "Rename zh_CN/zh_TW to zh_Hans/zh_Hant"
This reverts commit 57781dc0bc.
The rename, although in line with what we did in the engine, caused problems with RTD we need to fix (or push for a fix) first.
2025-12-24 07:14:31 +01:00

163 lines
7.5 KiB
ReStructuredText

:github_url: hide
.. _class_CollisionPolygon3D:
CollisionPolygon3D
==================
**繼承:** :ref:`Node3D<class_Node3D>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
:ref:`CollisionObject3D<class_CollisionObject3D>` 父級提供加厚多邊形形狀(角柱體)的節點。
.. rst-class:: classref-introduction-group
說明
----
:ref:`CollisionObject3D<class_CollisionObject3D>` 父級提供加厚多邊形形狀(角柱體)的節點,能夠為這個形狀提供編輯的方法。該多邊形可以是凹多邊形,也可以是凸多邊形。能夠為 :ref:`Area3D<class_Area3D>` 提供偵測形狀,也能夠將 :ref:`PhysicsBody3D<class_PhysicsBody3D>` 變為實體。
\ **警告:**\ 非均勻縮放的 :ref:`CollisionShape3D<class_CollisionShape3D>` 應該無法按預期工作。請確保它在所有軸上的縮放是一致的,可以用對形狀資源的調整來代替非均勻縮放。
.. rst-class:: classref-reftable-group
屬性
----
.. table::
:widths: auto
+-----------------------------------------------------+-------------------------------------------------------------------+--------------------------+
| :ref:`Color<class_Color>` | :ref:`debug_color<class_CollisionPolygon3D_property_debug_color>` | ``Color(0, 0, 0, 0)`` |
+-----------------------------------------------------+-------------------------------------------------------------------+--------------------------+
| :ref:`bool<class_bool>` | :ref:`debug_fill<class_CollisionPolygon3D_property_debug_fill>` | ``true`` |
+-----------------------------------------------------+-------------------------------------------------------------------+--------------------------+
| :ref:`float<class_float>` | :ref:`depth<class_CollisionPolygon3D_property_depth>` | ``1.0`` |
+-----------------------------------------------------+-------------------------------------------------------------------+--------------------------+
| :ref:`bool<class_bool>` | :ref:`disabled<class_CollisionPolygon3D_property_disabled>` | ``false`` |
+-----------------------------------------------------+-------------------------------------------------------------------+--------------------------+
| :ref:`float<class_float>` | :ref:`margin<class_CollisionPolygon3D_property_margin>` | ``0.04`` |
+-----------------------------------------------------+-------------------------------------------------------------------+--------------------------+
| :ref:`PackedVector2Array<class_PackedVector2Array>` | :ref:`polygon<class_CollisionPolygon3D_property_polygon>` | ``PackedVector2Array()`` |
+-----------------------------------------------------+-------------------------------------------------------------------+--------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
屬性說明
--------
.. _class_CollisionPolygon3D_property_debug_color:
.. rst-class:: classref-property
:ref:`Color<class_Color>` **debug_color** = ``Color(0, 0, 0, 0)`` :ref:`🔗<class_CollisionPolygon3D_property_debug_color>`
.. rst-class:: classref-property-setget
- |void| **set_debug_color**\ (\ value\: :ref:`Color<class_Color>`\ )
- :ref:`Color<class_Color>` **get_debug_color**\ (\ )
The collision shape color that is displayed in the editor, or in the running project if **Debug > Visible Collision Shapes** is checked at the top of the editor.
\ **Note:** The default value is :ref:`ProjectSettings.debug/shapes/collision/shape_color<class_ProjectSettings_property_debug/shapes/collision/shape_color>`. The ``Color(0, 0, 0, 0)`` value documented here is a placeholder, and not the actual default debug color.
.. rst-class:: classref-item-separator
----
.. _class_CollisionPolygon3D_property_debug_fill:
.. rst-class:: classref-property
:ref:`bool<class_bool>` **debug_fill** = ``true`` :ref:`🔗<class_CollisionPolygon3D_property_debug_fill>`
.. rst-class:: classref-property-setget
- |void| **set_enable_debug_fill**\ (\ value\: :ref:`bool<class_bool>`\ )
- :ref:`bool<class_bool>` **get_enable_debug_fill**\ (\ )
If ``true``, when the shape is displayed, it will show a solid fill color in addition to its wireframe.
.. rst-class:: classref-item-separator
----
.. _class_CollisionPolygon3D_property_depth:
.. rst-class:: classref-property
:ref:`float<class_float>` **depth** = ``1.0`` :ref:`🔗<class_CollisionPolygon3D_property_depth>`
.. rst-class:: classref-property-setget
- |void| **set_depth**\ (\ value\: :ref:`float<class_float>`\ )
- :ref:`float<class_float>` **get_depth**\ (\ )
產生的碰撞沿著與 2D 多邊形垂直的任意方向深入的長度。
.. rst-class:: classref-item-separator
----
.. _class_CollisionPolygon3D_property_disabled:
.. rst-class:: classref-property
:ref:`bool<class_bool>` **disabled** = ``false`` :ref:`🔗<class_CollisionPolygon3D_property_disabled>`
.. rst-class:: classref-property-setget
- |void| **set_disabled**\ (\ value\: :ref:`bool<class_bool>`\ )
- :ref:`bool<class_bool>` **is_disabled**\ (\ )
If ``true``, no collision will be produced. This property should be changed with :ref:`Object.set_deferred()<class_Object_method_set_deferred>`.
.. rst-class:: classref-item-separator
----
.. _class_CollisionPolygon3D_property_margin:
.. rst-class:: classref-property
:ref:`float<class_float>` **margin** = ``0.04`` :ref:`🔗<class_CollisionPolygon3D_property_margin>`
.. rst-class:: classref-property-setget
- |void| **set_margin**\ (\ value\: :ref:`float<class_float>`\ )
- :ref:`float<class_float>` **get_margin**\ (\ )
生成的 :ref:`Shape3D<class_Shape3D>` 的碰撞邊距。詳情見 :ref:`Shape3D.margin<class_Shape3D_property_margin>`\ 。
.. rst-class:: classref-item-separator
----
.. _class_CollisionPolygon3D_property_polygon:
.. rst-class:: classref-property
:ref:`PackedVector2Array<class_PackedVector2Array>` **polygon** = ``PackedVector2Array()`` :ref:`🔗<class_CollisionPolygon3D_property_polygon>`
.. rst-class:: classref-property-setget
- |void| **set_polygon**\ (\ value\: :ref:`PackedVector2Array<class_PackedVector2Array>`\ )
- :ref:`PackedVector2Array<class_PackedVector2Array>` **get_polygon**\ (\ )
Array of vertices which define the 2D polygon in the local XY plane.
**Note:** The returned array is *copied* and any changes to it will not update the original property value. See :ref:`PackedVector2Array<class_PackedVector2Array>` for more details.
.. |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 (無回傳值。)`