The Light class is a base class for all lighting objects used
by the engine. Common properties such as ambient, diffuse,
and specular color as well as attenuation properties are defined
in this class, but may not be used by all subclasses.
| C# |
public abstract class Light : ISavable
| All Members | Constructors | Methods | Properties | ||
|
|
|
|
|||
| Icon | Member | Description |
|---|---|---|
|
|
Light()()()() |
Base constructor that initializes the default
light values.
|
|
|
Light(String) |
Base constructor that initializes the default light values
and sets the specified name.
|
|
|
Ambient |
Gets or sets the ambient contribution of this light,
which is the color that appears to be coming from everywhere.
Default: Color(.4f, .4f, .4f, 1.0f);
|
|
|
Attenuate |
Gets or sets if this light should attenuate. Note,
some lights may ignore this (e.g. Directional lights
should never attenuate)
Default: True
|
|
|
Constant |
Gets or sets the attenuation constant, which is part
of this formula:
1 / (C + L*d + Q*d*d)
Where C,L, and Q are the attenuation values
and d is the distance from the light source to
the part of the object being lit.
Default: 1.0f
|
|
|
Diffuse |
Gets or sets the diffuse contribution of this light,
which is the color directly from the light source.
Default: Color(1.0f, 1.0f, 1.0f, 1.0f)
|
|
|
Equals(Object) |
(Inherited from Object.) |
|
|
Finalize()()()() |
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.) |
|
|
GetHashCode()()()() |
Serves as a hash function for a particular type. (Inherited from Object.) |
|
|
GetType()()()() |
Gets the Type of the current instance. (Inherited from Object.) |
|
|
IsEnabled |
Gets or sets if this light should be enabled or not.
Default: True
|
|
|
LightType |
Gets the light type for this light.
|
|
|
Linear |
Gets or sets the attenuation linear value, which is
part of this formula:
1 / (C + L*d + Q*d*d)
Where C,L, and Q are the attenuation values
and d is the distance from the light source to
the part of the object being lit.
Default: 0.0f
|
|
|
MemberwiseClone()()()() |
Creates a shallow copy of the current Object. (Inherited from Object.) |
|
|
Name |
Gets or sets the name of this light.
|
|
|
Quadratic |
Gets or sets the attenuation quadratic value,
which is part of this formula:
1 / (C + L*d + Q*d*d)
Where C,L, and Q are the attenuation values
and d is the distance from the light source to
the part of the object being lit.
Default: 0.0f
|
|
|
Read(ISavableReader) |
Deserializes this Light.
|
|
|
Specular |
Gets or sets the specular contribution of this light,
which is the color reflected by an object depending on
how shiny it is.
Default: Color(1.0f, 1.0f, 1.0f, 1.0f)
|
|
|
ToString()()()() |
(Inherited from Object.) |
|
|
Write(ISavableWriter) |
Serializes this Light.
|
Assembly: Tesla (Module: Tesla) Version: 0.5.0.0 (0.5.0.0)