Wednesday, July 8, 2009

Set Mass At run Time

To change the mass at run time just make desity=0 at the time of defining body
and in At run time Change its Mass


Update()
{
var massData = new b2MassData();
massData.mass = 1;

massData.center = new b2Vec2(-1,1);
massData.I=2
wallBd.SetMass(massData);//wallBd is a body
wallBd.WakeUp()
}

//////////////
bodyDef1.isSleeping = true; is used to make body active whenever its hit by anyobject

No comments:

FEEDJIT Live