quote:Original post by Puzzler183
I may not be understanding this all so is he just try to move the line segements?
Sort of. He wants an object to follow a path that runs parallel to the wall segments.
Timkin
quote:Original post by Puzzler183
I may not be understanding this all so is he just try to move the line segements?
for i=1 to NumberOfLineSegments{ FPS = GetCurrentFramesPerSecond() Li = sqrt( (xi(1)-xi(0))2 + (yi(1)-yi(0))2 ) stotal = Li/V ds = 1/(stotal*FPS) if (mi < mi+1) { theta=atan(mi) s = 0 while(theta!=atan(mi+1)) { ri+1 = sqrt( (xi(1)-x_curr)2 + (yi(1)-y_curr)2 ) if (ri+1==r) m = LERP(m,mi+1,ds) else m = mi Vx = sqrt(V2/(1+m2)) Vy = sqrt(m2V2/(1+m2)) x_curr = x_curr+ds*Vx y_curr = y_curr+ds*Vy s = s + ds theta = atan(m) } } else { ri+1 = sqrt((xi(1)-x_curr)2 + (yi(1)-y_curr)2 ) phi = atan(mi+1)-atan(mi) r' = r/cos(phi/2) m = mi while (ri+1!=r') { Vx = sqrt(V2/(1+m2)) Vy = sqrt(m2V2/(1+m2)) x_curr = x_curr+ds*Vx y_curr = y_curr+ds*Vy ri+1 = sqrt((xi(1)-x_curr)2 + (yi(1)-y_curr)2 ) } }}