| 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 | A point cloud sampler allows you to perform deformable terrain like with a bitmap backed sampler, |
| 9 | but without any bounds. It only requires memory for the points you add instead of large RAM chewing bitmap. |
| 10 | However, unlike a bitmap, the deformation can only go one way. (i.e. You can add or remove terrain, but not both). |
| 11 | Without any points, the sampler will return 1.0. Adding points will put "holes" in it causing it to return lower values. |
| 12 | */ |
| 13 | @interface ChipmunkPointCloudSampler : ChipmunkAbstractSampler { |
| 14 | @private |
| 15 | cpFloat _cellSize; |
| 16 | cpSpatialIndex *_index; |
| 17 | } |
| 18 | |
| 19 | /// Initialize the sampler with the given cell size, |
| 20 | /// which should roughly match the size of the points added to the sampler. |
| 21 | - (id)initWithCellSize:(cpFloat)cellSize; |
| 22 | |
| 23 | /// Add a point to the cloud and return the dirty rect for the point. |
| 24 | -(cpBB)addPoint:(cpVect)pos radius:(cpFloat)radius fuzz:(cpFloat)fuzz; |
| 25 | |
| 26 | @end |