示例#1
0
 /**
  * Populates the outputGeometryList with the geometry of the inputGeomtryList that are in the
  * frustum of the given camera
  *
  * @param inputGeometryList The list containing all geometry to check against the camera frustum
  * @param camera the camera to check geometries against
  * @param outputGeometryList the list of all geometries that are in the camera frustum
  */
 public static void getGeometriesInCamFrustum(
     GeometryList inputGeometryList, Camera camera, GeometryList outputGeometryList) {
   for (int i = 0; i < inputGeometryList.size(); i++) {
     Geometry g = inputGeometryList.get(i);
     int planeState = camera.getPlaneState();
     camera.setPlaneState(0);
     if (camera.contains(g.getWorldBound()) != Camera.FrustumIntersect.Outside) {
       outputGeometryList.add(g);
     }
     camera.setPlaneState(planeState);
   }
 }
示例#2
0
 /**
  * Populates the outputGeometryList with the geometry of the inputGeomtryList that are in the
  * radius of a light. The array of camera must be an array of 6 cameara initialized so they
  * represent the light viewspace of a pointlight
  *
  * @param inputGeometryList The list containing all geometry to check against the camera frustum
  * @param cameras the camera array to check geometries against
  * @param outputGeometryList the list of all geometries that are in the camera frustum
  */
 public static void getGeometriesInLightRadius(
     GeometryList inputGeometryList, Camera[] cameras, GeometryList outputGeometryList) {
   for (int i = 0; i < inputGeometryList.size(); i++) {
     Geometry g = inputGeometryList.get(i);
     boolean inFrustum = false;
     for (int j = 0; j < cameras.length && inFrustum == false; j++) {
       Camera camera = cameras[j];
       int planeState = camera.getPlaneState();
       camera.setPlaneState(0);
       inFrustum = camera.contains(g.getWorldBound()) != Camera.FrustumIntersect.Outside;
       camera.setPlaneState(planeState);
     }
     if (inFrustum) {
       outputGeometryList.add(g);
     }
   }
 }