Hey all,
just thought I'd share a small set of classes to draw a Verlet rope that people might find useful.
I created it to use in conjunction with box2d's new b2RopeJoint (which constricts two bodies with a "rope" joint, but obviously has no visual representation), although you can easily use the rope in other scenarios, as long as you feed it a start and end end point at creation and update.
By using VRope you can easily draw a segmented rope updated with a fast Verlet integration
Be aware that the "draw" method simply uses cocos2d's ccDrawLine method, other people might want to find more elegant solutions.
As always, my code is far from optimized but seems to suit my needs, so use at own risk :)
Download: http://cleverhamstergames.com/VRope-0.1.zip
USAGE
#import "VRope.h"
pointA and pointB are start and end points of the rope
Create
VRope *verletRope = [[VRope alloc] init:pointA pointB:pointB];
Update
[verletRope updateRope:dt pointA:pointA pointB:pointB];
Draw
[verletRope draw];