Created
October 11, 2012 14:18
-
-
Save boboboa32/3872651 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sat(a, b) | |
for i,v in ipairs(a.edges) do | |
local axis = perp(v) | |
local a_, b_ = project(a, axis), project(b, axis) | |
if not overlap(a_, b_) then return false end | |
end | |
for i,v in ipairs(b.edges) do | |
local axis = perp(v) | |
local a_, b_ = project(a, axis), project(b, axis) | |
if not overlap(a_, b_) then return false end | |
end | |
return true | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment