Add support for quaternion.w/x/y/z.

It's sometimes more useful to have direct access to each individual
component of the imaginary part of the quaternion, and then for
consistency, alias w and s.
This commit is contained in:
Bill Currie 2013-06-24 15:33:21 +09:00
parent c197d6a4f9
commit 2572811bf4

View file

@ -885,6 +885,21 @@ init_types (void)
make_structure ("@quaternion", 's', quaternion_struct, &type_quaternion);
type_quaternion.type = ev_quat;
type_quaternion.meta = ty_none;
{
symbol_t *sym;
sym = new_symbol_type ("w", &type_float);
sym->s.offset = 0;
symtab_addsymbol (type_quaternion.t.symtab, sym);
sym = new_symbol_type ("x", &type_float);
sym->s.offset = 1;
symtab_addsymbol (type_quaternion.t.symtab, sym);
sym = new_symbol_type ("y", &type_float);
sym->s.offset = 2;
symtab_addsymbol (type_quaternion.t.symtab, sym);
sym = new_symbol_type ("z", &type_float);
sym->s.offset = 3;
symtab_addsymbol (type_quaternion.t.symtab, sym);
}
}
void