Category Archives: Box2d

Programming box2d in javascript

Revolute joint in box2d in javascript

By | February 14, 2018

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 | February 14, 2018

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 [js] //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… Read More »

Programming box2d in javascript – tutorial on basics

By | February 14, 2018

Box2d Box2d is a 2d physics simulation library written for C++ and ported to many languages including Javascript. From Box2d’s Website Box2D is a feature rich 2D rigid body physics engine, written in C++ by Erin Catto. It has been used in many games, including Crayon Physics Deluxe, winner of the 2008 Independant Game Festival… Read More »