[Algorithms] Moving Segment vs Moving Point Intersection (2D)
Brought to you by:
vexxed72
From: metanet s. <met...@ya...> - 2006-03-11 21:51:22
|
hi, Hopefully someone can point me towards some good references/theory.. moving-segment tests came up in the context of Carmageddon a while ago (I think), but searching the archives hasn't turned anything up. My current "ad-hoc" algorithm is: given linesegment with endpoints A,B and endpoint velocities vA,vB, and point C with velocity vC: 1) find the velocity V of C relative to segment A->B** 2) use this to perform a segment-vs-segment test, using A->B vs C->(C+V) **for step (1), I find the point on A->B closest to C, and use the parametric description of this point to blend vA and vB together to generate a single velocity for the segment (which is subtracted from vC to get C's velocity from A-B's frame of reference). Step 1 seems very approximate/hacky, since you can use any combination of current or future positions, each of which will give you a different result: -point on A->B closest to C -point on A->B closest to (C+vC) -point on (A+vA)->(B+vB) closest to C -point on (A+vA)->(B+vB) closest to (C+vC) ..there's no obvious "best"/most correct combination, which seems to indicate that the "real" solution to this problem is probably not so neat or linear, involving root finding or closest-point-of-approach calculation. Anyway, any tips, suggestions or references would be great, I'd really like to know of any more accurate (or at least less spontaneously-invented) approached. I should mention that I only need a boolean result, no time/point of intersection. thanks, raigan --------------------------------- Enrich your life at Yahoo! Canada Finance |