public void processCollisions(ArrayList<Collidable> collidables)
    {
        Collidable each;
        ArrayList<ArrayList<Collidable>> possibleCollisions = quadTree.processList(collidables);

        //second pass, closer precision test
        collisionPossible = new boolean[entities.size()];
        collisionOccurred = new boolean[entities.size()];

        ArrayList<Collidable> actualCollisions;
        ArrayList<Collidable> neighboursOfEach;

        Rectangle eachBounds;

        Collidable[] collisionArray;

        int i;
        for (i = 0; i < possibleCollisions.size(); i++)
        {
            each = collidables.get(i);
            trig.utility.geometry.Polygon eachHitbox = each.getHitbox();
            neighboursOfEach = possibleCollisions.get(i);
            actualCollisions = new ArrayList<Collidable>();

            if (neighboursOfEach.size() > 0)
            {
                collisionPossible[i] = true;
                for (Collidable neighbour : neighboursOfEach)
                {
                    if ( eachHitbox.intersects(neighbour.getHitbox()) )
                    {
                        collisionOccurred[i] = true;
                        actualCollisions.add(neighbour);
                    }
                }
            }

            FloatCartesian pointOutside = eachHitbox.getOverflowDistance(worldBounds);

            if (Math.abs(pointOutside.x) > 0 || Math.abs(pointOutside.y) > 0)
            {
                actualCollisions.add(worldsEdge);
                if (each instanceof Movable)
                {
                    int shiftX, shiftY;
                    if(pointOutside.x < 0)
                    {
                        shiftX = (int) Math.floor(pointOutside.x);
                    }
                    else
                    {
                        shiftX = (int) Math.ceil(pointOutside.x);
                    }

                    if(pointOutside.y < 0)
                    {
                        shiftY = (int) Math.floor(pointOutside.y);
                    }
                    else
                    {
                        shiftY = (int) Math.ceil(pointOutside.y);
                    }
                   ((Movable) each).move(shiftX, shiftY);
                }
            }

            collisionArray = new Collidable[actualCollisions.size()];
            actualCollisions.toArray(collisionArray);
            each.onCollision(collisionArray);
        }
    }