
-----------------------------------
Insectoid
Tue Dec 02, 2008 12:22 pm

Quit #100
-----------------------------------
So, I've been working on a triangular collision detection program. I wrote a line of code to return the number of degrees in an angle, but it quits the program on that line with an error 'Quit #100'. There are no exit, quit, etc. statements in the entire program. Anyone know what this is?


%length variables created with Math.Distance

%cosine law to get angle
angleC := arccosd ((lengthA **2)+(lengthB**2) - (2*lengthB*lengthC)*(lengthC**2))


Remember, I need help with the error, not the actual triangular collision

-----------------------------------
The_Bean
Tue Dec 02, 2008 1:49 pm

Re: Quit #100
-----------------------------------
The reason for the problem is because arccosd(num:real) where -1a**2 then
   %numerator is greater than denominator and
   %angle will be greater than 180
end if


-----------------------------------
Insectoid
Mon Dec 08, 2008 7:44 pm

RE:Quit #100
-----------------------------------
Here's my diagram of my other concept: (making this way more complicated than it needs to be)

-----------------------------------
The_Bean
Tue Dec 09, 2008 1:28 pm

Re: Quit #100
-----------------------------------
Last night after getting a working concept myself I realized another problem with both of ares, you can have 2 triangles overlapping, but without any of their vertices inside the other.  Although depending on the speed and size at wich you have them moving this probably wouldn't happen.

-----------------------------------
Insectoid
Tue Dec 09, 2008 4:07 pm

RE:Quit #100
-----------------------------------
Oh, crap...Didn't even think of that. Hmm...This is going to be fun! We could try to modify the 'perfect' oval collision into triangles, and thus check previous frames to see if a collision occurred mid-frame.
