Axiom.Core.SceneManager.FindLightsAffectingFrustum C# (CSharp) Method

FindLightsAffectingFrustum() protected method

Internal method for locating a list of lights which could be affecting the frustum.
Custom scene managers are encouraged to override this method to make use of their scene partitioning scheme to more efficiently locate lights, and to eliminate lights which may be occluded by word geometry.
protected FindLightsAffectingFrustum ( Camera camera ) : void
camera Camera Camera to find lights within it's view.
return void
		protected virtual void FindLightsAffectingFrustum( Camera camera )
		{
			// Basic iteration for this scene manager
			this.lightsAffectingFrustum.Clear();

			MovableObjectCollection lightList = this.GetMovableObjectCollection( LightFactory.TypeName );

			// sphere to use for testing
			Sphere sphere = new Sphere();

			foreach ( Light light in lightList.Values )
			{
				if ( light.IsVisible )
				{
					if ( light.Type == LightType.Directional )
					{
						// Always visible
						this.lightsAffectingFrustum.Add( light );
					}
					else
					{
						// treating spotlight as point for simplicity
						// Just see if the lights attenuation range is within the frustum
						sphere.Center = light.DerivedPosition;
						sphere.Radius = light.AttenuationRange;

						if ( camera.IsObjectVisible( sphere ) )
						{
							this.lightsAffectingFrustum.Add( light );
						}
					}
				}
			}

			// notify light dirty, so all movable objects will re-populate
			// their light list next time
			NotifyLightsDirty();
		}
SceneManager