I'm trying to attach some mass to the body (in my case its a circle: ball). there is density that i can modify but I don't see mass attribute.
I've little bit worked on Phys2d there is mass property but here I can't find such thing.
Any help would be highly appreciated.
following is the function I'm using to create circle:
function createBall(_x, _y, _mass, _radius, _density, _rest, _friction, _userData, _linDamping) {
var ballSd = new b2CircleDef();
ballSd.density = _density;
ballSd.radius = _radius;
ballSd.restitution = _rest;
ballSd.friction = _friction;
ballSd.userData = _userData;
var ballBd = new b2BodyDef();
ballBd.linearDamping = _linDamping;
ballBd.allowSleep = false;
ballBd.AddShape(ballSd);
ballBd.position.Set(_x, _y);
return world.CreateBody(ballBd);
}
I've little bit worked on Phys2d there is mass property but here I can't find such thing.
Any help would be highly appreciated.
following is the function I'm using to create circle:
function createBall(_x, _y, _mass, _radius, _density, _rest, _friction, _userData, _linDamping) {
var ballSd = new b2CircleDef();
ballSd.density = _density;
ballSd.radius = _radius;
ballSd.restitution = _rest;
ballSd.friction = _friction;
ballSd.userData = _userData;
var ballBd = new b2BodyDef();
ballBd.linearDamping = _linDamping;
ballBd.allowSleep = false;
ballBd.AddShape(ballSd);
ballBd.position.Set(_x, _y);
return world.CreateBody(ballBd);
}