More things. So many things.
This commit is contained in:
@@ -1,13 +1,19 @@
|
||||
#ifndef GEOM_H
|
||||
#define GEOM_H
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <raylib.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
// The maximum number of Tris in a Plate.
|
||||
#define NTRI 4
|
||||
|
||||
// A two dimensional vector.
|
||||
typedef struct {
|
||||
int x;
|
||||
int y;
|
||||
} Vec2;
|
||||
|
||||
typedef struct {
|
||||
int x, y;
|
||||
} Pt;
|
||||
@@ -35,6 +41,13 @@ bool tri_within(Pt pt, Tri* tri);
|
||||
// Get the center point of a Tri.
|
||||
Pt tri_center(Tri* tri);
|
||||
|
||||
// Compare two points.
|
||||
int pt_cmp(const void* a, const void* b);
|
||||
|
||||
// Get the convex hull around the area. Given the points in the area and their
|
||||
// number.
|
||||
Pt* cvx_hull(Pt* area, size_t n, size_t* out_n);
|
||||
|
||||
typedef struct {
|
||||
Color col;
|
||||
size_t ntris;
|
||||
|
||||
Reference in New Issue
Block a user