@Override
    public boolean intersectsFrustum(Camera cam, TempVars vars) {
        if (spotRange == 0) {
            // The algorithm below does not support infinite spot range.
            return true;
        }
        Vector3f farPoint = vars.vect1.set(position).addLocal(vars.vect2.set(direction).multLocal(spotRange));
        for (int i = 5; i >= 0; i--) {
            //check origin against the plane
            Plane plane = cam.getWorldPlane(i);
            float dot = plane.pseudoDistance(position);
            if(dot < 0){                
                // outside, check the far point against the plane   
                dot = plane.pseudoDistance(farPoint);
                if(dot < 0){                   
                    // outside, check the projection of the far point along the normal of the plane to the base disc perimeter of the cone
                    //computing the radius of the base disc
                    float farRadius = (spotRange / outerAngleCos) * outerAngleSin;                    
                    //computing the projection direction : perpendicular to the light direction and coplanar with the direction vector and the normal vector
                    Vector3f perpDirection = vars.vect2.set(direction).crossLocal(plane.getNormal()).normalizeLocal().crossLocal(direction);
                    //projecting the far point on the base disc perimeter
                    Vector3f projectedPoint = vars.vect3.set(farPoint).addLocal(perpDirection.multLocal(farRadius));
                    //checking against the plane
                    dot = plane.pseudoDistance(projectedPoint);
                    if(dot < 0){                        
                        // Outside, the light can be culled
                        return false;
                    }
                }
            }
        }
        return true;
    }
Creates a SpotLight at the given position, with the given direction,
the given color and the given inner and outer angles 
(controls the falloff of the light)

@param position the position in world space.
@param direction the direction of the light.
@param range the spotlight range
@param color the light's color.
@param innerAngle the inner angle of the spotlight.
@param outerAngle the outer angle of the spotlight.

@see SpotLight#setSpotInnerAngle(float) 
@see SpotLight#setSpotOuterAngle(float)
jme3-core/src/main/java/com/jme3/light/SpotLight.java