Files
godot-docs-l10n/classes/uk/class_physicstestmotionparameters2d.rst

180 lines
11 KiB
ReStructuredText
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

:github_url: hide
.. _class_PhysicsTestMotionParameters2D:
PhysicsTestMotionParameters2D
=============================
**Успадковує:** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
Надає параметри для :ref:`PhysicsServer2D.body_test_motion()<class_PhysicsServer2D_method_body_test_motion>`.
.. rst-class:: classref-introduction-group
Опис
--------
При зміні різних властивостей цього об'єкта, таких як рух, можна налаштувати параметри для :ref:`PhysicsServer2D.body_test_motion()<class_PhysicsServer2D_method_body_test_motion>`.
.. rst-class:: classref-reftable-group
Властивості
----------------------
.. table::
:widths: auto
+----------------------------------------------------+----------------------------------------------------------------------------------------------------+-----------------------------------+
| :ref:`bool<class_bool>` | :ref:`collide_separation_ray<class_PhysicsTestMotionParameters2D_property_collide_separation_ray>` | ``false`` |
+----------------------------------------------------+----------------------------------------------------------------------------------------------------+-----------------------------------+
| :ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\] | :ref:`exclude_bodies<class_PhysicsTestMotionParameters2D_property_exclude_bodies>` | ``[]`` |
+----------------------------------------------------+----------------------------------------------------------------------------------------------------+-----------------------------------+
| :ref:`Array<class_Array>`\[:ref:`int<class_int>`\] | :ref:`exclude_objects<class_PhysicsTestMotionParameters2D_property_exclude_objects>` | ``[]`` |
+----------------------------------------------------+----------------------------------------------------------------------------------------------------+-----------------------------------+
| :ref:`Transform2D<class_Transform2D>` | :ref:`from<class_PhysicsTestMotionParameters2D_property_from>` | ``Transform2D(1, 0, 0, 1, 0, 0)`` |
+----------------------------------------------------+----------------------------------------------------------------------------------------------------+-----------------------------------+
| :ref:`float<class_float>` | :ref:`margin<class_PhysicsTestMotionParameters2D_property_margin>` | ``0.08`` |
+----------------------------------------------------+----------------------------------------------------------------------------------------------------+-----------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`motion<class_PhysicsTestMotionParameters2D_property_motion>` | ``Vector2(0, 0)`` |
+----------------------------------------------------+----------------------------------------------------------------------------------------------------+-----------------------------------+
| :ref:`bool<class_bool>` | :ref:`recovery_as_collision<class_PhysicsTestMotionParameters2D_property_recovery_as_collision>` | ``false`` |
+----------------------------------------------------+----------------------------------------------------------------------------------------------------+-----------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Описи властивостей
------------------------------------
.. _class_PhysicsTestMotionParameters2D_property_collide_separation_ray:
.. rst-class:: classref-property
:ref:`bool<class_bool>` **collide_separation_ray** = ``false`` :ref:`🔗<class_PhysicsTestMotionParameters2D_property_collide_separation_ray>`
.. rst-class:: classref-property-setget
- |void| **set_collide_separation_ray_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
- :ref:`bool<class_bool>` **is_collide_separation_ray_enabled**\ (\ )
Якщо встановити до ``true``, форми типу :ref:`PhysServer2D. SHAPE_SEPARATION_RAY<class_PhysServer2D_constant_ SHAPE_SEPARATION_RAY>` використовується для виявлення зіткнень і може зупинити рух. Може бути корисною при попаданні на землю.
Якщо встановити до ``false``, форми типу :ref:`PhysServer2D. SHAPE_SEPARATION_RAY<class_PhysServer2D_constant_ SHAPE_SEPARATION_RAY>` використовується для поділу при перекриттях з іншими тілами. Це основне використання для поділу променевих форм.
.. rst-class:: classref-item-separator
----
.. _class_PhysicsTestMotionParameters2D_property_exclude_bodies:
.. rst-class:: classref-property
:ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\] **exclude_bodies** = ``[]`` :ref:`🔗<class_PhysicsTestMotionParameters2D_property_exclude_bodies>`
.. rst-class:: classref-property-setget
- |void| **set_exclude_bodies**\ (\ value\: :ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\]\ )
- :ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\] **get_exclude_bodies**\ (\ )
Додатковий масив тіла :ref:`RID<class_RID>` для виключення з зіткнення. Використовуйте :ref:`CollisionObject2D.get_rid()<class_CollisionObject2D_method_get_rid>`, щоб отримати :ref:`RID<class_RID>`, пов'язаний з :ref:`CollisionObject2D<class_CollisionObject2D>`-derived node.
.. rst-class:: classref-item-separator
----
.. _class_PhysicsTestMotionParameters2D_property_exclude_objects:
.. rst-class:: classref-property
:ref:`Array<class_Array>`\[:ref:`int<class_int>`\] **exclude_objects** = ``[]`` :ref:`🔗<class_PhysicsTestMotionParameters2D_property_exclude_objects>`
.. rst-class:: classref-property-setget
- |void| **set_exclude_objects**\ (\ value\: :ref:`Array<class_Array>`\[:ref:`int<class_int>`\]\ )
- :ref:`Array<class_Array>`\[:ref:`int<class_int>`\] **get_exclude_objects**\ (\ )
Необов'язковий масив унікального екземпляра ID для виключення з зіткнення. Див. :ref:`Object.get_instance_id()<class_Object_method_get_instance_id>`.
.. rst-class:: classref-item-separator
----
.. _class_PhysicsTestMotionParameters2D_property_from:
.. rst-class:: classref-property
:ref:`Transform2D<class_Transform2D>` **from** = ``Transform2D(1, 0, 0, 1, 0, 0)`` :ref:`🔗<class_PhysicsTestMotionParameters2D_property_from>`
.. rst-class:: classref-property-setget
- |void| **set_from**\ (\ value\: :ref:`Transform2D<class_Transform2D>`\ )
- :ref:`Transform2D<class_Transform2D>` **get_from**\ (\ )
Трансформація в глобальному просторі, де рух повинен початися. Зазвичай набір до :ref:`Node2D.global_transform<class_Node2D_property_global_transform>` для перетворення поточного тіла.
.. rst-class:: classref-item-separator
----
.. _class_PhysicsTestMotionParameters2D_property_margin:
.. rst-class:: classref-property
:ref:`float<class_float>` **margin** = ``0.08`` :ref:`🔗<class_PhysicsTestMotionParameters2D_property_margin>`
.. rst-class:: classref-property-setget
- |void| **set_margin**\ (\ value\: :ref:`float<class_float>`\ )
- :ref:`float<class_float>` **get_margin**\ (\ )
Підвищує розмір форм, залучених до виявлення зіткнення.
.. rst-class:: classref-item-separator
----
.. _class_PhysicsTestMotionParameters2D_property_motion:
.. rst-class:: classref-property
:ref:`Vector2<class_Vector2>` **motion** = ``Vector2(0, 0)`` :ref:`🔗<class_PhysicsTestMotionParameters2D_property_motion>`
.. rst-class:: classref-property-setget
- |void| **set_motion**\ (\ value\: :ref:`Vector2<class_Vector2>`\ )
- :ref:`Vector2<class_Vector2>` **get_motion**\ (\ )
Вектор руху для визначення довжини і напрямку руху до тестування.
.. rst-class:: classref-item-separator
----
.. _class_PhysicsTestMotionParameters2D_property_recovery_as_collision:
.. rst-class:: classref-property
:ref:`bool<class_bool>` **recovery_as_collision** = ``false`` :ref:`🔗<class_PhysicsTestMotionParameters2D_property_recovery_as_collision>`
.. rst-class:: classref-property-setget
- |void| **set_recovery_as_collision_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
- :ref:`bool<class_bool>` **is_recovery_as_collision_enabled**\ (\ )
Якщо встановити до ``true``, будь-яке депенетування з фази відновлення повідомляється як зіткнення; це використовується наприклад :ref:`CharacterBody2D<class_CharacterBody2D>` для поліпшення виявлення підлоги під час перекриття підлоги.
Якщо встановити до ``false``, повідомляється лише зіткнення, що виникли внаслідок руху, яка, як правило, потрібна поведінка.
.. |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 (Значення не повертається.)`