diff options
Diffstat (limited to 'scene/3d/spatial.cpp')
-rw-r--r-- | scene/3d/spatial.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/scene/3d/spatial.cpp b/scene/3d/spatial.cpp index 1a41a31253..df831f92ef 100644 --- a/scene/3d/spatial.cpp +++ b/scene/3d/spatial.cpp @@ -684,15 +684,8 @@ void Spatial::look_at(const Vector3 &p_target, const Vector3 &p_up) { void Spatial::look_at_from_position(const Vector3 &p_pos, const Vector3 &p_target, const Vector3 &p_up) { - if (p_pos == p_target) { - ERR_EXPLAIN("Node origin and target are in the same position, look_at() failed"); - ERR_FAIL(); - } - - if (p_up.cross(p_target - p_pos) == Vector3()) { - ERR_EXPLAIN("Up vector and direction between node origin and target are aligned, look_at() failed"); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(p_pos == p_target, "Node origin and target are in the same position, look_at() failed."); + ERR_FAIL_COND_MSG(p_up.cross(p_target - p_pos) == Vector3(), "Up vector and direction between node origin and target are aligned, look_at() failed."); Transform lookat; lookat.origin = p_pos; |