diff options
author | Juan Linietsky <juan@godotengine.org> | 2019-02-26 09:15:51 -0300 |
---|---|---|
committer | Juan Linietsky <juan@godotengine.org> | 2019-02-26 09:16:23 -0300 |
commit | 329904598829dcbed462b012dee39bc37d7d7c83 (patch) | |
tree | 9ec170050fabfc905eb1ef248d213a35b6f1b12e | |
parent | 22ee7ba4f083fdfab1c177fcd8d921736b5a91ca (diff) |
Remove setting that caused is_inside_tree() errors on doppler tracking enabled.
-rw-r--r-- | core/math/basis.cpp | 10 | ||||
-rw-r--r-- | scene/3d/audio_stream_player_3d.cpp | 4 | ||||
-rw-r--r-- | scene/3d/camera.cpp | 4 |
3 files changed, 8 insertions, 10 deletions
diff --git a/core/math/basis.cpp b/core/math/basis.cpp index c293e753a6..8816e3639a 100644 --- a/core/math/basis.cpp +++ b/core/math/basis.cpp @@ -76,23 +76,17 @@ void Basis::invert() { } void Basis::orthonormalize() { - /* this check is undesired, the matrix could be wrong but we still may want to generate a valid one - * for practical purposes + #ifdef MATH_CHECKS ERR_FAIL_COND(determinant() == 0); #endif -*/ + // Gram-Schmidt Process Vector3 x = get_axis(0); Vector3 y = get_axis(1); Vector3 z = get_axis(2); -#ifdef MATH_CHECKS - ERR_FAIL_COND(x.length_squared() == 0); - ERR_FAIL_COND(y.length_squared() == 0); - ERR_FAIL_COND(z.length_squared() == 0); -#endif x.normalize(); y = (y - x * (x.dot(y))); y.normalize(); diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp index cf48a2503c..4b3934c4ea 100644 --- a/scene/3d/audio_stream_player_3d.cpp +++ b/scene/3d/audio_stream_player_3d.cpp @@ -860,7 +860,9 @@ void AudioStreamPlayer3D::set_doppler_tracking(DopplerTracking p_tracking) { if (doppler_tracking != DOPPLER_TRACKING_DISABLED) { set_notify_transform(true); velocity_tracker->set_track_physics_step(doppler_tracking == DOPPLER_TRACKING_PHYSICS_STEP); - velocity_tracker->reset(get_global_transform().origin); + if (is_inside_tree()) { + velocity_tracker->reset(get_global_transform().origin); + } } else { set_notify_transform(false); } diff --git a/scene/3d/camera.cpp b/scene/3d/camera.cpp index ed9374e422..368cebeeab 100644 --- a/scene/3d/camera.cpp +++ b/scene/3d/camera.cpp @@ -449,7 +449,9 @@ void Camera::set_doppler_tracking(DopplerTracking p_tracking) { doppler_tracking = p_tracking; if (p_tracking != DOPPLER_TRACKING_DISABLED) { velocity_tracker->set_track_physics_step(doppler_tracking == DOPPLER_TRACKING_PHYSICS_STEP); - velocity_tracker->reset(get_global_transform().origin); + if (is_inside_tree()) { + velocity_tracker->reset(get_global_transform().origin); + } } _update_camera_mode(); } |