DirectionalLight

public struct DirectionalLight : Codable, StyleEncodable

A light that has a direction and is located at infinite, so its rays are parallel. Simulates the sun light and it can cast shadows

  • id

    Unique light name

    Declaration

    Swift

    public let id: String
  • Type of the light.

    Declaration

    Swift

    public let type: LightType
  • Enable/Disable shadow casting for this light

    Declaration

    Swift

    public var castShadows: Value<Bool>?
  • Color of the directional light.

    Declaration

    Swift

    public var color: Value<StyleColor>?
  • Transition property for color

    Declaration

    Swift

    public var colorTransition: StyleTransition?
  • Direction of the light source specified as [a azimuthal angle, p polar angle] where a indicates the azimuthal angle of the light relative to north (in degrees and proceeding clockwise), and p indicates polar angle of the light (from 0 degree, directly above, to 180 degree, directly below).

    Declaration

    Swift

    public var direction: Value<[Double]>?
  • Transition property for direction

    Declaration

    Swift

    public var directionTransition: StyleTransition?
  • A multiplier for the color of the directional light.

    Declaration

    Swift

    public var intensity: Value<Double>?
  • Transition property for intensity

    Declaration

    Swift

    public var intensityTransition: StyleTransition?
  • Determines the shadow strength, affecting the shadow receiver surfaces final color. Values near 0.0 reduce the shadow contribution to the final color. Values near to 1.0 make occluded surfaces receive almost no directional light. Designed to be used mostly for transitioning between values 0 and 1.

    Declaration

    Swift

    public var shadowIntensity: Value<Double>?
  • Transition property for shadowIntensity

    Declaration

    Swift

    public var shadowIntensityTransition: StyleTransition?
  • Creates a new Directional light.

    Declaration

    Swift

    public init(id: String = UUID().uuidString)
  • Declaration

    Swift

    public func encode(to encoder: Encoder) throws
  • Declaration

    Swift

    public init(from decoder: Decoder) throws