Exemplo n.º 1
0
void     GLUI_Rotation::copy_ball_to_float_array( void )
{
  mat4 tmp_rot;
  tmp_rot = *ball->rot_ptr;

  set_float_array_val( (float*) &tmp_rot[0][0] );
}
Exemplo n.º 2
0
int    GLUI_Translation::iaction_mouse_held_down_handler( int local_x, int local_y,
							  int inside)
{  
  float x_off, y_off;
  float off_array[2];

  x_off = scale_factor * (float)(local_x - down_x);
  y_off = -scale_factor * (float)(local_y - down_y);

  if ( glui->curr_modifiers & GLUT_ACTIVE_SHIFT ) {
    x_off *= 100.0f;
    y_off *= 100.0f;
  }
  else if ( glui->curr_modifiers & GLUT_ACTIVE_CTRL ) {
    x_off *= .01f;
    y_off *= .01f;
  }
		

  if ( trans_type == GLUI_TRANSLATION_XY ) {

    if ( locked == GLUI_TRANSLATION_LOCK_X )
      y_off = 0.0;
    else if ( locked == GLUI_TRANSLATION_LOCK_Y )
      x_off = 0.0;

    off_array[0] = x_off + orig_x;
    off_array[1] = y_off + orig_y;
  }
  else if ( trans_type == GLUI_TRANSLATION_X ) {
    off_array[0] = x_off + orig_x;
  }
  else if ( trans_type == GLUI_TRANSLATION_Y ) {
    off_array[0] = y_off + orig_y;
  }
  else if ( trans_type == GLUI_TRANSLATION_Z ) {
    off_array[0] = y_off + orig_z;
  }

  set_float_array_val( (float*) &off_array[0] );

  return false;
}