Chipmunk2D Pro API Reference  7.0.1
 All Classes Functions Variables Typedefs Enumerations Enumerator Properties Groups Pages
ChipmunkTileCache.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 #import "ChipmunkAutoGeometry.h"
6 
7 
8 @class ChipmunkCachedTile;
9 
13 @interface ChipmunkAbstractTileCache : NSObject {
14 @private
15  ChipmunkAbstractSampler *_sampler;
16  ChipmunkSpace *_space;
17 
18  cpFloat _tileSize;
19  cpFloat _samplesPerTile;
20  cpVect _tileOffset;
21 
22  NSUInteger _tileCount, _cacheSize;
23  cpSpatialIndex *_tileIndex;
24  ChipmunkCachedTile *_cacheHead, *_cacheTail;
25 
26  cpBB _ensuredBB;
27  bool _ensuredDirty;
28 
29  bool _marchHard;
30 }
31 
34 @property(nonatomic, assign) bool marchHard;
35 
37 @property(nonatomic, assign) cpVect tileOffset;
38 
40 @property(nonatomic, readonly) ChipmunkAbstractSampler *sampler;
41 
44 -(id)initWithSampler:(ChipmunkAbstractSampler *)sampler space:(ChipmunkSpace *)space tileSize:(cpFloat)tileSize samplesPerTile:(NSUInteger)samplesPerTile cacheSize:(NSUInteger)cacheSize;
45 
47 -(void)resetCache;
48 
51 -(void)markDirtyRect:(cpBB)bounds;
52 
54 -(void)ensureRect:(cpBB)bounds;
55 
58 -(cpPolyline *)simplify:(cpPolyline *)polyline;
59 
62 -(ChipmunkSegmentShape *)makeSegmentFor:(ChipmunkBody *)staticBody from:(cpVect)a to:(cpVect)b;
63 
64 @end
65 
66 
69 @private
70  cpFloat _simplifyThreshold;
71 
72  cpFloat _segmentRadius;
73 
74  cpFloat _segmentFriction;
75  cpFloat _segmentElasticity;
76 
77  cpShapeFilter _segmentFilter;
78 
79  cpCollisionType _segmentCollisionType;
80 }
81 
83 @property(nonatomic, assign) cpFloat simplifyThreshold;
84 
86 @property(nonatomic, assign) cpFloat segmentRadius;
87 
89 @property(nonatomic, assign) cpFloat segmentFriction;
90 
92 @property(nonatomic, assign) cpFloat segmentElasticity;
93 
95 @property(nonatomic, assign) cpShapeFilter segmentFilter;
96 
98 @property(nonatomic, assign) cpCollisionType segmentCollisionType;
99 
100 @end