Tesla Graphics Engine Documentation (January 2012)
SpotLight Class
TeslaTesla.GraphicsSpotLight
A SpotLight is similar to point with it being located at a specific point in world space. However, it's light influence is restricted to a cone (opposed to being omni-directional) that is controlled by a direction and two angles for falloff to create a soft edge.
Declaration Syntax
C#
public class SpotLight : Light
Members
All Members Constructors Methods Properties



Icon Member Description
SpotLight()()()()
Creates a new instance of SpotLight, set at the origin and pointing down the negative Z-axis.

SpotLight(Vector3, Vector3, Single, Single)
Creates a new SpotLight.

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);
(Inherited from Light.)
Attenuate
Gets or sets if this light should attenuate. Note, some lights may ignore this (e.g. Directional lights should never attenuate) Default: True
(Inherited from Light.)
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
(Inherited from Light.)
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)
(Inherited from Light.)
Direction
Gets or sets the direction of the SpotLight. The value is always normalized. Default: (0, 0, -1)

Equals(Object)
Determines whether the specified Object is equal to the current 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.)
InnerAngle
Gets or sets the innter cutoff angle for this SpotLight. This is the extent of the concentration of the light along the direction (the cone). This should always be smaller than the outer angle. Default: 45 degrees

IsEnabled
Gets or sets if this light should be enabled or not. Default: True
(Inherited from Light.)
LightType
Gets the type of light, LightType.Spot.
(Overrides Light.LightType.)
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
(Inherited from Light.)
MemberwiseClone()()()()
Creates a shallow copy of the current Object.
(Inherited from Object.)
Name
Gets or sets the name of this light.
(Inherited from Light.)
OuterAngle
Gest or sets the outer cutoff angle for this SpotLight. This is used to allow a soft blending from the main concentration of the light to the area outside of the spotlight's cone. Default: 90 degrees

Position
Gets or sets the position of the SpotLight in world space. Default: (0, 0, 0)

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
(Inherited from Light.)
Read(ISavableReader)
Deserializes this SpotLight.
(Overrides Light.Read(ISavableReader).)
SetDirection(Single, Single, Single)
Convienance method for setting the direction of this SpotLight.

SetPosition(Single, Single, Single)
Convienence method for setting the position of this SpotLight in world space

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)
(Inherited from Light.)
ToString()()()()
Returns a String that represents the current Object.
(Inherited from Object.)
Write(ISavableWriter)
Serializes this SpotLight.
(Overrides Light.Write(ISavableWriter).)
Inheritance Hierarchy
Object
Light
  SpotLight

Assembly: Tesla (Module: Tesla) Version: 0.5.0.0 (0.5.0.0)