Cloud nextCloud(Vector3d p) {
        int j = -1;
        float dy_min = RANGE * p.z;

        for (int i = 0; i < clouds.size(); i++) {
            Cloud cloud = clouds.elementAt(i);
            //if (cloud.getY(p.z) >= p.y && cloud.age < 10) {
            if (cloud.getY(p.z) >= p.y && !cloud.decaying) {
                float dy = cloud.getY(p.z) - p.y;
                if (dy < dy_min) {
                    j = i;
                    dy_min = dy;
                }
            }
        }
        if (j != -1) return clouds.elementAt(j);

        //System.out.println("Next cloud returning null !");
        return null;
    }