:github_url: hide .. Generated automatically by doc/tools/make_rst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the PhysicsTestMotionResult2D.xml source instead. .. The source is found in doc/classes or modules//doc_classes. .. _class_PhysicsTestMotionResult2D: PhysicsTestMotionResult2D ========================= **Inherits:** :ref:`RefCounted` **<** :ref:`Object` Result from a 2D body motion test. Description ----------- This class contains the motion and collision result from :ref:`PhysicsServer2D.body_test_motion`. Methods ------- +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Object` | :ref:`get_collider` **(** **)** |const| | +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_collider_id` **(** **)** |const| | +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`get_collider_rid` **(** **)** |const| | +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_collider_shape` **(** **)** |const| | +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_collider_velocity` **(** **)** |const| | +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_collision_depth` **(** **)** |const| | +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_collision_local_shape` **(** **)** |const| | +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_collision_normal` **(** **)** |const| | +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_collision_point` **(** **)** |const| | +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_collision_safe_fraction` **(** **)** |const| | +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_collision_unsafe_fraction` **(** **)** |const| | +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_remainder` **(** **)** |const| | +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_travel` **(** **)** |const| | +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ Method Descriptions ------------------- .. _class_PhysicsTestMotionResult2D_method_get_collider: - :ref:`Object` **get_collider** **(** **)** |const| Returns the colliding body's attached :ref:`Object`, if a collision occurred. ---- .. _class_PhysicsTestMotionResult2D_method_get_collider_id: - :ref:`int` **get_collider_id** **(** **)** |const| Returns the unique instance ID of the colliding body's attached :ref:`Object`, if a collision occurred. See :ref:`Object.get_instance_id`. ---- .. _class_PhysicsTestMotionResult2D_method_get_collider_rid: - :ref:`RID` **get_collider_rid** **(** **)** |const| Returns the colliding body's :ref:`RID` used by the :ref:`PhysicsServer2D`, if a collision occurred. ---- .. _class_PhysicsTestMotionResult2D_method_get_collider_shape: - :ref:`int` **get_collider_shape** **(** **)** |const| Returns the colliding body's shape index, if a collision occurred. See :ref:`CollisionObject2D`. ---- .. _class_PhysicsTestMotionResult2D_method_get_collider_velocity: - :ref:`Vector2` **get_collider_velocity** **(** **)** |const| Returns the colliding body's velocity, if a collision occurred. ---- .. _class_PhysicsTestMotionResult2D_method_get_collision_depth: - :ref:`float` **get_collision_depth** **(** **)** |const| Returns the length of overlap along the collision normal, if a collision occurred. ---- .. _class_PhysicsTestMotionResult2D_method_get_collision_local_shape: - :ref:`int` **get_collision_local_shape** **(** **)** |const| Returns the moving object's colliding shape, if a collision occurred. ---- .. _class_PhysicsTestMotionResult2D_method_get_collision_normal: - :ref:`Vector2` **get_collision_normal** **(** **)** |const| Returns the colliding body's shape's normal at the point of collision, if a collision occurred. ---- .. _class_PhysicsTestMotionResult2D_method_get_collision_point: - :ref:`Vector2` **get_collision_point** **(** **)** |const| Returns the point of collision in global coordinates, if a collision occurred. ---- .. _class_PhysicsTestMotionResult2D_method_get_collision_safe_fraction: - :ref:`float` **get_collision_safe_fraction** **(** **)** |const| Returns the maximum fraction of the motion that can occur without a collision, between ``0`` and ``1``. ---- .. _class_PhysicsTestMotionResult2D_method_get_collision_unsafe_fraction: - :ref:`float` **get_collision_unsafe_fraction** **(** **)** |const| Returns the minimum fraction of the motion needed to collide, if a collision occurred, between ``0`` and ``1``. ---- .. _class_PhysicsTestMotionResult2D_method_get_remainder: - :ref:`Vector2` **get_remainder** **(** **)** |const| Returns the moving object's remaining movement vector. ---- .. _class_PhysicsTestMotionResult2D_method_get_travel: - :ref:`Vector2` **get_travel** **(** **)** |const| Returns the moving object's travel before collision. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`