Advertisement
Guest User

Untitled

a guest
Jul 20th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.53 KB | None | 0 0
  1. /**
  2.  * Sets up a boxed beam effect.
  3.  *
  4.  * Ported from eventscripts vecmath library
  5.  *
  6.  * @param client        The client to show the box to.
  7.  * @param upc           One upper corner of the box.
  8.  * @param btc           One bottom corner of the box.
  9.  * @param ModelIndex    Precached model index.
  10.  * @param HaloIndex     Precached model index.
  11.  * @param StartFrame    Initital frame to render.
  12.  * @param FrameRate     Beam frame rate.
  13.  * @param Life          Time duration of the beam.
  14.  * @param Width         Initial beam width.
  15.  * @param EndWidth      Final beam width.
  16.  * @param FadeLength    Beam fade time duration.
  17.  * @param Amplitude     Beam amplitude.
  18.  * @param color         Color array (r, g, b, a).
  19.  * @param Speed         Speed of the beam.
  20.  * @noreturn
  21.   * -------------------------------------------------------------------------- */
  22. TE_SendBeamBoxToClient(client, const Float:upc[3], const Float:btc[3], ModelIndex, HaloIndex, StartFrame, FrameRate, const Float:Life, const Float:Width, const Float:EndWidth, FadeLength, const Float:Amplitude, const Color[4], Speed)
  23. {
  24.     // Create the additional corners of the box
  25.     decl Float:tc1[] = {0.0, 0.0, 0.0};
  26.     decl Float:tc2[] = {0.0, 0.0, 0.0};
  27.     decl Float:tc3[] = {0.0, 0.0, 0.0};
  28.     decl Float:tc4[] = {0.0, 0.0, 0.0};
  29.     decl Float:tc5[] = {0.0, 0.0, 0.0};
  30.     decl Float:tc6[] = {0.0, 0.0, 0.0};
  31.  
  32.     AddVectors(tc1, upc, tc1);
  33.     AddVectors(tc2, upc, tc2);
  34.     AddVectors(tc3, upc, tc3);
  35.     AddVectors(tc4, btc, tc4);
  36.     AddVectors(tc5, btc, tc5);
  37.     AddVectors(tc6, btc, tc6);
  38.  
  39.     tc1[0] = btc[0];
  40.     tc2[1] = btc[1];
  41.     tc3[2] = btc[2];
  42.     tc4[0] = upc[0];
  43.     tc5[1] = upc[1];
  44.     tc6[2] = upc[2];
  45.  
  46.     // Draw all the edges
  47.     TE_SetupBeamPoints(upc, tc1, ModelIndex, HaloIndex, StartFrame, FrameRate, Life, Width, EndWidth, FadeLength, Amplitude, Color, Speed);
  48.     TE_SendToClient(client);
  49.     TE_SetupBeamPoints(upc, tc2, ModelIndex, HaloIndex, StartFrame, FrameRate, Life, Width, EndWidth, FadeLength, Amplitude, Color, Speed);
  50.     TE_SendToClient(client);
  51.     TE_SetupBeamPoints(upc, tc3, ModelIndex, HaloIndex, StartFrame, FrameRate, Life, Width, EndWidth, FadeLength, Amplitude, Color, Speed);
  52.     TE_SendToClient(client);
  53.     TE_SetupBeamPoints(tc6, tc1, ModelIndex, HaloIndex, StartFrame, FrameRate, Life, Width, EndWidth, FadeLength, Amplitude, Color, Speed);
  54.     TE_SendToClient(client);
  55.     TE_SetupBeamPoints(tc6, tc2, ModelIndex, HaloIndex, StartFrame, FrameRate, Life, Width, EndWidth, FadeLength, Amplitude, Color, Speed);
  56.     TE_SendToClient(client);
  57.     TE_SetupBeamPoints(tc6, btc, ModelIndex, HaloIndex, StartFrame, FrameRate, Life, Width, EndWidth, FadeLength, Amplitude, Color, Speed);
  58.     TE_SendToClient(client);
  59.     TE_SetupBeamPoints(tc4, btc, ModelIndex, HaloIndex, StartFrame, FrameRate, Life, Width, EndWidth, FadeLength, Amplitude, Color, Speed);
  60.     TE_SendToClient(client);
  61.     TE_SetupBeamPoints(tc5, btc, ModelIndex, HaloIndex, StartFrame, FrameRate, Life, Width, EndWidth, FadeLength, Amplitude, Color, Speed);
  62.     TE_SendToClient(client);
  63.     TE_SetupBeamPoints(tc5, tc1, ModelIndex, HaloIndex, StartFrame, FrameRate, Life, Width, EndWidth, FadeLength, Amplitude, Color, Speed);
  64.     TE_SendToClient(client);
  65.     TE_SetupBeamPoints(tc5, tc3, ModelIndex, HaloIndex, StartFrame, FrameRate, Life, Width, EndWidth, FadeLength, Amplitude, Color, Speed);
  66.     TE_SendToClient(client);
  67.     TE_SetupBeamPoints(tc4, tc3, ModelIndex, HaloIndex, StartFrame, FrameRate, Life, Width, EndWidth, FadeLength, Amplitude, Color, Speed);
  68.     TE_SendToClient(client);
  69.     TE_SetupBeamPoints(tc4, tc2, ModelIndex, HaloIndex, StartFrame, FrameRate, Life, Width, EndWidth, FadeLength, Amplitude, Color, Speed);
  70.     TE_SendToClient(client);
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement