Chipmunk2D Pro API Reference  7.0.1
 All Classes Functions Variables Typedefs Enumerations Enumerator Properties Groups Pages
cpPolyline.h
1 // Copyright 2013 Howling Moon Software. All rights reserved.
2 // See http://chipmunk2d.net/legal.php for more information.
3 
4 // Polylines are just arrays of vertexes.
5 // They are looped if the first vertex is equal to the last.
6 // cpPolyline structs are intended to be passed by value and destroyed when you are done with them.
7 typedef struct cpPolyline {
8  int count, capacity;
9  cpVect verts[];
10 } cpPolyline;
11 
13 CP_EXPORT void cpPolylineFree(cpPolyline *line);
14 
16 CP_EXPORT cpBool cpPolylineIsClosed(cpPolyline *line);
17 
22 CP_EXPORT cpPolyline *cpPolylineSimplifyCurves(cpPolyline *line, cpFloat tol);
23 
28 CP_EXPORT cpPolyline *cpPolylineSimplifyVertexes(cpPolyline *line, cpFloat tol);
29 
31 CP_EXPORT cpPolyline *cpPolylineToConvexHull(cpPolyline *line, cpFloat tol);
32 
33 
35 typedef struct cpPolylineSet {
36  int count, capacity;
37  cpPolyline **lines;
39 
41 CP_EXPORT cpPolylineSet *cpPolylineSetAlloc(void);
42 
44 CP_EXPORT cpPolylineSet *cpPolylineSetInit(cpPolylineSet *set);
45 
47 CP_EXPORT cpPolylineSet *cpPolylineSetNew(void);
48 
50 CP_EXPORT void cpPolylineSetDestroy(cpPolylineSet *set, cpBool freePolylines);
51 
52 CP_EXPORT
53 void cpPolylineSetFree(cpPolylineSet *set, cpBool freePolylines);
54 
60 CP_EXPORT void cpPolylineSetCollectSegment(cpVect v0, cpVect v1, cpPolylineSet *lines);
61 
68 CP_EXPORT cpPolylineSet *cpPolylineConvexDecomposition(cpPolyline *line, cpFloat tol);
69 
70 #define cpPolylineConvexDecomposition_BETA cpPolylineConvexDecomposition