diff options
author | Rodolfo Ribeiro Gomes <rodolforg@gmail.com> | 2019-10-11 02:22:02 -0300 |
---|---|---|
committer | Rodolfo Ribeiro Gomes <rodolforg@gmail.com> | 2019-10-11 02:22:02 -0300 |
commit | 58e5c650d7ed83859fef81872074991811b0ec2e (patch) | |
tree | 17d36447bdcb4c6888611ddf545fda0d903bee3c /scene/3d | |
parent | fc281dce576657461fb5b83582ccbafb9c21c1eb (diff) |
fix #32711 : Spatial::look_at wrong re-scaling
Diffstat (limited to 'scene/3d')
-rw-r--r-- | scene/3d/spatial.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/scene/3d/spatial.cpp b/scene/3d/spatial.cpp index df831f92ef..9a659ef4af 100644 --- a/scene/3d/spatial.cpp +++ b/scene/3d/spatial.cpp @@ -690,11 +690,10 @@ void Spatial::look_at_from_position(const Vector3 &p_pos, const Vector3 &p_targe Transform lookat; lookat.origin = p_pos; - Vector3 original_scale(get_global_transform().basis.get_scale()); + Vector3 original_scale(get_scale()); lookat = lookat.looking_at(p_target, p_up); - // as basis was normalized, we just need to apply original scale back - lookat.basis.scale(original_scale); set_global_transform(lookat); + set_scale(original_scale); } Vector3 Spatial::to_local(Vector3 p_global) const { |