Examples of AABB


Examples of org.jbox2d.collision.AABB

    Common.info(5, "new mine");
    shoot.actions.removeAction("nogravity");
    shoot.actions.removeAction("collision");

    Vec2 range = damageRange;
    AABB rect = new AABB(new Vec2(-range.x, -range.y), new Vec2(range.x,
        range.y));
    shoot.explosionRelativeRectangle = rect;
    shoot.explosionDamage = 2;
    this.initializeShoot(shoot);
  }
View Full Code Here

Examples of org.jbox2d.collision.AABB


            public Object force(Object o) {

                Mine mme = (Mine) me;
                AABB rr = new AABB(mme.explosionRelativeRectangle);
                Vec2 c = me.body.getWorldCenter();
                AABB ar = new AABB(new Vec2(c.x + rr.lowerBound.x/2, c.y
                                            + rr.lowerBound.y/2), new Vec2(c.x + rr.upperBound.x/2,
                                                    c.y + rr.upperBound.y/2)

                                  );
View Full Code Here

Examples of org.jbox2d.collision.AABB

    public void specialMove(KeyFlag k) {

    }

    private boolean isOnAir() {
        AABB r = new AABB(getAABB());
        r.lowerBound.x=0f;
        r.upperBound.x=0f;
        r.lowerBound.x += body.getPosition().x;
        r.lowerBound.y += body.getPosition().y+0.2f;
        r.upperBound.x += body.getPosition().x;
View Full Code Here

Examples of org.jbox2d.collision.AABB

    };
    mats = new OrderedStack<Mat22>(argSize, argContainerSize) {
      protected Mat22 newInstance() { return new Mat22(); }
    };
    aabbs = new OrderedStack<AABB>(argSize, argContainerSize) {
      protected AABB newInstance() { return new AABB(); }
    };
    rots = new OrderedStack<Rot>(argSize, argContainerSize) {
      protected Rot newInstance() { return new Rot(); }
    };
    mat33s = new OrderedStack<Mat33>(argSize, argContainerSize) {
View Full Code Here

Examples of org.jbox2d.collision.AABB

    }

    m_stepCount = 0;

    float h = worldExtent;
    m_queryAABB = new AABB();
    m_queryAABB.lowerBound.set(-3.0f, -4.0f + h);
    m_queryAABB.upperBound.set(5.0f, 6.0f + h);

    m_rayCastInput = new RayCastInput();
    m_rayCastInput.p1.set(-5.0f, 5.0f + h);
View Full Code Here

Examples of org.jbox2d.collision.AABB

      Actor actor = m_actors[j];
      if (actor.proxyId == -1) {
        continue;
      }

      AABB aabb0 = new AABB(actor.aabb);
      MoveAABB(actor.aabb);
      Vec2 displacement = actor.aabb.getCenter().sub(aabb0.getCenter());
      m_tree.moveProxy(actor.proxyId, new AABB(actor.aabb), displacement);
      return;
    }
  }
View Full Code Here

Examples of org.jbox2d.collision.AABB

    for (int i = 0; i < m_proxyCount; ++i) {
      FixtureProxy proxy = m_proxies[i];

      // Compute an AABB that covers the swept shape (may miss some rotation effect).
      final AABB aabb1 = pool1;
      final AABB aab = pool2;
      m_shape.computeAABB(aabb1, transform1, proxy.childIndex);
      m_shape.computeAABB(aab, transform2, proxy.childIndex);

      proxy.aabb.lowerBound.x = aabb1.lowerBound.x < aab.lowerBound.x ? aabb1.lowerBound.x : aab.lowerBound.x;
      proxy.aabb.lowerBound.y = aabb1.lowerBound.y < aab.lowerBound.y ? aabb1.lowerBound.y : aab.lowerBound.y;
View Full Code Here

Examples of org.jbox2d.collision.AABB

        }

        for (Fixture f = b.getFixtureList(); f != null; f = f.getNext()) {
          for (int i = 0; i < f.m_proxyCount; ++i) {
            FixtureProxy proxy = f.m_proxies[i];
            AABB aabb = m_contactManager.m_broadPhase.getFatAABB(proxy.proxyId);
            if (aabb != null) {
              Vec2[] vs = avs.get(4);
              vs[0].set(aabb.lowerBound.x, aabb.lowerBound.y);
              vs[1].set(aabb.upperBound.x, aabb.lowerBound.y);
              vs[2].set(aabb.upperBound.x, aabb.upperBound.y);
View Full Code Here

Examples of org.jbox2d.collision.AABB

   */
  @Override
  public boolean testOverlap(int proxyIdA, int proxyIdB) {
    // return AABB.testOverlap(proxyA.aabb, proxyB.aabb);
    //return m_tree.overlap(proxyIdA, proxyIdB);
    final AABB a = m_tree.getFatAABB(proxyIdA);
    final AABB b = m_tree.getFatAABB(proxyIdB);
    if (b.lowerBound.x - a.upperBound.x > 0.0f || b.lowerBound.y - a.upperBound.y > 0.0f) {
      return false;
    }

    if (a.lowerBound.x - b.upperBound.x > 0.0f || a.lowerBound.y - b.upperBound.y > 0.0f) {
View Full Code Here

Examples of org.jbox2d.collision.AABB

        continue;
      }

      // We have to query the tree with the fat AABB so that
      // we don't fail to create a pair that may touch later.
      final AABB fatAABB = m_tree.getFatAABB(m_queryProxyId);

      // Query tree, create pairs and add them pair buffer.
      // log.debug("quering aabb: "+m_queryProxy.aabb);
      m_tree.query(this, fatAABB);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.