Chipmunk2D Pro API Reference  7.0.1
 All Classes Functions Variables Typedefs Enumerations Enumerator Properties Groups Pages
ChipmunkAutoGeometry.h
1 // Copyright 2013 Howling Moon Software. All rights reserved.
2 // See http://chipmunk2d.net/legal.php for more information.
3 
4 #import "ObjectiveChipmunk/ObjectiveChipmunk.h"
5 
6 #import "chipmunk/cpMarch.h"
7 #import "chipmunk/cpPolyline.h"
8 
10 
12 @interface ChipmunkPolyline : NSObject {
13 @private
14  cpPolyline *_line;
15  cpFloat _area;
16 }
17 
18 -(id)initWithPolyline:(cpPolyline *)line;
19 +(ChipmunkPolyline *)fromPolyline:(cpPolyline *)line;
20 
22 @property(nonatomic, readonly) bool isClosed;
23 
26 @property(nonatomic, readonly) cpFloat area;
27 
30 @property(nonatomic, readonly) cpVect centroid;
31 
33 -(cpFloat)momentForMass:(cpFloat)mass offset:(cpVect)offset;
34 
35 
37 @property(nonatomic, readonly) NSUInteger count;
38 
40 @property(nonatomic, readonly) const cpVect *verts;
41 
46 -(ChipmunkPolyline *)simplifyCurves:(cpFloat)tolerance;
47 
52 -(ChipmunkPolyline *)simplifyVertexes:(cpFloat)tolerance;
53 
55 -(ChipmunkPolyline *)toConvexHull;
56 
58 -(ChipmunkPolyline *)toConvexHull:(cpFloat)tolerance;
59 
62 -(ChipmunkPolylineSet *)toConvexHulls_BETA:(cpFloat)tolerance;
63 
65 -(NSArray *)asChipmunkSegmentsWithBody:(ChipmunkBody *)body radius:(cpFloat)radius offset:(cpVect)offset;
66 
68 -(ChipmunkPolyShape *)asChipmunkPolyShapeWithBody:(ChipmunkBody *)body transform:(cpTransform)transform radius:(cpFloat)radius;
69 
70 @end
71 
72 
74 @interface ChipmunkPolylineSet : NSObject<NSFastEnumeration> {
75 @private
76  NSMutableArray *_lines;
77 }
78 
79 -(id)initWithPolylineSet:(cpPolylineSet *)set;
80 +(ChipmunkPolylineSet *)fromPolylineSet:(cpPolylineSet *)set;
81 
82 @property(nonatomic, readonly) NSUInteger count;
83 
84 -(ChipmunkPolyline *)lineAtIndex:(NSUInteger)index;
85 
86 @end
87 
88 
93 @interface ChipmunkAbstractSampler : NSObject {
94 @protected
95  cpFloat _marchThreshold;
96  cpMarchSampleFunc _sampleFunc;
97 }
98 
101 @property(nonatomic, assign) cpFloat marchThreshold;
102 
104 @property(nonatomic, readonly) cpMarchSampleFunc sampleFunc;
105 
107 -(id)initWithSamplingFunction:(cpMarchSampleFunc)sampleFunc;
108 
110 -(cpFloat)sample:(cpVect)pos;
111 
113 -(ChipmunkPolylineSet *)march:(cpBB)bb xSamples:(NSUInteger)xSamples ySamples:(NSUInteger)ySamples hard:(bool)hard;
114 
115 @end
116 
117 
118 
120 typedef cpFloat (^ChipmunkMarchSampleBlock)(cpVect point);
121 
123  ChipmunkMarchSampleBlock _block;
124 }
125 
127 -(id)initWithBlock:(ChipmunkMarchSampleBlock)block;
128 +(ChipmunkBlockSampler *)samplerWithBlock:(ChipmunkMarchSampleBlock)block;
129 
130 @end
131 
132 
133 
134 #import "ChipmunkImageSampler.h"
135 #import "ChipmunkPointCloudSampler.h"
136 #import "ChipmunkTileCache.h"