GLTFLight

    Represents a GLTF light.

    GLTFLight.swift:11
    class GLTFLight

    Represents a light as defined by the KHR_lights_punctual GLTF extension.

    Superclasses

    Citizens in SwiftGodot

    Conformances

    • protocol CustomStringConvertible

      A type with a customized textual representation.

    • protocol Equatable

      A type that can be compared for value equality.

    • protocol Hashable

      A type that can be hashed into a Hasher to produce an integer hash value.

    • protocol Identifiable<ID>

      A class of types whose instances hold the value of an entity with stable identity.

    • protocol VariantRepresentable

      Types that conform to VariantRepresentable can be stored directly in Variant with no conversion. These include all of the Variant types from Godot (for example GString, Rect, Plane), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.

    • protocol VariantStorable

      Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.

    Type members

    Instance members

    • var color: Color

      The Color of the light. Defaults to white. A black color causes the light to have no effect.

    • var innerConeAngle: Double

      The inner angle of the cone in a spotlight. Must be less than or equal to the outer cone angle.

    • var intensity: Double

      The intensity of the light. This is expressed in candelas (lumens per steradian) for point and spot lights, and lux (lumens per m²) for directional lights. When creating a Godot light, this value is converted to a unitless multiplier.

    • var lightType: String

      The type of the light. The values accepted by Godot are “point”, “spot”, and “directional”, which correspond to Godot’s OmniLight3D, SpotLight3D, and DirectionalLight3D respectively.

    • var outerConeAngle: Double

      The outer angle of the cone in a spotlight. Must be greater than or equal to the inner angle.

    • var range: Double

      The range of the light, beyond which the light has no effect. GLTF lights with no range defined behave like physical lights (which have infinite range). When creating a Godot light, the range is clamped to 4096.

    • func toDictionary() -> GDictionary

      Serializes this GLTFLight instance into a GDictionary.

    • func toNode() -> Light3D?

      Converts this GLTFLight instance into a Godot Light3D node.