Box2D AS3 Create Distant Joint Tutorial: Add Bodies
Joints in the Box2D Physics simulation are used to constrain bodies to the world or to each other. We will discuss how to create Distance Joints in very details in this series of Box2D AS3 tutorials.
Flash Box2D Physics Simulation Tutorial Content
One of the simplest joint of Box2D Physics Engine is a distance joint which says that the distance between two points on two bodies must be constant. When you specify a distance joint the two bodies should already be in place. Then you specify the two anchor points in world coordinates. The first anchor point is connected to body 1, and the second anchor point is connected to body 2. These points imply the length of the distance constraint.
STEP 1: Add Bodies to Stage
Like other Box2d Physics Simulation, the first step is to add bodies on the stage and ready for simulation in later steps.
Flash ActionScript Codes:
Almost all flash source codes on this website are free to download. In order to maintain our website, which includes the developement and maintenance of tutorials, we would appreciate your kind contribution by buying some source files at very small fee. Once we get reasonable amount of incentives from contribution or Advertisement sponsors, the source codes will be released for free to download.
Download Flash Source File:
Awaiting to be released.
This Box2D Actionscript Flash Physics animation tutorial shows how to create distant joints physics simulation. Step 1: Create bodies on stage of Flash Movie.