.. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead. .. _class_Physics2DDirectSpaceState: Physics2DDirectSpaceState ========================= **Inherits:** :ref:`Object` **Category:** Core Brief Description ----------------- Direct access object to a space in the :ref:`Physics2DServer`. Member Functions ---------------- +--------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Array` | :ref:`intersect_point` **(** :ref:`Vector2` point, :ref:`int` max_results=32, :ref:`Array` exclude=Array(), :ref:`int` layer_mask=2147483647, :ref:`int` type_mask=15 **)** | +--------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Dictionary` | :ref:`intersect_ray` **(** :ref:`Vector2` from, :ref:`Vector2` to, :ref:`Array` exclude=Array(), :ref:`int` layer_mask=2147483647, :ref:`int` type_mask=15 **)** | +--------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Array` | :ref:`intersect_shape` **(** :ref:`Physics2DShapeQueryParameters` shape, :ref:`int` max_results=32 **)** | +--------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Array` | :ref:`cast_motion` **(** :ref:`Physics2DShapeQueryParameters` shape **)** | +--------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Array` | :ref:`collide_shape` **(** :ref:`Physics2DShapeQueryParameters` shape, :ref:`int` max_results=32 **)** | +--------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Dictionary` | :ref:`get_rest_info` **(** :ref:`Physics2DShapeQueryParameters` shape **)** | +--------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Numeric Constants ----------------- - **TYPE_MASK_STATIC_BODY** = **1** - **TYPE_MASK_KINEMATIC_BODY** = **2** - **TYPE_MASK_RIGID_BODY** = **4** - **TYPE_MASK_CHARACTER_BODY** = **8** - **TYPE_MASK_AREA** = **16** - **TYPE_MASK_COLLISION** = **15** Description ----------- Direct access object to a space in the :ref:`Physics2DServer`. It's used mainly to do queries against objects and areas residing in a given space. Member Function Description --------------------------- .. _class_Physics2DDirectSpaceState_intersect_point: - :ref:`Array` **intersect_point** **(** :ref:`Vector2` point, :ref:`int` max_results=32, :ref:`Array` exclude=Array(), :ref:`int` layer_mask=2147483647, :ref:`int` type_mask=15 **)** .. _class_Physics2DDirectSpaceState_intersect_ray: - :ref:`Dictionary` **intersect_ray** **(** :ref:`Vector2` from, :ref:`Vector2` to, :ref:`Array` exclude=Array(), :ref:`int` layer_mask=2147483647, :ref:`int` type_mask=15 **)** Intersect a ray in a given space, the returned object is a dictionary with the following fields: position: place where ray is stopped. normal: normal of the object at the point where the ray was stopped. shape: shape index of the object against which the ray was stopped. collider\_: collider against which the ray was stopped. collider_id: collider id of the object against which the ray was stopped. collider: collider object against which the ray was stopped. rid: :ref:`RID` of the object against which the ray was stopped. If the ray did not intersect anything, then an empty dictionary (dir.empty()==true) is returned instead. .. _class_Physics2DDirectSpaceState_intersect_shape: - :ref:`Array` **intersect_shape** **(** :ref:`Physics2DShapeQueryParameters` shape, :ref:`int` max_results=32 **)** Intersect a given shape (RID or :ref:`Shape2D`) against the space, the intersected shapes are returned in a special result object. .. _class_Physics2DDirectSpaceState_cast_motion: - :ref:`Array` **cast_motion** **(** :ref:`Physics2DShapeQueryParameters` shape **)** .. _class_Physics2DDirectSpaceState_collide_shape: - :ref:`Array` **collide_shape** **(** :ref:`Physics2DShapeQueryParameters` shape, :ref:`int` max_results=32 **)** .. _class_Physics2DDirectSpaceState_get_rest_info: - :ref:`Dictionary` **get_rest_info** **(** :ref:`Physics2DShapeQueryParameters` shape **)**