GeneKrupa
09-28-2003, 05:30 PM
First of all, let me say that I'm still a novice when it comes to numerical methods.
Now that that's over with, I'll present my problem. I'm working on a piece of software that needs to do collision detection between spheres which have velocity and acceleration in any direction and a series of torus segments. I am attempting to use a closed solution to this problem, described as so:
Shrink the small radius of the torus by the radius of the sphere (I'm only concerned with *inner* collisions with the torus).
The "sphere" just follows a parabolic path, then, I think. We translate the parabolic path into the torus' object space.
So, we're only concerned with where the parabolic path intersects with the smaller torus segment.
This results in an octic polynomial, of which I can easily compute the coefficients. My question is, what is the best way to calculate the roots for this polynomial?
"Best" can be described as the following:
Fast! (the method has to be able to run in "real-time", preferably for multiple objects)
I don't care about complex roots. The coefficients are not complex, either. I'd rather not deal with any complex anything. :-)
I'm really only ever concerned with the *first* real root, though I'm not sure ahead of time whether one will occur, and if so, how long it'll take to get to it.
If a root doesn't occur in a reasonable about of time for the parabolic segment, I can just exit and try again next frame.
Accuracy is not quite as important as speed. The spheres aren't moving that fast, and if the "time" variable was off by a little on my root, it wouldn't be that big of a deal. I just want to find the time of the first collision, if there is any.
I'd really appreciate some help on this matter. I tried using zroots, but I'm not sure its the best solution, and its still kinda slow for my application (though there may not be anything better).
I've done sphere-sphere collisions successfully before just using a quartic solver, but obviously there is no octic equation solver, so I figure I need to use one of the generic polynomial solvers.
It may not be possible to do what I want in real time, I know, but computers have gotten pretty darn fast lately :-)
Now that that's over with, I'll present my problem. I'm working on a piece of software that needs to do collision detection between spheres which have velocity and acceleration in any direction and a series of torus segments. I am attempting to use a closed solution to this problem, described as so:
Shrink the small radius of the torus by the radius of the sphere (I'm only concerned with *inner* collisions with the torus).
The "sphere" just follows a parabolic path, then, I think. We translate the parabolic path into the torus' object space.
So, we're only concerned with where the parabolic path intersects with the smaller torus segment.
This results in an octic polynomial, of which I can easily compute the coefficients. My question is, what is the best way to calculate the roots for this polynomial?
"Best" can be described as the following:
Fast! (the method has to be able to run in "real-time", preferably for multiple objects)
I don't care about complex roots. The coefficients are not complex, either. I'd rather not deal with any complex anything. :-)
I'm really only ever concerned with the *first* real root, though I'm not sure ahead of time whether one will occur, and if so, how long it'll take to get to it.
If a root doesn't occur in a reasonable about of time for the parabolic segment, I can just exit and try again next frame.
Accuracy is not quite as important as speed. The spheres aren't moving that fast, and if the "time" variable was off by a little on my root, it wouldn't be that big of a deal. I just want to find the time of the first collision, if there is any.
I'd really appreciate some help on this matter. I tried using zroots, but I'm not sure its the best solution, and its still kinda slow for my application (though there may not be anything better).
I've done sphere-sphere collisions successfully before just using a quartic solver, but obviously there is no octic equation solver, so I figure I need to use one of the generic polynomial solvers.
It may not be possible to do what I want in real time, I know, but computers have gotten pretty darn fast lately :-)