Up to date

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

PhysicsDirectSpaceState3D

Inherits: Object

Inherited By: PhysicsDirectSpaceState3DExtension

Provides direct access to a physics space in the PhysicsServer3D.

Description

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

Tutorials

Methods

PackedFloat32Array

cast_motion ( PhysicsShapeQueryParameters3D parameters )

Vector3[]

collide_shape ( PhysicsShapeQueryParameters3D parameters, int max_results=32 )

Dictionary

get_rest_info ( PhysicsShapeQueryParameters3D parameters )

Dictionary[]

intersect_point ( PhysicsPointQueryParameters3D parameters, int max_results=32 )

Dictionary

intersect_ray ( PhysicsRayQueryParameters3D parameters )

Dictionary[]

intersect_shape ( PhysicsShapeQueryParameters3D parameters, int max_results=32 )


Method Descriptions

PackedFloat32Array cast_motion ( PhysicsShapeQueryParameters3D parameters )

Checks how far a Shape3D can move without colliding. All the parameters for the query, including the shape, are supplied through a PhysicsShapeQueryParameters3D object.

Returns an array with the safe and unsafe proportions (between 0 and 1) of the motion. The safe proportion is the maximum fraction of the motion that can be made without a collision. The unsafe proportion is the minimum fraction of the distance that must be moved for a collision. If no collision is detected a result of [1.0, 1.0] will be returned.

Note: Any Shape3Ds that the shape is already colliding with e.g. inside of, will be ignored. Use collide_shape to determine the Shape3Ds that the shape is already colliding with.


Vector3[] collide_shape ( PhysicsShapeQueryParameters3D parameters, int max_results=32 )

Checks the intersections of a shape, given through a PhysicsShapeQueryParameters3D object, against the space. The resul