summaryrefslogtreecommitdiff
path: root/scene/2d/audio_stream_player_2d.cpp
diff options
context:
space:
mode:
authorPouleyKetchoupp <pouleyketchoup@gmail.com>2021-11-01 18:00:58 -0700
committerPouleyKetchoupp <pouleyketchoup@gmail.com>2021-11-04 11:44:39 -0700
commitacbd24ea842cb90ab49cd66d5dc7220e57c73f29 (patch)
tree9ae32f04a7f744f7c58a19a1b9679f49589053cb /scene/2d/audio_stream_player_2d.cpp
parent25bea735449d4e762e3c5f6b960d5f5b9cf79ac1 (diff)
Use parameter classes instead of arguments for all physics queries
Same as what is already done for shape queries, applied to point and ray queries. Easier to document and more flexible to add more parameters. Also expose intersect_point method to script in 3D. Remove intersect_point_on_canvas in 2D, replaced with a parameter.
Diffstat (limited to 'scene/2d/audio_stream_player_2d.cpp')
-rw-r--r--scene/2d/audio_stream_player_2d.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/scene/2d/audio_stream_player_2d.cpp b/scene/2d/audio_stream_player_2d.cpp
index f73d52152e..24da2ce9ce 100644
--- a/scene/2d/audio_stream_player_2d.cpp
+++ b/scene/2d/audio_stream_player_2d.cpp
@@ -112,7 +112,13 @@ StringName AudioStreamPlayer2D::_get_actual_bus() {
PhysicsDirectSpaceState2D *space_state = PhysicsServer2D::get_singleton()->space_get_direct_state(world_2d->get_space());
PhysicsDirectSpaceState2D::ShapeResult sr[MAX_INTERSECT_AREAS];
- int areas = space_state->intersect_point(global_pos, sr, MAX_INTERSECT_AREAS, Set<RID>(), area_mask, false, true);
+ PhysicsDirectSpaceState2D::PointParameters point_params;
+ point_params.position = global_pos;
+ point_params.collision_mask = area_mask;
+ point_params.collide_with_bodies = false;
+ point_params.collide_with_areas = true;
+
+ int areas = space_state->intersect_point(point_params, sr, MAX_INTERSECT_AREAS);
for (int i = 0; i < areas; i++) {
Area2D *area2d = Object::cast_to<Area2D>(sr[i].collider);