mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2025-12-31 09:49:22 +03:00
181 lines
7.2 KiB
ReStructuredText
181 lines
7.2 KiB
ReStructuredText
:github_url: hide
|
||
|
||
.. _class_CollisionShape3D:
|
||
|
||
CollisionShape3D
|
||
================
|
||
|
||
**繼承:** :ref:`Node3D<class_Node3D>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
||
|
||
向 :ref:`CollisionObject3D<class_CollisionObject3D>` 父級提供 :ref:`Shape3D<class_Shape3D>` 的節點。
|
||
|
||
.. rst-class:: classref-introduction-group
|
||
|
||
說明
|
||
----
|
||
|
||
A node that provides a :ref:`Shape3D<class_Shape3D>` to a :ref:`CollisionObject3D<class_CollisionObject3D>` parent and allows it to be edited. This can give a detection shape to an :ref:`Area3D<class_Area3D>` or turn a :ref:`PhysicsBody3D<class_PhysicsBody3D>` into a solid object.
|
||
|
||
\ **Warning:** A non-uniformly scaled **CollisionShape3D** will likely not behave as expected. Make sure to keep its scale the same on all axes and adjust its :ref:`shape<class_CollisionShape3D_property_shape>` resource instead.
|
||
|
||
.. rst-class:: classref-introduction-group
|
||
|
||
教學
|
||
----
|
||
|
||
- :doc:`物理介紹 <../tutorials/physics/physics_introduction>`
|
||
|
||
- `3D 動力學角色演示 <https://godotengine.org/asset-library/asset/2739>`__
|
||
|
||
- `3D 平台跳躍示範 <https://godotengine.org/asset-library/asset/2748>`__
|
||
|
||
- `第三人稱射擊(TPS)示範 <https://godotengine.org/asset-library/asset/2710>`__
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
屬性
|
||
----
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+-------------------------------+-----------------------------------------------------------------+-----------------------+
|
||
| :ref:`Color<class_Color>` | :ref:`debug_color<class_CollisionShape3D_property_debug_color>` | ``Color(0, 0, 0, 0)`` |
|
||
+-------------------------------+-----------------------------------------------------------------+-----------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`debug_fill<class_CollisionShape3D_property_debug_fill>` | ``true`` |
|
||
+-------------------------------+-----------------------------------------------------------------+-----------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`disabled<class_CollisionShape3D_property_disabled>` | ``false`` |
|
||
+-------------------------------+-----------------------------------------------------------------+-----------------------+
|
||
| :ref:`Shape3D<class_Shape3D>` | :ref:`shape<class_CollisionShape3D_property_shape>` | |
|
||
+-------------------------------+-----------------------------------------------------------------+-----------------------+
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
方法
|
||
----
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+--------+---------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`make_convex_from_siblings<class_CollisionShape3D_method_make_convex_from_siblings>`\ (\ ) |
|
||
+--------+---------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`resource_changed<class_CollisionShape3D_method_resource_changed>`\ (\ resource\: :ref:`Resource<class_Resource>`\ ) |
|
||
+--------+---------------------------------------------------------------------------------------------------------------------------+
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
屬性說明
|
||
--------
|
||
|
||
.. _class_CollisionShape3D_property_debug_color:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`Color<class_Color>` **debug_color** = ``Color(0, 0, 0, 0)`` :ref:`🔗<class_CollisionShape3D_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_CollisionShape3D_property_debug_fill:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **debug_fill** = ``true`` :ref:`🔗<class_CollisionShape3D_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_CollisionShape3D_property_disabled:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **disabled** = ``false`` :ref:`🔗<class_CollisionShape3D_property_disabled>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_disabled**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_disabled**\ (\ )
|
||
|
||
禁用的碰撞形狀在世界中沒有影響。這個屬性應該用 :ref:`Object.set_deferred()<class_Object_method_set_deferred>` 改變。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_CollisionShape3D_property_shape:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`Shape3D<class_Shape3D>` **shape** :ref:`🔗<class_CollisionShape3D_property_shape>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_shape**\ (\ value\: :ref:`Shape3D<class_Shape3D>`\ )
|
||
- :ref:`Shape3D<class_Shape3D>` **get_shape**\ (\ )
|
||
|
||
該碰撞形狀擁有的實際形狀。
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
方法說明
|
||
--------
|
||
|
||
.. _class_CollisionShape3D_method_make_convex_from_siblings:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **make_convex_from_siblings**\ (\ ) :ref:`🔗<class_CollisionShape3D_method_make_convex_from_siblings>`
|
||
|
||
將碰撞形狀的形狀設定為其所有凸面 :ref:`MeshInstance3D<class_MeshInstance3D>` 兄弟幾何體的相加。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_CollisionShape3D_method_resource_changed:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **resource_changed**\ (\ resource\: :ref:`Resource<class_Resource>`\ ) :ref:`🔗<class_CollisionShape3D_method_resource_changed>`
|
||
|
||
**已棄用:** Use :ref:`Resource.changed<class_Resource_signal_changed>` instead.
|
||
|
||
This method does nothing.
|
||
|
||
.. |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 (無回傳值。)`
|