Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. oid Javelin::getParticle(int index, int ticks, float & x, float & y)
  2. {
  3. float dx = vec_dxnorm;
  4. float dy = vec_dynorm;
  5. int rad = index % radii;
  6. int dist = index / radii;
  7.  
  8. rad -= radii/2;
  9.  
  10. float crossx = -dy;
  11. float crossy = dx;
  12.  
  13. float adx = (float)rad * angle;
  14. float ady = (float)rad *crossy*sin(ticks/1000.0f);
  15. adx += dx;
  16. //ady += dy;
  17.  
  18.  
  19. float cosa = cosf( (float)rad * 3.1415f * 2.0f / radii - sin(ticks/1000.0f));
  20. float sina = sinf( (float)rad * 3.1415f * 2.0f / radii + sin(ticks/1000.0f));
  21.  
  22. float speed = (((float)dist / (float)traces) + 1)/(traces);
  23. float location = (float)ticks * 100 / 2500;
  24. //std::cout << "index = " << index << std::endl;
  25. if (index % 2 == 0)
  26. {
  27. x = startx + location * speed *vec_dxnorm*rad;
  28. y = starty + location * speed *vec_dynorm*rad;
  29. }
  30. else
  31. {
  32. x = startx + location * speed *vec_dxnorm*rad *sina;
  33. y = starty + location * speed *vec_dynorm *crossy;
  34. }
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement