module Eagle::Geometry

Overview

Polygon helpers used by the renderer and physics.

Defined in:

eagle/graphics/graphics.cr

Class Method Summary

Class Method Detail

def self.point_in_triangle?(p : Vec2, a : Vec2, b : Vec2, c : Vec2) : Bool #

True when p lies inside the triangle a, b, c.


def self.triangulate(pts : Array(Vec2)) : Array(Int32) #

Splits a simple polygon, convex or concave, into triangles by ear clipping. Returns indices into pts, three per triangle.