예제 #1
0
static CmdExecuteValue_t
select_command_execute(Command_t *parent)
{
   SelectCommand_t *command = (SelectCommand_t*) parent;
   object_select(command->obj);
   return CMD_APPEND;
}
예제 #2
0
파일: hook.c 프로젝트: wwatkins42/RT
int		loop_hook(t_env *e)
{
	e->tick.frame_start = clock();
	move_translate(e);
	move_rotate(e);
	e->key[KP] || e->key[KM] || e->mouse.kp || e->mouse.km ? move_zoom(e) : 0;
	e->key[MOUSE] ? mouse_orientation(e) : 0;
	e->key[FI] ? kswitch(&e->cam->filter.invert) : 0;
	e->key[FG] ? kswitch(&e->cam->filter.gray_scale) : 0;
	e->key[FGM] ? e->cam->filter.gamma += 0.05 : 0;
	e->key[FGP] ? e->cam->filter.gamma -= 0.05 : 0;
	e->mouse.lmb ? object_select(e) : 0;
	object_move(e, e->cam->selection);
	object_mouse_move(e, e->cam->selection);
	object_mouse_rotate(e, e->cam->selection);
	e->key[DEL] ? object_delete(e, e->cam->selection) : 0;
	e->mouse.kp = 0;
	e->mouse.km = 0;
	e->mouse.lmb = 0;
	e->mouse.rmb = 0;
	expose_hook(e);
	e->tick.frame = (clock() - e->tick.frame_start) / (float)CLOCKS_PER_SEC;
	return (0);
}