Chipmunk2D Pro API Reference  7.0.1
 All Classes Functions Variables Typedefs Enumerations Enumerator Properties Groups Pages
Properties | List of all members
ChipmunkHastySpace Class Reference

ChipmunkHastySpace is an Objective-Chipmunk wrapper for cpHastySpace. More...

#import <ChipmunkSpace.h>

Inherits ChipmunkSpace.

Properties

NSUInteger threads
 Number of threads to use for the solver. More...
 
- Properties inherited from ChipmunkSpace
int iterations
 The iteration count is how many solver passes the space should use when solving collisions and joints (default is 10). More...
 
cpVect gravity
 Global gravity value to use for all rigid bodies in this space (default value is cpvzero).
 
cpFloat damping
 Global viscous damping value to use for all rigid bodies in this space (default value is 1.0 which disables damping). More...
 
cpFloat idleSpeedThreshold
 If a body is moving slower than this speed, it is considered idle. The default value is 0, which signals that the space should guess a good value based on the current gravity.
 
cpFloat sleepTimeThreshold
 Elapsed time before a group of idle bodies is put to sleep (defaults to infinity which disables sleeping). More...
 
cpFloat collisionSlop
 Amount of encouraged penetration between colliding shapes. More...
 
cpFloat collisionBias
 Determines how fast overlapping shapes are pushed apart. More...
 
cpTimestamp collisionPersistence
 Number of frames that contact information should persist. More...
 
cpSpacespace
 Returns a pointer to the underlying cpSpace C struct.
 
ChipmunkBodystaticBody
 The space's designated static body. More...
 
cpFloat currentTimeStep
 Retrieves the current (if you are in a callback from [ChipmunkSpace step:]) or most recent (outside of a [ChipmunkSpace step:] call) timestep.
 
BOOL locked
 Returns true if the space is currently executing a timestep.
 
id userData
 An object that this space is associated with. More...
 

Additional Inherited Members

- Public Types inherited from ChipmunkSpace
typedef void(^ ChipmunkPostStepBlock )(void)
 Block type used with [ChipmunkSpace addPostStepBlock:].
 
- Instance Methods inherited from ChipmunkSpace
(void) - setDefaultCollisionHandler:begin:preSolve:postSolve:separate:
 Set the default collision handler. More...
 
(void) - addCollisionHandler:typeA:typeB:begin:preSolve:postSolve:separate:
 Set a collision handler to handle specific collision types. More...
 
(id) - add:
 Add an object to the space. More...
 
(id) - remove:
 Remove an object from the space. More...
 
(BOOL) - contains:
 Check if a space already contains a particular object:
 
(id) - smartAdd:
 If the space is locked and it's unsafe to call add: it will call addPostStepAddition: instead.
 
(id) - smartRemove:
 If the space is locked and it's unsafe to call remove: it will call addPostStepRemoval: instead.
 
(NSArray *) - addBounds:thickness:elasticity:friction:filter:collisionType:
 Handy utility method to add a border of collision segments around a box. More...
 
(BOOL) - addPostStepCallback:selector:key:
 Define a callback to be run just before [ChipmunkSpace step:] finishes. More...
 
(BOOL) - addPostStepBlock:key:
 Same as [ChipmunkSpace addPostStepCallback:] but with a block. The block is copied.
 
(void) - addPostStepAddition:
 Add the Chipmunk Object to the space at the end of the step.
 
(void) - addPostStepRemoval:
 Remove the Chipmunk Object from the space at the end of the step.
 
(NSArray *) - pointQueryAll:maxDistance:filter:
 Return an array of ChipmunkNearestPointQueryInfo objects for shapes within maxDistance of point. More...
 
(ChipmunkPointQueryInfo *) - pointQueryNearest:maxDistance:filter:
 Find the closest shape to a point that is within maxDistance of point. More...
 
(NSArray *) - segmentQueryAllFrom:to:radius:filter:
 Return a NSArray of ChipmunkSegmentQueryInfo objects for all the shapes that overlap the segment. The objects are unsorted.
 
(ChipmunkSegmentQueryInfo *) - segmentQueryFirstFrom:to:radius:filter:
 Returns the first shape that overlaps the given segment. The segment is treated as having the given group and layers.
 
(NSArray *) - bbQueryAll:filter:
 Returns a NSArray of all shapes whose bounding boxes overlap the given bounding box. The box is treated as having the given group and layers.
 
(NSArray *) - shapeQueryAll:
 Returns a NSArray of ChipmunkShapeQueryInfo objects for all the shapes that overlap shape.
 
(BOOL) - shapeTest:
 Returns true if the shape overlaps anything in the space.
 
(NSArray *) - bodies
 Get a copy of the list of all the bodies in the space.
 
(NSArray *) - shapes
 Get a copy of the list of all the shapes in the space.
 
(NSArray *) - constraints
 Get a copy of the list of all the constraints in the space.
 
(void) - reindexStatic
 Update all the static shapes.
 
(void) - reindexShape:
 Update the collision info for a single shape. More...
 
(void) - reindexShapesForBody:
 Update the collision info for all shapes attached to a body.
 
(void) - step:
 Step time forward. While variable timesteps may be used, a constant timestep will allow you to reduce CPU usage by using fewer iterations.
 
- Class Methods inherited from ChipmunkSpace
(ChipmunkSpace *) + spaceFromCPSpace:
 Get the ChipmunkSpace object associciated with a cpSpace pointer. More...
 

Detailed Description

ChipmunkHastySpace is an Objective-Chipmunk wrapper for cpHastySpace.

Subclass this class instead of ChipmunkSpace if you want to enable the cpHastySpace optimizations. If ChipmunkHastySpace is linked correctly, calling [[ChipmunkSpace alloc] init] will actually return a ChipmunkHastySpace.

Property Documentation

- (NSUInteger) threads
readwritenonatomicassign

Number of threads to use for the solver.

Setting 0 will choose the thread count automatically (recommended). There is currently little benefit in using more than 2 threads. Defaults to 1.


The documentation for this class was generated from the following file: