PhysicsTestMotionParameters2D

Hereda: RefCounted < Object

Proporciona parámetros para PhysicsServer2D.body_test_motion().

Descripción

By changing various properties of this object, such as the motion, you can configure the parameters for PhysicsServer2D.body_test_motion().

Propiedades

bool

collide_separation_ray

false

Array[RID]

exclude_bodies

[]

Array[int]

exclude_objects

[]

Transform2D

from

Transform2D(1, 0, 0, 1, 0, 0)

float

margin

0.08

Vector2

motion

Vector2(0, 0)

bool

recovery_as_collision

false


Descripciones de Propiedades

bool collide_separation_ray = false 🔗

  • void set_collide_separation_ray_enabled(value: bool)

  • bool is_collide_separation_ray_enabled()

If set to true, shapes of type PhysicsServer2D.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 PhysicsServer2D.SHAPE_SEPARATION_RAY are only used for separation when overlapping with other bodies. That's the main use for separation ray shapes.


Array[RID] exclude_bodies = [] 🔗

Optional array of body RID to exclude from collision. Use CollisionObject2D.get_rid() to get the RID associated with a CollisionObject2D-derived node.


Array[int] exclude_objects = [] 🔗

Array opcional de los ID de instancia únicas de objetos para excluir de la colisión. Véase Object.get_instance_id().


Transform2D from = Transform2D(1, 0, 0, 1, 0, 0) 🔗

Transformación en el espacio global donde debería comenzar el movimiento. Normalmente se establece en Node2D.global_transform para la transformación del cuerpo actual.


float margin = 0.08 🔗

  • void set_margin(value: float)

  • float get_margin()

Aumenta el tamaño de las formas involucradas en la detección de colisiones.


Vector2 motion = Vector2(0, 0) 🔗

Vector de movimiento para definir la longitud y la dirección del movimiento a probar.


bool recovery_as_collision = false 🔗

  • void set_recovery_as_collision_enabled(value: bool)

  • 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 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.