diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-08-04 07:37:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-04 07:37:32 +0200 |
commit | 036258b1e990a2f5ec136c5ad0381a8cb85ea8e2 (patch) | |
tree | 595b78eca323303676ae34e9b8c317b402903fad /doc/classes | |
parent | 0418e81b5a8604d833baa44e26338839b40b334c (diff) | |
parent | 9ada5941397d69954ff8ede8acf315e0c632d412 (diff) |
Merge pull request #61918 from KoBeWi/static_body
Add static methods to create RayQueryParameters
Diffstat (limited to 'doc/classes')
-rw-r--r-- | doc/classes/PhysicsRayQueryParameters2D.xml | 16 | ||||
-rw-r--r-- | doc/classes/PhysicsRayQueryParameters3D.xml | 16 |
2 files changed, 32 insertions, 0 deletions
diff --git a/doc/classes/PhysicsRayQueryParameters2D.xml b/doc/classes/PhysicsRayQueryParameters2D.xml index 36933ef9a2..1cfc6caadf 100644 --- a/doc/classes/PhysicsRayQueryParameters2D.xml +++ b/doc/classes/PhysicsRayQueryParameters2D.xml @@ -8,6 +8,22 @@ </description> <tutorials> </tutorials> + <methods> + <method name="create" qualifiers="static"> + <return type="PhysicsRayQueryParameters2D" /> + <argument index="0" name="from" type="Vector2" /> + <argument index="1" name="to" type="Vector2" /> + <argument index="2" name="collision_mask" type="int" default="4294967295" /> + <argument index="3" name="exclude" type="Array" default="[]" /> + <description> + Returns a new, pre-configured [PhysicsRayQueryParameters2D] object. Use it to quickly create query parameters using the most common options. + [codeblock] + var query = PhysicsRayQueryParameters2D.create(global_position, global_position + Vector2(0, 100)) + var collision = get_world_2d().direct_space_state.intersect_ray(query) + [/codeblock] + </description> + </method> + </methods> <members> <member name="collide_with_areas" type="bool" setter="set_collide_with_areas" getter="is_collide_with_areas_enabled" default="false"> If [code]true[/code], the query will take [Area2D]s into account. diff --git a/doc/classes/PhysicsRayQueryParameters3D.xml b/doc/classes/PhysicsRayQueryParameters3D.xml index 4244ec785f..e9216a8300 100644 --- a/doc/classes/PhysicsRayQueryParameters3D.xml +++ b/doc/classes/PhysicsRayQueryParameters3D.xml @@ -8,6 +8,22 @@ </description> <tutorials> </tutorials> + <methods> + <method name="create" qualifiers="static"> + <return type="PhysicsRayQueryParameters3D" /> + <argument index="0" name="from" type="Vector3" /> + <argument index="1" name="to" type="Vector3" /> + <argument index="2" name="collision_mask" type="int" default="4294967295" /> + <argument index="3" name="exclude" type="Array" default="[]" /> + <description> + Returns a new, pre-configured [PhysicsRayQueryParameters3D] object. Use it to quickly create query parameters using the most common options. + [codeblock] + var query = PhysicsRayQueryParameters3D.create(position, position + Vector3(0, -10, 0)) + var collision = get_world_3d().direct_space_state.intersect_ray(query) + [/codeblock] + </description> + </method> + </methods> <members> <member name="collide_with_areas" type="bool" setter="set_collide_with_areas" getter="is_collide_with_areas_enabled" default="false"> If [code]true[/code], the query will take [Area3D]s into account. |