Examples of doesCollide()


Examples of com.googlecode.jumpnevolve.math.Circle.doesCollide()

   * .
   */
  @Test
  public void testDoesCollide() {
    Circle circle = new Circle(0.4f, 0.99f, 29.0f);
    assertThat(circle.doesCollide(circle), is(true));
    assertThat(circle.doesCollide(circle.getBoundingRect()), is(true));
    assertThat(
        circle.doesCollide(new Rectangle(26.0f, 0.0f, 80.0f, 21.0f)),
        is(true));
    assertThat(circle.doesCollide(new Circle(30.0f, 30.0f, 0.1f)),
View Full Code Here

Examples of com.googlecode.jumpnevolve.math.Circle.doesCollide()

   */
  @Test
  public void testDoesCollide() {
    Circle circle = new Circle(0.4f, 0.99f, 29.0f);
    assertThat(circle.doesCollide(circle), is(true));
    assertThat(circle.doesCollide(circle.getBoundingRect()), is(true));
    assertThat(
        circle.doesCollide(new Rectangle(26.0f, 0.0f, 80.0f, 21.0f)),
        is(true));
    assertThat(circle.doesCollide(new Circle(30.0f, 30.0f, 0.1f)),
        is(false));
View Full Code Here

Examples of com.googlecode.jumpnevolve.math.Circle.doesCollide()

  public void testDoesCollide() {
    Circle circle = new Circle(0.4f, 0.99f, 29.0f);
    assertThat(circle.doesCollide(circle), is(true));
    assertThat(circle.doesCollide(circle.getBoundingRect()), is(true));
    assertThat(
        circle.doesCollide(new Rectangle(26.0f, 0.0f, 80.0f, 21.0f)),
        is(true));
    assertThat(circle.doesCollide(new Circle(30.0f, 30.0f, 0.1f)),
        is(false));
    assertThat(circle.doesCollide(new Rectangle(999.0f, 999.0f, 0.1f,
        1000.0f)), is(false));
View Full Code Here

Examples of com.googlecode.jumpnevolve.math.Circle.doesCollide()

    assertThat(circle.doesCollide(circle), is(true));
    assertThat(circle.doesCollide(circle.getBoundingRect()), is(true));
    assertThat(
        circle.doesCollide(new Rectangle(26.0f, 0.0f, 80.0f, 21.0f)),
        is(true));
    assertThat(circle.doesCollide(new Circle(30.0f, 30.0f, 0.1f)),
        is(false));
    assertThat(circle.doesCollide(new Rectangle(999.0f, 999.0f, 0.1f,
        1000.0f)), is(false));
  }
View Full Code Here

Examples of com.googlecode.jumpnevolve.math.Circle.doesCollide()

    assertThat(
        circle.doesCollide(new Rectangle(26.0f, 0.0f, 80.0f, 21.0f)),
        is(true));
    assertThat(circle.doesCollide(new Circle(30.0f, 30.0f, 0.1f)),
        is(false));
    assertThat(circle.doesCollide(new Rectangle(999.0f, 999.0f, 0.1f,
        1000.0f)), is(false));
  }

  /**
   * Test method for
View Full Code Here

Examples of com.googlecode.jumpnevolve.math.Rectangle.doesCollide()

    // Rectangle rect2 = new Rectangle(new Vector(10, 90), 20, 20);
    Shape rect2 = new Circle(new Vector(10, 90), 10);
    Date start = new Date();
    long startTime = start.getTime();
    for (int i = 0; i < 1000000; i++) {
      if (rect.doesCollide(rect2)) {
        rect.getCollision(rect2, false, true);
      }
      rect = rect.modifyCenter(rect.getCenter().add(
          new Vector(0, 0.000001f)));
    }
View Full Code Here

Examples of com.googlecode.jumpnevolve.math.Rectangle.doesCollide()

   * .
   */
  @Test
  public void testDoesCollide() {
    Rectangle rect = new Rectangle(55.0f, -20.0f, 356.0f, 23.0f);
    assertThat(rect.doesCollide(rect), is(true));
    assertThat(rect.doesCollide(rect.getBestCircle()), is(true));
    assertThat(rect.doesCollide(rect.getBoundingCircle()), is(true));
    assertThat(rect.doesCollide(new Circle(4000.0f, 4000.0f, 2.0f)),
        is(false));
    assertThat(rect.doesCollide(new Circle(0.0f, 0.0f, 60.0f)), is(true));
View Full Code Here

Examples of com.googlecode.jumpnevolve.math.Rectangle.doesCollide()

   */
  @Test
  public void testDoesCollide() {
    Rectangle rect = new Rectangle(55.0f, -20.0f, 356.0f, 23.0f);
    assertThat(rect.doesCollide(rect), is(true));
    assertThat(rect.doesCollide(rect.getBestCircle()), is(true));
    assertThat(rect.doesCollide(rect.getBoundingCircle()), is(true));
    assertThat(rect.doesCollide(new Circle(4000.0f, 4000.0f, 2.0f)),
        is(false));
    assertThat(rect.doesCollide(new Circle(0.0f, 0.0f, 60.0f)), is(true));
  }
View Full Code Here

Examples of com.googlecode.jumpnevolve.math.Rectangle.doesCollide()

  @Test
  public void testDoesCollide() {
    Rectangle rect = new Rectangle(55.0f, -20.0f, 356.0f, 23.0f);
    assertThat(rect.doesCollide(rect), is(true));
    assertThat(rect.doesCollide(rect.getBestCircle()), is(true));
    assertThat(rect.doesCollide(rect.getBoundingCircle()), is(true));
    assertThat(rect.doesCollide(new Circle(4000.0f, 4000.0f, 2.0f)),
        is(false));
    assertThat(rect.doesCollide(new Circle(0.0f, 0.0f, 60.0f)), is(true));
  }
View Full Code Here

Examples of com.googlecode.jumpnevolve.math.Rectangle.doesCollide()

  public void testDoesCollide() {
    Rectangle rect = new Rectangle(55.0f, -20.0f, 356.0f, 23.0f);
    assertThat(rect.doesCollide(rect), is(true));
    assertThat(rect.doesCollide(rect.getBestCircle()), is(true));
    assertThat(rect.doesCollide(rect.getBoundingCircle()), is(true));
    assertThat(rect.doesCollide(new Circle(4000.0f, 4000.0f, 2.0f)),
        is(false));
    assertThat(rect.doesCollide(new Circle(0.0f, 0.0f, 60.0f)), is(true));
  }

}
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.