Created
July 11, 2020 17:57
-
-
Save EduardoJM/aface044d819d2785d85b82c630b15b9 to your computer and use it in GitHub Desktop.
Separating Axis Theorem Polygon Structure
This file contains hidden or 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 createPolygon(vertices) { | |
const polygon = {}; | |
polygon.vertices = vertices; | |
polygon.edges = buildEdges(vertices); | |
polygon.projectInAxis = function(x, y) { | |
} | |
polygon.testWith = function (otherPolygon) { | |
} | |
polygon.render = function(context, color) { | |
} | |
polygon.offset = function(dx, dy) { | |
} | |
return polygon; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment