|
Hmm, I thought there was somewhere to get at a selected vertex, but I've just had a quick scan through the docs for the event and I can't see anything.
If you have "thousands" of vertices it might be a bit slow, but you could try a brute-force search.
Get the mouse position immediately after the event fireing.
Start at the beginning, compare each location in the track against the mouse position. Do with with a simple "DistanceTo" call. Choose the vertex with the lowest distance.
Depending on how complex your track is, there are probably ways to speed it up. Eg. if they tend to approximate straight lines then a simple "binary chop" algorithm will change the search space from N to log2(N).
Richard |