Just to give an idea of the things that may happen . . .
Two ships, traveling at huge speeds, missing each other by a very small
distance
One ship traveling at huge speeds hitting a ship at a virtual standstill
Two ships racing towards each other at huge speeds
Here's a nasty one: two ships in formation, one directly behind the other,
traveling at high speed
And a similar case where the rear ship is traveling fast enough to hit and
pass through the front ship . . .
Now, if this isn't hard enough . . .
Make an option for the circles to be empty. (These circles represent the
ships' shields, btw). One ship could conceivably drop its shields, the
second ship flys in, and the first ship raises its shield again. We assume
the second ship is much smaller, so it *can* fit in the space between the
larger ship and its shields. They will not intersect (unless one makes a
course correction and the other one doesn't, of course.)
Now, if this isn't hard enough . . .
The circles should be somewhat deformable. Nothing major - I'd be inputting
a "height", a "width", and an "angle", and then doing whatever calculations
would be necessary to make this into more useful data for the game. A long
sleek ship is NOT going to have a shield shaped like a perfect circle.
Everything mentioned above will still apply.
Now, if this isn't hard enough . . .
Add arbitrary polygons, quite possibly concave (something has to happen when
the shields get blown away, right? at the moment the ship explodes when the
shield goes down.) Once again, everything above applies, except these shapes
would be solid (though a toggle would be nice).
Now, if this isn't hard enough . . .
I also will need the ability for laser weapon intersection. I'd need to get
back a list of what it hits in what order. Actually, I need this for all the
ships (so they only hit the first target and then bounce). Naturally, this
would just be a line. This one actually shouldn't be too hard, especially
considering that only the laser entity needs to get an "intersection"
message.
And that's the problem. Hopefully, it won't get much harder :)
Hope someone can help,
Thanks,
-Zorba
I'm working out some stuff on my own, slowly - you can think of it as a pair
of vertical cylinders skewed (considering Z to be time). The equation would
be:
( x - ( Sx + Vx * z ) )^2 + ( y - ( Sy + Vy * z ) )^2 - r^2 = 0
for 0 <= z <= 1.
I think. Sx/Sy are the start positions (x and y), Vx/Vy are the velocities,
r is radius. (Please let me know if there's a more standard way of writing
this equation.)
So what I'm looking for is a standard way of getting the lowest z value
where two of these equations (with different numbers) are true. And I have
no idea where to even start with this one.
Incidentally, I've already tried programming places. They say it's a math
problem. The math people say it's a geometry problem. So here I am . . .
-Zorba
-Andrew A. Ritz
www.geocities.com/SoHo/Cafe/4441/