@Test
    public void testPointFiltering() {
        PointLight pl = new PointLight(Vector3f.ZERO);
        geom.addLight(pl);
        checkFilteredLights(1); // Infinite point lights must never be filtered
        
        // Light at origin does not intersect geom which is at Z=10
        pl.setRadius(1);
        checkFilteredLights(0);
        
        // Put it closer to geom, the very edge of the sphere touches the box.
        // Still not considered an intersection though.
        pl.setPosition(new Vector3f(0, 0, 8f));
        checkFilteredLights(0);
        
        // And closer - now they intersect.
        pl.setPosition(new Vector3f(0, 0, 8f + FastMath.ZERO_TOLERANCE));
        checkFilteredLights(1);
        
        // Move the geometry away
        geom.move(0, 0, FastMath.ZERO_TOLERANCE);
        checkFilteredLights(0);
        
        // Test if the algorithm converts the sphere 
        // to a box before testing the collision (incorrect)
        float sqrt3 = FastMath.sqrt(3);
        
        pl.setPosition(new Vector3f(2, 2, 8));
        pl.setRadius(sqrt3);
        checkFilteredLights(0);
        
        // Make it a wee bit larger.
        pl.setRadius(sqrt3 + FastMath.ZERO_TOLERANCE);
        checkFilteredLights(1);
        
        // Rotate the camera so it is up, light is outside frustum.
        cam.lookAtDirection(Vector3f.UNIT_Y, Vector3f.UNIT_X);
        checkFilteredLights(0);
        cam.lookAtDirection(Vector3f.UNIT_Z, Vector3f.UNIT_Y);
        
        // ==================================
        // Tests for bounding Sphere
        geom.setModelBound(new BoundingSphere(1f, Vector3f.ZERO));
        geom.setLocalTranslation(0, 0, 2);
        pl.setPosition(new Vector3f(0, 0, 2f));

        // Infinite point lights must never be filtered
        pl.setRadius(0);
        checkFilteredLights(1);
     
        pl.setRadius(1f);
        // Put the light very close to the geometry.
        // The edge of the sphere touches the other bounding sphere.
        // Still not considered an intersection though.
        pl.setPosition(new Vector3f(0, 0, 0));
        checkFilteredLights(0);

        // And closer - now they intersect.
        pl.setPosition(new Vector3f(0, 0, 0f + FastMath.ZERO_TOLERANCE));
        checkFilteredLights(1);
               
        geom.setLocalTranslation(0, 0, 0);
        // In this case, it's an intersection for PointLight versus box,
        // but not for PointLight versus sphere.
        // Vector3f(0, 0.5f, 0.5f).normalize().mult(2) ~ >= (0.0, 1.4142135, 1.4142135)
        //pl.setPosition(new Vector3f(0, 0.5f, 0.5f).normalizeLocal().multLocal(2 + FastMath.ZERO_TOLERANCE));
        pl.setPosition(new Vector3f(0f, 1.4142135f, 1.4142135f).multLocal(1+FastMath.ZERO_TOLERANCE));
        checkFilteredLights(0);
        
        // Make the distance a wee bit closer. Now it intersects.
        //pl.setPosition(new Vector3f(0, 0.5f, 0.5f).normalizeLocal().multLocal(2 - FastMath.ZERO_TOLERANCE));
        pl.setPosition(new Vector3f(0f, 1.4142135f, 1.4142135f).multLocal(1-FastMath.ZERO_TOLERANCE));
        checkFilteredLights(1);
        
        // It's a point light; also test for the other corner.
        pl.setPosition(new Vector3f(0f, -1.4142135f, -1.4142135f).multLocal(1-FastMath.ZERO_TOLERANCE));
        checkFilteredLights(0);

    }
Test light filtering for various light types.

@author Kirill Vainer
jme3-core/src/test/java/com/jme3/light/LightFilterTest.java