Actionscript:
-
import com.actionsnippet.qbox.*;
-
import Box2D.Common.Math.*;
-
-
[SWF (backgroundColor=0x000000, width=700, height=600, frameRate=60)]
-
-
var sim:QuickBox2D = new QuickBox2D(this);
-
-
sim.setDefault({fillColor:0xCCCCCC, lineColor:0x3355AA});
-
-
sim.createStageWalls();
-
-
var box:QuickObject = sim.addBox({x:10, y:10, density:0});
-
var circle:QuickObject = sim.addCircle({x:10, y:13});
-
-
sim.addJoint({type:"prismatic", a:box.body, b:circle.body, axis:new b2Vec2(1, 0), upperTranslation:3, lowerTranslation:-3, enableLimit:true, motorSpeed:10, maxMotorForce:10, enableMotor:true});
-
-
sim.start();
-
sim.mouseDrag();
Simple prismatic joint demo. Prismatic joints are odd, it took me awhile to realize how to use them and what they can be used for... Plan on using them in the creation of some Box2D machines in the near futrure...
Check out the swf
One Trackback
[...] 16. プリズムジョイント(PrismJoint)を作る – QuickBox2D Prismatic Joint [...]