SpotLight

Classes

SpotLight : NativeComponent

This component adds spot light to the node. It enables shadow casting and shading scene with given color in spot shape. Supported shadow casting and shading only for one directional light, Another lights will be ignored.

To use this component, add the following line to your project file:

require engine.core_components.spot_light_component // or require engine.core

Usage example:

var node = create_node(NodeData())
add_component(node, new SpotLight(
    color = float3(1),
    intensity = 0.5f,
    castShadows = false,
    radius = 10f,
    attenuation = 0.5f,
    angle = PI/4f
))
Properties:

SpotLight.castShadows: bool
SpotLight.castShadows =(value: bool)

Enable shadow casting from the light source. Default is true

Arguments:
  • value : bool

SpotLight.castShadowsOnlyForStatic: bool
SpotLight.castShadowsOnlyForStatic =(value: bool)

Enable shadow casting from the light source only for static objects. Default is false

Arguments:
  • value : bool

SpotLight.intensity: float
SpotLight.intensity =(value: float)

Intencity of the light source. Default is 1f

Arguments:
  • value : float

SpotLight.color: float3
SpotLight.color =(value: float3)

Color of the light source. Default is (1f, 1f, 1f)

Arguments:
  • value : float3

SpotLight.radius: float
SpotLight.radius =(value: float)

Radius of the spot light. Default is 10f

Arguments:
  • value : float

SpotLight.angle: float
SpotLight.angle =(value: float)

Spot angle of the spot light. Default is PI/3 radians, 60 degree.

Arguments:
  • value : float

SpotLight.attenuation: float
SpotLight.attenuation =(value: float)

Attenuation of the spot light. Default is 0.5f

Arguments:
  • value : float