/** This resets the mass properties to the sum of the mass properties of the fixtures. This normally does not need to be called * unless you called SetMassData to override the mass and you later want to reset the mass. */ public void resetMassData () { body.resetMassData(); }
/** * Set this body to have fixed rotation. This causes the mass to be reset. * * @param flag */ public void setFixedRotation(boolean flag) { if (flag) { m_flags |= e_fixedRotationFlag; } else { m_flags &= ~e_fixedRotationFlag; } resetMassData(); }
/** * Set this body to have fixed rotation. This causes the mass to be reset. * * @param flag */ public void setFixedRotation(boolean flag) { if (flag) { m_flags |= e_fixedRotationFlag; } else { m_flags &= ~e_fixedRotationFlag; } resetMassData(); }
/** * Set this body to have fixed rotation. This causes the mass to be reset. * * @param flag fixed rotation flag */ public void setFixedRotation(boolean flag) { if (flag) { m_flags |= e_fixedRotationFlag; } else { m_flags &= ~e_fixedRotationFlag; } resetMassData(); }
/** * Set this body to have fixed rotation. This causes the mass to be reset. * * @param flag */ public void setFixedRotation(boolean flag) { if (flag) { m_flags |= e_fixedRotationFlag; } else { m_flags &= ~e_fixedRotationFlag; } resetMassData(); }
/** * Set this body to have fixed rotation. This causes the mass to be reset. * * @param flag */ public void setFixedRotation(boolean flag) { if (flag) { m_flags |= e_fixedRotationFlag; } else { m_flags &= ~e_fixedRotationFlag; } resetMassData(); }
/** * Creates a fixture and attach it to this body. Use this function if you need to set some fixture * parameters, like friction. Otherwise you can create the fixture directly from a shape. If the * density is non-zero, this function automatically updates the mass of the body. Contacts are not * created until the next time step. * Note: This function is locked during callbacks. * * @param def the fixture definition. */ public final Fixture createFixture(FixtureDef def) { world.assertNotLocked(); Fixture fixture = new Fixture(this, def); if ((m_flags & e_activeFlag) == e_activeFlag) { BroadPhase broadPhase = world.m_contactManager.m_broadPhase; fixture.createProxies(broadPhase, m_xf); } fixtures.add(fixture); // Adjust mass properties if needed. if (fixture.getDensity() > 0.0f) { resetMassData(); } // Let the world know we have a new fixture. This will cause new contacts // to be created at the beginning of the next time step. world.notifyNewFixture(); return fixture; }