Author Archives: Zevan

QuickBox2D Revolute Walker

CLICK HERE TO COPY
Actionscript:

import com.actionsnippet.qbox.*;

import Box2D.Dynamics.Joints.*;

 

[SWF (backgroundColor=0x222222, width=700, height=600)]

 

var sim:QuickBox2D = new QuickBox2D(this);

 

sim.setDefault({fillColor:0x000000, lineColor:0xCCCCCC});

sim.createStageWalls();

 

var legA:QuickObject = sim.addBox({x:5, y:11, width:2, height:0.2,groupIndex:-2});

var three:QuickObject = sim.addBox({x:6.8 + 1.8, y:11, width:2, height:0.2,groupIndex:-2});

var legB:QuickObject = sim.addBox({x:6.8, y:11, width:2, height:0.5,groupIndex:-2});

sim.setDefault({type:"revolute"});

 

var anchorX:Number = legA.x + (legB.x - legA.x) / 2;

var anchorY:Number = legA.y;

var revJointA:QuickObject = sim.addJoint({a:legA.body, b:legB.body, x1:anchorX, y1:anchorY,enableMotor:true, maxMotorTorque:80});

 

anchorX = legB.x [...]

Posted in Box2D, QuickBox2D, motion | Tagged , , , , | 3 Comments

QuickBox2D Pulley Joint

CLICK HERE TO COPY
Actionscript:

import com.actionsnippet.qbox.*;

import Box2D.Common.Math.*;

 

[SWF (backgroundColor=0x000000, width=700, height=600)]

 

var sim:QuickBox2D = new QuickBox2D(this);

 

sim.setDefault({fillColor:0x113366, fillAlpha:0.8, lineColor:0x3355AA});

 

sim.createStageWalls();

 

var boxA:QuickObject = sim.addBox({x:10, y:8, fixedRotation:true});

var boxB:QuickObject = sim.addBox({x:14, y:8, width:2,  fixedRotation:true});

 

sim.addJoint({type:"pulley", a:boxA.body, b:boxB.body, groundAnchor1:new b2Vec2(boxA.x, 2), groundAnchor2:new b2Vec2(boxB.x, 2)});

 

sim.start();

sim.mouseDrag();

QuickBox2D pulley joint demo. This post is really meant to serve as part of the docs so it may seem a bit [...]

Posted in Box2D, QuickBox2D, motion | Tagged , , , , | 4 Comments

ActionSnippet Auto-Post

I'm going out of town for a week or so - the site will be on auto-post (QuickBox2D joint demos in the pipeline)... so apologies if your comments aren't approved in a timely fashion.

Posted in Uncategorized | Leave a comment

QuickBox2D Revolute Ragdoll

CLICK HERE TO COPY
Actionscript:

import com.actionsnippet.qbox.*;

import Box2D.Common.Math.*;

 

[SWF (backgroundColor=0x000000, width=700, height=600, frameRate=60)]

 

var sim:QuickBox2D = new QuickBox2D(this,{debug:false, frim:true, gravityY:1});

 

sim.setDefault({fillColor:0x113366, fillAlpha:0.8, lineColor:0x3355AA});

 

sim.createStageWalls();

 

var circle:QuickObject = sim.addCircle({x:10, y:10, radius:3});

var head:QuickObject = sim.addCircle({x:5, y:5, radius:0.5});

var torsoA:QuickObject = sim.addBox({x:5, y:6, width:1.5, height:0.8})

var torsoB:QuickObject = sim.addBox({x:5, y:6.5, width:1.25, height:0.8})

var torsoC:QuickObject = sim.addBox({x:5, y:7, width:1.0, height:0.8})

var pelvis:QuickObject = sim.addBox({x:5, y:7.5, width:1.0, height:0.8})

var leftLegA:QuickObject = sim.addBox({x:4.75, [...]

Posted in Box2D, QuickBox2D, motion | Tagged , , , , | 1 Comment