Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Separating Axis Theorem Implementation?

Asked by 9 years ago

So after quite a bit of research on how to detect collisions of non moving and non collidable parts I discovered the Separating Axis Theorem. Which is described here I understand that concept and how it works, but what I don't understand is how they find the line to separate the rectangles.

So my questions are how exactly do they go about finding the line and how would one implement it into Roblox Lua.

(Answering the first question is more important to me, and so if you are maybe not the best at Lua but you are good at math, I would still love for the help.)

0
Which line from that article are you refering to, exactly? I'm looking through it, but there seem to be a couple ones that you meant. deaththerapy 60 — 9y
0
I mean how do you go from having 2 rectangles to a line that if is possible will go between the two rectangles. Prohibetur 70 — 9y
0
So, create 2 rectangle and where the collision is located, a line (Like a part) will be placed on that intersection? alphawolvess 1784 — 9y
0
Well ... what it is suppose to do is look for a line through the middle of the two rotated rectangles and if that line exists then they must not be intersecting/colliding. Prohibetur 70 — 9y

1 answer

Log in to vote
0
Answered by
Validark 1580 Snack Break Moderation Voter
9 years ago

This is a relevant question I had 2 months back. I think it pretty much clears up everything if you read through it all and understand the code.

0
I'm grateful you showed me that for future reference but that doesn't help at the moment. After doing some testing it doesn't always work Prohibetur 70 — 9y
Ad

Answer this question