Add vec = quat * vec to the progs engine.

This commit is contained in:
Bill Currie 2012-04-26 10:29:21 +09:00
parent 0a22a98b60
commit 1a0ccf6a92
3 changed files with 9 additions and 1 deletions

View file

@ -431,6 +431,9 @@ PR_ExecuteProgram (progs_t * pr, func_t fnum)
case OP_MUL_Q:
QuatMult (OPA.quat_var, OPB.quat_var, OPC.quat_var);
break;
case OP_MUL_QV:
QuatMultVec (OPA.quat_var, OPB.vector_var, OPC.vector_var);
break;
case OP_MUL_FQ:
QuatScale (OPB.quat_var, OPA.float_var, OPC.quat_var);
break;

View file

@ -128,6 +128,10 @@ VISIBLE opcode_t pr_opcodes[] = {
ev_quat, ev_float, ev_quat,
PROG_VERSION,
},
{"*", "mul.qv", OP_MUL_QV, false,
ev_quat, ev_vector, ev_vector,
PROG_VERSION,
},
{"~", "conj.q", OP_CONJ_Q, false,
ev_quat, ev_invalid, ev_quat,