Add static methods to create RayQueryParameters

This commit is contained in:
kobewi 2022-06-10 23:37:04 +02:00
parent b9375ea7fc
commit 9ada594139
6 changed files with 58 additions and 0 deletions

View file

@ -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.