SpaceManager Class Reference
| Inherits from | NSObject |
| Declared in | SpaceManager.h SpaceManager.mm |
Overview
The SpaceManager
Space Manager
SpaceManager.m
Manage the space for the application
http://www.mobile-bros.com
Created by Robert Blackwood on 02/22/2009.
Copyright 2009 Mobile Bros. All rights reserved.
Tasks
Other Methods
-
spaceThe actual chipmunk space
property -
leftWallThe segment shapes that form the bounds of the window
property -
stepsNumber of steps (across dt) perform on each step call
property -
lastDtThe dt value that was used in step last
property -
gravityThe gravity of the space
property -
dampingThe damping of the space (viscousity in “air”)
property -
rehashStaticEveryStepIf this is set to YES/TRUE then step will call rehashStatic before stepping
property -
iterateFuncSet the iterateFunc; the function that will use “eachFunc” to sync chipmunk values
property -
eachFuncSet the iterateFunc; the default will update cocosnodes for pos and rotation
property -
staticBodyA staticBody for any particular reusable purpose
property -
isSpaceLockedWhether or not this space is internally locked
property -
constantDtIf this is set to anything other than zero, the step routine will use its value as the dt (constant)
property -
cleanupBodyDependenciesSetting this to YES/TRUE will also free contraints connected to a free’d shape
property -
constraintCleanupDelegateThis will be called from all methods that auto-free constraints dependent on bodies being freed
property -
+ spaceManagerDefault creation method
-
+ spaceManagerWithSize:count:Creation method
-
+ spaceManagerWithSpace: -
– initWithSize:count:Initialization method
-
– initWithSpace: -
– loadSpaceFromUserDocs:delegate:load a cpSerializer file from a user docs file, delegate can be nil
-
– saveSpaceToUserDocs:delegate:save a cpSerializer file to a user docs file, delegate can be nil
-
– loadSpaceFromPath:delegate:load a cpSerializer file from a file (path), delegate can be nil
-
– saveSpaceToPath:delegate:save a cpSerializer file to a resource file (path), delegate can be nil
-
– loadedShapeForId:after a load from a file, use this to retrieve a shape from it’s id in the file
-
– loadedBodyForId:after a load from a file, use this to retrieve a shape from it’s id in the file
-
– addWindowContainmentWithFriction:elasticity:size:inset:radius: -
– addWindowContainmentWithFriction:elasticity:rect:inset:radius: -
– step:Manually advance time within the space
-
– addCircleAt:mass:radius:add a circle shape
-
– addCircleToBody:radius:add a circle shape to existing body
-
– addCircleToBody:radius:offset:add a circle shape to existing body, with offset
-
– addRectAt:mass:width:height:rotation:add a rectangle shape
-
– addRectToBody:width:height:rotation:add a rectangle shape to existing body
-
– addRectToBody:width:height:rotation:offset:add a rectangle shape to existing body, with offset
-
– addPolyAt:mass:rotation:numPoints:points:add a polygon shape, convenience method
-
– addPolyAt:mass:rotation:points:add a polygon shape
-
– addPolyAt:mass:rotation:numPoints:pointsArray:add a polygon shape
-
– addPolyToBody:rotation:points:add a polygon shape to existing body
-
– addPolyToBody:rotation:points:offset:add a polygon shape to existing body, with offset
-
– addPolyToBody:rotation:numPoints:pointsArray:Alternative, add a polygon shape to existing body
-
– addPolyToBody:rotation:numPoints:pointsArray:offset:Alternative, add a polygon shape to existing body, with offset
-
– addSegmentAtWorldAnchor:toWorldAnchor:mass:radius: -
– addSegmentAt:fromLocalAnchor:toLocalAnchor:mass:radius: -
– addSegmentToBody:fromLocalAnchor:toLocalAnchor:radius: -
– getShapeAt:layers:group:Retrieve the first shape found at this position matching layers and group
-
– getShapeAt:Retrieve the first shape found at this position
-
– rehashActiveShapesUse if you need to call getShapes before you’ve actually started simulating
-
– rehashStaticShapesUse if you move static shapes during simulation
-
– rehashShape:Use to only rehash one shape
-
– getShapesAt:layers:group:Given a point, return an array of NSValues with a pointer to a cpShape
-
– getShapesAt:getShapesAt:layers:group:
-
– getShapesAt:radius:layers:group:Given a point and a radius, return an array of NSValues with a pointer to a cpShape
-
– getShapesAt:radius:getShapesAt:radius:layers:group:
-
– getShapesOnBody:Get shapes that are using this body
-
– getShapeFromRayCastSegment:end:layers:group:Return first shape hit by the given raycast
-
– getShapeFromRayCastSegment:end:see getShapeFromRayCastSegment:end:layers:group:
-
– getInfoFromRayCastSegment:end:layers:group:Return the info on the first shape hit by the given raycast
-
– getInfoFromRayCastSegment:end:see getInfoFromRayCastSegment:end:layers:group:
-
– getShapesFromRayCastSegment:end:layers:group:Return an array of NSValues with a pointer to a cpShape that intersects the raycast
-
– getShapesFromRayCastSegment:end:see getShapesFromRayCastSegment:end:layers:group:
-
– getInfosFromRayCastSegment:end:layers:group:Return an array of NSValues with a pointer to a cpSegmentQueryInfo, this array will clean up the infos when released
-
– getInfosFromRayCastSegment:end:see getInfosFromRayCastSegment:end:layers:group:
-
– applyLinearExplosionAt:radius:maxForce:Explosion, applied linear force to objects within radius
-
– applyLinearExplosionAt:radius:maxForce:layers:group:Explosion, applied linear force to objects within radius given a group and layer(s)
-
– isPersistentContactOnShape:contactShape:Queries the space as to whether these two shapes are in persistent contact
-
– persistentContactInfoOnShape:Queries the space as to whether this shape has a persistent contact, returns the first arbiter info
-
– persistentContactInfosOnShape:Queries the space as to whether this shape has a persistent contact, returns the all arbiters
-
– persistentContactOnShape:Queries the space as to whether this shape has ANY persistent contact, It will return the first shape it finds or NULL if nothing is found
-
– getConstraintsWill return an array of NSValues that point to the cpConstraints
-
– getConstraintsOnBody:Will return an array of NSValues that point to the cpConstraints on given body
-
– removeAndFreeShape:Use when removing & freeing a shape AND it’s body if the body is not used by other shapes
-
– removeShape:Use when removing a shape, will pass ownership to caller
-
– addShape:Manually add a shape to the space
-
– removeAndFreeBody:Use when removing & freeing a body
-
– removeBody:Use when removing a body, will pass ownership to caller
-
– addBody:Manually add a body to the space
-
– isBodyShared:Check is body belongs to more than one shape
-
– shapesOnBody:Count shapes on body
-
– morphShapeToStatic:This will force a shape into a static shape
-
– morphShapeToActive:mass:This will force a shape active and give it the given mass
-
– morphShapeToKinematic:This will force a shape to be kinematic (body will not simulate)
-
– fragmentShape:piecesNum:eachMass:This will take a shape (any) and split it into the number of pieces you specify,
-
– fragmentRect:rowPiecesNum:colPiecesNum:eachMass:This will take a rect and split it into the number of pieces (Rows x Cols) you specify,
-
– fragmentCircle:piecesNum:eachMass:This will take a circle and split it into the number of pieces you specify,
-
– fragmentSegment:piecesNum:eachMass:This will take a segment and split it into the number of pieces you specify,
-
– combineShapes:Combine two shapes together by combining their bodies into one
-
– offsetShape:offset:Offset shape from body using (circle:center, segment:endpoints, poly:vertices)
-
– ignoreCollisionBetweenType:otherType:Unique Collision: will ignore the effects a collsion between types
-
– addCollisionCallbackBetweenType:otherType:target:selector:Register a collision callback between types
-
– addCollisionCallbackBetweenType:otherType:target:selector:moments:Register a collision callback between types for the given collision moments
-
– removeCollisionCallbackBetweenType:otherType:Unregister a collision callback between types
-
– addConstraint:Use when adding created constraints
-
– removeConstraint:Use when removing constraints, ownership is given to caller
-
– removeAndFreeConstraint:This will remove and free the constraint
-
– removeAndFreeConstraintsOnBody:This will calculate all constraints on a body and remove & free them
-
– addSpringToBody:fromBody:toBodyAnchor:fromBodyAnchor:restLength:stiffness:damping:Add a spring to two bodies at the body anchor points
-
– addSpringToBody:fromBody:restLength:stiffness:damping:Add a spring to two bodies at the body anchor points
-
– addSpringToBody:fromBody:stiffness:Add a spring to two bodies at the body anchor points
-
– addGrooveToBody:fromBody:grooveAnchor1:grooveAnchor2:fromBodyAnchor:Add a groove (aka sliding pin) between two bodies
-
– addGrooveToBody:fromBody:grooveLength:isHorizontal:fromBodyAnchor:Add a groove (aka sliding pin) between two bodies
-
– addGrooveToBody:fromBody:grooveLength:isHorizontal:Add a groove (aka sliding pin) between two bodies
-
– addSlideToBody:fromBody:toBodyAnchor:fromBodyAnchor:minLength:maxLength:Add a sliding joint between two bodies
-
– addSlideToBody:fromBody:toBodyAnchor:fromBodyAnchor:minLength:Add a sliding joint between two bodies, calculating max length
-
– addSlideToBody:fromBody:minLength:maxLength:Add a sliding joint between two bodies
-
– addPinToBody:fromBody:toBodyAnchor:fromBodyAnchor:Create a pin (rod) between two bodies
-
– addPinToBody:fromBody:Create a pin (rod) between two bodies
-
– addPivotToBody:fromBody:toBodyAnchor:fromBodyAnchor:Add a shared point between two bodies that they may rotate around
-
– addPivotToBody:fromBody:worldAnchor:Add a shared point between two bodies that they may rotate around
-
– addPivotToBody:fromBody:Add a shared point between two bodies that they may rotate around
-
– addMotorToBody:fromBody:rate:Add a motor that applys torque to a specified body(s)
-
– addMotorToBody:rate:Add a motor that applys torque to a specified body(s)
-
– addGearToBody:fromBody:phase:ratio:Add gears between two bodies
-
– addGearToBody:fromBody:ratio:Add gears between two bodies
-
– addBreakableToConstraint:maxForce:This does not work yet
-
– addRotaryLimitToBody:fromBody:min:max:Specify a min and a max a body can rotate relative to another body
-
– addRotaryLimitToBody:min:max:Specify a min and a max a body can rotate
-
– addRatchetToBody:fromBody:phase:rachet:Add a ratchet between two bodies
-
– addRatchetToBody:phase:rachet:Add a ratchet to a body
-
– addRotarySpringToBody:fromBody:restAngle:stiffness:damping:Add a rotary spring between two bodies
-
– addRotarySpringToBody:restAngle:stiffness:damping:Add a rotary spring to a body
-
– addPulleyToBody:fromBody:pulleyBody:toBodyAnchor:fromBodyAnchor:toPulleyAnchor:fromPulleyAnchor:ratio:Add a pulley between two bodies and another body which is the actual pulley
-
– addPulleyToBody:fromBody:toBodyAnchor:fromBodyAnchor:toPulleyWorldAnchor:fromPulleyWorldAnchor:ratio:Add a pulley between two bodies
Other Methods
Properties
cleanupBodyDependencies
Setting this to YES/TRUE will also free contraints connected to a free’d shape
@property (readwrite, assign) BOOL cleanupBodyDependenciesDeclared In
SpaceManager.hconstantDt
If this is set to anything other than zero, the step routine will use its value as the dt (constant)
@property (readwrite, assign) cpFloat constantDtDeclared In
SpaceManager.hconstraintCleanupDelegate
This will be called from all methods that auto-free constraints dependent on bodies being freed
@property (readwrite, retain) id<cpConstraintCleanupDelegate> constraintCleanupDelegateDeclared In
SpaceManager.hdamping
The damping of the space (viscousity in “air”)
@property (readwrite, assign) cpFloat dampingDeclared In
SpaceManager.heachFunc
Set the iterateFunc; the default will update cocosnodes for pos and rotation
@property (readwrite, assign) smgrEachFunc eachFuncDeclared In
SpaceManager.hgravity
The gravity of the space
@property (readwrite, assign) cpVect gravityDeclared In
SpaceManager.hisSpaceLocked
Whether or not this space is internally locked
@property (readonly) BOOL isSpaceLockedDeclared In
SpaceManager.hiterateFunc
Set the iterateFunc; the function that will use “eachFunc” to sync chipmunk values
@property (readwrite, assign) smgrIterateFunc iterateFuncDeclared In
SpaceManager.hlastDt
The dt value that was used in step last
@property (readonly) cpFloat lastDtDeclared In
SpaceManager.hleftWall
The segment shapes that form the bounds of the window
@property (readwrite, assign) cpShape *, *, *, *leftWallDeclared In
SpaceManager.hrehashStaticEveryStep
If this is set to YES/TRUE then step will call rehashStatic before stepping
@property (readwrite, assign) BOOL rehashStaticEveryStepDeclared In
SpaceManager.hClass Methods
Instance Methods
addBreakableToConstraint:maxForce:
This does not work yet
- (cpConstraint *)addBreakableToConstraint:(cpConstraint *)breakConstraint maxForce:(cpFloat)maxDeclared In
SpaceManager.haddCircleAt:mass:radius:
add a circle shape
- (cpShape *)addCircleAt:(cpVect)pos mass:(cpFloat)mass radius:(cpFloat)radiusDeclared In
SpaceManager.haddCircleToBody:radius:
add a circle shape to existing body
- (cpShape *)addCircleToBody:(cpBody *)body radius:(cpFloat)radiusDeclared In
SpaceManager.haddCircleToBody:radius:offset:
add a circle shape to existing body, with offset
- (cpShape *)addCircleToBody:(cpBody *)body radius:(cpFloat)radius offset:(CGPoint)offsetDeclared In
SpaceManager.haddCollisionCallbackBetweenType:otherType:target:selector:
Register a collision callback between types
- (void)addCollisionCallbackBetweenType:(unsigned int)type1 otherType:(unsigned int)type2 target:(id)target selector:(SEL)selectorDeclared In
SpaceManager.haddCollisionCallbackBetweenType:otherType:target:selector:moments:
Register a collision callback between types for the given collision moments
- (void)addCollisionCallbackBetweenType:(unsigned int)type1 otherType:(unsigned int)type2 target:(id)target selector:(SEL)selector moments:(CollisionMoment)moment, ...Declared In
SpaceManager.haddConstraint:
Use when adding created constraints
- (void)addConstraint:(cpConstraint *)constraintDeclared In
SpaceManager.haddGearToBody:fromBody:phase:ratio:
Add gears between two bodies
- (cpConstraint *)addGearToBody:(cpBody *)toBody fromBody:(cpBody *)fromBody phase:(cpFloat)phase ratio:(cpFloat)ratioDeclared In
SpaceManager.haddGearToBody:fromBody:ratio:
Add gears between two bodies
- (cpConstraint *)addGearToBody:(cpBody *)toBody fromBody:(cpBody *)fromBody ratio:(cpFloat)ratioDeclared In
SpaceManager.haddGrooveToBody:fromBody:grooveAnchor1:grooveAnchor2:fromBodyAnchor:
Add a groove (aka sliding pin) between two bodies
- (cpConstraint *)addGrooveToBody:(cpBody *)toBody fromBody:(cpBody *)fromBody grooveAnchor1:(cpVect)groove1 grooveAnchor2:(cpVect)groove2 fromBodyAnchor:(cpVect)anchor2Declared In
SpaceManager.haddGrooveToBody:fromBody:grooveLength:isHorizontal:
Add a groove (aka sliding pin) between two bodies
- (cpConstraint *)addGrooveToBody:(cpBody *)toBody fromBody:(cpBody *)fromBody grooveLength:(cpFloat)length isHorizontal:(bool)horizDeclared In
SpaceManager.haddGrooveToBody:fromBody:grooveLength:isHorizontal:fromBodyAnchor:
Add a groove (aka sliding pin) between two bodies
- (cpConstraint *)addGrooveToBody:(cpBody *)toBody fromBody:(cpBody *)fromBody grooveLength:(cpFloat)length isHorizontal:(bool)horiz fromBodyAnchor:(cpVect)anchor2Declared In
SpaceManager.haddMotorToBody:fromBody:rate:
Add a motor that applys torque to a specified body(s)
- (cpConstraint *)addMotorToBody:(cpBody *)toBody fromBody:(cpBody *)fromBody rate:(cpFloat)rateDeclared In
SpaceManager.haddMotorToBody:rate:
Add a motor that applys torque to a specified body(s)
- (cpConstraint *)addMotorToBody:(cpBody *)toBody rate:(cpFloat)rateDeclared In
SpaceManager.haddPinToBody:fromBody:
Create a pin (rod) between two bodies
- (cpConstraint *)addPinToBody:(cpBody *)toBody fromBody:(cpBody *)fromBodyDeclared In
SpaceManager.haddPinToBody:fromBody:toBodyAnchor:fromBodyAnchor:
Create a pin (rod) between two bodies
- (cpConstraint *)addPinToBody:(cpBody *)toBody fromBody:(cpBody *)fromBody toBodyAnchor:(cpVect)anchr1 fromBodyAnchor:(cpVect)anchr2Declared In
SpaceManager.haddPivotToBody:fromBody:
Add a shared point between two bodies that they may rotate around
- (cpConstraint *)addPivotToBody:(cpBody *)toBody fromBody:(cpBody *)fromBodyDeclared In
SpaceManager.haddPivotToBody:fromBody:toBodyAnchor:fromBodyAnchor:
Add a shared point between two bodies that they may rotate around
- (cpConstraint *)addPivotToBody:(cpBody *)toBody fromBody:(cpBody *)fromBody toBodyAnchor:(cpVect)anchr1 fromBodyAnchor:(cpVect)anchr2Declared In
SpaceManager.haddPivotToBody:fromBody:worldAnchor:
Add a shared point between two bodies that they may rotate around
- (cpConstraint *)addPivotToBody:(cpBody *)toBody fromBody:(cpBody *)fromBody worldAnchor:(cpVect)anchrDeclared In
SpaceManager.haddPolyAt:mass:rotation:numPoints:points:
add a polygon shape, convenience method
- (cpShape *)addPolyAt:(cpVect)pos mass:(cpFloat)mass rotation:(cpFloat)r numPoints:(int)numPoints points:(cpVect)pt, ...Declared In
SpaceManager.haddPolyAt:mass:rotation:numPoints:pointsArray:
add a polygon shape
- (cpShape *)addPolyAt:(cpVect)pos mass:(cpFloat)mass rotation:(cpFloat)r numPoints:(int)numPoints pointsArray:(cpVect *)pointsDeclared In
SpaceManager.haddPolyAt:mass:rotation:points:
add a polygon shape
- (cpShape *)addPolyAt:(cpVect)pos mass:(cpFloat)mass rotation:(cpFloat)r points:(NSArray *)pointsDeclared In
SpaceManager.haddPolyToBody:rotation:numPoints:pointsArray:
Alternative, add a polygon shape to existing body
- (cpShape *)addPolyToBody:(cpBody *)body rotation:(cpFloat)r numPoints:(int)numPoints pointsArray:(cpVect *)pointsDeclared In
SpaceManager.haddPolyToBody:rotation:numPoints:pointsArray:offset:
Alternative, add a polygon shape to existing body, with offset
- (cpShape *)addPolyToBody:(cpBody *)body rotation:(cpFloat)r numPoints:(int)numPoints pointsArray:(cpVect *)points offset:(CGPoint)offsetDeclared In
SpaceManager.haddPolyToBody:rotation:points:
add a polygon shape to existing body
- (cpShape *)addPolyToBody:(cpBody *)body rotation:(cpFloat)r points:(NSArray *)pointsDeclared In
SpaceManager.haddPolyToBody:rotation:points:offset:
add a polygon shape to existing body, with offset
- (cpShape *)addPolyToBody:(cpBody *)body rotation:(cpFloat)r points:(NSArray *)points offset:(CGPoint)offsetDeclared In
SpaceManager.haddPulleyToBody:fromBody:pulleyBody:toBodyAnchor:fromBodyAnchor:toPulleyAnchor:fromPulleyAnchor:ratio:
Add a pulley between two bodies and another body which is the actual pulley
- (cpConstraint *)addPulleyToBody:(cpBody *)toBody fromBody:(cpBody *)fromBody pulleyBody:(cpBody *)pulleyBody toBodyAnchor:(cpVect)anchor1 fromBodyAnchor:(cpVect)anchor2 toPulleyAnchor:(cpVect)anchor3a fromPulleyAnchor:(cpVect)anchor3b ratio:(cpFloat)ratioDeclared In
SpaceManager.haddPulleyToBody:fromBody:toBodyAnchor:fromBodyAnchor:toPulleyWorldAnchor:fromPulleyWorldAnchor:ratio:
Add a pulley between two bodies
- (cpConstraint *)addPulleyToBody:(cpBody *)toBody fromBody:(cpBody *)fromBody toBodyAnchor:(cpVect)anchor1 fromBodyAnchor:(cpVect)anchor2 toPulleyWorldAnchor:(cpVect)anchor3a fromPulleyWorldAnchor:(cpVect)anchor3b ratio:(cpFloat)ratioDeclared In
SpaceManager.haddRatchetToBody:fromBody:phase:rachet:
Add a ratchet between two bodies
- (cpConstraint *)addRatchetToBody:(cpBody *)toBody fromBody:(cpBody *)fromBody phase:(cpFloat)phase rachet:(cpFloat)ratchetDeclared In
SpaceManager.haddRatchetToBody:phase:rachet:
Add a ratchet to a body
- (cpConstraint *)addRatchetToBody:(cpBody *)toBody phase:(cpFloat)phase rachet:(cpFloat)ratchetDeclared In
SpaceManager.haddRectAt:mass:width:height:rotation:
add a rectangle shape
- (cpShape *)addRectAt:(cpVect)pos mass:(cpFloat)mass width:(cpFloat)width height:(cpFloat)height rotation:(cpFloat)rDeclared In
SpaceManager.haddRectToBody:width:height:rotation:
add a rectangle shape to existing body
- (cpShape *)addRectToBody:(cpBody *)body width:(cpFloat)width height:(cpFloat)height rotation:(cpFloat)rDeclared In
SpaceManager.haddRectToBody:width:height:rotation:offset:
add a rectangle shape to existing body, with offset
- (cpShape *)addRectToBody:(cpBody *)body width:(cpFloat)width height:(cpFloat)height rotation:(cpFloat)r offset:(CGPoint)offsetDeclared In
SpaceManager.haddRotaryLimitToBody:fromBody:min:max:
Specify a min and a max a body can rotate relative to another body
- (cpConstraint *)addRotaryLimitToBody:(cpBody *)toBody fromBody:(cpBody *)fromBody min:(cpFloat)min max:(cpFloat)maxDeclared In
SpaceManager.haddRotaryLimitToBody:min:max:
Specify a min and a max a body can rotate
- (cpConstraint *)addRotaryLimitToBody:(cpBody *)toBody min:(cpFloat)min max:(cpFloat)maxDeclared In
SpaceManager.haddRotarySpringToBody:fromBody:restAngle:stiffness:damping:
Add a rotary spring between two bodies
- (cpConstraint *)addRotarySpringToBody:(cpBody *)toBody fromBody:(cpBody *)fromBody restAngle:(cpFloat)restAngle stiffness:(cpFloat)stiff damping:(cpFloat)dampDeclared In
SpaceManager.haddRotarySpringToBody:restAngle:stiffness:damping:
Add a rotary spring to a body
- (cpConstraint *)addRotarySpringToBody:(cpBody *)toBody restAngle:(cpFloat)restAngle stiffness:(cpFloat)stiff damping:(cpFloat)dampDeclared In
SpaceManager.haddShape:
Manually add a shape to the space
- (void)addShape:(cpShape *)shapeDeclared In
SpaceManager.haddSlideToBody:fromBody:minLength:maxLength:
Add a sliding joint between two bodies
- (cpConstraint *)addSlideToBody:(cpBody *)toBody fromBody:(cpBody *)fromBody minLength:(cpFloat)min maxLength:(cpFloat)maxDeclared In
SpaceManager.haddSlideToBody:fromBody:toBodyAnchor:fromBodyAnchor:minLength:
Add a sliding joint between two bodies, calculating max length
- (cpConstraint *)addSlideToBody:(cpBody *)toBody fromBody:(cpBody *)fromBody toBodyAnchor:(cpVect)anchr1 fromBodyAnchor:(cpVect)anchr2 minLength:(cpFloat)minDeclared In
SpaceManager.haddSlideToBody:fromBody:toBodyAnchor:fromBodyAnchor:minLength:maxLength:
Add a sliding joint between two bodies
- (cpConstraint *)addSlideToBody:(cpBody *)toBody fromBody:(cpBody *)fromBody toBodyAnchor:(cpVect)anchr1 fromBodyAnchor:(cpVect)anchr2 minLength:(cpFloat)min maxLength:(cpFloat)maxDeclared In
SpaceManager.haddSpringToBody:fromBody:restLength:stiffness:damping:
Add a spring to two bodies at the body anchor points
- (cpConstraint *)addSpringToBody:(cpBody *)toBody fromBody:(cpBody *)fromBody restLength:(cpFloat)rest stiffness:(cpFloat)stiff damping:(cpFloat)dampDeclared In
SpaceManager.haddSpringToBody:fromBody:stiffness:
Add a spring to two bodies at the body anchor points
- (cpConstraint *)addSpringToBody:(cpBody *)toBody fromBody:(cpBody *)fromBody stiffness:(cpFloat)stiffDeclared In
SpaceManager.haddSpringToBody:fromBody:toBodyAnchor:fromBodyAnchor:restLength:stiffness:damping:
Add a spring to two bodies at the body anchor points
- (cpConstraint *)addSpringToBody:(cpBody *)toBody fromBody:(cpBody *)fromBody toBodyAnchor:(cpVect)anchr1 fromBodyAnchor:(cpVect)anchr2 restLength:(cpFloat)rest stiffness:(cpFloat)stiff damping:(cpFloat)dampDeclared In
SpaceManager.happlyLinearExplosionAt:radius:maxForce:
Explosion, applied linear force to objects within radius
- (void)applyLinearExplosionAt:(cpVect)at radius:(cpFloat)radius maxForce:(cpFloat)maxForceDeclared In
SpaceManager.happlyLinearExplosionAt:radius:maxForce:layers:group:
Explosion, applied linear force to objects within radius given a group and layer(s)
- (void)applyLinearExplosionAt:(cpVect)at radius:(cpFloat)radius maxForce:(cpFloat)maxForce layers:(cpLayers)layers group:(cpGroup)groupDeclared In
SpaceManager.hcombineShapes:
Combine two shapes together by combining their bodies into one
- (void)combineShapes:(cpShape *)shape, ...Declared In
SpaceManager.hfragmentCircle:piecesNum:eachMass:
This will take a circle and split it into the number of pieces you specify,
- (NSArray *)fragmentCircle:(cpCircleShape *)circle piecesNum:(int)pieces eachMass:(float)massReturn Value
An NSArray of NSValues with cpShape* as the value (the fragments) or nil if failed
Declared In
SpaceManager.hfragmentRect:rowPiecesNum:colPiecesNum:eachMass:
This will take a rect and split it into the number of pieces (Rows x Cols) you specify,
- (NSArray *)fragmentRect:(cpPolyShape *)poly rowPiecesNum:(int)rows colPiecesNum:(int)cols eachMass:(float)massReturn Value
An NSArray of NSValues with cpShape* as the value (the fragments) or nil if failed
Declared In
SpaceManager.hfragmentSegment:piecesNum:eachMass:
This will take a segment and split it into the number of pieces you specify,
- (NSArray *)fragmentSegment:(cpSegmentShape *)segment piecesNum:(int)pieces eachMass:(float)massReturn Value
An NSArray of NSValues with cpShape* as the value (the fragments) or nil if failed
Declared In
SpaceManager.hfragmentShape:piecesNum:eachMass:
This will take a shape (any) and split it into the number of pieces you specify,
- (NSArray *)fragmentShape:(cpShape *)shape piecesNum:(int)pieces eachMass:(float)massReturn Value
An NSArray of NSValues with cpShape* as the value (the fragments) or nil if failed
Declared In
SpaceManager.hgetConstraints
Will return an array of NSValues that point to the cpConstraints
- (NSArray *)getConstraintsDeclared In
SpaceManager.hgetConstraintsOnBody:
Will return an array of NSValues that point to the cpConstraints on given body
- (NSArray *)getConstraintsOnBody:(cpBody *)bodyDeclared In
SpaceManager.hgetInfoFromRayCastSegment:end:
see getInfoFromRayCastSegment:end:layers:group:
- (cpSegmentQueryInfo)getInfoFromRayCastSegment:(cpVect)start end:(cpVect)endDeclared In
SpaceManager.hgetInfoFromRayCastSegment:end:layers:group:
Return the info on the first shape hit by the given raycast
- (cpSegmentQueryInfo)getInfoFromRayCastSegment:(cpVect)start end:(cpVect)end layers:(cpLayers)layers group:(cpGroup)groupDeclared In
SpaceManager.hgetInfosFromRayCastSegment:end:
see getInfosFromRayCastSegment:end:layers:group:
- (NSArray *)getInfosFromRayCastSegment:(cpVect)start end:(cpVect)endDeclared In
SpaceManager.hgetInfosFromRayCastSegment:end:layers:group:
Return an array of NSValues with a pointer to a cpSegmentQueryInfo, this array will clean up the infos when released
- (NSArray *)getInfosFromRayCastSegment:(cpVect)start end:(cpVect)end layers:(cpLayers)layers group:(cpGroup)groupDeclared In
SpaceManager.hgetShapeAt:
Retrieve the first shape found at this position
- (cpShape *)getShapeAt:(cpVect)posDeclared In
SpaceManager.hgetShapeAt:layers:group:
Retrieve the first shape found at this position matching layers and group
- (cpShape *)getShapeAt:(cpVect)pos layers:(cpLayers)layers group:(cpLayers)groupDeclared In
SpaceManager.hgetShapeFromRayCastSegment:end:
see getShapeFromRayCastSegment:end:layers:group:
- (cpShape *)getShapeFromRayCastSegment:(cpVect)start end:(cpVect)endDeclared In
SpaceManager.hgetShapeFromRayCastSegment:end:layers:group:
Return first shape hit by the given raycast
- (cpShape *)getShapeFromRayCastSegment:(cpVect)start end:(cpVect)end layers:(cpLayers)layers group:(cpGroup)groupDeclared In
SpaceManager.hgetShapesAt:
getShapesAt:layers:group:
- (NSArray *)getShapesAt:(cpVect)posSee Also
Declared In
SpaceManager.hgetShapesAt:layers:group:
Given a point, return an array of NSValues with a pointer to a cpShape
- (NSArray *)getShapesAt:(cpVect)pos layers:(cpLayers)layers group:(cpLayers)groupDeclared In
SpaceManager.hgetShapesAt:radius:
getShapesAt:radius:layers:group:
- (NSArray *)getShapesAt:(cpVect)pos radius:(float)radiusSee Also
Declared In
SpaceManager.hgetShapesAt:radius:layers:group:
Given a point and a radius, return an array of NSValues with a pointer to a cpShape
- (NSArray *)getShapesAt:(cpVect)pos radius:(float)radius layers:(cpLayers)layers group:(cpLayers)groupDeclared In
SpaceManager.hgetShapesFromRayCastSegment:end:
see getShapesFromRayCastSegment:end:layers:group:
- (NSArray *)getShapesFromRayCastSegment:(cpVect)start end:(cpVect)endDeclared In
SpaceManager.hgetShapesFromRayCastSegment:end:layers:group:
Return an array of NSValues with a pointer to a cpShape that intersects the raycast
- (NSArray *)getShapesFromRayCastSegment:(cpVect)start end:(cpVect)end layers:(cpLayers)layers group:(cpGroup)groupDeclared In
SpaceManager.hgetShapesOnBody:
Get shapes that are using this body
- (NSArray *)getShapesOnBody:(cpBody *)bodyDeclared In
SpaceManager.hignoreCollisionBetweenType:otherType:
Unique Collision: will ignore the effects a collsion between types
- (void)ignoreCollisionBetweenType:(unsigned int)type1 otherType:(unsigned int)type2Declared In
SpaceManager.hinitWithSize:count:
Initialization method
- (id)initWithSize:(int)size count:(int)countParameters
- size
The average size of shapes in space
- count
The expected number of shapes in a space (larger is better)
Declared In
SpaceManager.hisBodyShared:
Check is body belongs to more than one shape
- (BOOL)isBodyShared:(cpBody *)bodyDeclared In
SpaceManager.hisPersistentContactOnShape:contactShape:
Queries the space as to whether these two shapes are in persistent contact
- (BOOL)isPersistentContactOnShape:(cpShape *)shape contactShape:(cpShape *)shape2Declared In
SpaceManager.hloadSpaceFromPath:delegate:
load a cpSerializer file from a file (path), delegate can be nil
- (BOOL)loadSpaceFromPath:(NSString *)path delegate:(NSObject<SpaceManagerSerializeDelegate> *)delegateDeclared In
SpaceManager.hloadSpaceFromUserDocs:delegate:
load a cpSerializer file from a user docs file, delegate can be nil
- (BOOL)loadSpaceFromUserDocs:(NSString *)file delegate:(NSObject<SpaceManagerSerializeDelegate> *)delegateDeclared In
SpaceManager.hloadedBodyForId:
after a load from a file, use this to retrieve a shape from it’s id in the file
- (cpBody *)loadedBodyForId:(UInt64)bodyIdDeclared In
SpaceManager.hloadedShapeForId:
after a load from a file, use this to retrieve a shape from it’s id in the file
- (cpShape *)loadedShapeForId:(UInt64)shapeIdDeclared In
SpaceManager.hmorphShapeToActive:mass:
This will force a shape active and give it the given mass
- (cpShape *)morphShapeToActive:(cpShape *)shape mass:(cpFloat)massDeclared In
SpaceManager.hmorphShapeToKinematic:
This will force a shape to be kinematic (body will not simulate)
- (cpShape *)morphShapeToKinematic:(cpShape *)shapeDeclared In
SpaceManager.hmorphShapeToStatic:
This will force a shape into a static shape
- (cpShape *)morphShapeToStatic:(cpShape *)shapeDeclared In
SpaceManager.hoffsetShape:offset:
Offset shape from body using (circle:center, segment:endpoints, poly:vertices)
- (void)offsetShape:(cpShape *)shape offset:(cpVect)offsetDeclared In
SpaceManager.hpersistentContactInfoOnShape:
Queries the space as to whether this shape has a persistent contact, returns the first arbiter info
- (cpArbiter *)persistentContactInfoOnShape:(cpShape *)shapeDeclared In
SpaceManager.hpersistentContactInfosOnShape:
Queries the space as to whether this shape has a persistent contact, returns the all arbiters
- (NSArray *)persistentContactInfosOnShape:(cpShape *)shapeDeclared In
SpaceManager.hpersistentContactOnShape:
Queries the space as to whether this shape has ANY persistent contact, It will return the first shape it finds or NULL if nothing is found
- (cpShape *)persistentContactOnShape:(cpShape *)shapeDeclared In
SpaceManager.hrehashActiveShapes
Use if you need to call getShapes before you’ve actually started simulating
- (void)rehashActiveShapesDeclared In
SpaceManager.hrehashShape:
Use to only rehash one shape
- (void)rehashShape:(cpShape *)shapeDeclared In
SpaceManager.hrehashStaticShapes
Use if you move static shapes during simulation
- (void)rehashStaticShapesDeclared In
SpaceManager.hremoveAndFreeBody:
Use when removing & freeing a body
- (void)removeAndFreeBody:(cpBody *)bodyDeclared In
SpaceManager.hremoveAndFreeConstraint:
This will remove and free the constraint
- (void)removeAndFreeConstraint:(cpConstraint *)constraintDeclared In
SpaceManager.hremoveAndFreeConstraintsOnBody:
This will calculate all constraints on a body and remove & free them
- (void)removeAndFreeConstraintsOnBody:(cpBody *)bodyDeclared In
SpaceManager.hremoveAndFreeShape:
Use when removing & freeing a shape AND it’s body if the body is not used by other shapes
- (void)removeAndFreeShape:(cpShape *)shapeDeclared In
SpaceManager.hremoveBody:
Use when removing a body, will pass ownership to caller
- (void)removeBody:(cpBody *)bodyDeclared In
SpaceManager.hremoveCollisionCallbackBetweenType:otherType:
Unregister a collision callback between types
- (void)removeCollisionCallbackBetweenType:(unsigned int)type1 otherType:(unsigned int)type2Declared In
SpaceManager.hremoveConstraint:
Use when removing constraints, ownership is given to caller
- (cpConstraint *)removeConstraint:(cpConstraint *)constraintDeclared In
SpaceManager.hremoveShape:
Use when removing a shape, will pass ownership to caller
- (cpShape *)removeShape:(cpShape *)shapeDeclared In
SpaceManager.hsaveSpaceToPath:delegate:
save a cpSerializer file to a resource file (path), delegate can be nil
- (BOOL)saveSpaceToPath:(NSString *)path delegate:(NSObject<SpaceManagerSerializeDelegate> *)delegateDeclared In
SpaceManager.h