Merge pull request #5201 from Hinsbart/quat_op

Expose missing Quaternion operators.
This commit is contained in:
Rémi Verschelde 2016-06-23 10:00:05 +02:00 committed by GitHub
commit 60fa2b9815
1 changed files with 12 additions and 3 deletions

View File

@ -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);