@kognifai/cogsengine
    Preparing search index...

    Class LightComponent

    Defines a single light source and its behavior.

    Hierarchy (View Summary)

    Index

    Constructors

    • Internal: Component constructor

      Parameters

      • type: string

        type of the component. Ex. "TransformComponent"

      • entity: Entity

        Owning entity. Entity only passed when wrapping existing entity.

      Returns LightComponent

    Properties

    cameras: Entity[]

    Cameras from which the shadow maps will be used, defaults to main camera.

    castShadows: boolean

    If this light should cast shadows.

    dynamicCascadeCount: boolean

    Dynamically determine how many cascades should be drawn.

    enabled: boolean

    If the light is enabled.

    intensity: number

    Intensity of the light source.

    isTyped: boolean

    Internal flag set if component is a Cogs Core component.

    lightColor: vec4

    Color contribution of the light.

    lightingLayer: LightingLayers

    The lighting layer the light belongs to.

    lightType: LightType

    The type of light. Modifying this field changes how the field lightDirection is interpreted.

    lodReference: Entity

    Camera entity of which its z-axis define the shadowmap cascade split axis, defaults to main camera.

    range: number

    Falloff range.

    shadowBias: number

    Constant term shadow map rasterization bias.

    shadowBiasClamp: number

    Shadow map bias rasterization clamp.

    shadowIntensityOffset: number

    Shadow intensity offset.

    shadowNearPlane: number

    Shadow near plane. If set to 0 near plane is 1/1000th of the radius.

    shadowSampleBias: number

    Constant term shadow map sampling bias.

    shadowSlopedBias: number

    Linear term of shadow map rasterization bias.

    tightShadowBounds: boolean

    If the shadows should have tight bounds.

    Accessors

    • get entity(): Entity

      Gets the optional owning entity

      Returns Entity

    • set entity(entity: Entity): void

      Internal: set owning entity.

      Parameters

      Returns void

    • get name(): string

      Component name == type. For compatibility

      Returns string

    • get type(): string

      Gets the type of the component. Ex. "TransformComponent", "SceneComponent" etc.

      Returns string

    Methods

    • Internal: Creates a new component of the given type (name). Component is wrapped when adding to an entity.

      Parameters

      • type: string

        Type of the component. Ex. "TransformComponent"

      Returns Component

      Created Cogs.js component.

    • Internal: Creates a new component being wrapped as an existing member of the entity

      Parameters

      • type: string

        Type of the component. Ex. "TransformComponent"

      • entity: Entity

        The owning entity

      Returns Component

      Created Cogs.js component.