Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Circle-line collision
#3
(04-16-2024, 05:30 PM)kevin Wrote: Very good, thank you. This seems to be very efficient - I was consistently getting over 900 fps on my very old laptop, with minimums still over 600. I will certainly be looking to find a use for this Smile

As long as the speed doesn't get crazy, altering the lines shouldn't be a problem for the collision tests. But don't forget to recalculate the extra data for a line if you do:

Code:
    dx = ln[2] - ln[0]; dy = ln[3] - ln[1]
    ln[6] = sqr(dx*dx + dy*dy)
    ln[4] = dx/ln[6]
    ln[5] = dy/ln[6]
Reply


Messages In This Thread
Circle-line collision - by Marcus - 04-16-2024, 03:59 PM
RE: Circle-line collision - by kevin - 04-16-2024, 05:30 PM
RE: Circle-line collision - by Marcus - 04-16-2024, 06:40 PM
RE: Circle-line collision - by johnno56 - 04-16-2024, 07:09 PM
RE: Circle-line collision - by 1micha.elok - 04-17-2024, 04:17 AM
RE: Circle-line collision - by johnno56 - 04-17-2024, 07:01 AM
RE: Circle-line collision - by Marcus - 04-17-2024, 09:24 AM
RE: Circle-line collision - by johnno56 - 04-17-2024, 09:37 AM
RE: Circle-line collision - by Marcus - 04-18-2024, 04:03 PM
RE: Circle-line collision - by 1micha.elok - 04-19-2024, 02:12 AM

Forum Jump:


Users browsing this thread: 3 Guest(s)