summaryrefslogtreecommitdiff
path: root/core/variant.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/variant.cpp')
-rw-r--r--core/variant.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/core/variant.cpp b/core/variant.cpp
index d4143b8d84..0f97b98a6f 100644
--- a/core/variant.cpp
+++ b/core/variant.cpp
@@ -66,7 +66,7 @@ String Variant::get_type_name(Variant::Type p_type) {
return "String";
} break;
- // math types
+ // math types
case VECTOR2: {
@@ -513,6 +513,7 @@ bool Variant::can_convert_strict(Variant::Type p_type_from, Variant::Type p_type
static const Type valid[] = {
QUAT,
+ VECTOR3,
NIL
};
@@ -723,7 +724,7 @@ bool Variant::is_zero() const {
} break;
- // math types
+ // math types
case VECTOR2: {
@@ -932,7 +933,7 @@ void Variant::reference(const Variant &p_variant) {
memnew_placement(_data._mem, String(*reinterpret_cast<const String *>(p_variant._data._mem)));
} break;
- // math types
+ // math types
case VECTOR2: {
@@ -1632,7 +1633,9 @@ Variant::operator Basis() const {
return *_data._basis;
else if (type == QUAT)
return *reinterpret_cast<const Quat *>(_data._mem);
- else if (type == TRANSFORM)
+ else if (type == VECTOR3) {
+ return Basis(*reinterpret_cast<const Vector3 *>(_data._mem));
+ } else if (type == TRANSFORM) // unexposed in Variant::can_convert?
return _data._transform->basis;
else
return Basis();
@@ -2502,7 +2505,7 @@ void Variant::operator=(const Variant &p_variant) {
*reinterpret_cast<String *>(_data._mem) = *reinterpret_cast<const String *>(p_variant._data._mem);
} break;
- // math types
+ // math types
case VECTOR2: {
@@ -2642,7 +2645,7 @@ uint32_t Variant::hash() const {
return reinterpret_cast<const String *>(_data._mem)->hash();
} break;
- // math types
+ // math types
case VECTOR2: {