Taken from a box2djs sample.
I'm trying to understand the library, but I do not understand the line:
ballSd.radius = rad || 10;
what does it mean?
Here's the full definition
createBall2 = function(world, x, y, rad, fixed) {
var ballSd = new b2CircleDef();
if (!fixed) ballSd.density = 1.0;
// what does the next line do?
ballSd.radius = rad || 10;
ballSd.restitution = 0.2;
var ballBd = new b2BodyDef();
ballBd.AddShape(ballSd);
ballBd.position.Set(x,y);
return world.CreateBody(ballBd);
};