Пример #1
0
void vsx_widget_popup_menu::event_mouse_down(vsx_widget_distance distance, vsx_widget_coords coords, int button)
{
  VSX_UNUSED(distance);
  VSX_UNUSED(button);
  req(over);
  req(!oversub);
  req(current_command_over);

  visible = 0;

  // call event
  on_selection(*current_command_over);

  // perform command's action
  current_command_over->action();

  // send command to parent
  req(current_command_over->cmd.size());

  vsx_command_s* command = command_q_b.addc(current_command_over, true);
  if (command->cmd_data == "$mpos")
  {
    command->cmd_data = vsx_vector3_helper::to_string
        (
          coords.world_global-parent->get_pos_p(),
          2
          );

    if (command->parts.size() > 2)
      command->parts[2] = command->cmd_data;
  }
  parent->vsx_command_queue_b(this);
}
Пример #2
0
void vsx_widget_2d_pager::event_mouse_down(vsx_widget_distance distance,vsx_widget_coords coords,int button)
{
  VSX_UNUSED(coords);
  VSX_UNUSED(button);

  distance.center.x > 0.0f ? increase() : decrease();
}
Пример #3
0
/*vsx_vector3<> vsx_widget_panel::calc_pos()
{
  vsx_vector3<> p = get_pos_p();

  if (pos_from_parent) {
    return pos - target_size * 0.5;
//    p.x += target_pos.x;
//    p.y += target_pos.y;
      p.x -= target_size.x*0.5;
      p.y -= target_size.y*0.5;
  } else
  p = parent->get_inner_pos();


  if (render_type == render_3d) {
    p.z = pos.z;
  } else {
    p.z = 0.0f;
  }
  return p;
}
*/
int vsx_widget_panel::inside_xy_l(vsx_vector3<> &test, vsx_vector3<> &global)
{
  VSX_UNUSED(test);
  VSX_UNUSED(global);
  //return vsx_widget::inside_xy_l(test,global);
  return 0;
}
Пример #4
0
void vsx_widget_seq_pool_manager::event_text(wchar_t character_wide, char character)
{
  VSX_UNUSED(character_wide);
  VSX_UNUSED(character);

  vsx_string<>filter = ((vsx_widget_base_edit*)search)->get_string();
  ((vsx_widget_editor*)edit)->editor->set_filter_string( filter );
}
Пример #5
0
void GLFWCALL mouse_pos_event(int x, int y)
{
  VSX_UNUSED(x);
  VSX_UNUSED(y);
  set_modifiers();
  glfwGetMousePos(&last_x, &last_y);
  if (mouse_state) mouse_pos_type = 1;
  else mouse_pos_type = 2;
}
Пример #6
0
void GLFWCALL mouse_pos_event(int x, int y)
{
  VSX_UNUSED(x);
  VSX_UNUSED(y);

  set_modifiers();
  //printf("mouse_pos_event %d, %d\n",x,y);
  glfwGetMousePos(&last_x, &last_y);
  //last_x = x;
  //last_y = y;
  if (mouse_state) mouse_pos_type = 1;
  else mouse_pos_type = 2;
}
Пример #7
0
  void event_mouse_down(vsx_widget_distance distance,vsx_widget_coords coords,int button)
  {
    VSX_UNUSED(distance);
    VSX_UNUSED(coords);
    VSX_UNUSED(button);

    if (dragging) dragging = false;
    if (get_selected_item() != "")
    {
      command_q_b.add_raw("seq_pool select " + editor->get_line(editor->selected_line) );
      parent->vsx_command_queue_b(this);
    }
  }
Пример #8
0
void vsx_widget_profiler_thread::event_mouse_move_passive(vsx_widget_distance distance,vsx_widget_coords coords)
{
  VSX_UNUSED(distance);
  //mouse_pos = coords.world_global - get_pos_p();
  mouse_pos = distance.center;
  parent->event_mouse_move_passive(distance, coords);
}
Пример #9
0
void vsx_widget_profiler_plot::event_mouse_double_click(vsx_widget_distance distance,vsx_widget_coords coords,int button)
{
  VSX_UNUSED(distance);
  VSX_UNUSED(coords);
  VSX_UNUSED(button);
  if (!selected_chunk)
    return;

  double tdiff = selected_chunk->time_end - selected_chunk->time_start;
  vsx_printf("tdiff. %f\n", tdiff);
  time_scale::get_instance()->time_scale_x = 0.5 / (tdiff) ;
  time_scale::get_instance()->time_offset = -time_scale::get_instance()->time_scale_x * (selected_chunk->time_start + 0.5 * tdiff);

  camera.set_pos( vsx_vector3<>(0.0, 0.0, 1.9) );
  update_vbo();
}
Пример #10
0
bool vsx_widget_seq_pool_manager::event_key_down(uint16_t key)
{
  VSX_UNUSED(key);
  vsx_string<>filter = ((vsx_widget_base_edit*)search)->get_string();
  ((vsx_widget_editor*)edit)->editor->set_filter_string( filter );
  return true;
}
Пример #11
0
vsx_module* MOD_CM(unsigned long module, void* args)
{
  VSX_UNUSED(args);
  switch(module)
  {
    case 0: return (vsx_module*)(new module_mesh_vertex_picker);
    case 1: return (vsx_module*)(new module_mesh_quat_rotate);
    case 2: return (vsx_module*)(new module_mesh_deformers_mesh_vertex_move);
    case 3: return (vsx_module*)(new module_mesh_translate);
    case 4: return (vsx_module*)(new module_mesh_to_float3_arrays);
    case 5: return (vsx_module*)(new module_mesh_compute_tangents);
    case 6: return (vsx_module*)(new module_mesh_inflate_thread);
    case 7: return (vsx_module*)(new module_mesh_deformers_random_normal_distort);
    case 8: return (vsx_module*)(new module_mesh_noise);
    case 9: return (vsx_module*)(new module_mesh_quat_rotate_around_vertex);
    case 10: return (vsx_module*)(new module_mesh_dummy);
    case 11: return (vsx_module*)(new module_mesh_scale);
    case 12: return (vsx_module*)(new module_mesh_rain_down);
    case 13: return (vsx_module*)(new module_mesh_calc_attachment);
    case 14: return (vsx_module*)(new module_mesh_vertex_distance_sort);
    case 15: return (vsx_module*)(new module_mesh_translate_edge_wraparound);
    case 16: return (vsx_module*)(new module_mesh_vortex);
    case 17: return (vsx_module*)(new module_mesh_scale_normalize);
    case 18: return (vsx_module*)(new module_mesh_segmesh_to_mesh);
    case 19: return (vsx_module*)(new module_mesh_compute_tangents_vertex_color_array);
    case 20: return (vsx_module*)(new module_mesh_mirror);
    case 21: return (vsx_module*)(new module_mesh_interpolate_2p);
  }
  return 0;
}
Пример #12
0
  void output(vsx_module_param_abs* param)
  {
    VSX_UNUSED(param);
    particles = in_particlesystem->get_addr();
    if (particles) {
      if (prev_num_particles != particles->particles->size())
      {
    	// remove all the old ones
    	/*for (unsigned long i = 0; i < gr.size(); i++)
    	{
    		delete gr[i];
    	}
        gr.reset_used(0);*/
        //printf("num particles: %d\n",particles->particles->size());
    	//printf("prev_num: %d\n",prev_num_particles);
        for (unsigned long i = prev_num_particles; i < particles->particles->size(); ++i) {
        	//if (i == prev_num_particles) printf("allocating again\n");
        	gr[i] = new gravity_strip;
          //printf("i: %d\n",i);
          gr[i]->init();
          gr[i]->init_strip();
        }
        prev_num_particles = particles->particles->size();
      }
      //printf("done alloc %d\n",particles->particles->size());

      for (unsigned long i = 0; i < particles->particles->size(); ++i) {
      	//gr[i].length = 0.0f;
      	gr[i]->width = ribbon_width->get();
				//gr[i].masses[1].mass = gr[i].masses[0].mass + ribbon_width->get();
				gr[i]->length = length->get();
				gr[i]->friction = friction->get();
        float tt = ((*particles->particles)[i].time/(*particles->particles)[i].lifetime);
        if (tt < 0.0f) tt = 0.0f;
        if (tt > 1.0f) tt = 1.0f;
			  gr[i]->color0[0] = color0->get(0)*tt;
			  gr[i]->color0[1] = color0->get(1)*tt;
			  gr[i]->color0[2] = color0->get(2)*tt;
			  gr[i]->color0[3] = color0->get(3)*tt;

			  gr[i]->color1[0] = color1->get(0);
			  gr[i]->color1[1] = color1->get(1);
			  gr[i]->color1[2] = color1->get(2);
			  gr[i]->step_freq = 10.0f * step_length->get();
		  	//if (last_update != engine->vtime) {
			  gr[i]->update(engine->dtime, (*(particles->particles))[i].pos.x, (*(particles->particles))[i].pos.y, (*(particles->particles))[i].pos.z);
					//last_upd ate = engine->vtime;
	  		//}
				//printf("%f, %f, %f\n", (*particles->particles)[i].pos.x, (*particles->particles)[i].pos.y, (*particles->particles)[i].pos.z);
			  gr[i]->render();
		//		printf("%d %d;;; %d\n",__LINE__,i, particles->particles->size());
        // add the delta-time to the time of the particle
        /*(*particles->particles)[i].pos.x += px*engine->dtime;
        (*particles->particles)[i].pos.y += py*engine->dtime;
        (*particles->particles)[i].pos.z += pz*engine->dtime;*/
      }
      //printf("done drawing\n");
    }
	render_result->set(1);
  }
Пример #13
0
bool app_draw(int id)
{
  VSX_UNUSED(id);
	if (first)
	{
		first = false;
    intro = new vsx_logo_intro;
    vxe_local = new vsx_engine("");
    vxe_local->set_no_send_client_time(true);
    vxe_local->start();
    vsx_string path = PLATFORM_SHARED_FILES;
    vxe_local->load_state(path+"example-prods/vovoid-luna-reactivation.vsx");
  }
  
  vxe_local->process_message_queue(&cmd_in,&cmd_out);
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  vxe_local->render();
  if
  (
      vxe_local->get_engine_state() == VSX_ENGINE_LOADING
      &&
      vxe_local->get_engine_info()->vtime < 1.0f
  )
  intro->draw(true,false);
  else
  intro->draw(false,false);
  return true;
}
Пример #14
0
vsx_module* MOD_CM(unsigned long module, void* args)
{
  VSX_UNUSED(args);
  switch(module) {
    case 0: return (vsx_module*)(new module_output_screen_opengl);
  }
  return 0;
}
Пример #15
0
vsx_module* create_new_module(unsigned long module, void* args)
{
  VSX_UNUSED(args);
  switch(module) {
    case 0: return (vsx_module*)(new vsx_module_obj_loader);
    case 1: return (vsx_module*)(new vsx_module_vxm_loader);
  }
  return 0;
}
Пример #16
0
vsx_module* create_new_module(unsigned long module, void* args)
{
  VSX_UNUSED(args);
  switch(module) {
    case 0: return (vsx_module*)(new vsx_module_file_chooser);
    case 1: return (vsx_module*)(new vsx_module_resource_to_string);
  }
  return 0;
}
Пример #17
0
  void event_mouse_move(vsx_widget_distance distance, vsx_widget_coords coords)
  {
    VSX_UNUSED(distance);

    if (get_selected_item() != "")
    {
      dragging = true;
      drag_coords = coords;
    }
  }
Пример #18
0
vsx_module* MOD_CM(unsigned long module, void* args)
{
  VSX_UNUSED(args);
  switch (module) {
    case 0: return (vsx_module*)new module_plugin_maths_oscillator;
    case 1: return (vsx_module*)new module_plugin_maths_oscillators_float_sequencer;
    case 2: return (vsx_module*)new module_plugin_maths_oscillators_inside_range;
    case 3: return (vsx_module*)new module_plugin_maths_oscillators_pulse_oscillator;
  }
  return 0;
}
Пример #19
0
vsx_module* create_new_module(unsigned long module, void* args)
{
  VSX_UNUSED(args);
  switch (module) {
    case 0: return (vsx_module*)(new module_particlesystem_render);
    case 1: return (vsx_module*)(new module_particlesystem_render_c);
    case 2: return (vsx_module*)(new module_particlesystem_render_sparks);
    case 3: return (vsx_module*)(new module_particlesystem_render_ext);
  }
  return 0;
}
Пример #20
0
vsx_module* MOD_CM(unsigned long module, void* args)
{
  VSX_UNUSED(args);

  // as we have only one module available, don't look at the module variable, just return - for speed
  // otherwise you'd have something like,, switch(module) { case 0: break; }
  switch(module) {
    case 0: return (vsx_module*)(new vsx_module_text_s);
  }
  return 0;
}
Пример #21
0
void vsx_widget_controller_slider::event_mouse_move(vsx_widget_distance distance,vsx_widget_coords coords)
{
  VSX_UNUSED(coords);

  if (controlling)
  {
    target_value = (-(((distance.corner.y-handlesize/2)/(size.y-handlesize))-1) * (amp))+ofs; //amp-ofs
    cap_value();
  }
  send_to_server();
  ++mouse_moves;
}
Пример #22
0
vsx_module* MOD_CM(unsigned long module, void* args)
{
  VSX_UNUSED(args);
  switch (module) {
    case 0: return (vsx_module*)new module_render_basic_textured_rectangle;
    case 1: return (vsx_module*)new module_render_basic_colored_rectangle;
    case 2: return (vsx_module*)new module_render_line;
    case 3: return (vsx_module*)new module_render_basic_oscilloscope;
    case 4: return (vsx_module*)new module_render_basic_simple_colorline;
  } // switch
  return 0;
}
Пример #23
0
vsx_module* create_new_module(unsigned long module, void* args)
{
  VSX_UNUSED(args);
  // as we have only one module available, don't look at the module variable, just return - FOR SPEED (says jaw)
  // otherwise you'd have something like,, switch(module) { case 0: break; }
  switch (module) {
  	case 0: return (vsx_module*)new vsx_module_gravlines;
  	case 1: return (vsx_module*)new vsx_module_gravity_ribbon;
  	case 2: return (vsx_module*)new vsx_module_gravity_ribbon_particles;
    case 3: return (vsx_module*)new vsx_module_gravity_ribbon_mesh;
  }
  return 0;
}
Пример #24
0
unsigned long MOD_NM(vsx_engine_environment* environment)
{
  VSX_UNUSED(environment);

  // on windows glewInit has to be run per DLL
  #if PLATFORM_FAMILY == PLATFORM_FAMILY_WINDOWS
    #ifndef VSXU_STATIC
      glewInit();
    #endif
  #endif

  return 6;
}
Пример #25
0
vsx_module* MOD_CM(unsigned long module, void* args)
{
  VSX_UNUSED(args);
  switch(module)
  {
    case 0: return (vsx_module*)(new module_mesh_render);
    case 1: return (vsx_module*)(new module_mesh_render_zsort);
    case 2: return (vsx_module*)(new module_mesh_render_line);
    case 3: return (vsx_module*)(new module_mesh_render_dots);
    case 4: return (vsx_module*)(new module_mesh_render_face_id);
    case 5: return (vsx_module*)(new module_mesh_render_billboards);
  }
  return 0;
}
Пример #26
0
vsx_module* MOD_CM(unsigned long module, void* args)
{
  VSX_UNUSED(args);
  switch (module)
  {
    case 0: return (vsx_module*)(new module_float_selector);
    case 1: return (vsx_module*)(new module_float3_selector);
    case 2: return (vsx_module*)(new module_float4_selector);
    case 3: return (vsx_module*)(new module_quaternion_selector);
    case 4: return (vsx_module*)(new module_texture_selector);
    case 5: return (vsx_module*)(new module_string_selector);
  }
  return 0;
}
Пример #27
0
void vsx_param_sequence::update_line(vsx_command_list* dest, vsx_command_s* cmd_in, vsx_string cmd_prefix)
{
  VSX_UNUSED(dest);
  VSX_UNUSED(cmd_prefix);
	total_time = 0.0f; // reset total time for re-calculation
#ifdef VSXU_DEBUG
  printf("UPDATE_LINE in engine %s\n",cmd_in->raw.c_str());
#endif
  vsx_param_sequence_item pa;
  pa.total_length = vsx_string_helper::s2f(cmd_in->parts[5]);
  pa.interpolation = vsx_string_helper::s2i(cmd_in->parts[6]);
  if (pa.interpolation < 4)
  {
    pa.value = base64_decode(cmd_in->parts[4]);
  	//printf("value in string format: %s\n", pa.value.c_str());
  }
  else
  if (pa.interpolation == 4) {
    std::vector<vsx_string> pld_l;
    vsx_string pdeli_l = ":";
    vsx_string vtemp = base64_decode(cmd_in->parts[4]);
    //printf("value: %s\n",vtemp.c_str());
    explode(vtemp,pdeli_l,pld_l);
    pa.value = pld_l[0];
    pa.handle1 = vsx_vector3_helper::from_string<float>(pld_l[1]);
    pa.handle2 = vsx_vector3_helper::from_string<float>(pld_l[2]);
  }

  items[ vsx_string_helper::s2i(cmd_in->parts[7]) ] = pa;
  //dest->add_raw(cmd_prefix+"pseq_r_ok update "+cmd_in->parts[2]+" "+cmd_in->parts[3]+" "+cmd_in->parts[4]+" "+cmd_in->parts[5]+" "+cmd_in->parts[6]+" "+cmd_in->parts[7]);
  cur_val = to_val = "";
  last_time = 0.0;
  line_time = 0.0;
  line_cur = 0;
  p_time = 0;
  //printf("pseql_r a %s\n",cmd_in->parts[4].c_str());
}
Пример #28
0
vsx_module* MOD_CM(unsigned long module, void* args)
{
  VSX_UNUSED(args);
  glewInit();
  switch(module) {
    case 0:
    case 1:
    {
      module_texture_load_png* m = new module_texture_load_png;
      m->m_type = module % 2;
      return (vsx_module*)m;
    }
    case 2:
    case 3:
    {
      module_texture_load_jpeg* m2 = new module_texture_load_jpeg;
      m2->m_type = module % 2;
      return (vsx_module*)m2;
    }
    case 4:
    case 5:
    {
      module_texture_load_jpeg_alpha* m2 = new module_texture_load_jpeg_alpha;
      m2->m_type = module % 2;
      return (vsx_module*)m2;
    }
    case 6:
    return (vsx_module*)(new module_texture_load_bitmap2texture);
    case 7:
    return (vsx_module*)(new module_texture_load_png_cubemap);
    case 8: return (vsx_module*)(new vsx_module_rendered_texture_single);
    case 9: return (vsx_module*)(new module_texture_translate);
    case 10: return (vsx_module*)(new module_texture_scale);
    case 11: return (vsx_module*)(new module_texture_rotate);
    case 12: return (vsx_module*)(new module_texture_parameter);
    case 13: return (vsx_module*)(new module_texture_effect_blur);
    case 14: return (vsx_module*)(new module_texture_visual_fader);
    case 15: return (vsx_module*)(new module_texture_render_surface_color_depth_buffer);
    case 16: return (vsx_module*)(new module_texture_render_surface_color_buffer);
    case 17: return (vsx_module*)(new module_texture_render_buffer);
    case 18: return (vsx_module*)(new module_texture_dummy);
    case 19: return (vsx_module*)(new module_texture_screenshot_hires);
  };

  return 0;
}
Пример #29
0
vsx_module* MOD_CM(unsigned long module, void* args)
{
  VSX_UNUSED(args);

  switch(module)
  {
      case 0:
          return (vsx_module*)(new vsx_module_raw_sample_trigger);
      case 1:
          return (vsx_module*)(new vsx_module_raw_sample_play);
      case 2:
          return (vsx_module*)(new vsx_module_ogg_sample_trigger);
      case 3:
          return (vsx_module*)(new vsx_module_ogg_sample_play);
  }
  return 0;
}
Пример #30
0
vsx_module* create_new_module(unsigned long module, void* args)
{
  VSX_UNUSED(args);
  glewInit();
  switch(module) {
    case 0: return (vsx_module*)(new vsx_module_rendered_texture_single);
    case 1: return (vsx_module*)(new vsx_module_texture_translate);
    case 2: return (vsx_module*)(new vsx_module_texture_scale);
    case 3: return (vsx_module*)(new vsx_module_texture_rotate);
    case 4: return (vsx_module*)(new vsx_module_texture_parameter);
    case 5: return (vsx_module*)(new vsx_module_texture_blur);
    case 6: return (vsx_module*)(new vsx_module_visual_fader);
    case 7: return (vsx_module*)(new vsx_module_rendered_texture_color_depth_buffer);
    case 8: return (vsx_module*)(new vsx_module_rendered_texture_color_buffer);
  };
  return 0;
}