/** Enable/disable this contact. This can be used inside the pre-solve contact listener. The contact is only disabled for the * current time step (or sub-step in continuous collisions). */ public void setEnabled (boolean flag) { contact.setEnabled(flag); }
@Override public void preSolve(Contact contact, Manifold oldManifold) { super.preSolve(contact, oldManifold); Fixture fixtureA = contact.getFixtureA(); Fixture fixtureB = contact.getFixtureB(); if (fixtureA != m_platform && fixtureA != m_character) { return; } if (fixtureB != m_character && fixtureB != m_character) { return; } Vec2 position = m_character.getBody().getPosition(); if (position.y < m_top + m_radius - 3.0f * Settings.linearSlop) { contact.setEnabled(false); } } }
minContact.setEnabled(false); bA.m_sweep.set(backup1); bB.m_sweep.set(backup2);
private void performCoinCollision(boolean coinIsBodyA, Contact contact) { if (coinIsBodyA) { elementsToBeRemoved.add(contact.getFixtureA()); } else { elementsToBeRemoved.add(contact.getFixtureB()); } contact.setEnabled(false); ... } ... @Override public void onUpdate(float pSecondsElapsed) { if (elementsToBeRemoved != null) { for (Fixture fixture : elementsToBeRemoved) { fixture.setSensor(true); } } elementsToBeRemoved.clear(); }
@Override public void preSolve(Contact contact, Manifold oldManifold) { super.preSolve(contact, oldManifold); Fixture fixtureA = contact.getFixtureA(); Fixture fixtureB = contact.getFixtureB(); if (fixtureA != m_platform && fixtureA != m_character) { return; } if (fixtureB != m_character && fixtureB != m_character) { return; } Vec2 position = m_character.getBody().getPosition(); if (position.y < m_top + m_radius - 3.0f * Settings.linearSlop) { contact.setEnabled(false); } } }
minContact.setEnabled(false); bA.m_sweep.set(backup1); bB.m_sweep.set(backup2);
minContact.setEnabled(false); bA.m_sweep.set(backup1); bB.m_sweep.set(backup2);
minContact.setEnabled(false); bA.m_sweep.set(backup1); bB.m_sweep.set(backup2);
minContact.setEnabled(false); bA.m_sweep.set(backup1); bB.m_sweep.set(backup2);