Get objects in front of camera


how do i get all objects in front of the camera? I need to know which children are visible and which are not.


maybe you could use Camera.contains()

Hm, Im irritated, i dont know how to use it.

The doc doesnt help me either :frowning:

Someone help?

Well i thought you can check with it if a node or Mesh (or rather its bounding volume) is visible by the camera.

      for (Spatial s : rootNode.getChildren()) {
         if (cam.contains(s.getWorldBound()) == FrustumIntersect.Inside) {
            System.out.println(s.getName() +" is inside the camera's frustum");
         } else {
            System.out.println(s.getName() +" is outside the camera's frustum");

But in TestSimpleGame it does not seem to work, it always seems to be inside.
I'm not sure yet why