mirror of
https://github.com/godotengine/godot.git
synced 2024-11-22 12:12:28 +00:00
Fix processing of some types in math_fieldwise.cpp/fieldwise_assign
This commit is contained in:
parent
3472bdd6b6
commit
e7e1f84854
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user