B2CREATEREVOLUTEJOINT

This command will create a basic revolving joint between the specified bodies.  This type of joint will rotate freely, and is best suited for creating wheels or other spinning, round objects.  The BodyID1 specifies the "parent" body and should be the integer handle of that body.  The BodyID2 specifies the actual rotating part and should be the integer handle of that body.  The X and Y positions specify the location the 2nd body will revolve around.

If any of the bodies involved are moved or repositioned abruptly, the other bodies will not move with it instantly.  They will be pulled along but will not reconnect instantly.  Keep this in mind when repositioning bodies.

Image Source: Box2D User Manual

Syntax

Return  as Integer = b2CreateRevoluteJoint(ID as Integer, Body1ID as Integer, Body2ID as Integer, X as Float, Y as Float)

Related Information

BOX2D Commands Menu
Index