How do I check that a spatial is culled? ( Or how do I check normals? )

Hi,



how do I check that a spatial is culled?



Let's assume I have


    private void initRenderState(Spatial spatial) {
        CullState cs = display.getRenderer().createCullState();
        cs.setCullFace(CullState.Face.Back);
        spatial.setRenderState(cs);
    }



I need a check if the spatial is actually culled or not.
( Checking boundigvolume intersection doesn't help me here )

I thought about a second thing: if I could check that the normals of the spatial aren't towards me, the spatial is culled. But how do I implement this?

Thanks!

I'm a bit confused with this, are you asking about if the entire spatial is culled if its outside the view frustum (e.g. that branch is thrown out during drawing, no draw calls get made)? Because CullState is for how triangle gets culled when drawn (e.g. eliminate back face triangles, which is based on polygon winding).



If this is what you were referring to, you should be able to use the Spatial's last frustum intersect property, obtained from getLastFrustumIntersection().

Actually this is not what I want;

I already know if a object is in the frustrum of the cam.



But some objects are behind others! And I want to get only the objects which are in front of the camera and not behind other objects.

If I check the intersection, the objects which are behind other objects also intersect (cause the boundingvolumes).



I have a big globe of terrainblocks, and I only need the blocks which are faced to the camera (not culled) and not the ones which are backfaced to me (the other side of the globe).



Please, I need some hints, its very important for me!