LightComponent

 

 

LightComponent Class

 

The LightComponent handles interactions with lights.

 

Syntax

[Sansar.Script.Interface]
public class LightComponent : Sansar.Script.InstanceInterface

 

Remarks

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

Members

See Also: Inherited members from Sansar.Script.InstanceInterface.

Public Fields

static readonly
ComponentType ComponentType . The LightComponent.ComponentType of this component

Public Properties

[read-only]
ComponentId Sansar.Script.ComponentId . Retrieves the component id for this LightComponent.
[read-only]
IsScriptable bool . The scriptable flag for this LightComponent.
[read-only]
IsValid bool . Whether or not this interface is valid. (Inherited from Sansar.Script.InstanceInterface.)
[read-only]
LightType LightType . The light type for this LightComponent.
[read-only]
Name string . This LightComponent name, as specified in the editor.

Public Methods

  GetAngle () : float
Retrieves the cone angle of this LightComponent.
  GetAngularFalloff () : float
Retrieves the angular falloff of this LightComponent.
  GetCastsShadows () : bool
Retrieves whether this LightComponent casts shadows.
  GetNearClip () : float
Retrieves the near clip distance of this LightComponent.
  GetNormalizedColor () : Sansar.Color
Retrieves the normalized color of this LightComponent.
  GetRange () : float
Retrieves the current range of this LightComponent.
  GetRelativeIntensity () : float
Retrieves the intensity of this LightComponent based on its normalized color.
  GetShadowPriority () : uint
Retrieves the shadow priority of this LightComponent.
  SetAngle (float)
Sets the cone angle for this LightComponent of type LightType.SpotLight.
  SetAngle (float, Sansar.Script.ScriptBase.OperationComplete) : ulong
Sets the cone angle for this LightComponent of type LightType.SpotLight.
  SetAngle (float, Action<Sansar.Script.OperationCompleteEvent>)
Sets the cone angle for this LightComponent of type LightType.SpotLight.
  SetAngularFalloff (float)
Sets the angular falloff for this LightComponent of type LightType.SpotLight.
  SetAngularFalloff (float, Sansar.Script.ScriptBase.OperationComplete) : ulong
Sets the angular falloff for this LightComponent of type LightType.SpotLight.
  SetAngularFalloff (float, Action<Sansar.Script.OperationCompleteEvent>)
Sets the angular falloff for this LightComponent of type LightType.SpotLight.
  SetCastsShadows (bool)
Sets whether shadows are cast from this LightComponent of type LightType.SpotLight.
  SetCastsShadows (bool, Sansar.Script.ScriptBase.OperationComplete) : ulong
Sets whether shadows are cast from this LightComponent of type LightType.SpotLight.
  SetCastsShadows (bool, Action<Sansar.Script.OperationCompleteEvent>)
Sets whether shadows are cast from this LightComponent of type LightType.SpotLight.
  SetColorAndIntensity (Sansar.Color, float)
Sets the color for this LightComponent.
  SetColorAndIntensity (Sansar.Color, float, Sansar.Script.ScriptBase.OperationComplete) : ulong
Sets the color for this LightComponent.
  SetColorAndIntensity (Sansar.Color, float, Action<Sansar.Script.OperationCompleteEvent>)
Sets the color for this LightComponent.
  SetNearClip (float)
Sets the near clip plane distance for this LightComponent of type LightType.SpotLight.
  SetNearClip (float, Sansar.Script.ScriptBase.OperationComplete) : ulong
Sets the near clip plane distance for this LightComponent of type LightType.SpotLight.
  SetNearClip (float, Action<Sansar.Script.OperationCompleteEvent>)
Sets the near clip plane distance for this LightComponent of type LightType.SpotLight.
  SetRange (float)
Sets the range for this LightComponent.
  SetRange (float, Sansar.Script.ScriptBase.OperationComplete) : ulong
Sets the range for this LightComponent.
  SetRange (float, Action<Sansar.Script.OperationCompleteEvent>)
Sets the range for this LightComponent.
  SetShadowPriority (uint)
Sets the shadow priority of this LightComponent of type LightType.SpotLight.
  SetShadowPriority (uint, Sansar.Script.ScriptBase.OperationComplete) : ulong
Sets the shadow priority of this LightComponent of type LightType.SpotLight.
  SetShadowPriority (uint, Action<Sansar.Script.OperationCompleteEvent>)
Sets the shadow priority of this LightComponent of type LightType.SpotLight.
override
ToString () : string
A string representation of this object.

 

Member Details

ComponentId Property

Retrieves the component id for this LightComponent.

Syntax

[get: Sansar.Script.Interface]
public Sansar.Script.ComponentId ComponentId { get; }

Value

The id.

Remarks

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

ComponentType Field

The LightComponent.ComponentType of this component

Syntax

public static readonly ComponentType ComponentType

Remarks

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

GetAngle Method

Retrieves the cone angle of this LightComponent.

Syntax

[Sansar.Script.Interface]
public float GetAngle ()

Returns

The angle in degrees.

Remarks

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

GetAngularFalloff Method

Retrieves the angular falloff of this LightComponent.

Syntax

[Sansar.Script.Interface]
public float GetAngularFalloff ()

Returns

The angular falloff.

Remarks

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

GetCastsShadows Method

Retrieves whether this LightComponent casts shadows.

Syntax

[Sansar.Script.Interface]
public bool GetCastsShadows ()

Returns

The shadow cast state.

Remarks

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

GetNearClip Method

Retrieves the near clip distance of this LightComponent.

Syntax

[Sansar.Script.Interface]
public float GetNearClip ()

Returns

The near clip distance.

Remarks

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

GetNormalizedColor Method

Retrieves the normalized color of this LightComponent.

Syntax

[Sansar.Script.Interface]
public Sansar.Color GetNormalizedColor ()

Returns

The normalized color.

Remarks

This might not match values set via script or in the editor since the color of a light is internally multiplied by its intensity before being applied to the scene.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

GetRange Method

Retrieves the current range of this LightComponent.

Syntax

[Sansar.Script.Interface]
public float GetRange ()

Returns

The range.

Remarks

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

GetRelativeIntensity Method

Retrieves the intensity of this LightComponent based on its normalized color.

Syntax

[Sansar.Script.Interface]
public float GetRelativeIntensity ()

Returns

The intensity based on a normalized color.

Remarks

This might not match values set via script or in the editor since the color of a light is internally multiplied by its intensity before being applied to the scene.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

GetShadowPriority Method

Retrieves the shadow priority of this LightComponent.

Syntax

[Sansar.Script.Interface]
public uint GetShadowPriority ()

Returns

The shadow priority.

Remarks

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

IsScriptable Property

The scriptable flag for this LightComponent.

Syntax

[get: Sansar.Script.Interface]
public bool IsScriptable { get; }

Value

Whether or not this light can have properties changed by script.

Remarks

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

LightType Property

The light type for this LightComponent.

Syntax

[get: Sansar.Script.Interface]
public LightType LightType { get; }

Value

Light type enum for the light component.

Remarks

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

Name Property

This LightComponent name, as specified in the editor.

Syntax

[get: Sansar.Script.Interface]
public string Name { get; }

Value

Remarks

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

SetAngle Method

Sets the cone angle for this LightComponent of type LightType.SpotLight.

Syntax

[Sansar.Script.Interface]
public void SetAngle (float angle)

Parameters

angle
The angle in degrees, 1 to 160.

Returns

The return value is an internal event id.

Remarks

This method only affects spot lights. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to Sansar.Script.ScriptBase.WaitFor while in a coroutine.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

SetAngle Method

Sets the cone angle for this LightComponent of type LightType.SpotLight.

Syntax

[Sansar.Script.Interface]
[System.Obsolete("Deprecated. Use the Action<> overload", false)]
public ulong SetAngle (float angle, Sansar.Script.ScriptBase.OperationComplete handler)

Parameters

angle
The angle in degrees, 1 to 160.
handler
Handler to be called when the event completes.

Returns

The return value is an internal event id.

Remarks

This method only affects spot lights. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to Sansar.Script.ScriptBase.WaitFor while in a coroutine.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

SetAngle Method

Sets the cone angle for this LightComponent of type LightType.SpotLight.

Syntax

[Sansar.Script.Interface]
public void SetAngle (float angle, Action<Sansar.Script.OperationCompleteEvent> handler)

Parameters

angle
The angle in degrees, 1 to 160.
handler
Handler to be called when the event completes.

Returns

The return value is an internal event id.

Remarks

This method only affects spot lights. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to Sansar.Script.ScriptBase.WaitFor while in a coroutine.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

SetAngularFalloff Method

Sets the angular falloff for this LightComponent of type LightType.SpotLight.

Syntax

[Sansar.Script.Interface]
public void SetAngularFalloff (float angularFalloff)

Parameters

angularFalloff
The angular falloff, 0.01 to 1.

Returns

The return value is an internal event id.

Remarks

This method only affects spot lights. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to Sansar.Script.ScriptBase.WaitFor while in a coroutine.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

SetAngularFalloff Method

Sets the angular falloff for this LightComponent of type LightType.SpotLight.

Syntax

[Sansar.Script.Interface]
[System.Obsolete("Deprecated. Use the Action<> overload", false)]
public ulong SetAngularFalloff (float angularFalloff, Sansar.Script.ScriptBase.OperationComplete handler)

Parameters

angularFalloff
The angular falloff, 0.01 to 1.
handler
Handler to be called when the event completes.

Returns

The return value is an internal event id.

Remarks

This method only affects spot lights. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to Sansar.Script.ScriptBase.WaitFor while in a coroutine.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

SetAngularFalloff Method

Sets the angular falloff for this LightComponent of type LightType.SpotLight.

Syntax

[Sansar.Script.Interface]
public void SetAngularFalloff (float angularFalloff, Action<Sansar.Script.OperationCompleteEvent> handler)

Parameters

angularFalloff
The angular falloff, 0.01 to 1.
handler
Handler to be called when the event completes.

Returns

The return value is an internal event id.

Remarks

This method only affects spot lights. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to Sansar.Script.ScriptBase.WaitFor while in a coroutine.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

SetCastsShadows Method

Sets whether shadows are cast from this LightComponent of type LightType.SpotLight.

Syntax

[Sansar.Script.Interface]
public void SetCastsShadows (bool castsShadows)

Parameters

castsShadows
True to cast shadows.

Returns

The return value is an internal event id.

Remarks

This method only affects spot lights. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to Sansar.Script.ScriptBase.WaitFor while in a coroutine.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

SetCastsShadows Method

Sets whether shadows are cast from this LightComponent of type LightType.SpotLight.

Syntax

[Sansar.Script.Interface]
[System.Obsolete("Deprecated. Use the Action<> overload", false)]
public ulong SetCastsShadows (bool castsShadows, Sansar.Script.ScriptBase.OperationComplete handler)

Parameters

castsShadows
True to cast shadows.
handler
Handler to be called when the event completes.

Returns

The return value is an internal event id.

Remarks

This method only affects spot lights. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to Sansar.Script.ScriptBase.WaitFor while in a coroutine.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

SetCastsShadows Method

Sets whether shadows are cast from this LightComponent of type LightType.SpotLight.

Syntax

[Sansar.Script.Interface]
public void SetCastsShadows (bool castsShadows, Action<Sansar.Script.OperationCompleteEvent> handler)

Parameters

castsShadows
True to cast shadows.
handler
Handler to be called when the event completes.

Returns

The return value is an internal event id.

Remarks

This method only affects spot lights. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to Sansar.Script.ScriptBase.WaitFor while in a coroutine.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

SetColorAndIntensity Method

Sets the color for this LightComponent.

Syntax

[Sansar.Script.Interface]
public void SetColorAndIntensity (Sansar.Color color, float intensity)

Parameters

color
The color.
intensity
The intensity, 0 to 100.

Returns

The return value is an internal event id.

Remarks

The intensity is multiplied by the color and then applied to the light. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to Sansar.Script.ScriptBase.WaitFor while in a coroutine.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

SetColorAndIntensity Method

Sets the color for this LightComponent.

Syntax

[Sansar.Script.Interface]
[System.Obsolete("Deprecated. Use the Action<> overload", false)]
public ulong SetColorAndIntensity (Sansar.Color color, float intensity, Sansar.Script.ScriptBase.OperationComplete handler)

Parameters

color
The color.
intensity
The intensity, 0 to 100.
handler
Handler to be called when the event completes.

Returns

The return value is an internal event id.

Remarks

The intensity is multiplied by the color and then applied to the light. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to Sansar.Script.ScriptBase.WaitFor while in a coroutine.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

SetColorAndIntensity Method

Sets the color for this LightComponent.

Syntax

[Sansar.Script.Interface]
public void SetColorAndIntensity (Sansar.Color color, float intensity, Action<Sansar.Script.OperationCompleteEvent> handler)

Parameters

color
The color.
intensity
The intensity, 0 to 100.
handler
Handler to be called when the event completes.

Returns

The return value is an internal event id.

Remarks

The intensity is multiplied by the color and then applied to the light. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to Sansar.Script.ScriptBase.WaitFor while in a coroutine.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

SetNearClip Method

Sets the near clip plane distance for this LightComponent of type LightType.SpotLight.

Syntax

[Sansar.Script.Interface]
public void SetNearClip (float nearClip)

Parameters

nearClip
The near clip distance, 0 to 500.

Returns

The return value is an internal event id.

Remarks

This method only affects spot lights. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to Sansar.Script.ScriptBase.WaitFor while in a coroutine.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

SetNearClip Method

Sets the near clip plane distance for this LightComponent of type LightType.SpotLight.

Syntax

[Sansar.Script.Interface]
[System.Obsolete("Deprecated. Use the Action<> overload", false)]
public ulong SetNearClip (float nearClip, Sansar.Script.ScriptBase.OperationComplete handler)

Parameters

nearClip
The near clip distance, 0 to 500.
handler
Handler to be called when the event completes.

Returns

The return value is an internal event id.

Remarks

This method only affects spot lights. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to Sansar.Script.ScriptBase.WaitFor while in a coroutine.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

SetNearClip Method

Sets the near clip plane distance for this LightComponent of type LightType.SpotLight.

Syntax

[Sansar.Script.Interface]
public void SetNearClip (float nearClip, Action<Sansar.Script.OperationCompleteEvent> handler)

Parameters

nearClip
The near clip distance, 0 to 500.
handler
Handler to be called when the event completes.

Returns

The return value is an internal event id.

Remarks

This method only affects spot lights. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to Sansar.Script.ScriptBase.WaitFor while in a coroutine.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

SetRange Method

Sets the range for this LightComponent.

Syntax

[Sansar.Script.Interface]
public void SetRange (float range)

Parameters

range
The range, 1 to 500.

Returns

The return value is an internal event id.

Remarks

This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to Sansar.Script.ScriptBase.WaitFor while in a coroutine.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

SetRange Method

Sets the range for this LightComponent.

Syntax

[Sansar.Script.Interface]
[System.Obsolete("Deprecated. Use the Action<> overload", false)]
public ulong SetRange (float range, Sansar.Script.ScriptBase.OperationComplete handler)

Parameters

range
The range, 1 to 500.
handler
Handler to be called when the event completes.

Returns

The return value is an internal event id.

Remarks

This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to Sansar.Script.ScriptBase.WaitFor while in a coroutine.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

SetRange Method

Sets the range for this LightComponent.

Syntax

[Sansar.Script.Interface]
public void SetRange (float range, Action<Sansar.Script.OperationCompleteEvent> handler)

Parameters

range
The range, 1 to 500.
handler
Handler to be called when the event completes.

Returns

The return value is an internal event id.

Remarks

This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to Sansar.Script.ScriptBase.WaitFor while in a coroutine.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

SetShadowPriority Method

Sets the shadow priority of this LightComponent of type LightType.SpotLight.

Syntax

[Sansar.Script.Interface]
public void SetShadowPriority (uint shadowPriority)

Parameters

shadowPriority
Shadow priority.

Returns

The return value is an internal event id.

Remarks

Set this to zero to turn off shadows. This method only affects spot lights. The renderer prioritizes shadows cast from higher priority lights first. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to Sansar.Script.ScriptBase.WaitFor while in a coroutine.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

SetShadowPriority Method

Sets the shadow priority of this LightComponent of type LightType.SpotLight.

Syntax

[Sansar.Script.Interface]
[System.Obsolete("Deprecated. Use the Action<> overload", false)]
public ulong SetShadowPriority (uint shadowPriority, Sansar.Script.ScriptBase.OperationComplete handler)

Parameters

shadowPriority
Shadow priority.
handler
Handler to be called when the event completes.

Returns

The return value is an internal event id.

Remarks

Set this to zero to turn off shadows. This method only affects spot lights. The renderer prioritizes shadows cast from higher priority lights first. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to Sansar.Script.ScriptBase.WaitFor while in a coroutine.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

SetShadowPriority Method

Sets the shadow priority of this LightComponent of type LightType.SpotLight.

Syntax

[Sansar.Script.Interface]
public void SetShadowPriority (uint shadowPriority, Action<Sansar.Script.OperationCompleteEvent> handler)

Parameters

shadowPriority
Shadow priority.
handler
Handler to be called when the event completes.

Returns

The return value is an internal event id.

Remarks

Set this to zero to turn off shadows. This method only affects spot lights. The renderer prioritizes shadows cast from higher priority lights first. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to Sansar.Script.ScriptBase.WaitFor while in a coroutine.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

ToString Method

A string representation of this object.

Syntax

[Sansar.Script.Interface]
public override string ToString ()

Returns

A string representation of this object.

Remarks

The format of this string may change between releases.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

 


 

 

Was this article helpful?
1 out of 1 found this helpful
Have more questions? Submit a request

0 Comments

Article is closed for comments.