Files
godot-docs-l10n/classes/es/class_physicstestmotionparameters2d.rst
2025-12-19 14:34:07 +01:00

180 lines
9.6 KiB
ReStructuredText

:github_url: hide
.. _class_PhysicsTestMotionParameters2D:
PhysicsTestMotionParameters2D
=============================
**Hereda:** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
Proporciona parámetros para :ref:`PhysicsServer2D.body_test_motion()<class_PhysicsServer2D_method_body_test_motion>`.
.. rst-class:: classref-introduction-group
Descripción
----------------------
By changing various properties of this object, such as the motion, you can configure the parameters for :ref:`PhysicsServer2D.body_test_motion()<class_PhysicsServer2D_method_body_test_motion>`.
.. rst-class:: classref-reftable-group
Propiedades
----------------------
.. 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
Descripciones de Propiedades
--------------------------------------------------------
.. _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**\ (\ )
If set to ``true``, shapes of type :ref:`PhysicsServer2D.SHAPE_SEPARATION_RAY<class_PhysicsServer2D_constant_SHAPE_SEPARATION_RAY>` are used to detect collisions and can stop the motion. Can be useful when snapping to the ground.
If set to ``false``, shapes of type :ref:`PhysicsServer2D.SHAPE_SEPARATION_RAY<class_PhysicsServer2D_constant_SHAPE_SEPARATION_RAY>` are only used for separation when overlapping with other bodies. That's the main use for separation ray shapes.
.. 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**\ (\ )
Optional array of body :ref:`RID<class_RID>` to exclude from collision. Use :ref:`CollisionObject2D.get_rid()<class_CollisionObject2D_method_get_rid>` to get the :ref:`RID<class_RID>` associated with a :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**\ (\ )
Array opcional de los ID de instancia únicas de objetos para excluir de la colisión. Véase :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**\ (\ )
Transformación en el espacio global donde debería comenzar el movimiento. Normalmente se establece en :ref:`Node2D.global_transform<class_Node2D_property_global_transform>` para la transformación del cuerpo actual.
.. 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**\ (\ )
Aumenta el tamaño de las formas involucradas en la detección de colisiones.
.. 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**\ (\ )
Vector de movimiento para definir la longitud y la dirección del movimiento a probar.
.. 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**\ (\ )
If set to ``true``, any depenetration from the recovery phase is reported as a collision; this is used e.g. by :ref:`CharacterBody2D<class_CharacterBody2D>` for improving floor detection during floor snapping.
If set to ``false``, only collisions resulting from the motion are reported, which is generally the desired behavior.
.. |virtual| replace:: :abbr:`virtual (Normalmente, este método debería ser sobreescrito por el usuario para que tenga algún efecto.)`
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
.. |const| replace:: :abbr:`const (Este método no tiene efectos secundarios. No modifica ninguna de las variables miembro de la instancia.)`
.. |vararg| replace:: :abbr:`vararg (Este método permite agregar cualquier número de argumentos después de los descritos aquí.)`
.. |constructor| replace:: :abbr:`constructor (Este método se utiliza para construir un tipo.)`
.. |static| replace:: :abbr:`static (Este método no necesita una instancia para ser llamado, por lo que puede llamarse directamente utilizando el nombre de la clase.)`
.. |operator| replace:: :abbr:`operator (Este método describe un operador válido para usar con este tipo como operando izquierdo.)`
.. |bitfield| replace:: :abbr:`BitField (Este valor es un entero compuesto como una máscara de bits de las siguientes banderas.)`
.. |void| replace:: :abbr:`void (Sin valor de retorno.)`