Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions doc/classes/PhysicsCastMotionResult2D.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="PhysicsCastMotionResult2D" inherits="RefCounted" api_type="core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
Stores the result of a shape motion cast query.
</brief_description>
<description>
This class contains the safe and unsafe fractions computed by [method PhysicsDirectSpaceState2D.cast_motion_typed].
</description>
<tutorials>
</tutorials>
<members>
<member name="safe_fraction" type="float" setter="" getter="get_safe_fraction" default="1.0">
The maximum fraction of the motion that can be performed without colliding.
</member>
<member name="unsafe_fraction" type="float" setter="" getter="get_unsafe_fraction" default="1.0">
The minimum fraction of the motion at which a collision occurs.
</member>
</members>
</class>
19 changes: 19 additions & 0 deletions doc/classes/PhysicsCastMotionResult3D.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="PhysicsCastMotionResult3D" inherits="RefCounted" api_type="core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
Stores the result of a shape motion cast query.
</brief_description>
<description>
This class contains the safe and unsafe fractions computed by [method PhysicsDirectSpaceState3D.cast_motion_typed].
</description>
<tutorials>
</tutorials>
<members>
<member name="safe_fraction" type="float" setter="" getter="get_safe_fraction" default="1.0">
The maximum fraction of the motion that can be performed without colliding.
</member>
<member name="unsafe_fraction" type="float" setter="" getter="get_unsafe_fraction" default="1.0">
The minimum fraction of the motion at which a collision occurs.
</member>
</members>
</class>
62 changes: 62 additions & 0 deletions doc/classes/PhysicsDirectSpaceState2D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@
[b]Note:[/b] Any [Shape2D]s that the shape is already colliding with e.g. inside of, will be ignored. Use [method collide_shape] to determine the [Shape2D]s that the shape is already colliding with.
</description>
</method>
<method name="cast_motion_typed">
<return type="bool" />
<param index="0" name="parameters" type="PhysicsShapeQueryParameters2D" />
<param index="1" name="result" type="PhysicsCastMotionResult2D" />
<description>
Checks how far a [Shape2D] can move along a given motion without colliding. The shape and motion parameters are supplied through [PhysicsShapeQueryParameters2D].
If the query is successful, this method returns [code]true[/code] and writes the motion results into the [PhysicsCastMotionResult2D] object passed in [code skip-lint]result[/code]. If no collision occurs, it returns [code]false[/code].
[b]Note:[/b] Any [Shape2D]s that the shape is already colliding with e.g. inside of, will be ignored. Use [method collide_shape_typed] to determine the [Shape2D]s that the shape is already colliding with.
</description>
</method>
<method name="collide_shape">
<return type="Vector2[]" />
<param index="0" name="parameters" type="PhysicsShapeQueryParameters2D" />
Expand All @@ -30,6 +40,17 @@
Returned points are a list of pairs of contact points. For each pair the first one is in the shape passed in [PhysicsShapeQueryParameters2D] object, second one is in the collided shape from the physics space.
</description>
</method>
<method name="collide_shape_typed">
<return type="bool" />
<param index="0" name="parameters" type="PhysicsShapeQueryParameters2D" />
<param index="1" name="result" type="PhysicsShapeCollisionResult2D" />
<description>
Checks the intersections of a shape, given through a [PhysicsShapeQueryParameters2D] object, against the space.
If intersections are found, this method returns [code]true[/code] and writes the collision points into the [PhysicsShapeCollisionResult2D] object passed in [code skip-lint]result[/code]. If no intersections are found, it returns [code]false[/code].
Like with [method intersect_shape_typed], the number of returned results can be limited using [member PhysicsShapeCollisionResult2D.max_collisions], to reduce the processing time.
[b]Note:[/b] This method does not take into account the [code]motion[/code] property of the object.
</description>
</method>
<method name="get_rest_info">
<return type="Dictionary" />
<param index="0" name="parameters" type="PhysicsShapeQueryParameters2D" />
Expand All @@ -44,6 +65,16 @@
If the shape did not intersect anything, then an empty dictionary is returned instead.
</description>
</method>
<method name="get_rest_info_typed">
<return type="bool" />
<param index="0" name="parameters" type="PhysicsShapeQueryParameters2D" />
<param index="1" name="result" type="PhysicsRestInfoResult2D" />
<description>
Checks the intersections of a shape, given through a [PhysicsShapeQueryParameters2D] object, against the space.
If the shape collides with one or more shapes, this method returns [code]true[/code] and writes the nearest collision information into the [PhysicsRestInfoResult2D] object passed in [code skip-lint]result[/code]. If no collisions occur, it returns [code]false[/code].
[b]Note:[/b] This method does not take into account the [code]motion[/code] property of the object.
</description>
</method>
<method name="intersect_point">
<return type="Dictionary[]" />
<param index="0" name="parameters" type="PhysicsPointQueryParameters2D" />
Expand All @@ -58,6 +89,17 @@
[b]Note:[/b] [ConcavePolygonShape2D]s and [CollisionPolygon2D]s in [code]Segments[/code] build mode are not solid shapes. Therefore, they will not be detected.
</description>
</method>
<method name="intersect_point_typed">
<return type="bool" />
<param index="0" name="parameters" type="PhysicsPointQueryParameters2D" />
<param index="1" name="result" type="PhysicsPointIntersectionResult2D" />
<description>
Checks whether a point is inside any solid shape. The point position and query settings are defined through [PhysicsPointQueryParameters2D].
If one or more shapes overlap the point, this method returns [code]true[/code] and writes the intersection data into the [PhysicsPointIntersectionResult2D] object passed in [code skip-lint]result[/code]. If no intersections are found, it returns [code]false[/code].
The number of intersections can be limited using [member PhysicsPointIntersectionResult2D.max_collisions], to reduce the processing time.
[b]Note:[/b] [ConcavePolygonShape2D]s and [CollisionPolygon2D]s in [code]Segments[/code] build mode are not solid shapes. Therefore, they will not be detected.
</description>
</method>
<method name="intersect_ray">
<return type="Dictionary" />
<param index="0" name="parameters" type="PhysicsRayQueryParameters2D" />
Expand All @@ -72,6 +114,15 @@
If the ray did not intersect anything, then an empty dictionary is returned instead.
</description>
</method>
<method name="intersect_ray_typed">
<return type="bool" />
<param index="0" name="parameters" type="PhysicsRayQueryParameters2D" />
<param index="1" name="result" type="PhysicsRayIntersectionResult2D" />
<description>
Intersects a ray in a given space. The ray origin, direction, and all other parameters are defined through [PhysicsRayQueryParameters2D].
If the ray hits a shape, this method returns [code]true[/code] and writes the intersection information into the [PhysicsRayIntersectionResult2D] object passed in [code skip-lint]result[/code]. If nothing is hit, it returns [code]false[/code].
</description>
</method>
<method name="intersect_shape">
<return type="Dictionary[]" />
<param index="0" name="parameters" type="PhysicsShapeQueryParameters2D" />
Expand All @@ -85,5 +136,16 @@
The number of intersections can be limited with the [param max_results] parameter, to reduce the processing time.
</description>
</method>
<method name="intersect_shape_typed">
<return type="bool" />
<param index="0" name="parameters" type="PhysicsShapeQueryParameters2D" />
<param index="1" name="result" type="PhysicsShapeIntersectionResult2D" />
<description>
Checks the intersections of a shape, given through a [PhysicsShapeQueryParameters2D] object, against the space.
If one or more shapes are found, this method returns [code]true[/code] and writes the intersection data into the [PhysicsShapeIntersectionResult2D] object passed in [code skip-lint]result[/code]. If no shapes are overlapping, it returns [code]false[/code].
The number of intersections can be limited using [member PhysicsShapeIntersectionResult2D.max_collisions], to reduce the processing time.
[b]Note:[/b] This method does not take into account the [code]motion[/code] property of the object.
</description>
</method>
</methods>
</class>
61 changes: 61 additions & 0 deletions doc/classes/PhysicsDirectSpaceState3D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@
[b]Note:[/b] Any [Shape3D]s that the shape is already colliding with e.g. inside of, will be ignored. Use [method collide_shape] to determine the [Shape3D]s that the shape is already colliding with.
</description>
</method>
<method name="cast_motion_typed">
<return type="bool" />
<param index="0" name="parameters" type="PhysicsShapeQueryParameters3D" />
<param index="1" name="result" type="PhysicsCastMotionResult3D" />
<description>
Checks how far a [Shape3D] can move along a given motion without colliding. The shape and motion parameters are supplied through [PhysicsShapeQueryParameters3D].
If the query is successful, this method returns [code]true[/code] and writes the motion results into the [PhysicsCastMotionResult3D] object passed in [code skip-lint]result[/code]. If no collision occurs, it returns [code]false[/code].
[b]Note:[/b] Any [Shape3D]s that the shape is already colliding with e.g. inside of, will be ignored. Use [method collide_shape_typed] to determine the [Shape3D]s that the shape is already colliding with.
</description>
</method>
<method name="collide_shape">
<return type="Vector3[]" />
<param index="0" name="parameters" type="PhysicsShapeQueryParameters3D" />
Expand All @@ -31,6 +41,17 @@
[b]Note:[/b] This method does not take into account the [code]motion[/code] property of the object.
</description>
</method>
<method name="collide_shape_typed">
<return type="bool" />
<param index="0" name="parameters" type="PhysicsShapeQueryParameters3D" />
<param index="1" name="result" type="PhysicsShapeCollisionResult3D" />
<description>
Checks the intersections of a shape, given through a [PhysicsShapeQueryParameters3D] object, against the space.
If intersections are found, this method returns [code]true[/code] and writes the collision points into the [PhysicsShapeCollisionResult3D] object passed in [code skip-lint]result[/code]. If no intersections are found, it returns [code]false[/code].
Like with [method intersect_shape_typed], the number of returned results can be limited using [member PhysicsShapeCollisionResult3D.max_collisions], to reduce the processing time.
[b]Note:[/b] This method does not take into account the [code]motion[/code] property of the object.
</description>
</method>
<method name="get_rest_info">
<return type="Dictionary" />
<param index="0" name="parameters" type="PhysicsShapeQueryParameters3D" />
Expand All @@ -46,6 +67,16 @@
[b]Note:[/b] This method does not take into account the [code]motion[/code] property of the object.
</description>
</method>
<method name="get_rest_info_typed">
<return type="bool" />
<param index="0" name="parameters" type="PhysicsShapeQueryParameters3D" />
<param index="1" name="result" type="PhysicsRestInfoResult3D" />
<description>
Checks the intersections of a shape, given through a [PhysicsShapeQueryParameters3D] object, against the space.
If the shape collides with one or more shapes, this method returns [code]true[/code] and writes the nearest collision information into the [PhysicsRestInfoResult3D] object passed in [code skip-lint]result[/code]. If no collisions occur, it returns [code]false[/code].
[b]Note:[/b] This method does not take into account the [code]motion[/code] property of the object.
</description>
</method>
<method name="intersect_point">
<return type="Dictionary[]" />
<param index="0" name="parameters" type="PhysicsPointQueryParameters3D" />
Expand All @@ -59,6 +90,16 @@
The number of intersections can be limited with the [param max_results] parameter, to reduce the processing time.
</description>
</method>
<method name="intersect_point_typed">
<return type="bool" />
<param index="0" name="parameters" type="PhysicsPointQueryParameters3D" />
<param index="1" name="result" type="PhysicsPointIntersectionResult3D" />
<description>
Checks whether a point is inside any solid shape. The point position and query settings are defined through [PhysicsPointQueryParameters3D].
If one or more shapes overlap the point, this method returns [code]true[/code] and writes the intersection data into the [PhysicsPointIntersectionResult3D] object passed in [code skip-lint]result[/code]. If no intersections are found, it returns [code]false[/code].
The number of intersections can be limited using [member PhysicsPointIntersectionResult3D.max_collisions], to reduce the processing time.
</description>
</method>
<method name="intersect_ray">
<return type="Dictionary" />
<param index="0" name="parameters" type="PhysicsRayQueryParameters3D" />
Expand All @@ -75,6 +116,15 @@
If the ray did not intersect anything, then an empty dictionary is returned instead.
</description>
</method>
<method name="intersect_ray_typed">
<return type="bool" />
<param index="0" name="parameters" type="PhysicsRayQueryParameters3D" />
<param index="1" name="result" type="PhysicsRayIntersectionResult3D" />
<description>
Intersects a ray in a given space. The ray origin, direction, and all other parameters are defined through [PhysicsRayQueryParameters3D].
If the ray hits a shape, this method returns [code]true[/code] and writes the intersection information into the [PhysicsRayIntersectionResult3D] object passed in [code skip-lint]result[/code]. If nothing is hit, it returns [code]false[/code].
</description>
</method>
<method name="intersect_shape">
<return type="Dictionary[]" />
<param index="0" name="parameters" type="PhysicsShapeQueryParameters3D" />
Expand All @@ -89,5 +139,16 @@
[b]Note:[/b] This method does not take into account the [code]motion[/code] property of the object.
</description>
</method>
<method name="intersect_shape_typed">
<return type="bool" />
<param index="0" name="parameters" type="PhysicsShapeQueryParameters3D" />
<param index="1" name="result" type="PhysicsShapeIntersectionResult3D" />
<description>
Checks the intersections of a shape, given through a [PhysicsShapeQueryParameters3D] object, against the space.
If one or more shapes are found, this method returns [code]true[/code] and writes the intersection data into the [PhysicsShapeIntersectionResult3D] object passed in [code skip-lint]result[/code]. If no shapes are overlapping, it returns [code]false[/code].
The number of intersections can be limited using [member PhysicsShapeIntersectionResult3D.max_collisions], to reduce the processing time.
[b]Note:[/b] This method does not take into account the [code]motion[/code] property of the object.
</description>
</method>
</methods>
</class>
50 changes: 50 additions & 0 deletions doc/classes/PhysicsPointIntersectionResult2D.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="PhysicsPointIntersectionResult2D" inherits="RefCounted" api_type="core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
Stores the results of a point intersection query.
</brief_description>
<description>
This class contains the intersection information produced by [method PhysicsDirectSpaceState2D.intersect_point_typed].
It stores up to a user-defined number of overlapping shapes.
</description>
<tutorials>
</tutorials>
<methods>
<method name="get_collider" qualifiers="const">
<return type="Object" />
<param index="0" name="collision_index" type="int" default="0" />
<description>
Returns the collider object at the given result index.
</description>
</method>
<method name="get_collider_id" qualifiers="const">
<return type="int" />
<param index="0" name="collision_index" type="int" default="0" />
<description>
Returns the unique ID of the collider at the given result index.
</description>
</method>
<method name="get_collider_rid" qualifiers="const">
<return type="RID" />
<param index="0" name="collision_index" type="int" default="0" />
<description>
Returns the [RID] of the collider at the given result index.
</description>
</method>
<method name="get_collider_shape" qualifiers="const">
<return type="int" />
<param index="0" name="collision_index" type="int" default="0" />
<description>
Returns the shape index of the collider at the given result index.
</description>
</method>
</methods>
<members>
<member name="collision_count" type="int" setter="" getter="get_collision_count" default="0">
The number of shapes that collide with the queried point.
</member>
<member name="max_collisions" type="int" setter="set_max_collisions" getter="get_max_collisions" default="32">
The maximum number of collisions this result object can store.
</member>
</members>
</class>
50 changes: 50 additions & 0 deletions doc/classes/PhysicsPointIntersectionResult3D.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="PhysicsPointIntersectionResult3D" inherits="RefCounted" api_type="core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
Stores the results of a point intersection query.
</brief_description>
<description>
This class contains the intersection information produced by [method PhysicsDirectSpaceState3D.intersect_point_typed].
It stores up to a user-defined number of overlapping shapes.
</description>
<tutorials>
</tutorials>
<methods>
<method name="get_collider" qualifiers="const">
<return type="Object" />
<param index="0" name="collision_index" type="int" default="0" />
<description>
Returns the collider object at the given result index.
</description>
</method>
<method name="get_collider_id" qualifiers="const">
<return type="int" />
<param index="0" name="collision_index" type="int" default="0" />
<description>
Returns the unique ID of the collider at the given result index.
</description>
</method>
<method name="get_collider_rid" qualifiers="const">
<return type="RID" />
<param index="0" name="collision_index" type="int" default="0" />
<description>
Returns the [RID] of the collider at the given result index.
</description>
</method>
<method name="get_collider_shape" qualifiers="const">
<return type="int" />
<param index="0" name="collision_index" type="int" default="0" />
<description>
Returns the shape index of the collider at the given result index.
</description>
</method>
</methods>
<members>
<member name="collision_count" type="int" setter="" getter="get_collision_count" default="0">
The number of shapes that collide with the queried point.
</member>
<member name="max_collisions" type="int" setter="set_max_collisions" getter="get_max_collisions" default="32">
The maximum number of collisions this result object can store.
</member>
</members>
</class>
Loading