| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#import "ObjectiveChipmunk/ObjectiveChipmunk.h" |
| 5 |
#import "ChipmunkAutoGeometry.h" |
| 6 |
|
| 7 |
|
| 8 |
@class ChipmunkCachedTile; |
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 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 |
|
| 32 |
|
| 33 |
|
| 34 |
@property(nonatomic, assign) bool marchHard; |
| 35 |
|
| 36 |
|
| 37 |
@property(nonatomic, assign) cpVect tileOffset; |
| 38 |
|
| 39 |
|
| 40 |
@property(nonatomic, readonly) ChipmunkAbstractSampler *sampler; |
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
-(id)initWithSampler:(ChipmunkAbstractSampler *)sampler space:(ChipmunkSpace *)space tileSize:(cpFloat)tileSize samplesPerTile:(NSUInteger)samplesPerTile cacheSize:(NSUInteger)cacheSize; |
| 45 |
|
| 46 |
|
| 47 |
-(void)resetCache; |
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
-(void)markDirtyRect:(cpBB)bounds; |
| 52 |
|
| 53 |
|
| 54 |
-(void)ensureRect:(cpBB)bounds; |
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
-(cpPolyline *)simplify:(cpPolyline *)polyline; |
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
-(ChipmunkSegmentShape *)makeSegmentFor:(ChipmunkBody *)staticBody from:(cpVect)a to:(cpVect)b; |
| 63 |
|
| 64 |
@end |
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
@interface ChipmunkBasicTileCache : ChipmunkAbstractTileCache { |
| 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 |
|
| 82 |
|
| 83 |
@property(nonatomic, assign) cpFloat simplifyThreshold; |
| 84 |
|
| 85 |
|
| 86 |
@property(nonatomic, assign) cpFloat segmentRadius; |
| 87 |
|
| 88 |
|
| 89 |
@property(nonatomic, assign) cpFloat segmentFriction; |
| 90 |
|
| 91 |
|
| 92 |
@property(nonatomic, assign) cpFloat segmentElasticity; |
| 93 |
|
| 94 |
|
| 95 |
@property(nonatomic, assign) cpShapeFilter segmentFilter; |
| 96 |
|
| 97 |
|
| 98 |
@property(nonatomic, assign) cpCollisionType segmentCollisionType; |
| 99 |
|
| 100 |
@end |