diff options
author | Aaron Franke <arnfranke@yahoo.com> | 2021-01-30 04:22:20 -0500 |
---|---|---|
committer | Aaron Franke <arnfranke@yahoo.com> | 2021-02-16 18:33:23 -0500 |
commit | 7d9ad2b845fdb39e3d70b494b4a756ace7276dbd (patch) | |
tree | 9461ba7db9aa23d4f17f6d9c1af5908139779237 /core | |
parent | c0d01dcf6185e9090d6b6a1cd7682404d411b72b (diff) |
Use Vector3.UP as a default value for look_at's up vector
Diffstat (limited to 'core')
-rw-r--r-- | core/math/transform.h | 4 | ||||
-rw-r--r-- | core/variant/variant_call.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/core/math/transform.h b/core/math/transform.h index 60da6f5593..1c05dbe554 100644 --- a/core/math/transform.h +++ b/core/math/transform.h @@ -51,8 +51,8 @@ public: void rotate(const Vector3 &p_axis, real_t p_phi); void rotate_basis(const Vector3 &p_axis, real_t p_phi); - void set_look_at(const Vector3 &p_eye, const Vector3 &p_target, const Vector3 &p_up); - Transform looking_at(const Vector3 &p_target, const Vector3 &p_up) const; + void set_look_at(const Vector3 &p_eye, const Vector3 &p_target, const Vector3 &p_up = Vector3(0, 1, 0)); + Transform looking_at(const Vector3 &p_target, const Vector3 &p_up = Vector3(0, 1, 0)) const; void scale(const Vector3 &p_scale); Transform scaled(const Vector3 &p_scale) const; diff --git a/core/variant/variant_call.cpp b/core/variant/variant_call.cpp index 48f9816074..54ca1a911d 100644 --- a/core/variant/variant_call.cpp +++ b/core/variant/variant_call.cpp @@ -1257,7 +1257,7 @@ static void _register_variant_builtin_methods() { bind_method(Transform, rotated, sarray("axis", "phi"), varray()); bind_method(Transform, scaled, sarray("scale"), varray()); bind_method(Transform, translated, sarray("offset"), varray()); - bind_method(Transform, looking_at, sarray("target", "up"), varray()); + bind_method(Transform, looking_at, sarray("target", "up"), varray(Vector3(0, 1, 0))); bind_method(Transform, interpolate_with, sarray("xform", "weight"), varray()); bind_method(Transform, is_equal_approx, sarray("xform"), varray()); |