Package com.badlogic.gdx.math

Examples of com.badlogic.gdx.math.Circle


   * Detects collision within a given radius
   * @param radius Explosion radius
   * @return True if tank is in radius
   */
  protected boolean detectExplosionRadius(float radius){
    Circle temp = new Circle(position.x, position.y, radius);
    Rectangle otherTankBounds = Engine.getInstance().getOtherTank(shooter).getBounds();
    if(Intersector.overlapCircleRectangle(temp, otherTankBounds)){
      return true;
    }
    return false;
View Full Code Here


            tmp = p1sq * (p3x - p2x) + p2sq * (p1x - p3x) + p3sq * (p2x - p1x);
            y = tmp / (2.0f * cp);
        }
        r2 = (p1x - x) * (p1x - x) + (p1y - y) * (p1y - y);
        r = (float)Math.sqrt((double)r2);
        return new Circle(x, y, r);
    }
View Full Code Here

     */
    public void triangulate(Array<Vector2> vertices) {
        edges.clear();
        circles.clear();

        Circle circle;
        boolean ok;
        for(int i = 0; i < vertices.size - 2; i++) {
            for(int j = i + 1; j < vertices.size - 1; j++) {
                for(int k = j + 1; k < vertices.size; k++) {
                    circle = circle(vertices.get(i), vertices.get(j), vertices.get(k));
                    ok = true;
                    for(int l = 0; l < vertices.size && ok; l++) {
                        if(l != i && l != j && l != k) {
                            if(circle.contains(vertices.get(l))) {
                                ok = false;
                            }
                        }
                    }
                    if(ok) {
View Full Code Here

TOP

Related Classes of com.badlogic.gdx.math.Circle

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.