Class Light
Represents a light source in a station.
Inherited Members
Namespace: ABB.Robotics.RobotStudio.Stations
Assembly: ABB.Robotics.RobotStudio.Stations.dll
Syntax
sistent("Light")]
public class Light : ProjectObject, IGfxObject, IHasTransform, IAttachableChild
Remarks
Requires AdvancedLighting to be enabled.
Constructors
Light(LightType)
Creates a new Light source of the specified type.
Declaration
public Light(LightType type)
Parameters
Type | Name | Description |
---|---|---|
LightType | type |
Properties
AmbientIntensity
Gets or sets the ambient intensity of the light.
Declaration
public float AmbientIntensity { get; set; }
Property Value
Type | Description |
---|---|
Single |
CastShadows
Gets or sets if this light casts shadows
Declaration
public bool CastShadows { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Remarks
Having multiple lights casting shadows can increase 3D rendering time noticeably. Note that point lights does not support shadows. Enabling shadows for the ambient light will turn on ambient occlusion.
Color
Gets or sets the color of the light.
Declaration
public Color Color { get; set; }
Property Value
Type | Description |
---|---|
Color |
DiffuseIntensity
Gets or sets the diffuse intensity of the light.
Declaration
public float DiffuseIntensity { get; set; }
Property Value
Type | Description |
---|---|
Single |
Direction
Gets or sets the direction of the light. Not applicable to point lights.
Declaration
public Vector3 Direction { get; set; }
Property Value
Type | Description |
---|---|
Vector3 |
Enabled
Gets or sets if this light is enabled, i.e. turned on
Declaration
public bool Enabled { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
MaxLightCount
Returns the maximum number of lights that can be enabled at any given time
Declaration
public static int MaxLightCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
Remarks
If this number is exceeded, some of the lights in the station will be ignored.
MaxShadowCount
Returns the maximum number of lights that can cast shadows at any given time.
Declaration
public static int MaxShadowCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
Remarks
If this number is exceeded, some of the lights in the station will not cast shadows.
Position
Gets or sets the position of the light source. Not applicable to infinite lights.
Declaration
public Vector3 Position { get; set; }
Property Value
Type | Description |
---|---|
Vector3 |
Range
Gets or sets the maximum range of the light in meters
Declaration
public double Range { get; set; }
Property Value
Type | Description |
---|---|
Double |
Remarks
Set to 0 for infinite range
SpecularIntensity
Gets or sets the specular intensity of the light.
Declaration
public float SpecularIntensity { get; set; }
Property Value
Type | Description |
---|---|
Single |
SpotAngle
Angle of the spotlight cone, in radians
Declaration
public double SpotAngle { get; set; }
Property Value
Type | Description |
---|---|
Double |
Remarks
Only used for spotlights.
Transform
Gets the Transform of the light.
Declaration
public virtual Transform Transform { get; }
Property Value
Type | Description |
---|---|
Transform |
Remarks
In most cases, it is easier to set the Position and Direction properties directly.
Type
Returns the type of light.
Declaration
public LightType Type { get; }
Property Value
Type | Description |
---|---|
LightType |
Methods
AfterLoad(PimDocument)
Declaration
protected override void AfterLoad(PimDocument doc)
Parameters
Type | Name | Description |
---|---|---|
RobotStudio.API.Persistence.PimDocument | doc |
Overrides
CreateInfiniteLight(Vector3)
Creates a new Light that represents an infinite light source.
Declaration
public static Light CreateInfiniteLight(Vector3 direction)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | direction | Direction of the light. |
Returns
Type | Description |
---|---|
Light |
CreatePointLight(Vector3)
Creates a new Light that represents a point light source.
Declaration
public static Light CreatePointLight(Vector3 position)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | Position of the light source. |
Returns
Type | Description |
---|---|
Light |
CreateSpotLight(Vector3, Vector3)
Creates a new Light that represents a spot light source.
Declaration
public static Light CreateSpotLight(Vector3 position, Vector3 direction)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | Position of the light source. |
Vector3 | direction | Direction of the light. |
Returns
Type | Description |
---|---|
Light |