@kognifai/cogsengine
    Preparing search index...

    Class EnvironmentComponent

    class defining a Cogs component. Defines basic properties of the component - readonly for clients 'type' and 'entity'. All component shares same class definition. The properties for accessing the fields of the component type will be filled in at runtime, e.g. for TransformComponent: getter+setter for: coordinates, position, rotation etc.

    Hierarchy (View Summary)

    Index

    Constructors

    • Internal: Component constructor

      Parameters

      • type: string

        type of the component. Ex. "TransformComponent"

      • entity: Entity | null

        Owning entity. Entity only passed when wrapping existing entity.

      Returns EnvironmentComponent

    Properties

    ambientIrradiance: TextureResource | null
    brdfLUT: TextureResource | null
    brightness: number
    imageBasedLighting: boolean
    irradiance: TextureResource | null
    isTyped: boolean = false

    Internal flag set if component is a Cogs Core component.

    PBR: boolean
    radiance: TextureResource | null
    seaLevel: number
    skyDome: TextureResource | null
    skyMultiplier: number
    subseaRadiance: TextureResource | null
    subseaSupport: boolean
    subseaTurbidityAmount: number
    subseaTurbidityDistance: number

    Accessors

    • get entity(): Entity | null

      Gets the optional owning entity

      Returns Entity | null

    • set entity(entity: Entity | null): 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.