summaryrefslogtreecommitdiff
path: root/core/variant_op.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/variant_op.cpp')
-rw-r--r--core/variant_op.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/core/variant_op.cpp b/core/variant_op.cpp
index 5463e1cabb..f03ab43fce 100644
--- a/core/variant_op.cpp
+++ b/core/variant_op.cpp
@@ -662,7 +662,7 @@ void Variant::evaluate(const Operator& p_op, const Variant& p_a, const Variant&
case OP_DIVIDE: {
switch(p_a.type) {
- DEFAULT_OP_FAIL(NIL);
+ DEFAULT_OP_FAIL(NIL);
DEFAULT_OP_NUM(/,BOOL,_bool);
case INT: {
switch(p_b.type) {
@@ -779,7 +779,7 @@ void Variant::evaluate(const Operator& p_op, const Variant& p_a, const Variant&
}
#endif
_RETURN( p_a._data._int % p_b._data._int );
-
+
} else if (p_a.type==STRING) {
const String* format=reinterpret_cast<const String*>(p_a._data._mem);
@@ -2409,7 +2409,7 @@ Variant Variant::get(const Variant& p_index, bool *r_valid) const {
} if (str=="value") {
valid=true;
return ie.joy_motion.axis_value;
- }
+ }
}
if (ie.type==InputEvent::SCREEN_TOUCH) {
@@ -3461,12 +3461,18 @@ void Variant::blend(const Variant& a, const Variant& b, float c, Variant &r_dst)
const Rect2 *rb = reinterpret_cast<const Rect2*>(b._data._mem);
r_dst=Rect2(ra->pos + rb->pos * c, ra->size + rb->size * c);
} return;
- case VECTOR3:{ r_dst=*reinterpret_cast<const Vector2*>(a._data._mem)+*reinterpret_cast<const Vector2*>(b._data._mem)*c; } return;
+ case VECTOR3:{ r_dst=*reinterpret_cast<const Vector3*>(a._data._mem)+*reinterpret_cast<const Vector3*>(b._data._mem)*c; } return;
case _AABB:{
const AABB *ra = reinterpret_cast<const AABB*>(a._data._mem);
const AABB *rb = reinterpret_cast<const AABB*>(b._data._mem);
r_dst=AABB(ra->pos + rb->pos * c, ra->size + rb->size * c);
} return;
+ case QUAT:{
+ Quat empty_rot;
+ const Quat *qa = reinterpret_cast<const Quat*>(a._data._mem);
+ const Quat *qb = reinterpret_cast<const Quat*>(b._data._mem);
+ r_dst=*qa * empty_rot.slerp(*qb,c);
+ } return;
case COLOR:{
const Color *ca = reinterpret_cast<const Color*>(a._data._mem);
const Color *cb = reinterpret_cast<const Color*>(b._data._mem);