Ray-cast to find the closest geometry

@pspeed @Momoko_Fan
Ok, I will show you my screenshot and the relevant source code about my scene’s organization. Please be patient to read the following contents, thank you very much!

That is my screenshot in my scene. I know the objects are too much and I want to have a further culling in the scene to reduce the objects and the triangles because the frustum culling is not enough for me.

I know my scene is very big, I am trying my best to make my app’s performance well, so I want to only render the geometry that I can see, because there is many geometry is no need to be rendered every frame in the frustum, so I want to have a further culling, and I organized my scene in a binary tree, the relevant source code as follows:

//0, I organized the scene just like a binary tree
//1, tmpList has all the geometry.
for (int i=0;i<tmpList.size();i++){
node.attachChild(tmpList.get(i));
}
//2, I organize the scene in the “initNode()” method.
initNode(node,0);

//3, initNode() method is recursive call.
private void initNode(Node node,int layer) {

    if(node.getChildren().size()==1){
        return;
    }
    int nodeXYZ;
    if (((BoundingBox)node.getWorldBound()).getXExtent() >= ((BoundingBox)node.getWorldBound()).getYExtent() && ((BoundingBox)node.getWorldBound()).getXExtent() >= ((BoundingBox)node.getWorldBound()).getZExtent()) {
        nodeXYZ = 1;
    } else if (((BoundingBox)node.getWorldBound()).getYExtent() >= ((BoundingBox)node.getWorldBound()).getXExtent() && ((BoundingBox)node.getWorldBound()).getYExtent() >= ((BoundingBox)node.getWorldBound()).getZExtent()) {
        nodeXYZ = 2;
    } else {
        nodeXYZ = 3;
    }

    Node leftNode = new Node();
    Node rightNode = new Node();
    tmpList = node.getChildren();//the tmpList has all the children.
    float f1=0;
    float nodeCenterXYZ = 0;
    if(nodeXYZ==1){
        nodeCenterXYZ = node.getWorldBound().getCenter().getX();
        for (int i = 0; i < tmpList.size(); i++) {
            f1 =((Geometry)(tmpList.get(i))).getMesh().getBound().getCenter().getX()-nodeCenterXYZ;
            if(lengthToNodeCenter>Math.abs(f1)){//lengthToNodeCenter==2.
            }else if(f1>0){
                rightNode.attachChild(tmpList.get(i));
            }else if(f1<0){
                leftNode.attachChild(tmpList.get(i));
            }
        }
    }else if (nodeXYZ==2){
        nodeCenterXYZ = node.getWorldBound().getCenter().getY();
        for (int i = 0; i < tmpList.size(); i++) {
            f1 =((Geometry)(tmpList.get(i))).getMesh().getBound().getCenter().getY()-nodeCenterXYZ;
            if(lengthToNodeCenter>Math.abs(f1)){
            }else if(f1>0){
                rightNode.attachChild(tmpList.get(i));
            }else if(f1<0){
                leftNode.attachChild(tmpList.get(i));
            }
        }
    }else if(nodeXYZ==3) {
        nodeCenterXYZ = node.getWorldBound().getCenter().getZ();
        for (int i = 0; i < tmpList.size(); i++) {
            f1 =((Geometry)(tmpList.get(i))).getMesh().getBound().getCenter().getZ()-nodeCenterXYZ;
            if(lengthToNodeCenter>Math.abs(f1)){
            }else if(f1>0){
                rightNode.attachChild(tmpList.get(i));
            }else if(f1<0){
                leftNode.attachChild(tmpList.get(i));
            }
        }
    }

    if(leftNode.getVertexCount()!=0){
        node.attachChild(leftNode);
        initNode(leftNode,layer+1);
    }
    if(rightNode.getVertexCount()!=0){
        node.attachChild(rightNode);
        initNode(rightNode,layer+1);
    }

}

And to be honest, my scene in unity performs well through only show the geometry that I can see.
Please tell me what are you thinking about? Thank you very much!