summaryrefslogtreecommitdiff
path: root/core/variant
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-11-10 08:28:08 +0100
committerGitHub <noreply@github.com>2020-11-10 08:28:08 +0100
commit8e056ba2034caa9f69d242eb97eff54ce3760813 (patch)
tree4fa6ebf28401601e03b0ce2b387f60c32b771fb5 /core/variant
parentefc4d217d61f592a16ebab30731ff9f595dee2cf (diff)
parent0f249f5c0aa2c3a89848f03f155b76e834e4c32a (diff)
Merge pull request #43417 from akien-mga/variant-default-constructors-docs
Variant: Sync docs with new constructors, fixes to #43403
Diffstat (limited to 'core/variant')
-rw-r--r--core/variant/variant_construct.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/core/variant/variant_construct.cpp b/core/variant/variant_construct.cpp
index 5281265294..b777323e82 100644
--- a/core/variant/variant_construct.cpp
+++ b/core/variant/variant_construct.cpp
@@ -292,7 +292,7 @@ public:
}
static Variant::Type get_base_type() {
- return Variant::CALLABLE;
+ return Variant::SIGNAL;
}
};
@@ -569,10 +569,12 @@ void Variant::_register_variant_constructors() {
add_constructor<VariantConstructNoArgs<int64_t>>(sarray());
add_constructor<VariantConstructor<int64_t, int64_t>>(sarray("from"));
add_constructor<VariantConstructor<int64_t, double>>(sarray("from"));
+ add_constructor<VariantConstructor<int64_t, bool>>(sarray("from"));
add_constructor<VariantConstructNoArgs<double>>(sarray());
add_constructor<VariantConstructor<double, double>>(sarray("from"));
add_constructor<VariantConstructor<double, int64_t>>(sarray("from"));
+ add_constructor<VariantConstructor<double, bool>>(sarray("from"));
add_constructor<VariantConstructNoArgs<String>>(sarray());
add_constructor<VariantConstructor<String, String>>(sarray("from"));
@@ -613,13 +615,15 @@ void Variant::_register_variant_constructors() {
add_constructor<VariantConstructNoArgs<Transform2D>>(sarray());
add_constructor<VariantConstructor<Transform2D, Transform2D>>(sarray("from"));
- add_constructor<VariantConstructor<Transform2D, Vector2, Vector2, Vector2>>(sarray("x", "y", "origin"));
+ add_constructor<VariantConstructor<Transform2D, float, Vector2>>(sarray("rotation", "position"));
+ add_constructor<VariantConstructor<Transform2D, Vector2, Vector2, Vector2>>(sarray("x_axis", "y_axis", "origin"));
add_constructor<VariantConstructNoArgs<Plane>>(sarray());
add_constructor<VariantConstructor<Plane, Plane>>(sarray("from"));
add_constructor<VariantConstructor<Plane, Vector3, double>>(sarray("normal", "d"));
add_constructor<VariantConstructor<Plane, Vector3, Vector3>>(sarray("point", "normal"));
add_constructor<VariantConstructor<Plane, Vector3, Vector3, Vector3>>(sarray("point1", "point2", "point3"));
+ add_constructor<VariantConstructor<Plane, double, double, double, double>>(sarray("a", "b", "c", "d"));
add_constructor<VariantConstructNoArgs<Quat>>(sarray());
add_constructor<VariantConstructor<Quat, Quat>>(sarray("from"));
@@ -627,6 +631,7 @@ void Variant::_register_variant_constructors() {
add_constructor<VariantConstructor<Quat, Vector3>>(sarray("euler"));
add_constructor<VariantConstructor<Quat, Vector3, double>>(sarray("axis", "angle"));
add_constructor<VariantConstructor<Quat, Vector3, Vector3>>(sarray("arc_from", "arc_to"));
+ add_constructor<VariantConstructor<Quat, double, double, double, double>>(sarray("x", "y", "z", "w"));
add_constructor<VariantConstructNoArgs<::AABB>>(sarray());
add_constructor<VariantConstructor<::AABB, ::AABB>>(sarray("from"));
@@ -635,14 +640,20 @@ void Variant::_register_variant_constructors() {
add_constructor<VariantConstructNoArgs<Basis>>(sarray());
add_constructor<VariantConstructor<Basis, Basis>>(sarray("from"));
add_constructor<VariantConstructor<Basis, Quat>>(sarray("from"));
- add_constructor<VariantConstructor<Basis, Vector3, Vector3, Vector3>>(sarray("x", "y", "z"));
+ add_constructor<VariantConstructor<Basis, Vector3>>(sarray("euler"));
+ add_constructor<VariantConstructor<Basis, Vector3, double>>(sarray("axis", "phi"));
+ add_constructor<VariantConstructor<Basis, Vector3, Vector3, Vector3>>(sarray("x_axis", "y_axis", "z_axis"));
add_constructor<VariantConstructNoArgs<Transform>>(sarray());
add_constructor<VariantConstructor<Transform, Transform>>(sarray("from"));
add_constructor<VariantConstructor<Transform, Basis, Vector3>>(sarray("basis", "origin"));
+ add_constructor<VariantConstructor<Transform, Vector3, Vector3, Vector3, Vector3>>(sarray("x_axis", "y_axis", "z_axis", "origin"));
add_constructor<VariantConstructNoArgs<Color>>(sarray());
add_constructor<VariantConstructor<Color, Color>>(sarray("from"));
+ add_constructor<VariantConstructor<Color, Color, double>>(sarray("from", "alpha"));
+ add_constructor<VariantConstructor<Color, double, double, double>>(sarray("r", "g", "b"));
+ add_constructor<VariantConstructor<Color, double, double, double, double>>(sarray("r", "g", "b", "a"));
add_constructor<VariantConstructNoArgs<StringName>>(sarray());
add_constructor<VariantConstructor<StringName, StringName>>(sarray("from"));