|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.DirectX.Direct3D;
namespace MdxScene.Lights
{
public class D3dPointLight : D3dLight
{
public D3dPointLight()
{
XPosition = YPosition = ZPosition = 0;
Range = 1000;
// Set attenuation to no attenuation.
Attenuation0 = 1;
Attenuation1 = 0;
Attenuation2 = 0;
}
#region D3dLight implementation
protected override void SetSpecificLightValues(Device d3dDevice)
{
d3dDevice.Lights[Index].Type = LightType.Point;
d3dDevice.Lights[Index].XPosition = XPosition;
d3dDevice.Lights[Index].YPosition = YPosition;
d3dDevice.Lights[Index].ZPosition = ZPosition;
d3dDevice.Lights[Index].Range = Range;
d3dDevice.Lights[Index].Attenuation0 = Attenuation0;
d3dDevice.Lights[Index].Attenuation1 = Attenuation1;
d3dDevice.Lights[Index].Attenuation2 = Attenuation2;
}
#endregion
#region properties
public float XPosition { get; set; }
public float YPosition { get; set; }
public float ZPosition { get; set; }
public float Range { get; set; }
public float Attenuation0 { get; set; }
public float Attenuation1 { get; set; }
public float Attenuation2 { get; set; }
#endregion
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.