/** * 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 Fixture createFixture(FixtureDef def) { world.assertNotLocked(); Fixture fixture = new Fixture(this, def); if ((m_flags & e_activeFlag) == e_activeFlag) { BroadPhase broadPhase = world.getContactManager().broadPhase; fixture.createProxies(broadPhase, m_xf); } fixtures.add(fixture); // Adjust mass properties if needed. if (fixture.getDensity() > 0) { 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; }
/** * 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 Fixture createFixture(FixtureDef def) { world.assertNotLocked(); Fixture fixture = new Fixture(this, def); if ((m_flags & e_activeFlag) == e_activeFlag) { BroadPhase broadPhase = world.getContactManager().broadPhase; fixture.createProxies(broadPhase, m_xf); } fixtures.add(fixture); // Adjust mass properties if needed. if (fixture.getDensity() > 0) { 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; }
if (f.getDensity() == 0.0f) { continue;
if (f.getDensity() == 0.0f) { continue;