I've had chipmunk and SpaceManger running with cocos2d in my iPhone App.
I've just upgraded to the latest version of cocos, chipmunk v5.0 and spacemanager and I'm trying to get the same effect as I had in my original game.
The game uses a stretchy rope made up of a series of springJoints for eg.
Code: Select all
for(i=1; i<p4Count; i++) {
origin = cpvadd(origin, p4Offset);
shape4 = [smgr addCircleAt:origin mass:5.0f radius:1.0f];
springJoint = [smgr addSpringToBody:shape3->body fromBody:shape4->body
toBodyAnchor:cpvzero fromBodyAnchor:cpvzero restLength:2.0f stiffness:6000.0f * 4 damping:40.0f * 4 * ropeFlex];
springJN = [cpConstraintNode nodeWithConstraint:springJoint];
springJN.color = ccBLACK;
springJN.lineWidth = 1.5f;
[cameraNode addChild:springJN z:3];
shape3 = shape4;
}
If I need slideJoints can they be made to react the same way as the springJoints? How do I work out based on the above stiffness and damping what min and max lengths I should use.
Any help would be greatly appreciated.
Thanks,
Travis