B2CREATEPULLEYJOINT

This command will create a pulley joint between the specified bodies.  This is perhaps the most complex of all the available joints, but it is fairly self-explanatory.  When one body is moved up, the other will rappel down.  The BodyID1 and BodyID2 specify the bodies involved and should be the integer handles of those bodies.  The imaginary rope between these bodies must be connected to a fixed point in the world - these are the Point values.  The rope must also be attached to the bodies - the anchor values do this.  The ratio controls fast the 2nd rope will move proportionately to the 1st rope.  The MaxLength values control how long the ropes are each allowed to get.

Image Source: Box2D User Manual

Syntax

Return  as Integer = b2CreatePulleyJoint(ID as Integer, Body1ID as Integer, Body2ID as Integer, Point1X as Float, Point1Y as Float, Point2X as Float, Point2Y as Float, Anchor1X as Float, Anchor1Y as Float, Anchor2X as Float, Anchor2Y as Float, MaxLength1 as Float, MaxLength2 as Float, Ratio as Float)

Related Information

BOX2D Commands Menu
Index