@Override
    public boolean intersectsSphere(BoundingSphere sphere, TempVars vars) {
        if (this.spotRange > 0f) {
            // Check spot range first.
            // Sphere v. sphere collision
            if (!Intersection.intersect(sphere, position, spotRange)) {
                return false;
            }
        }

        float otherRadiusSquared = FastMath.sqr(sphere.getRadius());
        float otherRadius = sphere.getRadius();

        // Check if sphere is within spot angle.
        // Cone v. sphere collision.
        Vector3f E = direction.mult(otherRadius * outerAngleSinRcp, vars.vect1);
        Vector3f U = position.subtract(E, vars.vect2);
        Vector3f D = sphere.getCenter().subtract(U, vars.vect3);

        float dSquared = D.dot(D);
        float e = direction.dot(D);

        if (e > 0f && e * e >= dSquared * outerAngleCosSqr) {
            D = sphere.getCenter().subtract(position, vars.vect3);
            dSquared = D.dot(D);
            e = -direction.dot(D);

            if (e > 0f && e * e >= dSquared * outerAngleSinSqr) {
                return dSquared <= otherRadiusSquared;
            } else {
                return true;
            }
        }
        
        return false;
    }
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