C# Class Oglr.Core.Triangulator2D

A static class exposing methods for triangulating 2D polygons.
Show file Open project: SteveDunn/oglr

Public Methods

Method Description
IsPointInShape ( Vector2 point ) : bool

Determines if a given point is located inside of a shape.

Triangulate ( ) : int[]

Triangulates a 2D polygon produced the indexes required to render the points as a triangle list.

Private Methods

Method Description
GetPoints ( List points, int i, int &pim1, int &pi, int &pip1 ) : void

Given the list of point indices and the index, returns the three vertex indices.

Method Details

IsPointInShape() public static method

Determines if a given point is located inside of a shape.
public static IsPointInShape ( Vector2 point ) : bool
point Vector2 The point to test.
return bool

Triangulate() public static method

Triangulates a 2D polygon produced the indexes required to render the points as a triangle list.
public static Triangulate ( ) : int[]
return int[]