Skip to content

Instantly share code, notes, and snippets.

@boboboa32
Created October 11, 2012 14:18
Show Gist options
  • Save boboboa32/3872651 to your computer and use it in GitHub Desktop.
Save boboboa32/3872651 to your computer and use it in GitHub Desktop.
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