public PRectangle createCartesianIntersection(PRectangle src2) {
        PRectangle rec = new PRectangle(src2.x, src2.y, src2.width, src2.height);
        float xLeft = (x > rec.x) ? x : rec.x;
        float xRight = ((x + width) > (rec.x + rec.width)) ?
                (rec.x + rec.width) : (x + width);

        float yBottom = ((y - height) < (rec.y - rec.height) ?
                (rec.y - rec.height) : (y - height));
        float yTop = (y > rec.y) ? rec.y : y;

        rec.x = xLeft;
        rec.y = yTop;
        rec.width = xRight - xLeft;
        rec.height = yTop - yBottom;

        // If rectangles don't intersect, return zeroed intersection.
        if (rec.width < 0 || rec.height < 0) {
            rec.x = rec.y = rec.width = rec.height = 0;
        }
        return rec;
    }