List of usage examples for com.badlogic.gdx.physics.box2d Fixture setDensity
public void setDensity(float density)
From source file:edu.lehigh.cse.lol.Actor.java
License:Open Source License
/** * Adjust the default physics settings (density, elasticity, friction) for * this actor/*from w ww.j a v a 2 s . co m*/ * * @param density New density of the actor * @param elasticity New elasticity of the actor * @param friction New friction of the actor */ public Actor setPhysics(float density, float elasticity, float friction) { for (Fixture f : mBody.getFixtureList()) { f.setDensity(density); f.setRestitution(elasticity); f.setFriction(friction); } mBody.resetMassData(); return this; }
From source file:org.catrobat.catroid.physics.PhysicsObject.java
License:Open Source License
private void setDensity(float density) { if (density < MIN_DENSITY) { density = PhysicsObject.MIN_DENSITY; }//from w w w . ja v a 2 s .c o m fixtureDef.density = density; for (Fixture fixture : body.getFixtureList()) { fixture.setDensity(density); } body.resetMassData(); }