diff options
author | PouleyKetchoupp <pouleyketchoup@gmail.com> | 2021-11-01 18:00:58 -0700 |
---|---|---|
committer | PouleyKetchoupp <pouleyketchoup@gmail.com> | 2021-11-04 11:44:39 -0700 |
commit | acbd24ea842cb90ab49cd66d5dc7220e57c73f29 (patch) | |
tree | 9ae32f04a7f744f7c58a19a1b9679f49589053cb /scene/3d/audio_stream_player_3d.cpp | |
parent | 25bea735449d4e762e3c5f6b960d5f5b9cf79ac1 (diff) | |
download | redot-engine-acbd24ea842cb90ab49cd66d5dc7220e57c73f29.tar.gz |
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/3d/audio_stream_player_3d.cpp')
-rw-r--r-- | scene/3d/audio_stream_player_3d.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp index b5e4eac5d5..34f748b197 100644 --- a/scene/3d/audio_stream_player_3d.cpp +++ b/scene/3d/audio_stream_player_3d.cpp @@ -327,7 +327,13 @@ Area3D *AudioStreamPlayer3D::_get_overriding_area() { PhysicsDirectSpaceState3D::ShapeResult sr[MAX_INTERSECT_AREAS]; - int areas = space_state->intersect_point(global_pos, sr, MAX_INTERSECT_AREAS, Set<RID>(), area_mask, false, true); + PhysicsDirectSpaceState3D::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++) { if (!sr[i].collider) { |