2021-09-30 18:28:57 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
2022-02-14 13:18:53 +00:00
<class name= "PhysicsTestMotionParameters2D" inherits= "RefCounted" version= "4.0" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../class.xsd" >
2021-09-30 18:28:57 +00:00
<brief_description >
Parameters to be sent to a 2D body motion test.
</brief_description>
<description >
This class contains parameters used in [method PhysicsServer2D.body_test_motion].
</description>
<tutorials >
</tutorials>
<members >
<member name= "collide_separation_ray" type= "bool" setter= "set_collide_separation_ray_enabled" getter= "is_collide_separation_ray_enabled" default= "false" >
If set to [code]true[/code], shapes of type [constant 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 [code]false[/code], shapes of type [constant PhysicsServer2D.SHAPE_SEPARATION_RAY] are only used for separation when overlapping with other bodies. That's the main use for separation ray shapes.
</member>
2022-08-31 17:24:04 +00:00
<member name= "exclude_bodies" type= "RID[]" setter= "set_exclude_bodies" getter= "get_exclude_bodies" default= "[]" >
2022-11-23 17:32:30 +00:00
Optional array of body [RID] to exclude from collision. Use [method CollisionObject2D.get_rid] to get the [RID] associated with a [CollisionObject2D]-derived node.
2021-09-30 18:28:57 +00:00
</member>
2022-11-23 17:32:30 +00:00
<member name= "exclude_objects" type= "int[]" setter= "set_exclude_objects" getter= "get_exclude_objects" default= "[]" >
2021-09-30 18:05:30 +00:00
Optional array of object unique instance ID to exclude from collision. See [method Object.get_instance_id].
</member>
2021-09-30 18:28:57 +00:00
<member name= "from" type= "Transform2D" setter= "set_from" getter= "get_from" default= "Transform2D(1, 0, 0, 1, 0, 0)" >
Transform in global space where the motion should start. Usually set to [member Node2D.global_transform] for the current body's transform.
</member>
<member name= "margin" type= "float" setter= "set_margin" getter= "get_margin" default= "0.08" >
Increases the size of the shapes involved in the collision detection.
</member>
<member name= "motion" type= "Vector2" setter= "set_motion" getter= "get_motion" default= "Vector2(0, 0)" >
Motion vector to define the length and direction of the motion to test.
</member>
2022-04-28 20:44:09 +00:00
<member name= "recovery_as_collision" type= "bool" setter= "set_recovery_as_collision_enabled" getter= "is_recovery_as_collision_enabled" default= "false" >
2022-09-16 15:07:51 +00:00
If set to [code]true[/code], 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.
2022-11-01 14:29:38 +00:00
If set to [code]false[/code], only collisions resulting from the motion are reported, which is generally the desired behavior.
2022-04-28 20:44:09 +00:00
</member>
2021-09-30 18:28:57 +00:00
</members>
</class>