Public Member Functions | Properties

ChipmunkAbstractTileCache Class Reference

A tile cache enables an efficient means of updating a large deformable terrain. More...

#import <ChipmunkTileCache.h>

Inherited by ChipmunkBasicTileCache.

List of all members.

Public Member Functions

(id) - initWithSampler:space:tileSize:samplesPerTile:cacheSize:
 Create the cache from the given sampler, space to add the generated segments to, size of the tiles, and the number of samples for each tile.
(void) - resetCache
 Clear out all the cached tiles to force a full regen.
(void) - markDirtyRect:
 Mark a region as needing an update.
(void) - ensureRect:
 Ensure that the given rect has been fully generated and contains no dirty rects.
(cpPolyline- simplify:
 Override this in a subclass to make custom polygon simplification behavior.
(ChipmunkSegmentShape *) - makeSegmentFor:from:to:
 Override this method to construct the segment shapes.

Properties

bool marchHard
 Should the marching be hard or soft? See cpMarchHard() and cpMarchSoft() for more information.
cpVect tileOffset
 Offset of the tile grid origin.
ChipmunkAbstractSamplersampler
 The sampling function to use.

Detailed Description

A tile cache enables an efficient means of updating a large deformable terrain.

General usage would be to pass a rectangle covering the viewport to ensureRect: and calling markDirtyRect: each time a change is made that requires an area to be resampled.


Member Function Documentation

- (id) initWithSampler: (ChipmunkAbstractSampler *)  sampler
space: (ChipmunkSpace *)  space
tileSize: (cpFloat)  tileSize
samplesPerTile: (NSUInteger)  samplesPerTile
cacheSize: (NSUInteger)  cacheSize 

Create the cache from the given sampler, space to add the generated segments to, size of the tiles, and the number of samples for each tile.

- (ChipmunkSegmentShape *) makeSegmentFor: (ChipmunkBody *)  staticBody
from: (cpVect a
to: (cpVect b 

Override this method to construct the segment shapes.

By default, it creates a 0 radius segment and sets 1.0 for friction and elasticity and nothing else.

- (void) markDirtyRect: (cpBB bounds  

Mark a region as needing an update.

Geometry is not regenerated until ensureRect: is called.

- (cpPolyline) simplify: (cpPolyline polyline  

Override this in a subclass to make custom polygon simplification behavior.

Defaults to cpPolylineSimplifyCurves(polyline, 2.0f)


Property Documentation

- (bool) marchHard [read, write, assign]

Should the marching be hard or soft? See cpMarchHard() and cpMarchSoft() for more information.


The documentation for this class was generated from the following file:
 All Classes Functions Variables Properties