#[repr(C)]pub struct Light {Show 13 fields
pub ty: LightType,
pub diffuse: ColorValue,
pub specular: ColorValue,
pub ambient: ColorValue,
pub position: Vector,
pub direction: Vector,
pub range: f32,
pub falloff: f32,
pub attenuation0: f32,
pub attenuation1: f32,
pub attenuation2: f32,
pub theta: f32,
pub phi: f32,
}
Expand description
[docs.microsoft.com] D3DLIGHT9
Defines a set of lighting properties.
See Also
- IDirect3DDevice9Ext::set_light
- IDirect3DDevice9Ext::light_enable
- IDirect3DDevice9Ext::get_light
- IDirect3DDevice9Ext::get_light_enable
Fields
ty: LightType
Type of the light source.
diffuse: ColorValue
Diffuse color emitted by the light.
specular: ColorValue
Specular color emitted by the light.
ambient: ColorValue
Ambient color emitted by the light.
position: Vector
Position of the light in world space. This member has no meaning for Directional lights, and is ignored in that case.
direction: Vector
Direction that the light is pointing in world space. This member has meaning only for Directional and Spotlights. This vector need not be normalized, but it should have a nonzero length.
range: f32
Distance beyond which the light has no effect. The maximum allowable value for this member is the square root of f32::MAX. This member does not affect Directional lights.
falloff: f32
Decrease in illumination between a spotlight’s inner cone (the angle specified by theta) and the outer edge of the outer cone (the angle specified by phi).
The effect of falloff on the lighting is subtle. Furthermore, a small performance penalty is incurred by shaping the falloff curve. For these reasons, most developers set this value to 1.0.
attenuation0: f32
Value specifying how the light intensity changes over distance. Attenuation values are ignored for Directional lights. This member represents an attenuation constant. For information about attenuation, see Light Properties (Direct3D 9). Valid values for this member range from 0.0 to infinity. For non-directional lights, all three attenuation values should not be set to 0.0 at the same time.
attenuation1: f32
Value specifying how the light intensity changes over distance. Attenuation values are ignored for Directional lights. This member represents an attenuation constant. For information about attenuation, see Light Properties (Direct3D 9). Valid values for this member range from 0.0 to infinity. For non-Directional lights, all three attenuation values should not be set to 0.0 at the same time.
attenuation2: f32
Value specifying how the light intensity changes over distance. Attenuation values are ignored for Directional lights. This member represents an attenuation constant. For information about attenuation, see Light Properties (Direct3D 9). Valid values for this member range from 0.0 to infinity. For non-Directional lights, all three attenuation values should not be set to 0.0 at the same time.
theta: f32
Angle, in radians, of a spotlight’s inner cone - that is, the fully illuminated spotlight cone. This value must be in the range from 0 through the value specified by phi.
phi: f32
Angle, in radians, defining the outer edge of the spotlight’s outer cone. Points outside this cone are not lit by the spotlight. This value must be between 0 and std::f32::consts::PI.
Implementations
sourceimpl Light
impl Light
sourcepub const Point: LightType = LightType(D3DLIGHT_POINT)
pub const Point: LightType = LightType(D3DLIGHT_POINT)
Light is a point source. The light has a position in space and radiates light in all directions.
sourcepub const Directional: LightType = LightType(D3DLIGHT_DIRECTIONAL)
pub const Directional: LightType = LightType(D3DLIGHT_DIRECTIONAL)
Light is a directional light source. This is equivalent to using a point light source at an infinite distance.
Trait Implementations
impl Copy for Light
Auto Trait Implementations
impl RefUnwindSafe for Light
impl Send for Light
impl Sync for Light
impl Unpin for Light
impl UnwindSafe for Light
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more