Axiom.Core.Light.SetAttenuation C# (CSharp) Method

SetAttenuation() public method

Sets the attenuation parameters of the light in a single call.
public SetAttenuation ( float range, float constant, float linear, float quadratic ) : void
range float
constant float
linear float
quadratic float
return void
		public virtual void SetAttenuation( float range, float constant, float linear, float quadratic )
		{
			this.range = range;
			this.attenuationConst = constant;
			this.attenuationLinear = linear;
			this.attenuationQuad = quadratic;
		}

Usage Example

        protected void GenerateScene()
        {
            ((Axiom.SceneManagers.Multiverse.SceneManager)sceneManager).SetWorldParams(terrainGenerator, new LODSpec());
            sceneManager.LoadWorldGeometry("");

            AmbientLightColor = new ColorEx(0.5f, 0.5f, 0.5f);

            // set up directional light
            directionalLight = sceneManager.CreateLight("MainLight");
            directionalLight.Type = LightType.Directional;
            directionalLight.SetAttenuation(1000 * OneMeter, 1, 0, 0);

            DirectionalDiffuseColor = ColorEx.White;
            DirectionalSpecularColor = ColorEx.White;

            PositionLight();

            // create and position the scene node used to display the loaded model
            modelNode = sceneManager.RootSceneNode.CreateChildSceneNode();
            modelNode.Position = modelBase;

            helperNode = sceneManager.RootSceneNode.CreateChildSceneNode();
            helperNode.Position = modelBase;

            Axiom.SceneManagers.Multiverse.TerrainManager.Instance.ShowOcean = false;
            // Set our DisplayTerrain property to the current value.
            // This will set the desired SceneManager properties.
            this.DisplayTerrain = displayTerrain;
            //particleNode = scene.RootSceneNode.CreateChildSceneNode();
            //particleNode.Position = new Vector3(0 * oneMeter, 50 * oneMeter, 0 * oneMeter);

            //ParticleSystem ps = ParticleSystemManager.Instance.CreateSystem("foo", "PEExamples/ringOfFire");
            //particleNode.AttachObject(ps);
            //particleNode.ScaleFactor = new Vector3(1000f, 1000f, 1000f);
            //ps.ShowBoundingBox = true;

            return;
        }
All Usage Examples Of Axiom.Core.Light::SetAttenuation