static void position_create (EntComponent comp, EntSpeech speech) { struct position_data * position = xph_alloc (sizeof (struct position_data)); position->sensitivity = 0.20; position->view.side = vectorCreate (1.0, 0.0, 0.0); position->move.side = vectorCreate (1.0, 0.0, 0.0); position->view.up = vectorCreate (0.0, 1.0, 0.0); position->move.up = vectorCreate (0.0, 1.0, 0.0); position->view.front = vectorCreate (0.0, 0.0, 1.0); position->move.front = vectorCreate (0.0, 0.0, 1.0); position->orientation = quat_create (1.0, 0.0, 0.0, 0.0); position->position = NULL; position->pos = vectorCreate (0, 0, 0); component_setData (comp, position); }
quat* quat_create_id(){ quat* q = quat_create(); quat_set_angle(q, 1.0); return q; }
QUAT position_getOrientationR (const POSITION p) { if (p == NULL) return quat_create (1, 0, 0, 0); return p->orientation; }