/** * Set if this fixture is a sensor. * * @param sensor */ public void setSensor(boolean sensor) { if (sensor != m_isSensor) { m_body.setAwake(true); m_isSensor = sensor; } }
public void setAllowSleep(boolean flag) { if (flag == m_allowSleep) { return; } m_allowSleep = flag; if (m_allowSleep == false) { for (Body b = m_bodyList; b != null; b = b.m_next) { b.setAwake(true); } } }
/** Set the sleep state of the body. A sleeping body has very low CPU cost. * @param flag set to true to put body to sleep, false to wake it. */ public void setAwake (boolean flag) { body.setAwake(flag); }
/** * You can disable sleeping on this body. If you disable sleeping, the body will be woken. * * @param flag */ public void setSleepingAllowed(boolean flag) { if (flag) { m_flags |= e_autoSleepFlag; } else { m_flags &= ~e_autoSleepFlag; setAwake(true); } }
public void setTarget(Vec2 target) { if (m_bodyB.isAwake() == false) { m_bodyB.setAwake(true); } m_targetA.set(target); }
public void pushContact(Contact contact) { Fixture fixtureA = contact.getFixtureA(); Fixture fixtureB = contact.getFixtureB(); if (contact.m_manifold.pointCount > 0 && !fixtureA.isSensor() && !fixtureB.isSensor()) { fixtureA.getBody().setAwake(true); fixtureB.getBody().setAwake(true); } ShapeType type1 = fixtureA.getType(); ShapeType type2 = fixtureB.getType(); IDynamicStack<Contact> creator = contactStacks[type1.ordinal()][type2.ordinal()].creator; creator.push(contact); }