Chipmunk2D Pro API Reference
7.0.1
|
A point cloud sampler allows you to perform deformable terrain like with a bitmap backed sampler, but without any bounds. More...
#import <ChipmunkPointCloudSampler.h>
Inherits ChipmunkAbstractSampler.
Instance Methods | |
(id) | - initWithCellSize: |
Initialize the sampler with the given cell size, which should roughly match the size of the points added to the sampler. More... | |
(cpBB) | - addPoint:radius:fuzz: |
Add a point to the cloud and return the dirty rect for the point. | |
Instance Methods inherited from ChipmunkAbstractSampler | |
(id) | - initWithSamplingFunction: |
Designated initializer. | |
(cpFloat) | - sample: |
Sample at a specific point. | |
(ChipmunkPolylineSet *) | - march:xSamples:ySamples:hard: |
March a certain area of the sampler. | |
Additional Inherited Members | |
Properties inherited from ChipmunkAbstractSampler | |
cpFloat | marchThreshold |
The threshold passed to the cpMarch*() functions. More... | |
cpMarchSampleFunc | sampleFunc |
Get the primitive cpMarchSampleFunc used by this sampler. | |
A point cloud sampler allows you to perform deformable terrain like with a bitmap backed sampler, but without any bounds.
It only requires memory for the points you add instead of large RAM chewing bitmap. However, unlike a bitmap, the deformation can only go one way. (i.e. You can add or remove terrain, but not both). Without any points, the sampler will return 1.0. Adding points will put "holes" in it causing it to return lower values.
- (id) initWithCellSize: | (cpFloat) | cellSize |
Initialize the sampler with the given cell size, which should roughly match the size of the points added to the sampler.