diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-08-14 12:17:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-14 12:17:53 +0200 |
commit | b9b6102b916a679429acfd5a56b1acf353a11b0e (patch) | |
tree | 7568743d8f6925e47a6dddaa6f318ba5bf1ab962 /scene/3d | |
parent | a96c96ca7241974b1f86156a0ee70a87eae7b3e7 (diff) | |
parent | c390f0515d518c1a9bbaecf5d47718ff91bdbae5 (diff) |
Merge pull request #51660 from AnilBK/use-short-functions
Use get_global_* functions instead of using transforms.
Diffstat (limited to 'scene/3d')
-rw-r--r-- | scene/3d/audio_stream_player_3d.cpp | 2 | ||||
-rw-r--r-- | scene/3d/physics_joint_3d.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp index 711e7fbd5a..d2424c9a3b 100644 --- a/scene/3d/audio_stream_player_3d.cpp +++ b/scene/3d/audio_stream_player_3d.cpp @@ -428,7 +428,7 @@ void AudioStreamPlayer3D::_notification(int p_what) { if (area && area->is_using_reverb_bus() && area->get_reverb_uniformity() > 0) { area_sound_pos = space_state->get_closest_point_to_object_volume(area->get_rid(), listener_node->get_global_transform().origin); - listener_area_pos = listener_node->get_global_transform().affine_inverse().xform(area_sound_pos); + listener_area_pos = listener_node->to_local(area_sound_pos); } if (max_distance > 0) { diff --git a/scene/3d/physics_joint_3d.cpp b/scene/3d/physics_joint_3d.cpp index 59440bd1a8..12938946a0 100644 --- a/scene/3d/physics_joint_3d.cpp +++ b/scene/3d/physics_joint_3d.cpp @@ -259,11 +259,11 @@ real_t PinJoint3D::get_param(Param p_param) const { void PinJoint3D::_configure_joint(RID p_joint, PhysicsBody3D *body_a, PhysicsBody3D *body_b) { Vector3 pinpos = get_global_transform().origin; - Vector3 local_a = body_a->get_global_transform().affine_inverse().xform(pinpos); + Vector3 local_a = body_a->to_local(pinpos); Vector3 local_b; if (body_b) { - local_b = body_b->get_global_transform().affine_inverse().xform(pinpos); + local_b = body_b->to_local(pinpos); } else { local_b = pinpos; } |