Skip to content

Latest commit

 

History

History
106 lines (60 loc) · 3.34 KB

polygon.markdown

File metadata and controls

106 lines (60 loc) · 3.34 KB

Polygon

  • create (): Polygon

    input are many Vec2(s)

  • 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

  • toString (poly: Polygon)