-
create (): Polygon
input are many Vec2(s)
-
createConvexHull (vec2_list: Array(<Vec2>)): Polygon
Create the convex hull using the Gift wrapping algorithm
source: https://github.com/juhl/collision-detection-2d/blob/master/util.js
reference: http://en.wikipedia.org/wiki/Gift_wrapping_algorithm
reference: http://en.wikibooks.org/wiki/Algorithm_Implementation/Geometry/Convex_hull/Monotone_chain
- fromAABB (aabb2: AABB2): Polygon
- fromRectangle (rect: Rectangle): Polygon
-
fromBeizer (curve: Beizer, npoints: Number): Polygon
Create a polygon, the polygon is a line
todo: extrude this line
-
fromCircle (circle: Circle, npoints: Number, start_radians: Number): Polygon
Create a polygon from a circle
start_radians rotate the given polygon
- translate (out: Polygon, poly: Polygon, vec2: Vec2): Polygon
- rotate (out: Polygon, poly: Polygon, radians: Number (Radians)): Polygon
- edges (out: Polygon, poly: Polygon): Polygon
- normals (out: Polygon, edges: Polygon): Polygon
- centroid (out_vec2: Vec2, poly: Polygon): Vec2
- recenter (out: Polygon, poly: Polygon): Polygon
- area (poly: Polygon): Number
- transform (out: Polygon, poly: Polygon, m2d: Matrix23): Polygon
- isVec2Inside (poly: Polygon, vec2: Vec2): Boolean
-
furthestPoint (out_vec2: Vec2, poly: Polygon, vec2_dir: Vec2): Number
Compute farthest polygon point in particular direction.
Return the index in the polygon and a clone in out_vec2
-
furthestMinkowski (out_vec2: Vec2, poly_a: Polygon, poly_b: Polygon, vec2_dir: Vec2): Vec2
furthest Point in the Minkowski diff between A and B polygons for a given direction
-
MinkowskiDifference (poly_a: Polygon, poly_b: Polygon): Polygon
Calculate Minkowski Difference
-
momentOfInertia (poly: Polygon, mass: Number)
source: http://www.gamedev.net/topic/342822-moment-of-inertia-of-a-polygon-2d/
source: http://www.physicsforums.com/showthread.php?t=25293&page=2&pp=15
-
isConvex (poly: Polygon)
- toString (poly: Polygon)