Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Determining Collision Via Angles

Name: Anonymous 2007-11-03 1:00

I'm trying to make a collision-detection-function based on circles. The general idea is that, if circle A wants to move farther than is allowed by the distance between circle A and circle B, a collision will occur if the angle of circle A's desired movement is within a certain range around the angle of the difference between circle A and circle B.

The range is `atan ([radius A + radius B] / distance)' off from the angle of the difference between circle A and circle B. Two angles, min_radius and max_radius, measure both sides of the distance-angle. From both variables, the movement-angle is subtracted. After regulating both variables so that neither are negative, wether or not the movement-angle will cause a collision is determined by wether or not min_angle has become greater than max_angle. If the movement-angle is NOT within the scope, both variables would be angles where max_angle does not revolve past 2pi, and reset to zero, while min_angle would not drop below zero, and reset to 2pi, effectively making the scenario, `min_angle > max_angle'.

My problem is that working this idea out on paper works, but does work much at all in a program. What fundamental flaws am I overlooking?

Name: Anonymous 2007-11-03 1:26

your inability to communicate

Name: Anonymous 2007-11-03 1:28

Calculating arctans for all object pairs every step is pretty painful.

Name: Anonymous 2007-11-03 1:41

>>2
Sorry. I'm working on a better explaination.
>>3
Lingo makes it easy. I just go `atan(y, x)'.

Name: Anonymous 2007-11-03 1:48

>>4
You had better be joking. I can't tell anymore.

Name: Anonymous 2007-11-03 2:02

LET'S GET PRACTICAL, ANONYMOUS! FUCK YEAH!

The method >>2 could not understand through my explaination (understandable, because I thought of the whole damn thing with pictures and I suck at writing) actually works, according to my tests. My REAL problem is that I don't know how to really bust down distance.

"Say circle A is moving 100 pixels at 1 radian, and circle B is 50 pizels away from circle A at at 0.5 radians. How far can circle A move before it collides with circle B?"

What kind of algorithm is the above scenario called? I'd look it up myself, if I knew. It seems like linear algebra, but what in linear algebra is it?

Am I being too vague? I'm trying not to be, so I apologize if I am.

Name: Anonymous 2007-11-03 2:03

>>5
What? Are you referring to the computer-time calculating the arctangent would take? I thought you were referring to writing that out myself.

Name: Anonymous 2007-11-03 2:37

>>7
Jesus fucking Christ, I hope you die in a fire.

Name: Anonymous 2007-11-03 3:00

>>8
What in the hell have I done?!

Don't change these.
Name: Email:
Entire Thread Thread List