Guest User

Untitled

a guest
Feb 27th, 2011
505
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.15 KB | None | 0 0
  1.             // add some flavor to the bolt. mmmmmmmm, lightning
  2.             if(!IS_VEC_NULL_SQ_SAFE(&Storm->flavor)){          
  3.                 // start with your basic hot sauce. measure how much you have          
  4.                 vec3d your_basic_hot_sauce;
  5.                 vm_vec_sub(&your_basic_hot_sauce, &strike, &start);
  6.                 float how_much_hot_sauce = vm_vec_normalize(&your_basic_hot_sauce);
  7.  
  8.                 // now figure out how much of that good wing sauce to add
  9.                 vec3d wing_sauce = Storm->flavor;
  10.                 if(frand_range(0.0, 1.0f) < 0.5f){
  11.                     vm_vec_scale(&wing_sauce, -1.0f);
  12.                 }
  13.                 float how_much_of_that_good_wing_sauce_to_add = vm_vec_normalize(&wing_sauce);
  14.  
  15.                 // mix the two together, taking care not to add too much
  16.                 vec3d the_mixture;
  17.                 if(how_much_of_that_good_wing_sauce_to_add > 1000.0f){
  18.                     how_much_of_that_good_wing_sauce_to_add = 1000.0f;
  19.                 }
  20.                 vm_vec_interp_constant(&the_mixture, &your_basic_hot_sauce, &wing_sauce, how_much_of_that_good_wing_sauce_to_add / 1000.0f);
  21.  
  22.                 // take the final sauce and store it in the proper container
  23.                 vm_vec_scale(&the_mixture, how_much_hot_sauce);
  24.  
  25.                 // make sure to put it on everything! whee!        
  26.                 vm_vec_add(&strike, &start, &the_mixture);
  27.             }
Advertisement
Add Comment
Please, Sign In to add comment