@Override public final void onPreSolveContact(Body bodyA, Box2DActor<T> actorB, Body bodyB, Contact contact, Manifold oldManifold) { if (actorB instanceof WallActor) { WallActor wall = (WallActor) actorB; if (!mEntered) { // est� entrando se le deja pasar contact.setEnabled(false); } else if (wall.floor) { // se va a escapar! float v = bodyA.getLinearVelocity().y; // si va muy r�pido hacia abajo se perdona al jugador y se deja // que rebote if (v > BOUNCING_VEL) { // se deja que se escape contact.setEnabled(false); } } } }
@Override public void preSolve(Contact arg0, Manifold arg1) { final PhysicalData pData1 = (PhysicalData) ((IPhysic)arg0.getFixtureA() .getUserData()).getData(); final PhysicalData pData2 = (PhysicalData) ((IPhysic)arg0.getFixtureB() .getUserData()).getData(); if (!pData1.getIgnore() && !pData2.getIgnore() && pData1.getZ() != pData2.getZ()){ arg0.setEnabled(false); } else { final IPhysic p1 = (IPhysic)arg0.getFixtureA() .getUserData(); final IPhysic p2 = (IPhysic)arg0.getFixtureB() .getUserData(); if(p1.getType() != TypeId.getTypeId(Type.Entity) && p2.getType() != TypeId.getTypeId(Type.Entity)) BattleSystem.CheckForBattle(p1.getType(), p1.getId(), p2.getType(), p2.getId()); } }
@Override public void preSolve(Contact contact, Manifold oldManifold) { Fixture fixtureA = contact.getFixtureA(); Fixture fixtureB = contact.getFixtureB(); Body bodyA = fixtureA.getBody(); Body bodyB = fixtureB.getBody(); Actor actorA = (Actor) bodyA.getUserData(); Actor actorB = (Actor) bodyB.getUserData(); if (actorA != null && actorB != null && actorA instanceof Blob && actorB instanceof Blob) { ArrayList<Blob> blobsA = (ArrayList<Blob>) fixtureA.getUserData(); ArrayList<Blob> blobsB = (ArrayList<Blob>) fixtureB.getUserData(); Blob blobA = ((Blob) actorA); Blob blobB = ((Blob) actorB); if ((blobsA.contains(actorB) || blobA.isSolid()) && (blobsB.contains(actorA) || blobB.isSolid()) && !(blobB.isSolid() && blobA.isSolid())) { contact.setEnabled(false); } } }
@Override public void onContact(B2FlxShape sprite1, B2FlxShape sprite2, Contact contact, Manifold oldManifold, ContactImpulse impulse) { if(_broke) { // The body already broke. return; } // Should the body break? int count = contact.getWorldManifold().getNumberOfContactPoints(); float maxImpulse = 0.0f; for(int i = 0; i < count; i++) { maxImpulse = B2FlxMath.max(maxImpulse, impulse.getNormalImpulses()[i]); } if(maxImpulse > 40.0f) { _break = true; } }
public void preSolve(Contact contact, Manifold oldManifold) { Object goA = contact.getFixtureA().getBody().getUserData(); Object goB = contact.getFixtureB().getBody().getUserData(); Player p = null; PlayerWall pw = null; if(goA instanceof Player && goB instanceof PlayerWall) { p = (Player)goA; pw = (PlayerWall)goB; } else if(goA instanceof PlayerWall && goB instanceof Player) { p = (Player)goB; pw = (PlayerWall)goA; } if(pw != null && p != null) { if((pw.isTop() && p.getBody().getWorldCenter().cpy().y >= pw.getBody().getWorldCenter().y) || (!pw.isTop() && p.getBody().getWorldCenter().cpy().y <= pw.getBody().getWorldCenter().y)) { contact.setEnabled(false); } return; } }
@Override public void preSolve(Contact contact, Manifold oldManifold) { Pair<Collider> pair = checkObjects(contact); if (pair != null) { if (!pair.getA().canCollide() || !pair.getB().canCollide() || (pair.getA().getGroupId() >= 0 && pair.getA().getGroupId() == pair.getB().getGroupId())) { contact.setEnabled(false); } } }
@Override public void preSolve(Contact contact, Manifold oldManifold) { PlayerComponent player = getPlayer(contact); if (!matches(contact, player.fixture)) { return; } if (player.grounded && contact.isTouching()) { contact.resetFriction(); } }
@Override public void preSolve(Contact contact, Manifold oldManifold) { Fixture fixtureA = contact.getFixtureA(); Fixture fixtureB = contact.getFixtureB(); ContactListener listener = get( fixtureA.getFilterData().categoryBits, fixtureB.getFilterData().categoryBits ); if (listener != null) { listener.preSolve(contact, oldManifold); } }
@Override public void preSolve(Contact contact, Manifold oldManifold) { Fixture fixtureA = contact.getFixtureA(); Fixture fixtureB = contact.getFixtureB(); ContactListener listener = getListener(fixtureA.getFilterData().categoryBits, fixtureB.getFilterData().categoryBits); if (listener != null) { listener.preSolve(contact, oldManifold); } }
@Override public void preSolve(Contact contact, Manifold oldManifold) { if (contact.getFixtureA() != null && contact.getFixtureB() != null) { for (ComponentContactListener listener : listenerMap.values()) { listener.preSolve(contact, oldManifold); } } }
public void preSolve (Contact contact, Manifold oldManifold) { Fixture fixtureA = contact.getFixtureA(); Fixture fixtureB = contact.getFixtureB(); if (fixtureA == m_platform || fixtureB == m_platform) { contact.setTangentSpeed(5.0f); } }
@Override public void onContact(B2FlxShape sprite1, B2FlxShape sprite2, Contact contact, Manifold oldManifold, ContactImpulse impulse) { _ghost2.removeOverlap(); if(!_ghost2.gotOverlaps()) _ghost2.setAlpha(1f); }
/** * This is called after a contact is updated. This allows you to inspect a contact before it goes to the solver. If you are * careful, you can modify the contact manifold (e.g. disable contact). A copy of the old manifold is provided so that you can * detect changes. Note: this is called only for awake bodies. Note: this is called even when the number of contact points is * zero. Note: this is not called for sensors. Note: if you set the number of contact points to zero, you will not get an * EndContact callback. However, you may get a BeginContact callback the next step. */ @Override public void preSolve(Contact contact, Manifold oldManifold) { if(_event == null) return; _event.impulse = null; _event.oldManifold = oldManifold; dispatch(contact, B2FlxContactEvent.PRE_SOLVE); }
@Override public void preSolve(Contact contact, Manifold oldManifold) { contact.resetFriction(); AbstractWorldManager managerA=getManager(((Box2DPhysicsObject) contact.getFixtureA().getUserData()).getGrupo()); AbstractWorldManager managerB=getManager(((Box2DPhysicsObject) contact.getFixtureB().getUserData()).getGrupo()); if(managerA!=null) managerA.handlePreSolve(contact, oldManifold); if(managerB!=null) managerB.handlePreSolve(contact, oldManifold); }
@Override public void preSolve(Contact contact, Manifold oldManifold) { Fixture f1 = contact.getFixtureA(); Fixture f2 = contact.getFixtureB(); final Entity e1 = (Entity) f1.getBody().getUserData(); final Entity e2 = (Entity) f2.getBody().getUserData(); if (e1 == null || e2 == null) return; // If the collision is invalid // PHYSICAL CODE if (!f1.isSensor() && !f2.isSensor()) { // They are both physical if (e1.hasComponent(Collidable.class) && e2.hasComponent(Collidable.class)) { final Collidable c1 = (Collidable) e1 .getComponent(Collidable.class); final Collidable c2 = (Collidable) e2 .getComponent(Collidable.class); float collide1 = c1.continueCollision(e1, e2); float collide2 = c2.continueCollision(e2, e1); if (collide1 == 0f || collide2 == 0f) { contact.setEnabled(false); } } } }
@Override public void preSolve(Contact arg0, Manifold arg1) { // Not used. }
/** * {@inheritDoc} */ @Override public void preSolve(Contact contact, Manifold oldManifold) { }
@Override public void preSolve(Contact contact, Manifold oldManifold) { // TODO Auto-generated method stub }
@Override public void preSolve(Contact contact, Manifold oldManifold) { }
@Override public void onCollisionPreSolve(Contact contact, Manifold oldManifold) { }
@Override public void preSolve(final Contact contact, final Manifold oldManifold) { }
@Override public void preSolve(Contact contact, Manifold oldManifold) {}
@Override public void preSolve(Contact contact, Manifold oldManifold) { for (ContactListener contactListener : contactListeners) { contactListener.preSolve(contact, oldManifold); } }
@Override public void preSolve(Contact contact, Manifold oldManifold) { contact.setEnabled(false); }
public void preSolve(Contact c, Manifold m) { }
@Override public void preSolve(final Contact contact, final Manifold oldManifold) { // }
@Override public void preSolve (Contact contact, Manifold oldManifold) { // TODO Auto-generated method stub }
public void preSolve(PhysixContact contact, Manifold oldManifold) { }
public void preSolve(Contact contact, Manifold oldManifold) { testAndRun(contact, (PhysixContact physixContact) -> preSolve(physixContact, oldManifold)); }