QuickBox2D Pulley Joint

Actionscript:
  1. import com.actionsnippet.qbox.*;
  2. import Box2D.Common.Math.*;
  3.  
  4. [SWF (backgroundColor=0x000000, width=700, height=600)]
  5.  
  6. var sim:QuickBox2D = new QuickBox2D(this);
  7.  
  8. sim.setDefault({fillColor:0x113366, fillAlpha:0.8, lineColor:0x3355AA});
  9.  
  10. sim.createStageWalls();
  11.  
  12. var boxA:QuickObject = sim.addBox({x:10, y:8, fixedRotation:true});
  13. var boxB:QuickObject = sim.addBox({x:14, y:8, width:2,  fixedRotation:true});
  14.  
  15. sim.addJoint({type:"pulley", a:boxA.body, b:boxB.body, groundAnchor1:new b2Vec2(boxA.x, 2), groundAnchor2:new b2Vec2(boxB.x, 2)});
  16.  
  17. sim.start();
  18. sim.mouseDrag();

QuickBox2D pulley joint demo. This post is really meant to serve as part of the docs so it may seem a bit boring in its simplicity...

Have a look at the swf...

This entry was posted in Box2D, QuickBox2D, motion and tagged , , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

3 Comments

  1. Posted August 11, 2009 at 7:37 am | Permalink

    The link for:

    QuickBox2D alpha 108

    is not working.

    Great site otherwise.

    Corey

  2. Posted August 11, 2009 at 3:46 pm | Permalink

    oops, link is now fixed:

    http://actionsnippet.com/qb2d/QuickBox2D_alpha108.zip

  3. Posted March 5, 2010 at 5:42 pm | Permalink

    how do i apply friction to a pulley joint?

    If I use the mouse and pull one box down, they kinda just keep moving. Is there a way to make them come to rest faster?

One Trackback

  1. [...] 12. 滑車ジョイント(PulleyJoint)を作る – QuickBox2D Pulley Joint [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*