private void computeAngleParameters() {
        float innerCos = FastMath.cos(spotInnerAngle);
        outerAngleCos = FastMath.cos(spotOuterAngle);
        packedAngleCos = (int) (innerCos * 1000);
        
        //due to approximations, very close angles can give the same cos
        //here we make sure outer cos is below inner cos.
        if (((int) packedAngleCos) == ((int) (outerAngleCos * 1000))) {
            outerAngleCos -= 0.001f;
        }
        packedAngleCos += outerAngleCos;

        if (packedAngleCos == 0.0f) {
            throw new IllegalArgumentException("Packed angle cosine is invalid");
        }
        
        // compute parameters needed for cone vs sphere check.
        outerAngleSin    = FastMath.sin(spotOuterAngle);
        outerAngleCosSqr = outerAngleCos * outerAngleCos;
        outerAngleSinSqr = outerAngleSin * outerAngleSin;
        outerAngleSinRcp = 1.0f / outerAngleSin;
    }
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