Category Archives: Box2d

Programming box2d in javascript

Revolute joint in box2d in javascript

By | May 9, 2020

Revolute Joint Revolute joint is a useful joint in box2d that allows 2 bodies to be pinned together at a point without restricting rotation. The joint can be made between 2 dynamic bodies or between a static and dynamic body. The pendulum on left is a static circle joined to dynamic rectangle. Whereas the cart… Read More »

Weld joint in box2d in javascript

By | May 9, 2020

Weld joint in box2d The weld joint can be used to join to bodies tightly at a common point. Here is an example A weld joint is created like this //create distance joint between b and c var joint_def = new b2WeldJointDef(); joint_def.bodyA = b; joint_def.bodyB = c; //connect the centers – center in local… Read More »