Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- oid Javelin::getParticle(int index, int ticks, float & x, float & y)
- {
- float dx = vec_dxnorm;
- float dy = vec_dynorm;
- int rad = index % radii;
- int dist = index / radii;
- rad -= radii/2;
- float crossx = -dy;
- float crossy = dx;
- float adx = (float)rad * angle;
- float ady = (float)rad *crossy*sin(ticks/1000.0f);
- adx += dx;
- //ady += dy;
- float cosa = cosf( (float)rad * 3.1415f * 2.0f / radii - sin(ticks/1000.0f));
- float sina = sinf( (float)rad * 3.1415f * 2.0f / radii + sin(ticks/1000.0f));
- float speed = (((float)dist / (float)traces) + 1)/(traces);
- float location = (float)ticks * 100 / 2500;
- //std::cout << "index = " << index << std::endl;
- if (index % 2 == 0)
- {
- x = startx + location * speed *vec_dxnorm*rad;
- y = starty + location * speed *vec_dynorm*rad;
- }
- else
- {
- x = startx + location * speed *vec_dxnorm*rad *sina;
- y = starty + location * speed *vec_dynorm *crossy;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement