AI for Games 1.1.1
|
Static Public Member Functions | |
static boolean | triangulate (List< Vector2D > contour, List< Integer > result) |
static Integer[] | triangulate (List< Vector2D > contour) |
static Integer[] | triangulate (Vector2D[] contour) |
static double | area (Vector2D[] contour) |
static boolean | isInsideTriangle (double aX, double aY, double bX, double bY, double cX, double cY, double pX, double pY) |
static boolean | isInsideTriangle (Vector2D a, Vector2D b, Vector2D c, Vector2D p) |
static boolean | isInsideTriangle (Vector2D a, Vector2D b, Vector2D c, double pX, double pY) |
Static Package Attributes | |
static final double | EPSILON = 1E-30 |
Static Private Member Functions | |
static boolean | snip (Vector2D[] contour, int u, int v, int w, int n, int[] vList) |
Various routines to work with concave/convex shapes.
|
static |
Calculate the area of the polygon.
contour | an array of vertices that make up an open 2D polygon |
|
static |
Determine if the point pX/pY is inside triangle defined by triangle ABC whose vertices are given by [ax,ay] [bx,by] [cx,cy]
|
static |
Determine if the point (p) is inside triangle defined by triangle ABC
a | triangle vertex 1 |
b | triangle vertex 2 |
c | triangle vertex 3 |
pX | x position for point of interest |
pY | x position for point of interest |
|
static |
Determine if the point (p) is inside triangle defined by triangle ABC
a | triangle vertex 1 |
b | triangle vertex 2 |
c | triangle vertex 3 |
p | point of interest |
|
static |
Create a set of triangles from a concave/convex polygon with no holes and no intersecting sides.
contour | an open list of vertices that make up a 2D polygon |
|
static |
Create a set of triangles from a concave/convex polygon with no holes and no intersecting sides.
contour | an open list of vertices that make up a 2D polygon |
result | list of vertex indices (to contour list) in groups of three for the render triangles |
|
static |
Create a set of triangles from a concave/convex polygon with no holes and no intersecting sides.
contour | an array of vertices that make up an open 2D polygon |