diff options
| author | Ovnuniarchos | 2015-11-19 01:19:19 +0100 |
|---|---|---|
| committer | Ovnuniarchos | 2015-11-19 01:19:19 +0100 |
| commit | a9a330645b29152ccc29b6e075c0ebda24b03e37 (patch) | |
| tree | 2cf319ce8453dd295c40b809b4bf54527e4fe020 /core/variant_op.cpp | |
| parent | 0f0dc1a5d328502343c5a902aec552fb01033504 (diff) | |
| parent | 94fdd01241749cb7a575ed5f9fa4c7bbb286901a (diff) | |
| download | godot-a9a330645b29152ccc29b6e075c0ebda24b03e37.tar.gz godot-a9a330645b29152ccc29b6e075c0ebda24b03e37.tar.zst godot-a9a330645b29152ccc29b6e075c0ebda24b03e37.zip | |
Diffstat (limited to 'core/variant_op.cpp')
| -rw-r--r-- | core/variant_op.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/core/variant_op.cpp b/core/variant_op.cpp index 1cdf6d731..eabd64783 100644 --- a/core/variant_op.cpp +++ b/core/variant_op.cpp @@ -586,7 +586,21 @@ void Variant::evaluate(const Operator& p_op, const Variant& p_a, const Variant& } break; DEFAULT_OP_LOCALMEM_NUM(*,VECTOR3,Vector3); DEFAULT_OP_FAIL(PLANE); - DEFAULT_OP_FAIL(QUAT); + case QUAT: { + + switch(p_b.type) { + case VECTOR3: { + + _RETURN( reinterpret_cast<const Quat*>(p_a._data._mem)->xform( *(const Vector3*)p_b._data._mem) ); + } break; + case QUAT: { + + _RETURN( *reinterpret_cast<const Quat*>(p_a._data._mem) * *reinterpret_cast<const Quat*>(p_b._data._mem) ); + } break; + }; + r_valid=false; + return; + } break; DEFAULT_OP_FAIL(_AABB); case MATRIX3: { @@ -2573,7 +2587,7 @@ bool Variant::in(const Variant& p_index, bool *r_valid) const { String idx=p_index; const String *str=reinterpret_cast<const String*>(_data._mem); - return str->find("idx")!=-1; + return str->find(idx)!=-1; } } break; |
