Spatial 2D Audio: improved the reverb effect parameter calculation

This commit is contained in:
ChaoticByte 2024-10-05 10:33:07 +02:00
parent 3ec5a9edf7
commit 46f5b788a1
No known key found for this signature in database
5 changed files with 12 additions and 29 deletions

View file

@ -52,6 +52,3 @@ func _physics_process(delta: float) -> void:
if collider is RigidBody2D:
var impulse = -collision.get_normal() * (velocity.length() / collider.mass) * rigidbody_impulse_mult
collider.apply_central_impulse(impulse)
func _ready() -> void:
$AudioListener2D.make_current()

View file

@ -39,11 +39,8 @@ target_position = Vector2(0, -8.1)
[node name="Polygon2D" type="Polygon2D" parent="."]
polygon = PackedVector2Array(-9, -9, -9, 9, 9, 9, 9, -9)
[node name="AudioListener2D" type="AudioListener2D" parent="."]
[node name="SpatialAudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."]
position = Vector2(0, -8)
stream = ExtResource("2_p4pcw")
volume_db = 10.0
volume_db = 15.0
autoplay = true
script = ExtResource("3_yaiah")