Package com.badlogic.gdx.math.collision

Examples of com.badlogic.gdx.math.collision.BoundingBox


    }
  }

  /** Returns the bounding box for all active particles. z axis will always be zero. */
  public BoundingBox getBoundingBox () {
    if (bounds == null) bounds = new BoundingBox();

    BoundingBox bounds = this.bounds;
    bounds.inf();
    for (ParticleEmitter emitter : this.emitters)
      bounds.ext(emitter.getBoundingBox());
    return bounds;
  }
View Full Code Here


    System.out.println(r1.overlaps(r1)); // true
    System.out.println(r1.overlaps(r2)); // false
    System.out.println(r1.contains(0, 0)); // true

    System.out.println("BoundingBox test cases");
    BoundingBox b1 = new BoundingBox(Vector3.Zero, new Vector3(1, 1, 1));
    BoundingBox b2 = new BoundingBox(new Vector3(1, 1, 1), new Vector3(2, 2, 2));
    System.out.println(b1.contains(Vector3.Zero)); // true
    System.out.println(b1.contains(b1)); // true
    System.out.println(b1.contains(b2)); // false

    // Note, in stage the bottom and left sides are inclusive while the right and top sides are exclusive.
View Full Code Here

    }
  }
 
  /** Returns the bounding box for all active particles. z axis will always be zero. */
  public BoundingBox getBoundingBox () {
    if (bounds == null) bounds = new BoundingBox();

    BoundingBox bounds = this.bounds;
    bounds.inf();
    for (ParticleEmitter emitter : this.emitters)
      bounds.ext(emitter.getBoundingBox());
    return bounds;
  }
View Full Code Here

  /** Calculates the {@link BoundingBox} of the vertices contained in this mesh. In case no vertices are defined yet a
   * {@link GdxRuntimeException} is thrown. This method creates a new BoundingBox instance.
   *
   * @return the bounding box. */
  public BoundingBox calculateBoundingBox () {
    BoundingBox bbox = new BoundingBox();
    calculateBoundingBox(bbox);
    return bbox;
  }
View Full Code Here

    yOffsetValue.setLow(-yOffsetValue.getLowMin(), -yOffsetValue.getLowMax());
  }

  /** Returns the bounding box for all active particles. z axis will always be zero. */
  public BoundingBox getBoundingBox () {
    if (bounds == null) bounds = new BoundingBox();

    Particle[] particles = this.particles;
    boolean[] active = this.active;
    BoundingBox bounds = this.bounds;

    bounds.inf();
    for (int i = 0, n = active.length; i < n; i++)
      if (active[i]) {
        Rectangle r = particles[i].getBoundingRectangle();
        bounds.ext(r.x, r.y, 0);
        bounds.ext(r.x + r.width, r.y + r.height, 0);
      }

    return bounds;
  }
View Full Code Here

    System.out.println(r1.overlaps(r1)); // true
    System.out.println(r1.overlaps(r2)); // false
    System.out.println(r1.contains(0, 0)); // true

    System.out.println("BoundingBox test cases");
    BoundingBox b1 = new BoundingBox(Vector3.Zero, new Vector3(1, 1, 1));
    BoundingBox b2 = new BoundingBox(new Vector3(1, 1, 1), new Vector3(2, 2, 2));
    System.out.println(b1.contains(Vector3.Zero)); // true
    System.out.println(b1.contains(b1)); // true
    System.out.println(b1.contains(b2)); // false

    // Note, in stage the bottom and left sides are inclusive while the right and top sides are exclusive.
View Full Code Here

    System.out.println(r1.overlaps(r1)); // true
    System.out.println(r1.overlaps(r2)); // false
    System.out.println(r1.contains(0, 0)); // true

    System.out.println("BoundingBox test cases");
    BoundingBox b1 = new BoundingBox(Vector3.Zero, new Vector3(1, 1, 1));
    BoundingBox b2 = new BoundingBox(new Vector3(1, 1, 1), new Vector3(2, 2, 2));
    System.out.println(b1.contains(Vector3.Zero)); // true
    System.out.println(b1.contains(b1)); // true
    System.out.println(b1.contains(b2)); // false

    // Note, in stage the bottom and left sides are inclusive while the right and top sides are exclusive.
View Full Code Here

    }
  }
 
  /** Returns the bounding box for all active particles. z axis will always be zero. */
  public BoundingBox getBoundingBox () {
    if (bounds == null) bounds = new BoundingBox();

    BoundingBox bounds = this.bounds;
    bounds.inf();
    for (ParticleEmitter emitter : this.emitters)
      bounds.ext(emitter.getBoundingBox());
    return bounds;
  }
View Full Code Here

    System.out.println(r1.overlaps(r1)); // true
    System.out.println(r1.overlaps(r2)); // false
    System.out.println(r1.contains(0, 0)); // true

    System.out.println("BoundingBox test cases");
    BoundingBox b1 = new BoundingBox(Vector3.Zero, new Vector3(1, 1, 1));
    BoundingBox b2 = new BoundingBox(new Vector3(1, 1, 1), new Vector3(2, 2, 2));
    System.out.println(b1.contains(Vector3.Zero)); // true
    System.out.println(b1.contains(b1)); // true
    System.out.println(b1.contains(b2)); // false

    // Note, in stage the bottom and left sides are inclusive while the right and top sides are exclusive.
View Full Code Here

    }
  }

  /** @return the merged bounding box of all controllers. */
  public BoundingBox getBoundingBox () {
    if (bounds == null) bounds = new BoundingBox();

    BoundingBox bounds = this.bounds;
    bounds.inf();
    for (ParticleController emitter : controllers)
      bounds.ext(emitter.getBoundingBox());
    return bounds;
  }
View Full Code Here

TOP

Related Classes of com.badlogic.gdx.math.collision.BoundingBox

Copyright © 2018 www.massapicom. 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.