Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

PhysicsDirectSpaceState2D

Inherits: Object

Inherited By: PhysicsDirectSpaceState2DExtension

Provides direct access to a physics space in the PhysicsServer2D.

Description

Provides direct access to a physics space in the PhysicsServer2D. It's used mainly to do queries against objects and areas residing in a given space.

Tutorials

Methods

PackedFloat32Array

cast_motion ( PhysicsShapeQueryParameters2D parameters )

Vector2[]

collide_shape ( PhysicsShapeQueryParameters2D parameters, int max_results=32 )

Dictionary

get_rest_info ( PhysicsShapeQueryParameters2D parameters )

Dictionary[]

intersect_point ( PhysicsPointQueryParameters2D parameters, int max_results=32 )

Dictionary

intersect_ray ( PhysicsRayQueryParameters2D parameters )

Dictionary[]

intersect_shape ( PhysicsShapeQueryParameters2D parameters, int max_results=32 )


Method Descriptions

PackedFloat32Array cast_motion ( PhysicsShapeQueryParameters2D parameters )

Checks how far a Shape2D can move without colliding. All the parameters for the query, including the shape and the motion, are supplied through a