diff options
author | Juan Linietsky <reduzio@gmail.com> | 2023-04-15 10:01:43 +0200 |
---|---|---|
committer | Silc Lizard (Tokage) Renew <61938263+TokageItLab@users.noreply.github.com> | 2023-05-24 10:10:24 +0900 |
commit | 5fdc1232eff45e31ee53f58e618de6c58d3f7203 (patch) | |
tree | ff8e6d4a7a3557d4d42c78294425c2604d35fd17 /core/math/basis.h | |
parent | d5c1b9f883adbb54900c145eafcaa789d0fd563c (diff) | |
download | redot-engine-5fdc1232eff45e31ee53f58e618de6c58d3f7203.tar.gz |
Add the ability to look-at in model-space.
This is a much simpler attempt to solve the same problem as #76060, but without breaking any compatibility.
* Adds a description of what model space is in the Vector3 enums (MODEL_* constants). This has the proper axes laid out for imported 3D assets.
* Adds the option to `look_at` using model_space, which uses Vector3.MODEL_FRONT as forward vector.
The attempt of this PR is to still break the assumption that there is a single direction of forward (which is not the case in Godot)
and make it easier to understand where 3D models are facing, as well as orienting them via look_at.
Diffstat (limited to 'core/math/basis.h')
-rw-r--r-- | core/math/basis.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/math/basis.h b/core/math/basis.h index bbc1d40469..1a68bee686 100644 --- a/core/math/basis.h +++ b/core/math/basis.h @@ -217,7 +217,7 @@ struct _NO_DISCARD_ Basis { operator Quaternion() const { return get_quaternion(); } - static Basis looking_at(const Vector3 &p_target, const Vector3 &p_up = Vector3(0, 1, 0)); + static Basis looking_at(const Vector3 &p_target, const Vector3 &p_up = Vector3(0, 1, 0), bool p_use_model_front = false); Basis(const Quaternion &p_quaternion) { set_quaternion(p_quaternion); }; Basis(const Quaternion &p_quaternion, const Vector3 &p_scale) { set_quaternion_scale(p_quaternion, p_scale); } |