public CollisionResult collide(CollisionShape other) {
        CollisionResult res;
        if (other instanceof CollisionCircle) {
            res = collideCircle((CollisionCircle) other);
        } else if (other instanceof CollisionPolygon) {
            res = collidePolygon((CollisionPolygon) other);
        } else {
            throw new IllegalArgumentException(
                    "Cannot collide with CollisionShape other than CollisionCircle or CollisionPolygon.");
        }
        if (res == null)
            return null;
        Vector trans = res.translation();
        if (trans.getX() == 0 && trans.getY() == 0) {
            // make the angle go away but be off slightly, to prevent shapes
            // sliding through each other
            double angle = center().subtract(other.center()).angle() + .001;
            return new CollisionResult(res.contactPoint(), Vector.fromAngle(
                    angle, .001));
        }
        return res;
    }