Hit detection on spline?

Does anyone have any ideas about how I can detect a hit on a spline?

The best I can come up with at the moment is to draw the spline into a
bitmap, convert that bitmap to a region, and then see if the hit point
is in the region. But it's not very quick.

Anyone have any better ideas?

Regards,
Phillip

···

------------------------------------------------------------------------
Phillip Piper www.bigfoot.com/~phillip_piper phillip_piper@bigfoot.com
A man's life does not consist in the abundance of his possessions

Does anyone have any ideas about how I can detect a hit on a spline?

The best I can come up with at the moment is to draw the spline into a
bitmap, convert that bitmap to a region, and then see if the hit point
is in the region. But it's not very quick.

Anyone have any better ideas?

I can't think of a better one, off-hand.
However, you could cache the region for each spline.
Calculate it the first time you need it, store it
in a dictionary, delete it when/if the spline is
changed.

- Sam

···

At 2004-06-04 08:02 AM +0200, you wrote:

Regards,
Phillip

__________________________________________________________
Spinward Stars, LLC Samuel Reynolds
Software Consulting and Development 303-805-1446
http://SpinwardStars.com/ sam@SpinwardStars.com