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 /scene | |
parent | c0d01dcf6185e9090d6b6a1cd7682404d411b72b (diff) |
Use Vector3.UP as a default value for look_at's up vector
Diffstat (limited to 'scene')
-rw-r--r-- | scene/3d/node_3d.cpp | 4 | ||||
-rw-r--r-- | scene/3d/node_3d.h | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/scene/3d/node_3d.cpp b/scene/3d/node_3d.cpp index 3b1fb830e3..4575716f7a 100644 --- a/scene/3d/node_3d.cpp +++ b/scene/3d/node_3d.cpp @@ -747,8 +747,8 @@ void Node3D::_bind_methods() { ClassDB::bind_method(D_METHOD("orthonormalize"), &Node3D::orthonormalize); ClassDB::bind_method(D_METHOD("set_identity"), &Node3D::set_identity); - ClassDB::bind_method(D_METHOD("look_at", "target", "up"), &Node3D::look_at); - ClassDB::bind_method(D_METHOD("look_at_from_position", "position", "target", "up"), &Node3D::look_at_from_position); + ClassDB::bind_method(D_METHOD("look_at", "target", "up"), &Node3D::look_at, DEFVAL(Vector3(0, 1, 0))); + ClassDB::bind_method(D_METHOD("look_at_from_position", "position", "target", "up"), &Node3D::look_at_from_position, DEFVAL(Vector3(0, 1, 0))); ClassDB::bind_method(D_METHOD("to_local", "global_point"), &Node3D::to_local); ClassDB::bind_method(D_METHOD("to_global", "local_point"), &Node3D::to_global); diff --git a/scene/3d/node_3d.h b/scene/3d/node_3d.h index 8610e2c0bd..a62c7b31a8 100644 --- a/scene/3d/node_3d.h +++ b/scene/3d/node_3d.h @@ -173,8 +173,8 @@ public: void global_scale(const Vector3 &p_scale); void global_translate(const Vector3 &p_offset); - void look_at(const Vector3 &p_target, const Vector3 &p_up); - void look_at_from_position(const Vector3 &p_pos, const Vector3 &p_target, const Vector3 &p_up); + void look_at(const Vector3 &p_target, const Vector3 &p_up = Vector3(0, 1, 0)); + void look_at_from_position(const Vector3 &p_pos, const Vector3 &p_target, const Vector3 &p_up = Vector3(0, 1, 0)); Vector3 to_local(Vector3 p_global) const; Vector3 to_global(Vector3 p_local) const; |