summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/variant_op.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/core/variant_op.cpp b/core/variant_op.cpp
index 9f706e75cf..e549161de9 100644
--- a/core/variant_op.cpp
+++ b/core/variant_op.cpp
@@ -477,7 +477,7 @@ void Variant::evaluate(const Operator& p_op, const Variant& p_a, const Variant&
DEFAULT_OP_FAIL(MATRIX32);
DEFAULT_OP_LOCALMEM(+,VECTOR3,Vector3);
DEFAULT_OP_FAIL(PLANE);
- DEFAULT_OP_FAIL(QUAT);
+ DEFAULT_OP_LOCALMEM(+, QUAT, Quat);
DEFAULT_OP_FAIL(_AABB);
DEFAULT_OP_FAIL(MATRIX3);
DEFAULT_OP_FAIL(TRANSFORM);
@@ -535,7 +535,7 @@ void Variant::evaluate(const Operator& p_op, const Variant& p_a, const Variant&
DEFAULT_OP_FAIL(MATRIX32);
DEFAULT_OP_LOCALMEM(-,VECTOR3,Vector3);
DEFAULT_OP_FAIL(PLANE);
- DEFAULT_OP_FAIL(QUAT);
+ DEFAULT_OP_LOCALMEM(-, QUAT, Quat);
DEFAULT_OP_FAIL(_AABB);
DEFAULT_OP_FAIL(MATRIX3);
DEFAULT_OP_FAIL(TRANSFORM);
@@ -597,6 +597,9 @@ void Variant::evaluate(const Operator& p_op, const Variant& p_a, const Variant&
_RETURN( *reinterpret_cast<const Quat*>(p_a._data._mem) * *reinterpret_cast<const Quat*>(p_b._data._mem) );
} break;
+ case REAL: {
+ _RETURN( *reinterpret_cast<const Quat*>(p_a._data._mem) * p_b._data._real);
+ } break;
};
r_valid=false;
return;
@@ -699,7 +702,13 @@ void Variant::evaluate(const Operator& p_op, const Variant& p_a, const Variant&
DEFAULT_OP_FAIL(MATRIX32);
DEFAULT_OP_LOCALMEM_NUM(/,VECTOR3,Vector3);
DEFAULT_OP_FAIL(PLANE);
- DEFAULT_OP_FAIL(QUAT);
+ case QUAT: {
+ if (p_b.type != REAL) {
+ r_valid = false;
+ return;
+ }
+ _RETURN( *reinterpret_cast<const Quat*>(p_a._data._mem) / p_b._data._real);
+ } break;
DEFAULT_OP_FAIL(_AABB);
DEFAULT_OP_FAIL(MATRIX3);
DEFAULT_OP_FAIL(TRANSFORM);