Example usage for com.badlogic.gdx.math Circle contains

List of usage examples for com.badlogic.gdx.math Circle contains

Introduction

In this page you can find the example usage for com.badlogic.gdx.math Circle contains.

Prototype

public boolean contains(Circle c) 

Source Link

Usage

From source file:im.ligas.worms.util.Utils.java

License:Open Source License

public static boolean objectCollisions(Vector2 vector, Array<Array<Shape2D>> arrays) {
    for (Array<Shape2D> objects : arrays) {
        for (Shape2D object : objects) {
            if (object instanceof Circle) {
                Circle circle = (Circle) object;
                if (circle.contains(vector)) {
                    return true;
                }// w w w. j a v a 2 s. co  m
            } else if (object instanceof Polyline) {
                Polyline polyline = (Polyline) object;
                if (checkCollision(vector, polyline.getVertices(), false)) {
                    return true;
                }

            }
        }
    }
    return false;
}