diff options
author | Yuri Rubinsky <chaosus89@gmail.com> | 2022-09-26 13:02:23 +0300 |
---|---|---|
committer | Yuri Rubinsky <chaosus89@gmail.com> | 2022-09-26 13:22:49 +0300 |
commit | e7e1f84854fa6bab3ebfaec3715a02935a062825 (patch) | |
tree | 9d3185ae760e8376a150cd4e50ba27ae7a0d28c5 /core/math | |
parent | 3472bdd6b6dd7c085b716caabdda16f88e6f167e (diff) |
Fix processing of some types in `math_fieldwise.cpp/fieldwise_assign`
Diffstat (limited to 'core/math')
-rw-r--r-- | core/math/math_fieldwise.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/core/math/math_fieldwise.cpp b/core/math/math_fieldwise.cpp index f36b228543..726a2aeb97 100644 --- a/core/math/math_fieldwise.cpp +++ b/core/math/math_fieldwise.cpp @@ -56,6 +56,15 @@ Variant fieldwise_assign(const Variant &p_target, const Variant &p_source, const return target; } + case Variant::VECTOR2I: { + SETUP_TYPE(Vector2i) + + /**/ TRY_TRANSFER_FIELD("x", x) + else TRY_TRANSFER_FIELD("y", y) + + return target; + } + case Variant::RECT2: { SETUP_TYPE(Rect2) @@ -67,6 +76,17 @@ Variant fieldwise_assign(const Variant &p_target, const Variant &p_source, const return target; } + case Variant::RECT2I: { + SETUP_TYPE(Rect2i) + + /**/ TRY_TRANSFER_FIELD("x", position.x) + else TRY_TRANSFER_FIELD("y", position.y) + else TRY_TRANSFER_FIELD("w", size.x) + else TRY_TRANSFER_FIELD("h", size.y) + + return target; + } + case Variant::VECTOR3: { SETUP_TYPE(Vector3) @@ -192,6 +212,29 @@ Variant fieldwise_assign(const Variant &p_target, const Variant &p_source, const return target; } + case Variant::PROJECTION: { + SETUP_TYPE(Projection) + + /**/ TRY_TRANSFER_FIELD("xx", matrix[0].x) + else TRY_TRANSFER_FIELD("xy", matrix[0].y) + else TRY_TRANSFER_FIELD("xz", matrix[0].z) + else TRY_TRANSFER_FIELD("xw", matrix[0].w) + else TRY_TRANSFER_FIELD("yx", matrix[1].x) + else TRY_TRANSFER_FIELD("yy", matrix[1].y) + else TRY_TRANSFER_FIELD("yz", matrix[1].z) + else TRY_TRANSFER_FIELD("yw", matrix[1].w) + else TRY_TRANSFER_FIELD("zx", matrix[2].x) + else TRY_TRANSFER_FIELD("zy", matrix[2].y) + else TRY_TRANSFER_FIELD("zz", matrix[2].z) + else TRY_TRANSFER_FIELD("zw", matrix[2].w) + else TRY_TRANSFER_FIELD("xo", matrix[3].x) + else TRY_TRANSFER_FIELD("yo", matrix[3].y) + else TRY_TRANSFER_FIELD("zo", matrix[3].z) + else TRY_TRANSFER_FIELD("wo", matrix[3].w) + + return target; + } + default: { ERR_FAIL_V(p_target); } |